o
    <ÊÆh3�  ã                   @   sd  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m	Z	m
Z
 d dlmZ d dlmZmZmZ d dlZg d¢Zdd„ Zdd	„ ZG d
d„ dƒZdd„ Zdd„ Zdd„ Zdd„ Zd1dd„Zdd„ Zdadad2dd„Zd1dd„Z edƒd3dd„ƒZ!edƒej"fd d!„ƒZ#i Z$e %d"ej&¡Z'edƒ	$	d4d%d&„ƒZ(d'd(„ Z)d)d*„ Z*d+d,„ Z+d-d.„ Z,d/d0„ Z-dS )5é    N)Úissubclass_ÚissubsctypeÚ
issubdtype)Ú
set_module)ÚndarrayÚufuncÚasarray)r   r   r   Ú	deprecateÚdeprecate_with_docÚget_includeÚinfoÚsourceÚwhoÚlookforÚbyte_boundsÚ	safe_evalÚshow_runtimec            	      C   s°   ddl m} m}m} ddlm} g }g g }}|D ]}| | r%| |¡ q| |¡ q| d|||dœi¡ zddlm} | |ƒ ¡ W n t	yQ   t
dƒ Y nw ||ƒ dS )	aÈ  
    Print information about various resources in the system
    including available intrinsic support and BLAS/LAPACK library
    in use

    See Also
    --------
    show_config : Show libraries in the system on which NumPy was built.

    Notes
    -----
    1. Information is derived with the help of `threadpoolctl <https://pypi.org/project/threadpoolctl/>`_
       library.
    2. SIMD related information is derived from ``__cpu_features__``,
       ``__cpu_baseline__`` and ``__cpu_dispatch__``

    Examples
    --------
    >>> import numpy as np
    >>> np.show_runtime()
    [{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'],
                          'found': ['SSSE3',
                                    'SSE41',
                                    'POPCNT',
                                    'SSE42',
                                    'AVX',
                                    'F16C',
                                    'FMA3',
                                    'AVX2'],
                          'not_found': ['AVX512F',
                                        'AVX512CD',
                                        'AVX512_KNL',
                                        'AVX512_KNM',
                                        'AVX512_SKX',
                                        'AVX512_CLX',
                                        'AVX512_CNL',
                                        'AVX512_ICL']}},
     {'architecture': 'Zen',
      'filepath': '/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so',
      'internal_api': 'openblas',
      'num_threads': 12,
      'prefix': 'libopenblas',
      'threading_layer': 'pthreads',
      'user_api': 'blas',
      'version': '0.3.20'}]
    r   ©Ú__cpu_features__Ú__cpu_baseline__Ú__cpu_dispatch__)ÚpprintÚsimd_extensions)ÚbaselineÚfoundÚ	not_found)Úthreadpool_infoz¨WARNING: `threadpoolctl` not found in system! Install it by `pip install threadpoolctl`. Once installed, try `np.show_runtime` again for more detailed build informationN)Únumpy.core._multiarray_umathr   r   r   r   ÚappendÚthreadpoolctlr   ÚextendÚImportErrorÚprint)	r   r   r   r   Úconfig_foundÚfeatures_foundÚfeatures_not_foundÚfeaturer   © r'   ú\/var/www/html/HyperOracle/crypto_trader/venv/lib/python3.10/site-packages/numpy/lib/utils.pyr      s,   /
ýÿÿr   c                  C   sX   ddl } | jdu rtj tj | j¡dd¡}|S ddlm} tj tj |j¡d¡}|S )a¬  
    Return the directory that contains the NumPy \*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    r   NÚcoreÚinclude)	ÚnumpyÚshow_configÚosÚpathÚjoinÚdirnameÚ__file__Ú
numpy.corer)   )r+   Údr)   r'   r'   r(   r   a   s   
þr   c                   @   s"   e Zd ZdZddd„Zdd„ ZdS )Ú
_Deprecatez†
    Decorator class to deprecate old functions.

    Refer to `deprecate` for details.

    See Also
    --------
    deprecate

    Nc                 C   s   || _ || _|| _d S ©N)Úold_nameÚnew_nameÚmessage)Úselfr6   r7   r8   r'   r'   r(   Ú__init__Š   s   
z_Deprecate.__init__c                    s2  | j }| j}| j}|du rˆj}|du rd| ‰ nd||f ‰ |dur)ˆ d| 7 ‰ t ˆ¡‡ ‡fdd„ƒ}||_ˆj}|du rBˆ }nR| ¡  d¡}	t	|	dd… ƒ}
|	d  
¡ r^|
d	 | }n't|	d ƒd }|	dd… D ]}t|ƒ|
krv n	|t|ƒd 7 }ql||d… }t ˆ d	|
 ¡‰ d
 ˆ |g¡}||_|S )z:
        Decorator call.  Refer to ``decorate``.

        Nz`%s` is deprecated!z%`%s` is deprecated, use `%s` instead!Ú
c                     s   t jˆ tdd� ˆ| i |¤ŽS )Né   )Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarning)ÚargsÚkwds©ÚdepdocÚfuncr'   r(   Únewfunc£   s   z$_Deprecate.__call__.<locals>.newfuncé   r   ú z

)r6   r7   r8   Ú__name__Ú	functoolsÚwrapsÚ__doc__Ú
expandtabsÚsplitÚ_get_indentÚlstripÚlenÚtextwrapÚindentr/   )r9   rE   rA   Úkwargsr6   r7   r8   rF   ÚdocÚlinesrS   ÚskipÚliner'   rC   r(   Ú__call__�   s@   
ÿz_Deprecate.__call__)NNN)rI   Ú
__module__Ú__qualname__rL   r:   rY   r'   r'   r'   r(   r4   ~   s    
r4   c                 C   sD   t j}| D ]}t| ¡ ƒ}|rt|t|ƒ| ƒ}q|t jkr d}|S )zU
    Determines the leading whitespace that could be removed from all the lines.
    r   )ÚsysÚmaxsizerQ   rP   Úmin)rV   rS   rX   Úcontentr'   r'   r(   rO   Â   s   €
rO   c                  O   s8   | r| d }| dd… } t | i |¤Ž|ƒS t | i |¤ŽS )aœ  
    Issues a DeprecationWarning, adds warning to `old_name`'s
    docstring, rebinds ``old_name.__name__`` and returns the new
    function object.

    This function may also be used as a decorator.

    Parameters
    ----------
    func : function
        The function to be deprecated.
    old_name : str, optional
        The name of the function to be deprecated. Default is None, in
        which case the name of `func` is used.
    new_name : str, optional
        The new name for the function. Default is None, in which case the
        deprecation message is that `old_name` is deprecated. If given, the
        deprecation message is that `old_name` is deprecated and `new_name`
        should be used instead.
    message : str, optional
        Additional explanation of the deprecation.  Displayed in the
        docstring after the warning.

    Returns
    -------
    old_func : function
        The deprecated function.

    Examples
    --------
    Note that ``olduint`` returns a value after printing Deprecation
    Warning:

    >>> olduint = np.deprecate(np.uint)
    DeprecationWarning: `uint64` is deprecated! # may vary
    >>> olduint(6)
    6

    r   rG   N©r4   )rA   rT   Úfnr'   r'   r(   r	   Ð   s
   ,r	   c                 C   s
   t | d�S )a�  
    Deprecates a function and includes the deprecation in its docstring.

    This function is used as a decorator. It returns an object that can be
    used to issue a DeprecationWarning, by passing the to-be decorated
    function as argument, this adds warning to the to-be decorated function's
    docstring and returns the new function object.

    See Also
    --------
    deprecate : Decorate a function such that it issues a `DeprecationWarning`

    Parameters
    ----------
    msg : str
        Additional explanation of the deprecation. Displayed in the
        docstring after the warning.

    Returns
    -------
    obj : object

    )r8   r`   )Úmsgr'   r'   r(   r
     s   
r
   c           
      C   s¢   | j }|d d }|d }|d }t| ƒjj}| }}|du r*|| j| 7 }||fS t||ƒD ]\}}	|	dk r@||d |	 7 }q/||d |	 7 }q/||7 }||fS )a#  
    Returns pointers to the end-points of an array.

    Parameters
    ----------
    a : ndarray
        Input array. It must conform to the Python-side of the array
        interface.

    Returns
    -------
    (low, high) : tuple of 2 integers
        The first integer is the first byte of the array, the second
        integer is just past the last byte of the array.  If `a` is not
        contiguous it will not use every byte between the (`low`, `high`)
        values.

    Examples
    --------
    >>> I = np.eye(2, dtype='f'); I.dtype
    dtype('float32')
    >>> low, high = np.byte_bounds(I)
    >>> high - low == I.size*I.itemsize
    True
    >>> I = np.eye(2); I.dtype
    dtype('float64')
    >>> low, high = np.byte_bounds(I)
    >>> high - low == I.size*I.itemsize
    True

    Údatar   ÚstridesÚshapeNrG   )Ú__array_interface__r   ÚdtypeÚitemsizeÚsizeÚzip)
ÚaÚaiÚa_dataÚastridesÚashapeÚbytes_aÚa_lowÚa_highre   Ústrider'   r'   r(   r   $  s    úr   c                 C   s  | du rt  ¡ j}|j} g }i }|  ¡ D ]D}t| | tƒrX| | }t|ƒ}|| ¡ v r6|d||   }d}n|||< |}d}d t	t
|jƒ¡}	t
|jƒ}
| ||	|
|jj|g¡ qd}d}d}d}|D ]8}|t|d ƒk rst|d ƒ}|t|d ƒk r�t|d ƒ}|t|d ƒk r�t|d ƒ}|d r›|t|d ƒ7 }qct|ƒdkrÎtd|ƒ}td|ƒ}td|ƒ}d	|d
 |d
 |d
 f }t|d dt|ƒd   d ƒ |D ]5}td|d d
|t|d ƒ d  |d d
|t|d ƒ d  |d d
|t|d ƒ d  |d f ƒ qÐtd| ƒ dS )a%  
    Print the NumPy arrays in the given dictionary.

    If there is no dictionary passed in or `vardict` is None then returns
    NumPy arrays in the globals() dictionary (all NumPy arrays in the
    namespace).

    Parameters
    ----------
    vardict : dict, optional
        A dictionary possibly containing ndarrays.  Default is globals().

    Returns
    -------
    out : None
        Returns 'None'.

    Notes
    -----
    Prints out the name, shape, bytes and type of all of the ndarrays
    present in `vardict`.

    Examples
    --------
    >>> a = np.arange(10)
    >>> b = np.ones(20)
    >>> np.who()
    Name            Shape            Bytes            Type
    ===========================================================
    a               10               80               int64
    b               20               160              float64
    Upper bound on total bytes  =       240

    >>> d = {'x': np.arange(2.0), 'y': np.arange(3.0), 'txt': 'Some str',
    ... 'idx':5}
    >>> np.who(d)
    Name            Shape            Bytes            Type
    ===========================================================
    x               2                16               float64
    y               3                24               float64
    Upper bound on total bytes  =       40

    Nz (%s)r   rG   z x r<   é   é
   zName %s Shape %s Bytes %s TyperH   r;   ú=é   z%s %s %s %s %s %s %sé   z'
Upper bound on total bytes  =       %d)r\   Ú	_getframeÚf_backÚ	f_globalsÚkeysÚ
isinstancer   Úidr/   ÚmapÚstrre   Únbytesr   rg   ÚnamerQ   ÚintÚmaxr"   )ÚvardictÚframeÚstaÚcacher‚   ÚvarÚidvÚnamestrÚoriginalÚshapestrÚbytestrÚmaxnameÚmaxshapeÚmaxbyteÚ
totalbytesÚvalÚsp1Úsp2Úsp3Úprvalr'   r'   r(   r   ]  sb   ,

ÿ€€


  
ýr   c           
      C   s�   t | ƒ}|}| }d}| |¡}|D ]4}||krd}	n|}	|t |ƒ t |	ƒ }||kr?|d t |ƒ }|d d|d   | }q||	 | }q|S )Nz, Ú rG   z,
rH   r<   )rQ   rN   )
r‚   Ú	argumentsÚwidthÚ
firstwidthÚkÚnewstrÚsepstrÚarglistÚargumentÚaddstrr'   r'   r(   Ú_split_lineÄ  s   
r¢   r+   c                 C   s¨   t | tƒ tƒ g ƒ} | j| ji}| jg}| jg}	 t|ƒdkr#	 ||fS | d¡}| ¡ D ]&}t|| t	j
ƒrR|| j}||vrR|| j}| |¡ | |¡ |||< q,q)NTr   )Ú
__import__ÚglobalsÚlocalsrI   Ú__dict__rQ   Úpopr|   r}   ÚtypesÚ
ModuleTyper   )ÚmoduleÚthedictÚdictlistÚ
totraverseÚthisdictÚxÚmodnameÚmoddictr'   r'   r(   Ú_makenamedictÜ  s&   

÷



€õr²   c           
      C   s‚  d}d}dd„ }t | dt| ƒƒ}t |d|ƒ}| j}| jj}|du r$tj}td||d� td	| j|d� td
||d� td| j	|d� td|| j
jƒ|d� td|| j
jƒ|d� td| j
j|d� tdt| jjjƒ|f |d� tdd|d� |dv rŠtd|tj|f |d� d}	n#|dkržtd||f |d� tjdk}	ntd||f |d� tjdk}	td||	ƒ|d� td| j |d� dS )aO  Provide information about ndarray obj.

    Parameters
    ----------
    obj : ndarray
        Must be ndarray, not checked.
    output
        Where printed output goes.

    Notes
    -----
    Copied over from the numarray module prior to its removal.
    Adapted somewhat as only numpy is an option now.

    Called by info.

    r˜   c                 S   s   | S r5   r'   )r¯   r'   r'   r(   Ú<lambda>  s    z_info.<locals>.<lambda>Ú	__class__rI   Nzclass: ©Úfilezshape: z	strides: z
itemsize: z	aligned: zcontiguous: z	fortran: zdata pointer: %s%szbyteorder: rH   )Úendr¶   )ú|rv   z%s%s%sFú>z%sbig%sÚbigz
%slittle%sÚlittlez
byteswap: ztype: %s)ÚgetattrÚtyperd   rg   Ú	byteorderr\   Ústdoutr"   re   rh   ÚflagsÚalignedÚ
contiguousÚfortranÚhexÚctypesÚ_as_parameter_Úvalue)
ÚobjÚoutputÚextraÚticÚbpÚclsÚnmrd   ÚendianÚbyteswapr'   r'   r(   Ú_infoð  s>   þ
rÑ   éL   c              	   C   sT  ddl }ddl}t| dƒst| dƒr| j} nt| dƒr| j} |du r%tj}| du r/ttƒ dS t| t	ƒr<t
| |d� dS t| tƒr«tdu rKt|ƒ\aad}g }tD ]A}z6t| |  }	t|	ƒ|v ritd| |d� n| t|	ƒ¡ td	| |d� t|	ƒ td
| |d� |d7 }W qQ ty’   Y qQw |dkr¡td|  |d� dS td| |d� dS | | ¡sµ| | ¡rõ| j}
z	t| | ¡ƒ}W n tyÌ   d}Y nw t|
| ƒ|krÜt|
||ƒ}n|
| }td| d |d� t| | ¡|d� dS | | ¡�r—| j}
z	t| | ¡ƒ}W n t�y   d}Y nw t|
| ƒ|k�r$t|
||ƒ}n|
| }td| d |d� | | ¡}|du �rMt| dƒ�rLt| | j¡|d� n	t| | ¡|d� | | ¡}dd„ |D ƒ}|�r“td|d� |D ]'}t| |dƒ}|du�r‡| | |¡�pƒd¡\}}td||f |d� �qmdS dS t| dƒ�r¨t| | ¡|d� dS dS )a¼  
    Get help information for a function, class, or module.

    Parameters
    ----------
    object : object or str, optional
        Input object or name to get information about. If `object` is a
        numpy object, its docstring is given. If it is a string, available
        modules are searched for matching objects.  If None, information
        about `info` itself is returned.
    maxwidth : int, optional
        Printing width.
    output : file like object, optional
        File like object that the output is written to, default is
        ``None``, in which case ``sys.stdout`` will be used.
        The object has to be opened in 'w' or 'a' mode.
    toplevel : str, optional
        Start search at this level.

    See Also
    --------
    source, lookfor

    Notes
    -----
    When used interactively with an object, ``np.info(obj)`` is equivalent
    to ``help(obj)`` on the Python prompt or ``obj?`` on the IPython
    prompt.

    Examples
    --------
    >>> np.info(np.polyval) # doctest: +SKIP
       polyval(p, x)
         Evaluate the polynomial p at x.
         ...

    When using a string for `object` it is possible to get multiple results.

    >>> np.info('fft') # doctest: +SKIP
         *** Found in numpy ***
    Core FFT routines
    ...
         *** Found in numpy.fft ***
     fft(a, n=None, axis=-1)
    ...
         *** Repeat reference found in numpy.fft.fftpack ***
         *** Total of 3 references found. ***

    r   NÚ_ppimport_importerÚ_ppimport_moduleÚ_ppimport_attr)rÉ   z+
     *** Repeat reference found in %s *** rµ   z     *** Found in %s ***ú-rG   zHelp for %s not found.z+
     *** Total of %d references found. ***z()rH   r;   r:   c                 S   s   g | ]
}|d  dkr|‘qS )r   Ú_r'   )Ú.0Úmethr'   r'   r(   Ú
<listcomp>­  s    zinfo.<locals>.<listcomp>z

Methods:
ÚNonez  %s  --  %srL   ) ÚpydocÚinspectÚhasattrrÔ   rÕ   r\   r¿   r   r}   r   rÑ   r€   Ú	_namedictr²   Ú	_dictlistr~   r"   r   ÚKeyErrorÚ
isfunctionÚismethodrI   Ú	signatureÚ	ExceptionrQ   r¢   ÚgetdocÚisclassr:   Ú
allmethodsr¼   Úsplitdoc)ÚobjectÚmaxwidthrÉ   ÚtoplevelrÜ   rÝ   ÚnumfoundÚobjlistr‹   rÈ   r‚   r™   ÚargstrÚdoc1ÚmethodsÚpublic_methodsrÙ   ÚthisobjÚmethstrÚotherr'   r'   r(   r   &  s°   5
ÿ


ÿþÿÿ
þÿÿ

€

ÿøÿr   c                 C   sX   ddl }ztd| | ¡ |d� t| | ¡|d� W dS  ty+   td|d� Y dS w )aí  
    Print or write to a file the source code for a NumPy object.

    The source code is only returned for objects written in Python. Many
    functions and classes are defined in C and will therefore not return
    useful information.

    Parameters
    ----------
    object : numpy object
        Input object. This can be any object (function, class, module,
        ...).
    output : file object, optional
        If `output` not supplied then source code is printed to screen
        (sys.stdout).  File object must be created with either write 'w' or
        append 'a' modes.

    See Also
    --------
    lookfor, info

    Examples
    --------
    >>> np.source(np.interp)                        #doctest: +SKIP
    In file: /usr/lib/python2.6/dist-packages/numpy/lib/function_base.py
    def interp(x, xp, fp, left=None, right=None):
        """.... (full docstring printed)"""
        if isinstance(x, (float, int, number)):
            return compiled_interp([x], xp, fp, left, right).item()
        else:
            return compiled_interp(x, xp, fp, left, right)

    The source code is only returned for objects written in Python.

    >>> np.source(np.array)                         #doctest: +SKIP
    Not available for this object.

    r   NzIn file: %s
rµ   zNot available for this object.)rÝ   r"   ÚgetsourcefileÚ	getsourcerå   )rê   rÉ   rÝ   r'   r'   r(   r   ¼  s   )ÿr   z[a-z0-9_]+\(.*[,=].*\)TFc              	      sº  ddl }t|||ƒ‰ g }t| ƒ ¡  ¡ ‰ˆsdS ˆ  ¡ D ] \}\}}	}
|	dv r(q| ¡ ‰t‡fdd„ˆD ƒƒr<| |¡ qdddddœ‰‡‡fd	d
„‰‡ ‡fdd„}|j|d� dd 	ˆ¡ }|dt
|ƒ g}|ddd… D ]=}ˆ | \‰}	}dd„ ˆ ¡  d¡D ƒ}z|d  ¡ }t |¡r•|d  ¡ }W n ty¡   d}Y nw | d||f ¡ qn|s³| d¡ |durÁ| d 	|¡¡ dS t
|ƒdkrÔ| ¡ }|d 	|¡ƒ dS td 	|¡ƒ dS )aº  
    Do a keyword search on docstrings.

    A list of objects that matched the search is displayed,
    sorted by relevance. All given keywords need to be found in the
    docstring for it to be returned as a result, but the order does
    not matter.

    Parameters
    ----------
    what : str
        String containing words to look for.
    module : str or list, optional
        Name of module(s) whose docstrings to go through.
    import_modules : bool, optional
        Whether to import sub-modules in packages. Default is True.
    regenerate : bool, optional
        Whether to re-generate the docstring cache. Default is False.
    output : file-like, optional
        File-like object to write the output to. If omitted, use a pager.

    See Also
    --------
    source, info

    Notes
    -----
    Relevance is determined only roughly, by checking if the keywords occur
    in the function name, at the start of a docstring, etc.

    Examples
    --------
    >>> np.lookfor('binary representation') # doctest: +SKIP
    Search results for 'binary representation'
    ------------------------------------------
    numpy.binary_repr
        Return the binary representation of the input number as a string.
    numpy.core.setup_common.long_double_representation
        Given a binary dump as given by GNU od -b, look for long double
    numpy.base_repr
        Return a string representation of a number in the given base system.
    ...

    r   N)rª   rê   c                 3   s   � | ]}|ˆ v V  qd S r5   r'   ©rØ   Úw)rU   r'   r(   Ú	<genexpr>7  s   € zlookfor.<locals>.<genexpr>iè  éüÿÿ)rE   Úclassrª   rê   c                    s¦   d}d  | ¡  ¡  d¡d d… ¡‰ |t‡ fdd„ˆD ƒƒ7 }|t‡fdd„ˆD ƒƒ7 }|tˆƒ d 7 }|ˆ |d¡7 }|ˆ d	¡ d
 7 }|t| d dƒ7 }|S )Nr   r;   rx   c                    ó   g | ]}|ˆ v rd ‘qS )éÈ   r'   rø   )Ú	first_docr'   r(   rÚ   E  ó    z.lookfor.<locals>.relevance.<locals>.<listcomp>c                    rý   )é   r'   rø   )r‚   r'   r(   rÚ   G  r   rw   rû   Ú.ru   éd   iœÿÿÿ)	r/   ÚlowerÚstriprN   ÚsumrQ   ÚgetÚcountr„   )r‚   ÚdocstrÚkindÚindexÚr)Úkind_relevanceÚwhats)rÿ   r‚   r(   Ú	relevanceA  s    zlookfor.<locals>.relevancec                    s   ˆ| gˆ |  ¢R Ž S r5   r'   )rk   )rˆ   r  r'   r(   Úrelevance_valueQ  s   z lookfor.<locals>.relevance_value)ÚkeyzSearch results for '%s'rH   rÖ   éÿÿÿÿc                 S   s   g | ]
}|  ¡ r|  ¡ ‘qS r'   )r  )rØ   rX   r'   r'   r(   rÚ   [  s    ÿzlookfor.<locals>.<listcomp>r;   rG   r˜   z	%s
    %szNothing found.ru   )rÜ   Ú_lookfor_generate_cacher€   r  rN   ÚitemsÚallr   Úsortr/   rQ   r  Ú_function_signature_reÚsearchÚ
IndexErrorÚwriteÚgetpagerr"   )Úwhatrª   Úimport_modulesÚ
regeneraterÉ   rÜ   r   r‚   Ú	docstringr
  r  r  ÚsÚ	help_textÚixÚdoclinesrÿ   Úpagerr'   )rˆ   rU   r  r  r  r(   r   ÷  sR   /
€ÿ
€ÿ
r   c              
   C   s¬  ddl }ddlm} | du rd} t| tƒr-zt| ƒ W n ty&   i  Y S w tj|  } nt| t	ƒs7t| t
ƒrIi }| D ]}| t|||ƒ¡ q;|S t| ƒtv rW|sWtt| ƒ S i }|tt| ƒ< i }d}| j| fg}	|	�rÔ|	 d¡\}
}t|ƒ|v rzqid|t|ƒ< |d7 }d}| |¡�rŒd}z|j}W n tyž   d}Y nw |�r t|d	ƒ�r |jD ]t}t |¡D ]l}tj ||¡}tj ||d
¡}tj |¡rÕ| d¡rÕ|dd… }n
tj |¡rÞ|}nq²|dkräq²z(tj}tj}z|ƒ t_|ƒ t_td|
|f ƒ W |t_|t_n|t_|t_w W q² t�y   ‚  t�y   Y q²w q«t |ƒD ]f\}}zt!|dd|
|f ƒ}t!|ddƒ}W n t"�yL   d|
|f }d}Y nw d|v�r[|�r[d||f }| #|
d ¡�slt|t$ƒ�rjn�q$| |¡�s~|du �s~||v �s~�q$|	 %d|
|f |f¡ �q$n&| &|¡�rªd}t |ƒD ]\}}|	 %d|
|f |f¡ �q˜nt|dƒ�r²d}z| '|¡}W n t"�yÅ   d}Y nw |du�rÒ|||f||
< |	sl|S )aõ  
    Generate docstring cache for given module.

    Parameters
    ----------
    module : str, None, module
        Module for which to generate docstring cache
    import_modules : bool
        Whether to import sub-modules in packages.
    regenerate : bool
        Re-generate the docstring cache

    Returns
    -------
    cache : dict {obj_full_name: (docstring, kind, index), ...}
        Docstring cache for the module, either cached one (regenerate=False)
        or newly generated.

    r   N)ÚStringIOr+   TrG   rê   rª   Ú__path__z__init__.pyz.pyéýÿÿÿr:   z%s.%srI   rZ   r  rü   rY   rE   )(rÝ   Úior%  r}   r€   r£   r!   r\   ÚmodulesÚlistÚtupleÚupdater  r~   Ú_lookfor_cachesrI   r§   ÚismoduleÚ__all__ÚAttributeErrorrÞ   r&  r-   Úlistdirr.   r/   ÚisfileÚendswithr¿   ÚstderrÚKeyboardInterruptÚBaseExceptionÚ_getmembersr¼   Ú	NameErrorÚ
startswithr   r   rç   ræ   )rª   r  r  rÝ   r%  rˆ   ÚmodÚseenr  Ústackr‚   Úitemr
  Ú_allÚpthÚmod_pathÚthis_pyÚinit_pyÚ	to_importÚ
old_stdoutÚ
old_stderrÚnÚvÚ	item_nameÚmod_namerU   r'   r'   r(   r  s  sÐ   
ÿ
ÿ
ÿ
ÿÿýæü ëÿþ
«Wr  c                    sD   dd l }z| ˆ ¡}W |S  ty!   ‡ fdd„tˆ ƒD ƒ}Y |S w )Nr   c                    s$   g | ]}t ˆ |ƒr|tˆ |ƒf‘qS r'   )rÞ   r¼   )rØ   r¯   ©r=  r'   r(   rÚ     s    ÿz_getmembers.<locals>.<listcomp>)rÝ   Ú
getmembersrå   Údir)r=  rÝ   Úmembersr'   rJ  r(   r7  þ  s   ýýr7  c                 C   s   ddl }| | ¡S )au  
    Protected string evaluation.

    Evaluate a string containing a Python literal expression without
    allowing the execution of arbitrary non-literal code.

    .. warning::

        This function is identical to :py:meth:`ast.literal_eval` and
        has the same security implications.  It may not always be safe
        to evaluate large input strings.

    Parameters
    ----------
    source : str
        The string to evaluate.

    Returns
    -------
    obj : object
       The result of evaluating `source`.

    Raises
    ------
    SyntaxError
        If the code has invalid Python syntax, or if it contains
        non-literal code.

    Examples
    --------
    >>> np.safe_eval('1')
    1
    >>> np.safe_eval('[1, 2, 3]')
    [1, 2, 3]
    >>> np.safe_eval('{"foo": ("bar", 10.0)}')
    {'foo': ('bar', 10.0)}

    >>> np.safe_eval('import os')
    Traceback (most recent call last):
      ...
    SyntaxError: invalid syntax

    >>> np.safe_eval('open("/home/user/.ssh/id_dsa").read()')
    Traceback (most recent call last):
      ...
    ValueError: malformed node or string: <_ast.Call object at 0x...>

    r   N)ÚastÚliteral_eval)r   rN  r'   r'   r(   r     s   2
r   c                 C   sr   | j dkr|S t | jd|d�¡}tj |¡r| d¡}t | ¡ ¡dkr7t	|tj
ƒr2| j tj¡S tj||< |S )a{  
    Utility function to check median result from data for NaN values at the end
    and return NaN in that case. Input result can also be a MaskedArray.

    Parameters
    ----------
    data : array
        Sorted input data to median function
    result : Array or MaskedArray
        Result of median function.
    axis : int
        Axis along which the median was computed.

    Returns
    -------
    result : scalar or ndarray
        Median or NaN in axes which contained NaN in the input.  If the input
        was an array, NaN will be inserted in-place.  If a scalar, either the
        input itself or a scalar NaN.
    r   r  )ÚaxisF)ri   ÚnpÚisnanÚtakeÚmaÚisMaskedArrayÚfilledÚcount_nonzeroÚravelr}   Úgenericrg   r½   Únan)rc   ÚresultrP  rF  r'   r'   r(   Ú_median_nancheck>  s   


r\  c                  C   sr   ddl m} m}m} t|ƒdkrt|ƒdkrdS d |¡}|D ]}| | r.|d|› d�7 }q|d|› d�7 }q|S )a‰  
    Returns a string contains the supported CPU features by the current build.

    The string format can be explained as follows:
        - dispatched features that are supported by the running machine
          end with `*`.
        - dispatched features that are "not" supported by the running machine
          end with `?`.
        - remained features are representing the baseline.
    r   r   r˜   rH   Ú*ú?)r   r   r   r   rQ   r/   )r   r   r   Úenabled_featuresr&   r'   r'   r(   Ú	_opt_infob  s   
r`  r5   )r+   )NrÒ   Nr+   )NTFN).r-   r\   rR   r¨   Úrer>   rJ   Únumpy.core.numerictypesr   r   r   Únumpy.core.overridesr   r2   r   r   r   r+   rQ  r/  r   r   r4   rO   r	   r
   r   r   r¢   rß   rà   r²   rÑ   r   r¿   r   r-  ÚcompileÚIr  r   r  r7  r   r\  r`  r'   r'   r'   r(   Ú<module>   sT    LD5
9g

6 3ÿ{ 
6$