HOME


sh-3ll 1.0
DIR:/usr/local/lib64/python3.6/site-packages/numpy/lib/tests/__pycache__/
Upload File :
Current File : //usr/local/lib64/python3.6/site-packages/numpy/lib/tests/__pycache__/test_utils.cpython-36.pyc
3

���h��@s�ddlZddlZddlZddlmZddlmZmZmZddl	m
Z
ddljj
Z
ddlmZejjejjdkdd�d	d
��Ze
dd��Ze
d
d�dd��Zdd�Ze
eddd�Zdd�Ze
e�Zdd�Ze
edd�Zdd�Ze
e�Zdd�Zdd�Z d d!�Z!ejjejjdkd"d�ejj"d#eefeefeefg�d$d%���Z#d&d'�Z$ejjejjdkd"d�d(d)��Z%d*d+�Z&Gd,d-�d-�Z'd.d/�Z(dS)0�N)�arange)�assert_�assert_equal�assert_raises_regex)�	deprecate)�StringIO�zPython running -OO)�reasoncCs0t�}tjdd|dd�|j�}td|k�dS)NZ
eigenvalueZnumpyF)�module�outputZimport_modulesznumpy.linalg.eig)r�utilsZlookfor�getvaluer)�out�r�;/tmp/pip-build-5_djhm0z/numpy/numpy/lib/tests/test_utils.py�test_lookfor
s

rcCs|S)Nr)�self�xrrr�old_funcsrzRather use new_func2)�messagecCs|S)Nr)rrrrr�	old_func2srcCs|S)Nr)rrrrr�	old_func3 sr�	new_func3)Zold_name�new_namecCs|S)z Summary.

    Further info.
    r)rrrrr�	old_func4%srcCs|S)z+Summary.

        Bizarre indentation.
    r)rrrrr�	old_func5.srzThis function is
deprecated.cCs|S)z
    Also in PEP-257.
    r)rrrrr�	old_func67srcCstdtjk�dS)NZ
deprecated)rr�__doc__rrrr�test_deprecate_decorator?srcCstdtjk�dS)NzRather use new_func2)rrrrrrr� test_deprecate_decorator_messageCsrcCs tdtjk�tdtjk�dS)Nrr)rrrrrrr�test_deprecate_fnGsr z-OO discards docstringszold_func, new_funccCs�t||�xxd|fd|ffD]d\}}xZt|jjd��D]F\}}|dkrf|jd�s||jd�s|t|��q6|r6|jd�s6t|��q6WqWdS)N�old�new�
rz    � )�
_compare_docs�	enumerater�split�
startswith�AssertionError)r�new_funcZknd�func�li�linerrr�test_deprecate_help_indentationLs
 r.cCs8tj|�}tj|�}|jd�d}t||d�|�dS)Nz

r)�inspectZgetdoc�indexr)rr*Zold_docZnew_docr0rrrr%]s

r%cCstdtjk�dS)Nz
        Bizarre)r�	new_func5rrrrr�"test_deprecate_preserve_whitespacedsr2cCstjd�dS)N�None)rZ	safe_evalrrrr�test_safe_eval_nameconstantisr4c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestByteBoundscCs8td�jdd�}tj|�\}}t|||j|j�dS)N���)r�reshaper�byte_boundsr�size�itemsize)r�a�low�highrrr�test_byte_boundspszTestByteBounds.test_byte_boundscCs>td�jdd�}|j}tj|�\}}t|||j|j�dS)Nr6r7r8)rr9�Trr:rr;r<)rr=�br>r?rrr�"test_unusual_order_positive_stridewsz1TestByteBounds.test_unusual_order_positive_stridecCsHtd�jdd�}|jddd�}tj|�\}}t|||j|j�dS)Nr6r7r8����)rr9rArr:rr;r<)rr=rBr>r?rrr�"test_unusual_order_negative_stride}sz1TestByteBounds.test_unusual_order_negative_stridecCsHtd�}|ddd�}tj|�\}}t|||jd|j|j�dS)Nr6r)rrr:rr;r<)rr=rBr>r?rrr�test_strided�szTestByteBounds.test_stridedN)�__name__�
__module__�__qualname__r@rCrFrGrrrrr5nsr5c	Cs"ttd��td��WdQRXdS)Nzno deprecation warning)r�
ValueErrorrrrr�(test_assert_raises_regex_context_manager�srL))r/�sysZpytestZ
numpy.corerZ
numpy.testingrrrZ	numpy.librZnumpy.lib.utils�libr�ior�markZskipif�flags�optimizerrrrrrZ	new_func4rr1rZ	new_func6rrr Zparametrizer.r%r2r4r5rLrrrr�<module>s>