o
    Ô­jJ  ã                   @   s  d dl Z 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;„ Z0d<d=„ Z1ej (d>e 2d?¡d@dAg e 2dB¡e 2dC¡g¡dDdE„ ƒZ3dS )Fé    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 )NÚ
eigenvalueÚnumpyF)ÚmoduleÚoutputÚimport_modulesznumpy.linalg.eig)r   ÚutilsÚlookforÚgetvaluer   )Úout© r   úW/var/www/html/CropPilot/venv/lib/python3.10/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)Ú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_func53   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_func7D   r!   r0   c                   C   ó   t dtjv ƒ d S )NÚ
deprecated)r   r    Ú__doc__r   r   r   r   Útest_deprecate_decoratorI   ó   r4   c                   C   r1   )Nr"   )r   r$   r3   r   r   r   r   Ú test_deprecate_decorator_messageM   r5   r6   c                   C   s    t dtjv ƒ t dtjv ƒ d S )Nr%   r'   )r   r'   r3   r   r   r   r   Útest_deprecate_fnQ   s   r7   c                   C   r1   )Nr.   )r   r0   r3   r   r   r   r   Ú)test_deprecate_with_doc_decorator_messageV   r5   r8   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Ú	enumerater3   ÚsplitÚ
startswith)r    Únew_funcÚkndÚfuncÚliÚliner   r   r   Útest_deprecate_help_indentationZ   s   
€€üÿrF   c                 C   s8   t  | ¡}t  |¡}| d¡d }t||d … |ƒ d S )Nz

r	   )ÚinspectÚgetdocÚindexr   )r    rA   Úold_docÚnew_docrI   r   r   r   r=   k   s   

r=   c                   C   r1   )Nz
        Bizarre)r   Ú	new_func5r3   r   r   r   r   Ú"test_deprecate_preserve_whitespacer   s   rM   c                   C   s   t tjtkƒ d S r   )r   r    Ú
__module__Ú__name__r   r   r   r   Útest_deprecate_modulew   r5   rP   c                   C   s   t  d¡ d S )NÚNone)r   Ú	safe_evalr   r   r   r   Útest_safe_eval_nameconstant{   s   rS   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 rU   ©r   rX   ÚTr   rY   r   rZ   r[   ©r   r\   Úbr]   r^   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 )NrV   r   rW   éÿÿÿÿr`   rb   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 )NrV   r	   )r   r   rY   r   rZ   r[   rb   r   r   r   Útest_strided•   s   $zTestByteBounds.test_stridedN)rO   rN   Ú__qualname__r_   rd   rf   rg   r   r   r   r   rT   €   s
    rT   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   ÿrj   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)rO   rN   rh   r   r   r   r   ÚNoPublicMethods¦   s    rk   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)rO   rN   rh   rl   r   r   r   r   ÚWithPublicMethods©   s    rm   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   )rk   rm   rp   r   r   r   Útest_info_method_heading£   s
   rq   c                  C   sD  dd„ } t jddt jdddid�fgfgdd	id�}t |¡}| ||ƒd
u s(J ‚|jd u s/J ‚|d jd u s8J ‚|d d jd u sCJ ‚t jddgd
ddid�}t |¡}| ||ƒd
u s]J ‚|jd u sdJ ‚t jdddid�}t |¡}| ||ƒd
u s{J ‚|jd u s‚J ‚t jdddid�}t |¡}| ||ƒd
u s™J ‚|jd u s J ‚d S )Nc                 S   s   t j| |dd�S )NÚno)Úcasting)ÚnpÚcan_cast)Údt1Údt2r   r   r   Ú_compare_dtypes·   s   z+test_drop_metadata.<locals>._compare_dtypesÚl1Úl2ÚS8r/   Útoto©ÚmetadataÚtitiT)r   z<f8)Úyz<i4)Úalignr~   Ú8fÚuint32)rt   Údtyper   Údrop_metadatar~   )rx   ÚdtÚdt_mr   r   r   Útest_drop_metadata¶   s8    ÿ

þ
ÿ
ÿ
rˆ   r„   zi,i,i,iÚf1Úf3Úf8Ú10ic                 C   s<   t  | ¡| u s	J ‚tj| ddid�} t  | ¡jd u sJ ‚d S )Nr   r	   r}   )r   r…   rt   r„   r~   )r„   r   r   r   Ú$test_drop_metadata_identity_and_copyÚ   s   r�   )4rG   ÚsysÚpytestr   rt   Ú
numpy.corer   Únumpy.testingr   r   r   Ú	numpy.libr   r   Únumpy.lib.utilsÚlibr   Úior   ÚmarkÚskipifÚflagsÚoptimizeÚversion_infor   r    r$   r%   r'   r*   Ú	new_func4r,   rL   r-   Ú	new_func6r0   r4   r6   r7   r8   ÚparametrizerF   r=   rM   rP   rS   rT   rj   rq   rˆ   r„   r�   r   r   r   r   Ú<module>   sp    þ


ý
$þÿ