HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //usr/local/lib/python3.10/dist-packages/numpy/lib/tests/__pycache__/test_utils.cpython-310.pyc
o

���gJ�@sddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
ddlmZm
Z
ddlmmZddlmZejjejjdkdd�ejjejd	kd
d�dd���Zed
d��Zedd�dd��Zdd�Zeeddd�Zdd�Zee�Zdd�Zeedd�Z dd�Z!ee!�Z"e
dd�d d!��Z#d"d#�Z$d$d%�Z%d&d'�Z&d(d)�Z'ejjejjdkd*d�ej�(d+eefee fe!e"fg�d,d-���Z)d.d/�Z*ejjejjdkd*d�d0d1��Z+d2d3�Z,d4d5�Z-Gd6d7�d7�Z.d8d9�Z/d:d;�Z0d<d=�Z1ej�(d>e�2d?�d@dAge�2dB�e�2dC�g�dDdE��Z3dS)F�N)�arange)�assert_�assert_equal�assert_raises_regex)�	deprecate�deprecate_with_doc)�StringIO�zPython running -OO)�reason)��
r�	candidate�zBroken as of bpo-44524cCs0t�}tjdd|dd�|��}td|v�dS)N�
eigenvalue�numpyF)�module�output�import_modulesznumpy.linalg.eig)r�utils�lookfor�getvaluer)�out�r�E/usr/local/lib/python3.10/dist-packages/numpy/lib/tests/test_utils.py�test_lookfors
�rcC�|S�Nr��self�xrrr�old_func�r �Rather use new_func2)�messagecCrrrrrrr�	old_func2 r!r$cCrrrrrrr�	old_func3%�r%�	new_func3)�old_name�new_namecCr)z Summary.

    Further info.
    rrrrr�	old_func4*�r*cCr)z+Summary.

        Bizarre indentation.
    rrrrr�	old_func53r+r,zThis function is
deprecated.cCr)z
    Also in PEP-257.
    rrrrr�	old_func6<sr-�Rather use new_func7)�msgcCrrrrrrr�	old_func7Dr!r0cC�tdtjv�dS)N�
deprecated)rr �__doc__rrrr�test_deprecate_decoratorI�r4cCr1)Nr")rr$r3rrrr� test_deprecate_decorator_messageMr5r6cCs tdtjv�tdtjv�dS)Nr%r')rr'r3rrrr�test_deprecate_fnQsr7cCr1)Nr.)rr0r3rrrr�)test_deprecate_with_doc_decorator_messageVr5r8z-OO discards docstringszold_func, new_funccCs~t||�d|fd|ffD]/\}}t|j�d��D]"\}}|dkr0|�d�s/|�d�r/J|��q|r;|�d�s;J|��qq
dS)N�old�new�
rz    � )�
_compare_docs�	enumerater3�split�
startswith)r �new_func�knd�func�li�linerrr�test_deprecate_help_indentationZs
����rFcCs8t�|�}t�|�}|�d�d}t||d�|�dS)Nz

r	)�inspect�getdoc�indexr)r rA�old_doc�new_docrIrrrr=ks

r=cCr1)Nz
        Bizarre)r�	new_func5r3rrrr�"test_deprecate_preserve_whitespacersrMcCsttjtk�dSr)rr �
__module__�__name__rrrr�test_deprecate_modulewr5rPcCst�d�dS)N�None)r�	safe_evalrrrr�test_safe_eval_nameconstant{srSc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestByteBoundscCs8td��dd�}t�|�\}}t|||j|j�dS�N�r�)r�reshaper�byte_boundsr�size�itemsize)r�a�low�highrrr�test_byte_bounds�szTestByteBounds.test_byte_boundscCs>td��dd�}|j}t�|�\}}t|||j|j�dSrU�rrX�TrrYrrZr[�rr\�br]r^rrr�"test_unusual_order_positive_stride�sz1TestByteBounds.test_unusual_order_positive_stridecCsHtd��dd�}|jddd�}t�|�\}}t|||j|j�dS)NrVrrW���r`rbrrr�"test_unusual_order_negative_stride�sz1TestByteBounds.test_unusual_order_negative_stridecCsHtd�}|ddd�}t�|�\}}t|||jd|j|j�dS)NrVr	)rrrYrrZr[rbrrr�test_strided�s$zTestByteBounds.test_stridedN)rOrN�__qualname__r_rdrfrgrrrrrT�s
rTcCs(ttd��td��1s
wYdS)Nzno deprecation warning)r�
ValueErrorrrrr�(test_assert_raises_regex_context_manager�s�rjcCs@Gdd�d�}Gdd�d�}dd�}||�sJ�||�rJ�dS)Nc@seZdZdS)z1test_info_method_heading.<locals>.NoPublicMethodsN)rOrNrhrrrr�NoPublicMethods�srkc@seZdZdd�ZdS)z3test_info_method_heading.<locals>.WithPublicMethodscSsdSrrrrrr�first_method�r&z@test_info_method_heading.<locals>.WithPublicMethods.first_methodN)rOrNrhrlrrrr�WithPublicMethods�srmcSs t�}tj||d�d|��vS)N)rzMethods:)rr�infor)�clsrrrr�_has_method_heading�sz5test_info_method_heading.<locals>._has_method_headingr)rkrmrprrr�test_info_method_heading�s
rqcCsDdd�}tjddtjdddid�fgfgdd	id�}t�|�}|||�d
us(J�|jdus/J�|djdus8J�|ddjdusCJ�tjddgd
ddid
�}t�|�}|||�d
us]J�|jdusdJ�tjdddid�}t�|�}|||�d
us{J�|jdus�J�tjdddid�}t�|�}|||�d
us�J�|jdus�J�dS)NcSstj||dd�S)N�no)�casting)�np�can_cast)�dt1�dt2rrr�_compare_dtypes�sz+test_drop_metadata.<locals>._compare_dtypes�l1�l2�S8r/�toto��metadata�titiT)rz<f8)�yz<i4)�alignr~�8f�uint32)rt�dtyper�
drop_metadatar~)rx�dt�dt_mrrr�test_drop_metadata�s8 �

�
�
�
r�r�zi,i,i,i�f1�f3�f8�10icCs<t�|�|us	J�tj|ddid�}t�|�jdusJ�dS)Nrr	r})rr�rtr�r~)r�rrr�$test_drop_metadata_identity_and_copy�sr�)4rG�sys�pytestrrt�
numpy.corer�
numpy.testingrrr�	numpy.librr�numpy.lib.utils�libr�ior�mark�skipif�flags�optimize�version_inforr r$r%r'r*�	new_func4r,rLr-�	new_func6r0r4r6r7r8�parametrizerFr=rMrPrSrTrjrqr�r�r�rrrr�<module>sp�


�
$��