
    (phF                        S SK r S SKrS SKrS SKrS SKrS SKrS SKrS SKrS SKrS SK	r	S SK
Jr   S SKrS%S jrS r\	R                   R#                  \SS9\	R                   R%                  SS/5      S	 5       5       rS
 rS rS r\	R                   R#                  \SL SS9S 5       rS V s/ s H  n SU -   PM
     sn r\ R2                  S:  a  \S V s/ s H  n SU -   PM
     sn -  r/ SQrS V s/ s H  n SU -   PM
     sn r\ R2                  S:  a  \S V s/ s H  n SU -   PM
     sn -  rS r/ SQr\ R2                  S:  a  \S/-  r\	R                   R=                  S5      S 5       r/ SQr \ R2                  S:  a  \ / SQ-  r S r!S r"\	R                   RG                  \RH                  " S5      S ;  S!S9S" 5       r%\	R                   R%                  S/ S#Q5      S$ 5       r&g! \ a    Sr GNf = fs  sn f s  sn f s  sn f s  sn f )&    N)IS_WASMc                    Uc  U R                   n0 n[        U 5       Hd  n[        X5      n[        US5      (       d  M!  [        US5      (       d  M4  UR                  U:w  d  MF  UR                  S-   UR                   -   X#'   Mf     U$ )zEReturns a mapping of all objects with the wrong __module__ attribute.
__module____name__.)r   dirgetattrhasattrr   )modulemodule_nameresultsnameitems        N/var/www/html/venv/lib/python3.13/site-packages/numpy/tests/test_public_api.py	check_dirr      ss    ooGFv$D,''GD*,E,EOO{2 OOc1DMMAGM	 
 N    c                      0 SS_SS_SS_SS_SS	_S
S_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S!_S"S#S$.En U n[        [        5      nX!:X  d   eg )%N_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_functionshow_configznumpy.__config__.showznumpy.lib.utils.show_runtimeznumpy.lib.utils.who)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!" 	.#$ 7$'L, IB-K ###r   zcan't start subprocess)reasonr   testingc                     [         R                  SSU -   4n[        R                  " U5      nU(       a   eU [	        [
        5      ;   d   eg)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_importr5   A   sD     >>4!7$!>
?C$$S)F: 3r7??r   c                  ~    [        [        [        5      5      [        [        [        [        5      5      5      :X  d   eg)zSAssert that output of dir has only one "testing/tester"
attribute without duplicateN)lenr   r'   set r   r   test_dir_testingr:   X   s'     s2w<3s3r7|,,,,r   c                  F    [        [        R                  5      n U 0 :X  d   eg N)r   r'   linalgr*   s    r   test_numpy_linalgr?   ^   s    BII&K"r   c                  F    [        [        R                  5      n U 0 :X  d   eg r<   )r   r'   fftr>   s    r   test_numpy_fftrB   c   s    BFF#K"r   z#ctypes not available in this pythonc                      [         R                  " [        R                  R                  R
                  5      n [        U SS 5      nUb   S5       eg )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_EXPORTrL   h   sG     ;;rww0099:D)40A9 5 4 59r   )"	array_apizarray_api.linalg	ctypeslibdoczdoc.constantsz
doc.ufuncsdtypes
exceptionsf2pyrA   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-   ztesting.overridestypingztyping.mypy_pluginversionznumpy.)      )	distutilszdistutils.cpuinfozdistutils.exec_commandzdistutils.misc_utilzdistutils.logzdistutils.system_info)z
numpy.charznumpy.emathz	numpy.rec):compatzcompat.py3kconftestrG   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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.corezma.testutilszma.timer_comparison	matrixlibzmatrixlib.defmatrixzpolynomial.polyutilszrandom.mtrandzrandom.bit_generatorztesting.print_coercion_tables)7zdistutils.armccompilerzdistutils.fujitsuccompilerz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.unixccompilerc                 l    SU ;   d  SU ;   d  SU ;   a  gU [         ;   a  gU [        ;   a  gU [        ;   a  gg)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_unexpectedre   1  s@    t|x4'8t+;~%%**r   )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.code_generators.verify_c_api_versionznumpy.core.cversionsznumpy.core.generate_numpy_apiznumpy.core.umath_testsznumpy.distutils.msvc9compilerz'ignore:.*np.compat.*:DeprecationWarningc                     / n [         R                  " [        R                  [        R                  S-   SS9 H5  u  pn[        U5      (       d  M  U[        ;  d  M$  U R                  U5        M7     U (       a  [        SU  35      eg)zp
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   re   	SKIP_LISTappendAssertionError)modnames_modnameispkgs       r   test_all_modules_are_expectedrt   W  sy     H$22:<++:K;?AE !!gY&> OOG$A 9(DEE r   )z
numpy.mathz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.exceptionsznumpy.matlib.mathznumpy.matlib.linalgznumpy.matlib.fftznumpy.matlib.randomznumpy.matlib.ctypeslibznumpy.matlib.ma)znumpy.distutils.log.sysznumpy.distutils.log.loggingznumpy.distutils.log.warningsc                      S n U " S5      n[          H  nUR                  U " U5      5        M     U(       a  [        SR                  U5      5      eg)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[         R                  " U 5      n[        US5      (       a  UR                  nO[	        U5      nU H|  nUR                  S5      (       a  M  U S-   U-   n[        [        X$5      [        R                  5      (       d  MM  [        U5      (       d  M_  U[        ;  d  Mk  UR                  U5        M~     U$ )N__all__rq   r   )	importlibimport_moduler
   rw   r   
startswith
isinstancer	   types
ModuleTypere   SKIP_LIST_2rn   )mod_namemembersr   objnamesobjnamefullobjnames         r   find_unexpected_members@test_all_modules_are_expected_2.<locals>.find_unexpected_members  s    ((269%%~~H6{HG%%c**&nw6gf68H8HII$[11&k9#NN;7   r   numpyz5Found unexpected object(s) that look like modules: {}N)ra   extendro   format)r   unexpected_membersrr   s      r   test_all_modules_are_expected_2r     s[    2$ 19!!!"9'"BC "  ++162D+EG 	G r   c                     S n / n[          H#  nU " U5      (       a  M  UR                  U5        M%     U(       a  [        SR                  U5      5      e[         H  n [        U5        M     U(       a  [        SR                  U5      5      e[        R                  " SS9 n[        R                  " S[        S9  [        R                  " S[        S9  [         H#  nU " U5      (       a  M  UR                  U5        M%     SSS5        U(       a  [        S	R                  U5      5      eg! [         a    UR                  U5         M  f = f! , (       d  f       NR= f)
z
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                 ^     [         R                  " U 5        g! [        [        4 a     gf = f)NFT)rx   ry   ImportErrorAttributeError)r   s    r   check_importable-test_api_importable.<locals>.check_importable  s3    	##K0  ^, 		s    ,,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: {})ra   rn   ro   r   rb   evalr   warningscatch_warningsfilterwarningsDeprecationWarningImportWarningrc   )r   module_namesr   ws       r   test_api_importabler     s7    L%,,, &  ,,2F<,@B 	B .	- .  ))/)=? 	? 
	 	 	-3EF=A6K#K00##K0 7 
.  ""(&"68 	8   	-,	- 
.	-s%   D,"AE-E,E
E
EPy_DEBUG)Nr   0zNumPy 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                      [         R                  " S5      [        R                  ;   n [        R
                  R                  5       n UR                  SS9n[        U5      S:X  a  U (       a  Sn[        U5      Seg [        S U 5       5      nUR                  5       nS	UR                   S
3nU[         R"                  L d   U5       eg! [         a    UR                  S/ 5      n Nf = f! [         a    U (       a  Sn[        U5      Se gf = f)zq
Entry point for Array API implementation can be found with importlib and
returns the numpy.array_api namespace.
platlibrM   )groupr   z%No entry points for 'array_api' foundNc              3   H   #    U  H  oR                   S :X  d  M  Uv   M     g7f)r   Nrd   ).0eps     r   	<genexpr>-test_array_api_entry_point.<locals>.<genexpr>  s     <vG);""vs   "	"z%'numpy' not in array_api entry pointsznumpy entry point value 'z0' does not point to our Array API implementation)	sysconfigget_pathr'   rI   rx   metadataentry_pointsselectr   getr7   ro   nextStopIterationloadvaluer   rM   )numpy_in_sitepackagesepsxp_epsmsgr   xps         r   test_array_api_entry_pointr     s     &..y9R[[H



)
)
+C*+. 6{a 9C %4/<v<< 
B
#BHH: .9 	9   %#% 3  *
 b)*   9C %4/	s$   C	 <C+ 	C('C(+DD)ModuleDeprecationWarningVisibleDeprecationWarningComplexWarningTooHardError	AxisErrorc                    U [         R                  ;   d   eU [         R                  " 5       ;  d   e[        [         U 5      R                  S:X  d   eU [         R
                  R                  ;   d   e[        [         R
                  U 5        g )Nznumpy.exceptions)r'   rw   __dir__r	   r   rQ   rd   s    r   test_moved_exceptionsr     sl     2::rzz|###2t''+====2==(((((BMM4 r   r<   )'r/   r   r1   rj   r|   rx   r   r   r'   pytestnumpy.testingr   rE   r   r   r+   markskipifparametrizer5   r:   r?   rB   rL   ra   version_inforb   rc   re   rm   r   rt   r~   r   r   xfailget_config_varr   r   )ss   0r   <module>r      s   
          !

$@ G$<=)- . >*-

 FdN@  B5B5(#) # #)1(Q, #) #H g
	
1 
	 	N ;6 ; ;6x!| ;6 ; x g8
:$8
1 8
:$ :z&	 g122I EFF GF," g  K1Gh-8` Z(>	8  &&&&R  "7 8!8!_  F\#J	(;z:$s)   G  +G/G4.G9G> G,+G,