§
    €Ûg
?  ã                   óP  — d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZ 	 d dlZn# e$ r dZY nw xY wdd„Zd„ Ze	j                             ed¬¦  «        e	j                             ddd	g¦  «        d
„ ¦   «         ¦   «         Zd„ Zd„ Zd„ Ze	j                             edu d¬¦  «        d„ ¦   «         Zd„ dD ¦   «         Zg d¢Zd„ dD ¦   «         Zd„ Zg d¢Zd„ Zg d¢Zd„ Zd„ Z e	j         !                     ej"        d¦  «        dud¬¦  «        d„ ¦   «         Z#dS )é    N)ÚIS_WASMc                 óà   — |€| j         }i }t          | ¦  «        D ]R}t          | |¦  «        }t          |d¦  «        r0t          |d¦  «        r |j        |k    r|j        dz   |j         z   ||<   ŒS|S )zEReturns a mapping of all objects with the wrong __module__ attribute.NÚ
__module__Ú__name__ú.)r   ÚdirÚgetattrÚhasattrr   )ÚmoduleÚmodule_nameÚresultsÚnameÚitems        úQ/granary/edev/quantum/lib/python3.11/site-packages/numpy/tests/test_public_api.pyÚ	check_dirr      s‰   € àÐØ”oˆØ€GÝ�F‘”ð Bð BˆÝ�v˜tÑ$Ô$ˆÝ�D˜,Ñ'Ô'ð 	B­G°D¸*Ñ,EÔ,Eð 	BØ”O {Ò2Ð2Ø œO¨cÑ1°D´MÑAˆG�D‰MøØ€Nó    c                  ó¸   — i dd“dd“dd“dd“d	d“d
d“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“d d!“d"d#d$d%œ¥} | }t          t          ¦  «        }||k    sJ ‚d S )&NÚTesterz,numpy.testing._private.nosetester.NoseTesterÚ_add_newdoc_ufuncz.numpy.core._multiarray_umath._add_newdoc_ufuncÚadd_docstringz*numpy.core._multiarray_umath.add_docstringÚ
add_newdocz#numpy.core.function_base.add_newdocÚadd_newdoc_ufuncÚbyte_boundsznumpy.lib.utils.byte_boundsÚcompare_chararraysz/numpy.core._multiarray_umath.compare_chararraysÚ	deprecateznumpy.lib.utils.deprecateÚdeprecate_with_docz"numpy.lib.utils.deprecate_with_docÚdispznumpy.lib.function_base.dispÚfastCopyAndTransposez1numpy.core._multiarray_umath.fastCopyAndTransposeÚget_array_wrapz#numpy.lib.shape_base.get_array_wrapÚget_includeznumpy.lib.utils.get_includeÚ
recfromcsvznumpy.lib.npyio.recfromcsvÚ
recfromtxtznumpy.lib.npyio.recfromtxtÚ	safe_evalznumpy.lib.utils.safe_evalÚset_string_functionz)numpy.core.arrayprint.set_string_functionznumpy.__config__.showznumpy.lib.utils.show_runtimeznumpy.lib.utils.who)Úshow_configÚshow_runtimeÚwho)r   Únp)ÚundocumentedÚ	allowlistÚbad_resultss      r   Útest_numpy_namespacer,   !   s'  € ðØÐ@ðàÐMðð 	ÐEðð 	Ð;ð	ð
 	ÐLðð 	Ð4ðð 	ÐOðð 	Ð0ðð 	ÐBðð 	Ð.ðð 	Ð Sðð 	Ð?ðð 	Ð4ðð 	Ð2ðð 	Ð2ðð  	Ð0ð!ð" 	ÐJð#ð$ /Ø6Ø$ð)ð ð €Lð. €IÝ�B‘-”-€Kð ˜)Ò#Ð#Ð#Ð#Ð#Ð#r   zcan't start subprocess)Úreasonr   Útestingr   c                 óŠ   — t           j        dd| z   f}t          j        |¦  «        }|rJ ‚| t	          t
          ¦  «        v sJ ‚dS )a¶  Make sure we can actually use the modules we lazy load.

    While not exported as part of the public API, it was accessible.  With the
    use of __getattr__ and __dir__, this isn't always true It can happen that
    an infinite recursion may happen.

    This is the only way I found that would force the failure to appear on the
    badly implemented code.

    We also test for the presence of the lazily imported modules in dir

    z-czimport numpy; numpy.N)ÚsysÚ
executableÚ
subprocessÚcheck_outputr   r(   )r   ÚexeÚresults      r   Útest_import_lazy_importr6   B   sM   € õ Œ>˜4Ð!7¸$Ñ!>Ð
?€CÝÔ$ SÑ)Ô)€FØÐÐÐð •3•r‘7”7ˆ?ˆ?ˆ?ˆ?ˆ?ˆ?r   c                  ó¬   — t          t          t          ¦  «        ¦  «        t          t          t          t          ¦  «        ¦  «        ¦  «        k    sJ ‚dS )zWAssert that output of dir has only one "testing/tester"
    attribute without duplicateN)Úlenr   r(   Úset© r   r   Útest_dir_testingr;   Y   s;   € õ �s•2‰wŒw‰<Œ<�3�s¥3¥r¡7¤7™|œ|Ñ,Ô,Ò,Ð,Ð,Ð,Ð,Ð,r   c                  óH   — t          t          j        ¦  «        } | i k    sJ ‚d S ©N)r   r(   Úlinalg©r+   s    r   Útest_numpy_linalgr@   _   s(   € Ý�BœIÑ&Ô&€KØ˜"ÒÐÐÐÐÐr   c                  óH   — t          t          j        ¦  «        } | i k    sJ ‚d S r=   )r   r(   Úfftr?   s    r   Útest_numpy_fftrC   d   s(   € Ý�BœFÑ#Ô#€KØ˜"ÒÐÐÐÐÐr   z#ctypes not available in this pythonc                  ó�   — t          j        t          j        j        j        ¦  «        } t          | dd ¦  «        }|�
J d¦   «         ‚d S )NÚtest_not_exportedzG'test_not_exported' is mistakenly exported, NPY_NO_EXPORT does not work)ÚctypesÚCDLLr(   ÚcoreÚ_multiarray_testsÚ__file__r	   )ÚcdllÚfs     r   Útest_NPY_NO_EXPORTrM   i   sC   € õ Œ;•r”wÔ0Ô9Ñ:Ô:€Då�Ð)¨4Ñ0Ô0€AØˆ9ˆ9ð 4‰9Œ9ˆ9ˆ9ˆ9r   c                 ó   — g | ]}d |z   ‘ŒS ©znumpy.r:   ©Ú.0Úss     r   ú
<listcomp>rS      s(   € ð &ð &ð & 1�(˜Q‘,ð &ð &ð &r   )%Ú	array_apizarray_api.linalgÚ	ctypeslibÚ	distutilszdistutils.cpuinfozdistutils.exec_commandzdistutils.misc_utilzdistutils.logzdistutils.system_infoÚdoczdoc.constantsz
doc.ufuncsÚf2pyrB   Úlibz
lib.formatz
lib.mixinszlib.recfunctionszlib.scimathzlib.stride_tricksr>   Úmaz	ma.extraszma.mrecordsÚmatlibÚ
polynomialzpolynomial.chebyshevzpolynomial.hermitezpolynomial.hermite_ezpolynomial.laguerrezpolynomial.legendrezpolynomial.polynomialÚrandomr.   Útypingztyping.mypy_pluginÚversion)z
numpy.charznumpy.emathz	numpy.recc                 ó   — g | ]}d |z   ‘ŒS rO   r:   rP   s     r   rS   rS   ¯   s.   € ð uð uð u°˜x¨!™|ð uð uð ur   )tÚcompatzcompat.py3kÚconftestrH   zcore.arrayprintzcore.defchararrayzcore.einsumfunczcore.fromnumericzcore.function_basezcore.getlimitszcore.memmapzcore.multiarrayzcore.numericzcore.numerictypeszcore.overrideszcore.recordszcore.shape_basez
core.umathzcore.umath_testszdistutils.armccompilerzdistutils.ccompilerzdistutils.ccompiler_optzdistutils.commandzdistutils.command.autodistzdistutils.command.bdist_rpmzdistutils.command.buildzdistutils.command.build_clibzdistutils.command.build_extzdistutils.command.build_pyzdistutils.command.build_scriptszdistutils.command.build_srczdistutils.command.configz!distutils.command.config_compilerzdistutils.command.developzdistutils.command.egg_infozdistutils.command.installzdistutils.command.install_clibzdistutils.command.install_dataz!distutils.command.install_headerszdistutils.command.sdistzdistutils.conv_templatezdistutils.corezdistutils.extensionzdistutils.fcompilerzdistutils.fcompiler.absoftzdistutils.fcompiler.armzdistutils.fcompiler.compaqzdistutils.fcompiler.environmentzdistutils.fcompiler.g95zdistutils.fcompiler.gnuzdistutils.fcompiler.hpuxzdistutils.fcompiler.ibmzdistutils.fcompiler.intelzdistutils.fcompiler.laheyzdistutils.fcompiler.mipszdistutils.fcompiler.nagzdistutils.fcompiler.nonezdistutils.fcompiler.pathf95zdistutils.fcompiler.pgzdistutils.fcompiler.nvzdistutils.fcompiler.sunzdistutils.fcompiler.vastzdistutils.fcompiler.fujitsuzdistutils.from_templatezdistutils.intelccompilerzdistutils.lib2defzdistutils.line_endingszdistutils.mingw32ccompilerzdistutils.msvccompilerzdistutils.npy_pkg_configzdistutils.numpy_distributionzdistutils.pathccompilerzdistutils.unixccompilerÚdualzf2py.auxfuncszf2py.capi_mapszf2py.cb_ruleszf2py.cfuncszf2py.common_ruleszf2py.crackfortranzf2py.diagnosezf2py.f2py2ezf2py.f90mod_ruleszf2py.func2subrz
f2py.ruleszf2py.symboliczf2py.use_rulesz
fft.helperzlib.arraypadzlib.arraysetopszlib.arrayteratorzlib.function_basezlib.histogramszlib.index_trickszlib.nanfunctionsz	lib.npyiozlib.polynomialzlib.shape_basezlib.twodim_basezlib.type_checkzlib.ufunclikezlib.user_arrayz	lib.utilszlinalg.lapack_litezlinalg.linalgzma.benchzma.corezma.testutilszma.timer_comparisonÚ	matrixlibzmatrixlib.defmatrixzpolynomial.polyutilszrandom.mtrandzrandom.bit_generatorztesting.print_coercion_tablesztesting.utilsc                 ód   — d| v sd| v sd| v rdS | t           v rdS | t          v rdS | t          v rdS dS )z%Check if this needs to be considered.z._z.testsz.setupFT)ÚPUBLIC_MODULESÚPUBLIC_ALIASED_MODULESÚPRIVATE_BUT_PRESENT_MODULES©r   s    r   Úis_unexpectedrj   '  s[   € àˆt€|€|�x 4Ð'Ð'¨8°tÐ+;Ð+;Øˆuà�~ÐÐØˆuàÕ%Ð%Ð%ØˆuàÕ*Ð*Ð*Øˆuàˆ4r   )znumpy.core.code_generatorsz!numpy.core.code_generators.genapiz)numpy.core.code_generators.generate_umathz+numpy.core.code_generators.ufunc_docstringsz-numpy.core.code_generators.generate_numpy_apiz-numpy.core.code_generators.generate_ufunc_apiz$numpy.core.code_generators.numpy_apiz-numpy.core.code_generators.generate_umath_docznumpy.core.cversionsznumpy.core.generate_numpy_apiznumpy.distutils.msvc9compilerc                  óö   — g } t          j        t          j        t          j        dz   d¬¦  «        D ]3\  }}}t          |¦  «        r|t          vr|                      |¦  «         Œ4| rt          d| › �¦  «        ‚dS )z|
    Test that we don't add anything that looks like a new public module by
    accident.  Check is based on filenames.
    r   N)ÚpathÚprefixÚonerrorzFound unexpected modules: )	ÚpkgutilÚwalk_packagesr(   Ú__path__r   rj   Ú	SKIP_LISTÚappendÚAssertionError)ÚmodnamesÚ_ÚmodnameÚispkgs       r   Útest_all_modules_are_expectedry   I  s¢   € ð €HÝ$Ô2½¼Ý:<¼+ÈÑ:KØ;?ðAñ Aô Að %ð %Ñˆˆ7�Eõ ˜Ñ!Ô!ð 	% gµYÐ&>Ð&>ð �OŠO˜GÑ$Ô$Ð$øàð FÝÐD¸(ÐDÐDÑEÔEÐEðFð Fr   )z
numpy.mathznumpy.distutils.log.sysznumpy.distutils.log.loggingznumpy.distutils.log.warningsznumpy.doc.constants.reznumpy.doc.constants.textwrapznumpy.lib.emathznumpy.lib.mathznumpy.matlib.charznumpy.matlib.recznumpy.matlib.emathznumpy.matlib.mathznumpy.matlib.linalgznumpy.matlib.fftznumpy.matlib.randomznumpy.matlib.ctypeslibznumpy.matlib.mac                  óº   — d„ }  | d¦  «        }t           D ] }|                      | |¦  «        ¦  «         Œ!|r"t          d                     |¦  «        ¦  «        ‚dS )aâ  
    Method checking all objects. The pkgutil-based method in
    `test_all_modules_are_expected` does not catch imports into a namespace,
    only filenames.  So this test is more thorough, and checks this like:

        import .lib.scimath as emath

    To check if something in a module is (effectively) public, one can check if
    there's anything in that namespace that's a public function/object but is
    not exposed in a higher-level namespace.  For example for a `numpy.lib`
    submodule::

        mod = np.lib.mixins
        for obj in mod.__all__:
            if obj in np.__all__:
                continue
            elif obj in np.lib.__all__:
                continue

            else:
                print(obj)

    c                 ón  — g }t          j        | ¦  «        }t          |d¦  «        r|j        }nt	          |¦  «        }|D ]t}|                     d¦  «        s]| dz   |z   }t          t          ||¦  «        t          j	        ¦  «        r-t          |¦  «        r|t          vr|                     |¦  «         Œu|S )NÚ__all__rv   r   )Ú	importlibÚimport_moduler
   r|   r   Ú
startswithÚ
isinstancer	   ÚtypesÚ
ModuleTyperj   ÚSKIP_LIST_2rs   )Úmod_nameÚmembersr   ÚobjnamesÚobjnameÚfullobjnames         r   Úfind_unexpected_membersz@test_all_modules_are_expected_2.<locals>.find_unexpected_members�  sÂ   € ØˆÝÔ(¨Ñ2Ô2ˆÝ�6˜9Ñ%Ô%ð 	#Ø”~ˆHˆHå˜6‘{”{ˆHàð 	8ð 	8ˆGØ×%Ò% cÑ*Ô*ð 8Ø&¨™n¨wÑ6�Ý�g f¨gÑ6Ô6½Ô8HÑIÔIð 8Ý$ [Ñ1Ô1ð 8Ø&­kÐ9Ð9Ø#ŸNšN¨;Ñ7Ô7Ð7øàˆr   Únumpyz5Found unexpected object(s) that look like modules: {}N)rf   Úextendrt   Úformat)r‰   Úunexpected_membersrw   s      r   Útest_all_modules_are_expected_2rŽ   t  s•   € ð2ð ð ð$ 1Ð0°Ñ9Ô9ÐÝ!ð Dð DˆØ×!Ò!Ð"9Ð"9¸'Ñ"BÔ"BÑCÔCÐCÐCàð GÝð +ß+1ª6Ð2DÑ+EÔ+EñGô Gð 	GðGð Gr   c                  óÖ  — d„ } g }t           D ]"} | |¦  «        s|                     |¦  «         Œ#|r"t          d                     |¦  «        ¦  «        ‚t          D ]7}	 t          |¦  «         Œ# t          $ r |                     |¦  «         Y Œ4w xY w|r"t          d                     |¦  «        ¦  «        ‚t          j        d¬¦  «        5 }t          j	        dt          ¬¦  «         t          j	        dt          ¬¦  «         t          D ]"} | |¦  «        s|                     |¦  «         Œ#	 ddd¦  «         n# 1 swxY w Y   |r"t          d	                     |¦  «        ¦  «        ‚dS )
a	  
    Check that all submodules listed higher up in this file can be imported

    Note that if a PRIVATE_BUT_PRESENT_MODULES entry goes missing, it may
    simply need to be removed from the list (deprecation may or may not be
    needed - apply common sense).
    c                 ób   — 	 t          j        | ¦  «         n# t          t          f$ r Y dS w xY wdS )NFT)r}   r~   ÚImportErrorÚAttributeError)r   s    r   Úcheck_importablez-test_api_importable.<locals>.check_importable°  sI   € ð	ÝÔ# KÑ0Ô0Ð0Ð0øÝ�^Ð,ð 	ð 	ð 	Ø�5�5ð	øøøð ˆts   ‚ —,«,z5Modules in the public API that cannot be imported: {}z1Modules in the public API that were not found: {}T)ÚrecordÚalways)ÚcategoryNzPModules that are not really public but looked public and can not be imported: {})rf   rs   rt   rŒ   rg   Úevalr’   ÚwarningsÚcatch_warningsÚfilterwarningsÚDeprecationWarningÚImportWarningrh   )r“   Úmodule_namesr   Úws       r   Útest_api_importablerŸ   ¨  s  € ðð ð ð €LÝ%ð -ð -ˆØÐ Ñ,Ô,ð 	-Ø×Ò Ñ,Ô,Ð,øàð BÝð ,ß,2ªF°<Ñ,@Ô,@ñBô Bð 	Bõ .ð -ð -ˆð	-Ý�ÑÔÐÐøÝð 	-ð 	-ð 	-Ø×Ò Ñ,Ô,Ð,Ð,Ð,ð	-øøøð ð ?Ýð )ß)/ª°Ñ)=Ô)=ñ?ô ?ð 	?õ 
Ô	 ¨Ð	-Ñ	-Ô	-ð 1°ÝÔ Õ3EÐFÑFÔFÐFÝÔ µ=ÐAÑAÔAÐAÝ6ð 	1ð 	1ˆKØ#Ð# KÑ0Ô0ð 1Ø×#Ò# KÑ0Ô0Ð0øð	1ð1ð 1ð 1ñ 1ô 1ð 1ð 1ð 1ð 1ð 1ð 1øøøð 1ð 1ð 1ð 1ð ð 8Ýð "ç"(¢&¨Ñ"6Ô"6ñ8ô 8ð 	8ð8ð 8s%   ÁA.Á.BÂBÃA!D:Ä:D>ÅD>ÚPy_DEBUGz£NumPy possibly built with `USE_DEBUG=True ./tools/travis-test.sh`, which does not expose the `array_api` entry point. See https://github.com/numpy/numpy/pull/19800c                  óØ  — t           j                             ¦   «         } 	 |                      d¬¦  «        }n&# t          $ r |                      dg ¦  «        }Y nw xY wt          |¦  «        dk    s
J d¦   «         ‚	 t          d„ |D ¦   «         ¦  «        }n# t          $ r t          d¦  «        d‚w xY w| 
                    ¦   «         }d|j        › d	�}|t          j        u s
J |¦   «         ‚dS )
z}
    Entry point for Array API implementation can be found with importlib and
    returns the numpy.array_api namespace.
    rT   )Úgroupr   z%No entry points for 'array_api' foundc              3   ó0   K  — | ]}|j         d k    ¯|V — ŒdS )rŠ   Nri   )rQ   Úeps     r   ú	<genexpr>z-test_array_api_entry_point.<locals>.<genexpr>ñ  s.   è è € Ð<Ð<˜¨¬°GÒ);Ð);�"Ð);Ð);Ð);Ð);Ð<Ð<r   z%'numpy' not in array_api entry pointsNznumpy entry point value 'z0' does not point to our Array API implementation)r}   ÚmetadataÚentry_pointsÚselectr’   Úgetr8   ÚnextÚStopIterationrt   ÚloadÚvaluerŠ   rT   )ÚepsÚxp_epsr¤   ÚxpÚmsgs        r   Útest_array_api_entry_pointr²   Ø  s%  € õ Ô
×
)Ò
)Ñ
+Ô
+€Cð*Ø—’ +�Ñ.Ô.ˆˆøÝð *ð *ð *ð
 —’˜ bÑ)Ô)ˆˆˆð*øøøõ ˆv‰;Œ;˜Š?ˆ?ˆ?ÐC‰?Œ?ˆ?ðPÝÐ<Ð<˜vÐ<Ñ<Ô<Ñ<Ô<ˆˆøÝð Pð Pð PÝÐDÑEÔEÈ4ÐOðPøøøð 
�Š‰Œ€Bð	9 B¤Hð 	9ð 	9ð 	9ð ð •”Ð Ð Ð  #Ñ Ô Ð Ð Ð s    7 · AÁAÁ;B ÂB0r=   )$r0   Ú	sysconfigr2   ro   r�   r}   r˜   rŠ   r(   ÚpytestÚnumpy.testingr   rF   r‘   r   r,   ÚmarkÚskipifÚparametrizer6   r;   r@   rC   rM   rf   rg   rh   rj   rr   ry   rƒ   rŽ   rŸ   ÚxfailÚget_config_varr²   r:   r   r   ú<module>r»      s²  ðØ 
€
€
€
Ø Ð Ð Ð Ø Ð Ð Ð Ø €€€Ø €€€Ø Ð Ð Ð Ø €€€à Ð Ð Ð Ø €€€Ø €€€Ø !Ð !Ð !Ð !Ð !Ð !ðØ€M€M€M€MøØð ð ð Ø€F€F€Fðøøøð
ð 
ð 
ð 
ð$ð $ð $ðB „×Ò�GÐ$<ÐÑ=Ô=Ø„×Ò˜ )¨XÐ!6Ñ7Ô7ðð ñ 8Ô7ñ >Ô=ðð*-ð -ð -ðð ð ð
ð ð ð
 „×Ò�F˜d�NØ@ð ñ Bô Bð5ð 5ñBô Bð5ð(&ð &ð &)ð &ñ &ô &€ðRð ð Ð ðuð uð u6ð uñ uô uÐ ðpð ð ð&ð ð €	ðFð Fð Fð,ð ð €ð*1Gð 1Gð 1Gðh-8ð -8ð -8ð` „×ÒØ€IÔ˜ZÑ(Ô(°Ð4ð	8ð ñ ô ð&ð &ñô ð&ð &ð &s   °5 µ?¾?