U
    b                     @   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| k d S )NZ
eigenvalueZnumpyF)moduleoutputZimport_modulesznumpy.linalg.eig)r   utilsZlookforgetvaluer   )out r   Z/home/fireinfo/NEWAFireInfo/venv/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func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   r7   Zold_docZnew_docr>   r   r   r   r2   j   s    

r2   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 d d S )NNone)r   Z	safe_evalr   r   r   r   test_safe_eval_nameconstantv   s    rB   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 rD   r   rG   Tr   rH   r   rI   rJ   r   rK   brL   rM   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 )NrE   r   rF   rO   rQ   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 )NrE   r	   )r   r   rH   r   rI   rJ   rQ   r   r   r   test_strided   s    zTestByteBounds.test_stridedN)__name__
__module____qualname__rN   rS   rU   rV   r   r   r   r   rC   {   s   rC   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)rW   rX   rY   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)rW   rX   rY   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)r6   )r\   r^   ra   r   r   r   test_info_method_heading   s
    rb   ).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;   r2   r@   rB   rC   r[   rb   r   r   r   r   <module>   sZ   



