zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
U
P±dÎã@sÐddlZddlZddlZddlmZddlmZmZmZddl    m
Z
m Z ddl m mZddlmZejjejjdkddejjejd    kd
dd d „ƒƒZe
d d„ƒZe
dddd„ƒZdd„Ze
edddZdd„Ze
eƒZdd„Ze
eddZdd„Ze
eƒZ e ddd d!„ƒZ!d"d#„Z"d$d%„Z#d&d'„Z$d(d)„Z%ejjejjdkd*dej &d+eefeefee fg¡d,d-„ƒƒZ'd.d/„Z(ejjejjdkd*dd0d1„ƒZ)d2d3„Z*d4d5„Z+Gd6d7„d7ƒZ,d8d9„Z-d:d;„Z.dS)<é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|kƒdS)NZ
eigenvalueÚnumpyF)ÚmoduleÚoutputZimport_modulesznumpy.linalg.eig)rÚutilsZlookforÚgetvaluer)Úout©rúQd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\numpy/lib/tests/test_utils.pyÚ test_lookfor s 
ÿrcCs|S©Nr©ÚselfÚxrrrÚold_funcsrúRather use new_func2)ÚmessagecCs|SrrrrrrÚ    old_func2srcCs|SrrrrrrÚ    old_func3$sr Ú    new_func3)Zold_nameÚnew_namecCs|S)z Summary.
 
    Further info.
    rrrrrÚ    old_func4)sr#cCs|S)z+Summary.
 
        Bizarre indentation.
    rrrrrÚ    old_func52sr$zThis function is
deprecated.cCs|S)z
    Also in PEP-257.
    rrrrrÚ    old_func6;sr%úRather use new_func7)ÚmsgcCs|SrrrrrrÚ    old_func7Csr(cCstdtjkƒdS)NÚ
deprecated)rrÚ__doc__rrrrÚtest_deprecate_decoratorHsr+cCstdtjkƒdS)Nr)rrr*rrrrÚ test_deprecate_decorator_messageLsr,cCs tdtjkƒtdtjkƒdS)Nr r!)rr!r*rrrrÚtest_deprecate_fnPsr-cCstdtjkƒdS)Nr&)rr(r*rrrrÚ)test_deprecate_with_doc_decorator_messageUsr.z-OO discards docstringszold_func, new_funccCs~t||ƒd|fd|ffD]^\}}t|j d¡ƒD]D\}}|dkr`| d¡sv| d¡rvt|ƒ‚q2|r2| d¡s2t|ƒ‚q2qdS)NÚoldÚnewÚ
rz    ú )Ú _compare_docsÚ    enumerater*ÚsplitÚ
startswithÚAssertionError)rÚnew_funcZkndÚfuncÚliÚlinerrrÚtest_deprecate_help_indentationYs
r<cCs8t |¡}t |¡}| d¡d}t||d…|ƒdS)Nz
 
r    )ÚinspectÚgetdocÚindexr)rr8Zold_docZnew_docr?rrrr3js
 
r3cCstdtjkƒdS)Nz
        Bizarre)rÚ    new_func5r*rrrrÚ"test_deprecate_preserve_whitespaceqsrAcCsttjtkƒdSr)rrÚ
__module__Ú__name__rrrrÚtest_deprecate_modulevsrDcCst d¡dS)NÚNone)rZ    safe_evalrrrrÚtest_safe_eval_nameconstantzsrFc@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ƒdSrH©rrKÚTrrLrrMrN©rrOÚbrPrQrrrÚ"test_unusual_order_positive_strideˆsz1TestByteBounds.test_unusual_order_positive_stridecCsHtdƒ dd¡}|jddd…}t |¡\}}t|||j|jƒdS)NrIr rJéÿÿÿÿrSrUrrrÚ"test_unusual_order_negative_strideŽsz1TestByteBounds.test_unusual_order_negative_stridecCsHtdƒ}|ddd…}t |¡\}}t|||jd|j|jƒdS)NrIr    )rrrLrrMrNrUrrrÚ test_strided”szTestByteBounds.test_stridedN)rCrBÚ __qualname__rRrWrYrZrrrrrGsrGc    Cs"ttdƒtdƒ‚W5QRXdS)Nzno deprecation warning)rÚ
ValueErrorrrrrÚ(test_assert_raises_regex_context_managers r]cCs@Gdd„dƒ}Gdd„dƒ}dd„}||ƒs0t‚||ƒr<t‚dS)Nc@s eZdZdS)z1test_info_method_heading.<locals>.NoPublicMethodsN)rCrBr[rrrrÚNoPublicMethods¥sr^c@seZdZdd„ZdS)z3test_info_method_heading.<locals>.WithPublicMethodscSsdSrrrrrrÚ first_method©sz@test_info_method_heading.<locals>.WithPublicMethods.first_methodN)rCrBr[r_rrrrÚWithPublicMethods¨sr`cSs tƒ}tj||dd| ¡kS)N)rzMethods:)rrÚinfor)ÚclsrrrrÚ_has_method_heading¬sz5test_info_method_heading.<locals>._has_method_heading)r7)r^r`rcrrrÚtest_info_method_heading¢s
 rd)/r=ÚsysZpytestZ
numpy.corerZ numpy.testingrrrZ    numpy.librrZnumpy.lib.utilsÚlibrÚiorÚmarkZskipifÚflagsÚoptimizeÚ version_inforrrr r!r#Z    new_func4r$r@r%Z    new_func6r(r+r,r-r.Z parametrizer<r3rArDrFrGr]rdrrrrÚ<module>s\  þ 
 
 
ý