U
    ¸mœd  ã                   @   sÐ  d dl Z d dlZd dlZd dlmZ d dlmZmZmZ d dl	m
Z
mZ d dlm  mZ d dlmZ ejjejjdkdd�ejjejd	kd
d�dd„ ƒƒZe
dd„ ƒZe
dd�dd„ ƒZdd„ Ze
eddd�Zdd„ Ze
eƒZdd„ Ze
edd�Zdd„ Ze
eƒZ edd�d d!„ ƒZ!d"d#„ Z"d$d%„ Z#d&d'„ Z$d(d)„ Z%ejjejjdkd*d�ej &d+eefeefee fg¡d,d-„ ƒƒZ'd.d/„ Z(ejjejjdkd*d�d0d1„ ƒZ)d2d3„ Z*d4d5„ Z+G d6d7„ d7ƒZ,d8d9„ Z-d:d;„ Z.dS )<é    N)Úarange)Úassert_Úassert_equalÚassert_raises_regex)Ú	deprecateÚdeprecate_with_doc)ÚStringIOé   zPython running -OO)Úreason)é   é
   r   Ú	candidateé   zBroken as of bpo-44524c                  C   s0   t ƒ } tjdd| dd� |  ¡ } td| kƒ d S )NZ
eigenvalueÚnumpyF)ÚmoduleÚoutputZimport_modulesznumpy.linalg.eig)r   ÚutilsZlookforÚgetvaluer   )Úout© r   úS/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/numpy/lib/tests/test_utils.pyÚtest_lookfor   s    
ÿr   c                 C   s   |S ©Nr   ©ÚselfÚxr   r   r   Úold_func   s    r   úRather use new_func2)Úmessagec                 C   s   |S r   r   r   r   r   r   Ú	old_func2   s    r   c                 C   s   |S r   r   r   r   r   r   Ú	old_func3$   s    r    Ú	new_func3)Zold_nameÚnew_namec                 C   s   |S )z Summary.

    Further info.
    r   r   r   r   r   Ú	old_func4)   s    r#   c                 C   s   |S )z+Summary.

        Bizarre indentation.
    r   r   r   r   r   Ú	old_func52   s    r$   zThis function is
deprecated.c                 C   s   |S )z
    Also in PEP-257.
    r   r   r   r   r   Ú	old_func6;   s    r%   úRather use new_func7)Úmsgc                 C   s   |S r   r   r   r   r   r   Ú	old_func7C   s    r(   c                   C   s   t dtjkƒ d S )NÚ
deprecated)r   r   Ú__doc__r   r   r   r   Útest_deprecate_decoratorH   s    r+   c                   C   s   t dtjkƒ d S )Nr   )r   r   r*   r   r   r   r   Ú test_deprecate_decorator_messageL   s    r,   c                   C   s    t dtjkƒ t dtjkƒ d S )Nr    r!   )r   r!   r*   r   r   r   r   Útest_deprecate_fnP   s    r-   c                   C   s   t dtjkƒ d S )Nr&   )r   r(   r*   r   r   r   r   Ú)test_deprecate_with_doc_decorator_messageU   s    r.   z-OO discards docstringszold_func, new_funcc                 C   s~   t | |ƒ d| fd|ffD ]^\}}t|j d¡ƒD ]D\}}|dkr`| d¡sv| d¡rvt|ƒ‚q2|r2| d¡s2t|ƒ‚q2qd S )NÚoldÚnewÚ
r   z    ú )Ú_compare_docsÚ	enumerater*   ÚsplitÚ
startswithÚAssertionError)r   Únew_funcZkndÚfuncZliÚliner   r   r   Útest_deprecate_help_indentationY   s    
r;   c                 C   s8   t  | ¡}t  |¡}| d¡d }t||d … |ƒ d S )Nz

r	   )ÚinspectÚgetdocÚindexr   )r   r8   Zold_docZnew_docr>   r   r   r   r3   j   s    

r3   c                   C   s   t dtjkƒ d S )Nz
        Bizarre)r   Ú	new_func5r*   r   r   r   r   Ú"test_deprecate_preserve_whitespaceq   s    r@   c                   C   s   t tjtkƒ d S r   )r   r   Ú
__module__Ú__name__r   r   r   r   Útest_deprecate_modulev   s    rC   c                   C   s   t  d¡ d S )NÚNone)r   Z	safe_evalr   r   r   r   Útest_safe_eval_nameconstantz   s    rE   c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚTestByteBoundsc                 C   s8   t dƒ dd¡}t |¡\}}t|| |j|j ƒ d S ©Né   r   é   )r   Úreshaper   Úbyte_boundsr   ÚsizeÚitemsize)r   ÚaÚlowÚhighr   r   r   Útest_byte_bounds�   s    zTestByteBounds.test_byte_boundsc                 C   s>   t dƒ dd¡}|j}t |¡\}}t|| |j|j ƒ d S rG   ©r   rJ   ÚTr   rK   r   rL   rM   ©r   rN   ÚbrO   rP   r   r   r   Ú"test_unusual_order_positive_strideˆ   s    z1TestByteBounds.test_unusual_order_positive_stridec                 C   sH   t dƒ dd¡}|jd d d… }t |¡\}}t|| |j|j ƒ d S )NrH   r   rI   éÿÿÿÿrR   rT   r   r   r   Ú"test_unusual_order_negative_strideŽ   s    z1TestByteBounds.test_unusual_order_negative_stridec                 C   sH   t dƒ}|d d d… }t |¡\}}t|| |jd |j |j ƒ d S )NrH   r	   )r   r   rK   r   rL   rM   rT   r   r   r   Útest_strided”   s    zTestByteBounds.test_stridedN)rB   rA   Ú__qualname__rQ   rV   rX   rY   r   r   r   r   rF      s   rF   c                	   C   s"   t tdƒ� tdƒ‚W 5 Q R X d S )Nzno deprecation warning)r   Ú
ValueErrorr   r   r   r   Ú(test_assert_raises_regex_context_manager�   s    r\   c                  C   s@   G dd„ dƒ} G dd„ dƒ}dd„ }||ƒs0t ‚|| ƒr<t ‚d S )Nc                   @   s   e Zd ZdS )z1test_info_method_heading.<locals>.NoPublicMethodsN)rB   rA   rZ   r   r   r   r   ÚNoPublicMethods¥   s   r]   c                   @   s   e Zd Zdd„ ZdS )z3test_info_method_heading.<locals>.WithPublicMethodsc                   S   s   d S r   r   r   r   r   r   Úfirst_method©   s    z@test_info_method_heading.<locals>.WithPublicMethods.first_methodN)rB   rA   rZ   r^   r   r   r   r   ÚWithPublicMethods¨   s   r_   c                 S   s    t ƒ }tj| |d� d| ¡ kS )N)r   zMethods:)r   r   Úinfor   )Úclsr   r   r   r   Ú_has_method_heading¬   s    z5test_info_method_heading.<locals>._has_method_heading)r7   )r]   r_   rb   r   r   r   Útest_info_method_heading¢   s
    rc   )/r<   ÚsysZpytestZ
numpy.corer   Znumpy.testingr   r   r   Z	numpy.libr   r   Znumpy.lib.utilsÚlibr   Úior   ÚmarkZskipifÚflagsÚoptimizeÚversion_infor   r   r   r    r!   r#   Z	new_func4r$   r?   r%   Z	new_func6r(   r+   r,   r-   r.   Zparametrizer;   r3   r@   rC   rE   rF   r\   rc   r   r   r   r   Ú<module>   s\   þ


ý
