o
    $e~  ã                   @   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*G d4d5„ d5ƒZ+d6d7„ Z,d8d9„ 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| v ƒ d S )NZ
eigenvalueÚnumpyF)ÚmoduleÚoutputZimport_modulesznumpy.linalg.eig)r   ÚutilsZlookforÚgetvaluer   )Úout© r   úJD:\Projects\ConvertPro\env\Lib\site-packages\numpy/lib/tests/test_utils.pyÚtest_lookfor   s   
ÿr   c                 C   ó   |S ©Nr   ©ÚselfÚxr   r   r   Úold_func   ó   r   úRather use new_func2)Úmessagec                 C   r   r   r   r   r   r   r   Ú	old_func2   r   r!   c                 C   r   r   r   r   r   r   r   Ú	old_func3$   ó   r"   Ú	new_func3)Zold_nameÚnew_namec                 C   r   )z Summary.

    Further info.
    r   r   r   r   r   Ú	old_func4)   ó   r&   c                 C   r   )z+Summary.

        Bizarre indentation.
    r   r   r   r   r   Ú	old_func52   r'   r(   zThis function is
deprecated.c                 C   r   )z
    Also in PEP-257.
    r   r   r   r   r   Ú	old_func6;   s   r)   úRather use new_func7)Úmsgc                 C   r   r   r   r   r   r   r   Ú	old_func7C   r   r,   c                   C   ó   t dtjv ƒ d S )NÚ
deprecated)r   r   Ú__doc__r   r   r   r   Útest_deprecate_decoratorH   ó   r0   c                   C   r-   )Nr   )r   r!   r/   r   r   r   r   Ú test_deprecate_decorator_messageL   r1   r2   c                   C   s    t dtjv ƒ t dtjv ƒ d S )Nr"   r$   )r   r$   r/   r   r   r   r   Útest_deprecate_fnP   s   r3   c                   C   r-   )Nr*   )r   r,   r/   r   r   r   r   Ú)test_deprecate_with_doc_decorator_messageU   r1   r4   z-OO discards docstringszold_func, new_funcc                 C   s~   t | |ƒ d| fd|ffD ]/\}}t|j d¡ƒD ]"\}}|dkr0| d¡s/| d¡r/J |ƒ‚q|r;| d¡s;J |ƒ‚qqd S )NÚoldÚnewÚ
r   z    ú )Ú_compare_docsÚ	enumerater/   ÚsplitÚ
startswith)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   r=   Zold_docZnew_docrC   r   r   r   r9   j   s   

r9   c                   C   r-   )Nz
        Bizarre)r   Ú	new_func5r/   r   r   r   r   Ú"test_deprecate_preserve_whitespaceq   s   rE   c                   C   s   t  d¡ d S )NÚNone)r   Z	safe_evalr   r   r   r   Útest_safe_eval_nameconstantv   s   rG   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 rI   ©r   rL   ÚTr   rM   r   rN   rO   ©r   rP   ÚbrQ   rR   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 )NrJ   r   rK   éÿÿÿÿrT   rV   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 )NrJ   r	   )r   r   rM   r   rN   rO   rV   r   r   r   Útest_strided�   s   $zTestByteBounds.test_stridedN)Ú__name__Ú
__module__Ú__qualname__rS   rX   rZ   r[   r   r   r   r   rH   {   s
    rH   c                   C   s(   t tdƒ� tdƒ‚1 sw   Y  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„ }||ƒsJ ‚|| ƒrJ ‚d S )Nc                   @   s   e Zd ZdS )z1test_info_method_heading.<locals>.NoPublicMethodsN)r\   r]   r^   r   r   r   r   ÚNoPublicMethods¡   s    ra   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¥   r#   z@test_info_method_heading.<locals>.WithPublicMethods.first_methodN)r\   r]   r^   rb   r   r   r   r   ÚWithPublicMethods¤   s    rc   c                 S   s    t ƒ }tj| |d� d| ¡ v S )N)r   zMethods:)r   r   Úinfor   )Úclsr   r   r   r   Ú_has_method_heading¨   s   z5test_info_method_heading.<locals>._has_method_headingr   )ra   rc   rf   r   r   r   Útest_info_method_headingž   s
   rg   ).rA   Ú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(   rD   r)   Z	new_func6r,   r0   r2   r3   r4   Zparametrizer@   r9   rE   rG   rH   r`   rg   r   r   r   r   Ú<module>   s\    þ


ý
