관리-도구
편집 파일: brain_numpy_utils.cpython-311.pyc
� �܋fM � �t � d Z ddlmZ ddlmZ ddlmZ ddlmZm Z m Z mZ dZdd �Z dd�Zddd�Zdd�Zdd�ZdS )z)Different utilities for the numpy brains.� )�annotations)�extract_node)�InferenceContext)� Attribute�Import�Name�NodeNG)�1�20�0�return�boolc �8 � t � � } | o | t k S )z*Returns True if numpy supports type hints.)�_get_numpy_version� NUMPY_VERSION_TYPE_HINTS_SUPPORT)�np_vers �p/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/astroid/brain/brain_numpy_utils.py�numpy_supports_type_hintsr s � � � !� !�F��?�f�?�?�?� �tuple[str, str, str]c � � ddl } t | j j � d� � � � S # t t f$ r Y dS w xY w)zj Return the numpy version number if numpy can be imported. Otherwise returns ('0', '0', '0') r N�.)r r r )�numpy�tuple�version�split�ImportError�AttributeError)r s r r r sX � �������U�]�*�0�0��5�5�6�6�6����(� � � �������s �/2 �A�AN�context�InferenceContext | Nonec �L � t | � � }|� |�� � S )N)r )r �infer)�src�noder s r �infer_numpy_memberr% % s# � �����D��:�:�g�:�&�&�&r r$ r c � �� | j �d� | � �� � d D � � }t �fd�|D � � � � S )a> Returns True if the node is a representation of a numpy module. For example in : import numpy as np x = np.linspace(1, 2) The node <Name.np> is a representation of the numpy module. :param node: node to test :return: True if the node is a representation of the numpy module. c �<