HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/numpy/tests/__pycache__/test_public_api.cpython-310.pyc
o

6��a�:�@s$ddlZddlZddlZddlZddlZddlZddlZddlZddlZzddl	Z	Wne
y5dZ	Ynwd%dd�Zdd�Zej
�dddg�d	d
��Zdd�Zd
d�Zdd�Zej
je	dudd�dd��Zdd�dD�Zgd�Zdd�dD�Zdd�Zgd�Zdd�Zgd �Zd!d"�Zd#d$�ZdS)&�NcCs`|dur|j}i}t|�D] }t||�}t|d�r-t|d�r-|j|kr-|jd|j||<q
|S)zEReturns a mapping of all objects with the wrong __module__ attribute.N�
__module__�__name__�.)r�dir�getattr�hasattrr)�module�module_name�results�name�item�r
�=/usr/lib/python3/dist-packages/numpy/tests/test_public_api.py�	check_dirs

�rc	Cs�idd�dd�dd�dd�d	d�d
d�dd
�dd�dd�dd�dd�dd�dd�dd�dd�dd�d d!�d"d#d$d%d&��}tjd'krUd(d)d*d+d+d,d-d-d.�}t|fi|��}n|}tt�}||ksaJ�dS)/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_boundsznumpy.lib.utils.byte_bounds�compare_chararraysz/numpy.core._multiarray_umath.compare_chararrays�	deprecateznumpy.lib.utils.deprecate�deprecate_with_docz"numpy.lib.utils.deprecate_with_doc�dispznumpy.lib.function_base.disp�fastCopyAndTransposez2numpy.core._multiarray_umath._fastCopyAndTranspose�get_array_wrapz#numpy.lib.shape_base.get_array_wrap�get_includeznumpy.lib.utils.get_include�	mafromtxtznumpy.lib.npyio.mafromtxt�	ndfromtxtznumpy.lib.npyio.ndfromtxt�
recfromcsvznumpy.lib.npyio.recfromcsv�
recfromtxtznumpy.lib.npyio.recfromtxtznumpy.lib.utils.safe_evalz)numpy.core.arrayprint.set_string_functionznumpy.__config__.showznumpy.lib.utils.who)�	safe_eval�set_string_function�show_config�who)��z
builtins.boolzbuiltins.complexzbuiltins.floatzbuiltins.intzbuiltins.objectzbuiltins.str)�bool�complex�float�int�long�object�str�unicode)�sys�version_info�dictr�np)�undocumented�builtins�	allowlist�bad_resultsr
r
r�test_numpy_namespacesl��������	�
���
������
�
r7r�testingrcCs6tjdd|f}t�|�}|rJ�|tt�vsJ�dS)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-czimport numpy; numpy.N)r/�
executable�
subprocess�check_outputrr2)r�exe�resultr
r
r�test_import_lazy_importOs
r>cCs$ttt��tttt���ksJ�dS)zWAssert that output of dir has only one "testing/tester"
    attribute without duplicateN)�lenrr2�setr
r
r
r�test_dir_testinges$rAcC�ttj�}|iksJ�dS�N)rr2�linalg�r6r
r
r�test_numpy_linalgk�
rFcCrBrC)rr2�fftrEr
r
r�test_numpy_fftprGrIz#ctypes not available in this python)�reasoncCs0t�tjjj�}t|dd�}|dusJd��dS)N�test_not_exportedzG'test_not_exported' is mistakenly exported, NPY_NO_EXPORT does not work)�ctypes�CDLLr2�core�_multiarray_tests�__file__r)�cdll�fr
r
r�test_NPY_NO_EXPORTusrScC�g|]}d|�qS�znumpy.r
��.0�sr
r
r�
<listcomp>��rY)#�	ctypeslib�	distutilszdistutils.cpuinfozdistutils.exec_commandzdistutils.misc_utilz
distutils.logzdistutils.system_info�docz
doc.constantsz
doc.ufuncs�f2pyrH�libz
lib.formatz
lib.mixinszlib.recfunctionszlib.scimathzlib.stride_tricksrD�maz	ma.extraszma.mrecords�matlib�
polynomialzpolynomial.chebyshevzpolynomial.hermitezpolynomial.hermite_ezpolynomial.laguerrezpolynomial.legendrezpolynomial.polynomial�randomr8�typingztyping.mypy_plugin�version)z
numpy.charznumpy.emathz	numpy.reccCrTrUr
rVr
r
rrY�rZ)s�compatzcompat.py3k�conftestrNzcore.arrayprintzcore.defchararrayzcore.einsumfunczcore.fromnumericzcore.function_basezcore.getlimitszcore.macharzcore.memmapzcore.multiarrayzcore.numericzcore.numerictypeszcore.overrideszcore.recordszcore.shape_basez
core.umathzcore.umath_testszdistutils.ccompilerzdistutils.ccompiler_optzdistutils.commandzdistutils.command.autodistzdistutils.command.bdist_rpmzdistutils.command.buildzdistutils.command.build_clibzdistutils.command.build_extzdistutils.command.build_pyzdistutils.command.build_scriptszdistutils.command.build_srczdistutils.command.configz!distutils.command.config_compilerzdistutils.command.developzdistutils.command.egg_infozdistutils.command.installzdistutils.command.install_clibzdistutils.command.install_dataz!distutils.command.install_headerszdistutils.command.sdistzdistutils.conv_templatezdistutils.corezdistutils.extensionzdistutils.fcompilerzdistutils.fcompiler.absoftzdistutils.fcompiler.compaqzdistutils.fcompiler.environmentzdistutils.fcompiler.g95zdistutils.fcompiler.gnuzdistutils.fcompiler.hpuxzdistutils.fcompiler.ibmzdistutils.fcompiler.intelzdistutils.fcompiler.laheyzdistutils.fcompiler.mipszdistutils.fcompiler.nagzdistutils.fcompiler.nonezdistutils.fcompiler.pathf95zdistutils.fcompiler.pgzdistutils.fcompiler.nvzdistutils.fcompiler.sunzdistutils.fcompiler.vastzdistutils.fcompiler.fujitsuzdistutils.from_templatezdistutils.intelccompilerzdistutils.lib2defzdistutils.line_endingszdistutils.mingw32ccompilerzdistutils.msvccompilerzdistutils.npy_pkg_configzdistutils.numpy_distributionzdistutils.pathccompilerzdistutils.unixccompiler�dualz
f2py.auxfuncszf2py.capi_mapsz
f2py.cb_ruleszf2py.cfuncszf2py.common_ruleszf2py.crackfortranz
f2py.diagnosezf2py.f2py2ezf2py.f2py_testingzf2py.f90mod_ruleszf2py.func2subrz
f2py.ruleszf2py.use_rulesz
fft.helperzlib.arraypadzlib.arraysetopszlib.arrayteratorzlib.function_basezlib.histogramszlib.index_trickszlib.nanfunctionsz	lib.npyiozlib.polynomialzlib.shape_basezlib.twodim_basezlib.type_checkz
lib.ufunclikezlib.user_arrayz	lib.utilszlinalg.lapack_litez
linalg.linalgzma.benchzma.corezma.testutilszma.timer_comparison�	matrixlibzmatrixlib.defmatrixzpolynomial.polyutilsz
random.mtrandzrandom.bit_generatorztesting.print_coercion_tablesz
testing.utilscCsDd|vsd|vsd|vrdS|tvrdS|tvrdS|tvr dSdS)z%Check if this needs to be considered.z._z.testsz.setupFT)�PUBLIC_MODULES�PUBLIC_ALIASED_MODULES�PRIVATE_BUT_PRESENT_MODULES)rr
r
r�
is_unexpected0srm)
znumpy.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_apiznumpy.core.cversionsznumpy.core.generate_numpy_apiznumpy.distutils.msvc9compilercCsXg}tjtjtjddd�D]\}}}t|�r |tvr |�|�q|r*td|����dS)z|
    Test that we don't add anything that looks like a new public module by
    accident.  Check is based on filenames.
    rN)�path�prefix�onerrorzFound unexpected modules: )	�pkgutil�
walk_packagesr2�__path__rrm�	SKIP_LIST�append�AssertionError)�modnames�_�modname�ispkgr
r
r�test_all_modules_are_expectedQs�
��r{)z
numpy.mathznumpy.distutils.log.sysznumpy.doc.constants.reznumpy.doc.constants.textwrapznumpy.lib.emathznumpy.lib.mathznumpy.matlib.charznumpy.matlib.recznumpy.matlib.emathznumpy.matlib.mathznumpy.matlib.linalgznumpy.matlib.fftznumpy.matlib.randomznumpy.matlib.ctypeslibznumpy.matlib.macCs>dd�}|d�}tD]	}|�||��q
|rtd�|���dS)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)

    cSsxg}t�|�}t|d�r|j}nt|�}|D]#}|�d�s9|d|}tt||�tj	�r9t
|�r9|tvr9|�|�q|S)N�__all__rxr)
�	importlib�
import_modulerr|r�
startswith�
isinstancer�types�
ModuleTyperm�SKIP_LIST_2ru)�mod_name�membersr�objnames�objname�fullobjnamer
r
r�find_unexpected_members�s



�z@test_all_modules_are_expected_2.<locals>.find_unexpected_members�numpyz5Found unexpected object(s) that look like modules: {}N)rj�extendrv�format)r��unexpected_membersryr
r
r�test_all_modules_are_expected_2zs��r�c	Cs�dd�}g}tD]}||�s|�|�q|rtd�|���tD]}zt|�Wqty5|�|�Yqw|r?td�|���tjdd��$}tj	dt
d�tj	dtd�tD]}||�sa|�|�qVWd	�n1slwY|rztd
�|���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	Ss*zt�|�WdSttfyYdSw)NFT)r}r~�ImportError�AttributeError)r	r
r
r�check_importable�s��z-test_api_importable.<locals>.check_importablez5Modules 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: {})
rjrurvr�rk�evalr��warnings�catch_warnings�filterwarnings�DeprecationWarning�
ImportWarningrl)r��module_namesr	�wr
r
r�test_api_importable�sD
����
�����r�rC)r/r:rqr�r}r�r�r2�pytestrLr�rr7�mark�parametrizer>rArFrI�skipifrSrjrkrlrmrtr{r�r�r�r
r
r
r�<module>sD�

0
�
'w4