idJ<ddlZddlZddlZddlZddlmZddlmZm Z m Z ddl m Z m Z ddlmcmZddlmZejejjdkdejejd kd d Ze d Ze d dZdZe eddZdZe eZdZe edZ dZ!e e!Z"e ddZ#dZ$dZ%dZ&dZ'ejejjdkdej(d eefee fe!e"fgd!Z)d"Z*ejejjdkdd#Z+d$Z,d%Z-Gd&d'Z.d(Z/d)Z0d*Z1ej(d+ej2d,d-d.gej2d/ej2d0gd1Z3dS)2N)arange)assert_ assert_equalassert_raises_regex) deprecatedeprecate_with_doc)StringIOzPython running -OO)reason) r candidatezBroken as of bpo-44524ct}tjdd|d|}t d|vdS)N eigenvaluenumpyF)moduleoutputimport_modulesznumpy.linalg.eig)r utilslookforgetvaluer)outs O/opt/cloudlinux/venv/lib/python3.11/site-packages/numpy/lib/tests/test_utils.py test_lookforrsV **C M,ws!&(((( ,,..C # %&&&&&c|SNselfxs rold_funcr# HrRather use new_func2)messagec|Srrr s r old_func2r( r$rc|Srrr s r old_func3r*%s Hrr* new_func3)old_namenew_namec|S)z Summary. Further info. rr s r old_func4r/* Hrc|S)z+Summary. Bizarre indentation. rr s r old_func5r23r0rzThis function is deprecated.c|S)z Also in PEP-257. rr s r old_func6r4<s  HrRather use new_func7)msgc|Srrr s r old_func7r8Dr$rc<tdtjvdS)N deprecated)rr#__doc__rrrtest_deprecate_decoratorr<Is LH, ,-----rc<tdtjvdS)Nr%)rr(r;rrr test_deprecate_decorator_messager>M "i&7 788888rcrtdtjvtdtjvdS)Nr*r+)rr+r;rrrtest_deprecate_fnrAQs4 K9, ,--- K9, ,-----rc<tdtjvdS)Nr5)rr8r;rrr)test_deprecate_with_doc_decorator_messagerCVr?rz-OO discards docstringszold_func, new_funccTt||d|fd|ffD]\}}t|jdD]a\}}|dkr5|ds|dr J|@|r|ds J|bdS)Noldnew rz  ) _compare_docs enumerater;split startswith)r#new_funckndfunclilines rtest_deprecate_help_indentationrRZs(H%%%h'%):;44 T!$,"4"4T":":;; 4 4HBQwwv..Odooc6J6JOOCOOO 4v..33333  444rctj|}tj|}|ddz}t||d|dS)Nz r )inspectgetdocindexr)r#rMold_docnew_docrVs rrIrIksTnX&&GnX&&G MM& ! !A %E'*****rc<tdtjvdS)Nz Bizarre)r new_func5r;rrr"test_deprecate_preserve_whitespacer[rs 9#4 455555rcJttjtkdSr)rr# __module____name__rrrtest_deprecate_moduler_ws H 8 +,,,,,rc.tjddS)NNone)r safe_evalrrrtest_safe_eval_nameconstantrc{s OFrc&eZdZdZdZdZdZdS)TestByteBoundsctddd}tj|\}}t ||z |j|jzdSN r )rreshaper byte_boundsrsizeitemsize)r!alowhighs rtest_byte_boundszTestByteBounds.test_byte_boundssV 2JJ  q! $ $%a(( TTCZ!*!455555rctddd}|j}tj|\}}t ||z |j|jzdSrgrrjTrrkrrlrmr!rnbrorps r"test_unusual_order_positive_stridez1TestByteBounds.test_unusual_order_positive_strides[ 2JJ  q! $ $ C%a(( TTCZ!*!455555rctddd}|jddd}tj|\}}t ||z |j|jzdS)Nrhr rirsrus r"test_unusual_order_negative_stridez1TestByteBounds.test_unusual_order_negative_stridese 2JJ  q! $ $ C"I%a(( TTCZ!*!455555rctd}|ddd}tj|\}}t||z |jdz|jz|jz dS)Nrhr )rrrkrrlrmrus r test_stridedzTestByteBounds.test_strideds` 2JJ cccF%a(( T TCZ!aj!81:!EFFFFFrN)r^r] __qualname__rqrwrzr|rrrreresU666666 666 GGGGGrrecfttd5td#1swxYwYdS)Nzno deprecation warning)r ValueErrorrrr(test_assert_raises_regex_context_managerrs^ Z)A B B3312223333333333s &**ctGdd}Gdd}d}||sJ||rJdS)NceZdZdS)1test_info_method_heading..NoPublicMethodsN)r^r]r}rrrNoPublicMethodsrs rrceZdZdZdS)3test_info_method_heading..WithPublicMethodscdSrrrrr first_methodz@test_info_method_heading..WithPublicMethods.first_methods DrN)r^r]r}rrrrWithPublicMethodsrs#     rrcvt}tj||d|vS)N)rzMethods:)r rinfor)clsrs r_has_method_headingz5test_info_method_heading.._has_method_headings3jj 3s####S\\^^++rr)rrrs rtest_info_method_headingrs        ,,,  0 1 1111""?3333333rc d}tjddtjdddifgfgddi}tj|}|||d usJ|jJ|djJ|ddjJtjd d gd ddi }tj|}|||d usJ|jJtjd ddi}tj|}|||d usJ|jJtjdddi}tj|}|||d usJ|jJdS)Nc0tj||dS)Nno)casting)npcan_cast)dt1dt2s r_compare_dtypesz+test_drop_metadata.._compare_dtypess{3T2222rl1l2S8r6totometadatatitiT)r"zrArC parametrizerRrIr[r_rcrerrrrrrrrrs DDDDDDDDDD33333333CI&!+4HII22 #'' JI '      )***  +*    Ii+ L L L    Ii    Ii)H I I I    Ii .///  0/ ...999... 999CI&!+4MNN-   0 44 ON 4+++CI&!+4MNN66ON6--- GGGGGGGG<333 444&!!!!!!H )  dD\ * 77 777r