
     h3                        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 Zd Z G d d	          Zd
 Zd Zd Zd ZddZd Zdadad dZddZ  ed          d!d            Z! ed          ej"        fd            Z#i Z$ ej%        dej&                  Z' ed          	 	 d"d            Z(d Z)d Z*d Z+d Z,d Z-dS )#    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                  v   ddl m} m}m} ddlm} g }g g }}|D ]5}| |         r|                    |            |                    |           6|                    d|||di           	 ddlm} |                     |                       n# t          $ r t          d           Y nw xY 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_infozWARNING: `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   s	            K/var/www/html/Sam_Eipo/venv/lib/python3.11/site-packages/numpy/lib/utils.pyr   r      s_   ^          L)+R&N# / /G$ 	/!!'****%%g....(#+
 
   6111111OO--.... 6 6 6 5 	6 	6 	6 	6 	66
 F<s   +#B B+*B+c                  4   ddl } | j        Dt          j                            t          j                            | j                  dd          }nHd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+   s      r)   r   r   a   s}    $ LLL GLL88&)LL 	"!!!!!GLL77CCH    c                        e Zd ZdZddZd ZdS )
_Deprecatez
    Decorator class to deprecate old functions.

    Refer to `deprecate` for details.

    See Also
    --------
    deprecate

    Nc                 0    || _         || _        || _        d S N)old_namenew_namemessage)selfr;   r<   r=   s       r)   __init__z_Deprecate.__init__   s      r6   c                    | j         }| j        }| j        }|j        }|d|z  n	d|d|d|d|z   z  t	          j                  fd            }||_        j        }|}n|                                                    d          }	t          |	dd                   }
|	d	         
                                r	|
d
z  |z   }nYt          |	d	                   dz   }|	dd         D ],}t          |          |
k    r n|t          |          dz   z  }-||d         }t          j        d
|
z            d                    |g          }||_        |S )z:
        Decorator call.  Refer to ``decorate``.

        Nz`%s` is deprecated!`z` is deprecated, use `z
` instead!
c                  L    t          j        t          d            | i |S )N   )
stacklevel)warningswarnDeprecationWarning)argskwdsdepdocfuncs     r)   newfuncz$_Deprecate.__call__.<locals>.newfunc   s0    M&"4CCCC4&&&&r6      r    z

)r;   r<   r=   __name__	functoolswraps__doc__
expandtabssplit_get_indentlstriplentextwrapindentr1   )r>   rL   rI   kwargsr;   r<   r=   rM   doclinesrZ   skiplinerK   s    `           @r)   __call__z_Deprecate.__call__   s   
 ==,}H*X5FF  hh*F dWn$F				' 	' 	' 	' 	' 
		' $l;CCNN$$**400E qrr++FQx   ! slS( 58}}q(!!""I * *D4yy6))CIIM)DD$%%j_VS6\::F++vsm,,Cr6   )NNN)rP   
__module____qualname__rS   r?   r`    r6   r)   r8   r8   ~   sA        	 	   
0 0 0 0 0r6   r8   c                     t           j        }| D ]E}t          |                                          }|r t	          |t          |          |z
            }F|t           j        k    rd}|S )zU
    Determines the leading whitespace that could be removed from all the lines.
    r   )sysmaxsizerX   rW   min)r]   rZ   r_   contents       r)   rV   rV      si     [F 6 6dkkmm$$ 	6TW!455FMr6   c                  l    | 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   rN   Nr8   )rI   r[   fns      r)   r
   r
      sS    X  +!WABBx*z4*6**2...4*6***r6   c                 "    t          |           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

    )r=   rj   )msgs    r)   r   r     s    0 c""""r6   c                    | j         }|d         d         }|d         }|d         }t          |           j        j        }|x}}||| j        |z  z  }n8t          ||          D ]"\  }}	|	dk     r||dz
  |	z  z  }||dz
  |	z  z  }#||z  }||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shapeNrN   )__array_interface__r	   dtypeitemsizesizezip)
aaia_dataastridesashapebytes_aa_lowa_highrq   strides
             r)   r   r   $  s    @ 
	BZ]F)}H[Fajj'GEF!&7"" 22 	+ 	+ME6zz%'6))57F**'&=r6   c                    | t          j                    j        }|j        } g }i }|                                 D ]}t          | |         t                    r| |         }t          |          }||                                v r|d||         z  z   }d}n	|||<   |}d}d                    t          t          |j                            }	t          |j                  }
|                    ||	|
|j        j        |g           d}d}d}d}|D ]}|t!          |d                   k     rt!          |d                   }|t!          |d                   k     rt!          |d                   }|t!          |d                   k     rt!          |d                   }|d         r|t#          |d                   z  }t!          |          dk    rpt%          d|          }t%          d|          }t%          d|          }d	|d
z  d|d
z  d|d
z  d}t'          |dz   dt!          |          dz   z  z   dz              |D ]}t'          |d         d
d
|t!          |d                   z
  dz   z  d
|d         d
d
|t!          |d                   z
  dz   z  d
|d         d
d
|t!          |d                   z
  dz   z  d
|d                    t'          d|z             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   rN   z x rD      
   zName rO   z Shape z Bytes z TyperB   =      z'
Upper bound on total bytes  =       %d)re   	_getframef_back	f_globalskeys
isinstancer   idr1   mapstrrq   nbytesr    rs   namerX   intmaxr$   )vardictframestacacher   varidvnamestroriginalshapestrbytestrmaxnamemaxshapemaxbyte
totalbytesvalsp1sp2sp3prvals                       r)   r   r   ]  s   X &/
CE # #gdmW-- 	#$-CS''Cejjll""5:!55!c
zz#c39"5"566H#*ooGJJ7CIN " # # # GHGJ & &SQ[[  #a&kkGc#a&kk!!3q6{{HSQ[[  #a&kkGq6 	&#c!f++%J
3xx!||"g"h"g47GGGSWWWc#gggNedlS#e**Q,//$6777 1 1ASSV_Q5F0G0G0G(+ASSV_Q5F0G0G0G(+ASSV_Q5F0G0G0G(+A0 	1 	1 	1 	1 

4z
ABBB
Fr6   c                 (   t          |           }|}| }d}|                    |          }|D ]d}||k    rd}	n|}	|t          |          z   t          |	          z   }||k    r'|dz   t          |          z   }|dz   d|dz   z  z   |z   }\||	z   |z   }e|S )Nz,  rN   z,
rO   rD   )rX   rU   )
r   	argumentswidth
firstwidthknewstrsepstrarglistargumentaddstrs
             r)   _split_liner     s    TJAFFoof%%G 
0 
0
??FFFHF+u99QX.Ae^c:a<&888CFFf_x/FFMr6   r-   c                    t          | t                      t                      g           } | j        | j        i}| j        g}| j        g}	 t          |          dk    rn|                    d          }|                                D ]o}t          ||         t          j
                  rM||         j        }||vr<||         j        }|                    |           |                    |           |||<   p||fS )NTr   )
__import__globalslocalsrP   __dict__rX   popr   r   types
ModuleTyper    )modulethedictdictlist
totraversethisdictxmodnamemoddicts           r)   _makenamedictr     s    		688R88Fv/G H/"J/z??a>>!$$ 	/ 	/A(1+u'788 /"1+.(**&qk2GOOG,,,%%g...'.GG$/ Hr6   c                 
   d}d}d }t          | dt          |                     }t          |d|          }| j        }| j        j        }|t
          j        }t          d||           t          d| j        |           t          d	||           t          d
| j	        |           t          d || j
        j                  |           t          d || j
        j                  |           t          d| j
        j        |           t          dt          | j        j        j                  ||           t          dd|           |dv r$t          |t
          j        ||           d}	nS|dk    r't          |d||           t
          j        dk    }	n&t          |d||           t
          j        dk    }	t          d ||	          |           t          d| j        z  |           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 r:   rc   )r   s    r)   <lambda>z_info.<locals>.<lambda>  s    1 r6   	__class__rP   Nzclass: filezshape: z	strides: z
itemsize: z	aligned: zcontiguous: z	fortran: zdata pointer: zbyteorder: rO   )endr   )|r   F>biglittlez
byteswap: ztype: %s)getattrtyperp   rs   	byteorderre   stdoutr$   rq   rt   flagsaligned
contiguousfortranhexctypes_as_parameter_value)
objoutputextraticbpclsnmrp   endianbyteswaps
             r)   _infor     s4   $ E
C	B
#{DII
.
.C	j#	&	&BkGY F~	)Rf%%%%	)SYV,,,,	+wV,,,,	,62222	+rr#)+,,6::::	.""SY122@@@@	+sy(v6666	E #CJ$=$C D D DeeL
 
 
 
 
-Sv....##s}}cc2@@@@	3333$62222=E)ccc33'f5555=H,	,862222	*sy
 v......r6   L   c                    ddl }ddl}t          | d          st          | d          r| j        } nt          | d          r| j        } |t
          j        }| t          t                     dS t          | t                    rt          | |           dS t          | t                    rt          t          |          \  aad}g }t          D ]}	 t          |         |          }	t          |	          |v rt!          d|z  |           nY|                    t          |	                     t!          d	|z  |           t          |	           t!          d
|z  |           |dz  }# t$          $ r Y w xY w|dk    rt!          d| z  |           dS t!          d|z  |           dS |                    |           s|                    |           r| j        }
	 t          |                    |                     }n# t.          $ r d}Y nw xY wt1          |
|z             |k    rt3          |
||          }n|
|z   }t!          d|z   dz   |           t!          |                    |           |           dS |                    |           r| j        }
	 t          |                    |                     }n# t.          $ r d}Y nw xY wt1          |
|z             |k    rt3          |
||          }n|
|z   }t!          d|z   dz   |           |                    |           }|:t          | d          r)t!          |                    | j                  |           n$t!          |                    |           |           |                    |           }d |D             }|rmt!          d|           |D ][}t=          | |d          }|-|                    |                    |          pd          \  }}t!          d|d||           ZdS dS t          | d          r&t!          |                    |           |           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 ***-rN   zHelp for %s not found.z+
     *** Total of %d references found. ***z()rO   rB   r?   c                 *    g | ]}|d          dk    |S )r   _rc   ).0meths     r)   
<listcomp>zinfo.<locals>.<listcomp>  s!    EEE4d1gnn$nnnr6   z

Methods:
Nonez  z  --  rS   ) pydocinspecthasattrr   r   re   r   r   r   r   r   r   	_namedictr   	_dictlistr   r$   r    KeyError
isfunctionismethodrP   	signature	ExceptionrX   r   getdocisclassr?   
allmethodsr   splitdoc)objectmaxwidthr   toplevelr   r   numfoundobjlistr   r   r   r   argstrdoc1methodspublic_methodsr   thisobjmethstrothers                       r)   r   r   &  sC   j LLLNNN,-- '6-..'(	)	*	* '&~~T




	FG	$	$ P3fV$$$$$$	FC	 	  N3#0#:#: Iy  	 	G(0c77g%% BDKL%    
 NN2c77+++4w>VLLLLIII#h,V4444A   q==*V3&AAAAAA :<DE     
 
		F	#	# 13w'7'7'?'? 13	G--f5566II 	 	 	III	 tI~)) y(;;FFI%FcFlT!////gnnV$$6222222		 	  "3	G--f5566II 	 	 	III	 tI~)) y(;;FFI%FcFlT!////~~f%%<vz** DgnnV_55FCCCC'..((v6666""6**EE7EEE 	E"0000& E E!&$55&%*^^#NN733=v& &NGU gg6VDDDDD	E 	EE E 
	#	# 3gnnV$$62222223 3s7   BE++
E87E8"H HH"J? ?KKc                     ddl }	 t          d|                    |           z  |           t          |                    |           |           dS # t          $ r t          d|           Y dS w xY 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   s      r)   r   r     s    R NNN=o 5 5f = ==FKKKKg''f555555 = = =.V<<<<<<<=s   AA A21A2z[a-z0-9_]+\(.*[,=].*\)TFc                 
   ddl }t          |||          g }t          |                                                                           sdS                                 D ]R\  }\  }}	}
|	dv r|                                t          fdD                       r|                    |           Sdddddfdfd	}|                    |
           dd	                              z  }|dt          |          z  g}|ddd         D ]}|         \  }	}d                                                     d          D             }	 |d                                         }t                              |          r|d                                         }n# t          $ r d}Y nw xY w|                    |d|           |s|                    d           |*|                    d	                    |                     dS t          |          dk    r4|                                } |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       K   | ]}|v V  	d S r:   rc   )r   wr\   s     r)   	<genexpr>zlookfor.<locals>.<genexpr>7  s'      ''AqCx''''''r6   i  )rL   classr   r   c                     d}d                     |                                                                                    d          d d                   |t	          fdD                       z  }|t	           fdD                       z  }|t                      dz  z  }|                    |d          z  }|                     d           d	z  z  }|t          | d
z  d          z  }|S )Nr   rB   r   c                     g | ]}|v d 	S )   rc   )r   r  	first_docs     r)   r   z.lookfor.<locals>.relevance.<locals>.<listcomp>E  s    777!Y#r6   c                     g | ]}|v d 	S )   rc   )r   r  r   s     r)   r   z.lookfor.<locals>.relevance.<locals>.<listcomp>G  s    111qDyy"yyyr6   r   r  .r   d   i)	r1   lowerstriprU   sumrX   getcountr   )r   docstrkindindexrr  kind_relevancewhatss   `    @r)   	relevancezlookfor.<locals>.relevanceA  s    IIfllnn2244::4@@!DEE		S7777u777888	S1111e111222	c$iiZ!^	^e,,,	djjoo""	S%#t$$$r6   c                 "     | g|          R  S r:   rc   )rw   r   r%  s    r)   relevance_valuez lookfor.<locals>.relevance_valueQ  s    y&U1X&&&&r6   )keyzSearch results for '%s'rO   r   c                 ^    g | ]*}|                                 |                                 +S rc   )r  )r   r_   s     r)   r   zlookfor.<locals>.<listcomp>[  s<     % % %Tzz||%DJJLL % % %r6   rB   rN   r   z
    zNothing found.r   )r   _lookfor_generate_cacher   r  rU   itemsallr    sortr1   rX   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\   r#  r%  r$  s                     @@@@@r)   r   r     s   ^ LLL $FNJGGE EIIOO##%%E */++--  &&y$'''oo''''''''' 	LL #T %8 8N      ' ' ' ' ' '	JJ?J### 	"SXXe__5ACAJIddd ; ;dT2% %SYY[[->->t-D-D % % %	 ))++I%,,Y77 0$QK--//	 	 	 	III	yy9:::: +)*** TYYy))*****	Y"		  dii	""#####dii	""#####s   AF**F98F9c                    ddl }ddlm} | d} t          | t                    r6	 t          |            n# t          $ r i cY S w xY wt          j        |          } nWt          | t                    st          | t                    r-i }| D ]&}|                    t          |||                     '|S t          |           t          v r|st          t          |                    S i }|t          t          |           <   i }d}| j        | fg}	|	r]|	                    d          \  }
}t          |          |v r-d|t          |          <   |dz  }d}|                    |          rsd}	 |j        }n# t&          $ r d}Y nw xY w|rt)          |d	          rv|j        D ]m}t-          j        |          D ]T}t,          j                            ||          }t,          j                            ||d
          }t,          j                            |          r |                    d          r|dd         }n#t,          j                            |          r|}n|dk    r	 t          j        }t          j        }	  |            t          _         |            t          _        t          |
d|           |t          _        |t          _        n# |t          _        |t          _        w xY w;# t<          $ r  t>          $ r Y Rw xY wotA          |          D ]\  }}	 tC          |d|
d|          }tC          |dd          }n# tD          $ r |
d|}d}Y nw xY wd|vr	|r|d|}|#                    |
dz             st          |tH                    rn|                    |          s|||v s|	%                    |
d||f           n[|&                    |          r4d}tA          |          D ]!\  }}|	%                    |
d||f           "nt)          |d          rd}	 |'                    |          }n# tD          $ r d}Y nw xY w||||f||
<   |	]|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-   TrN   r   r   __path__z__init__.pyz.pyr?   r  rP   ra   r  r`   rL   )(r   ior>  r   r   r   r#   re   moduleslisttupleupdater+  r   _lookfor_cachesrP   r   ismodule__all__AttributeErrorr   r?  r/   listdirr0   r1   isfileendswithr   stderrKeyboardInterruptBaseException_getmembersr   	NameError
startswithr   r    r   r   )r   r5  r6  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_namer\   s                             r)   r+  r+  s  sv   * NNN~&# 	v 	 	 	III	V$	FD	!	! Z%>%>  	> 	>CLL0n1;= = > > > >	&zz_$$Z$r&zz** E"'OBvJJDEov&'E
 U-YYq\\
dd88tRXX
D!! D	D|!     %'$
";"; %= % %C$&JsOO % %"$',,sH"="="$',,sHm"L"LGNN733 % ( 1 1% 8 8%(0"IIW^^G44 %(0II$$
22$%),J),J8-5XZZ
-5XZZ
 *dddII+F G G G-7
-7

 .8
-7
 7 7 7 7
0 " " "!, % % % %H%5%> $D)) 7 71$ ':$$$7J K KI&q,==HH  $ $ $ ,044 3I#HHH	$
 i''H'+388YY ?I ++D3J77 !!U++ ! !**1-- dqq1156666+7, __T"" 	D#D)) 7 71qq11566667T:&& 	D	..&&CC 	 	 	CCC	 ?e,E$Kk  U-n Lso   5 AA)E1 1F ?F #K0<<K8K0K++K00LL"'M

M M 5Q QQc                      dd l }	 |                               }n+# t          $ r  fdt                     D             }Y nw xY w|S )Nr   c                 T    g | ]$}t          |          |t          |          f%S rc   )r   r   )r   r   rV  s     r)   r   z_getmembers.<locals>.<listcomp>  sF     ( ( (QdA&&(AwtQ''( ( ( (r6   )r   
getmembersr   dir)rV  r   memberss   `  r)   rP  rP    sy    NNN($$T** ( ( (( ( ( (#d)) ( ( (( Ns    %AAc                 4    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   ri  s     r)   r   r     s"    d JJJF###r6   c                    | j         dk    r|S t          j        |                     d|                    }t          j                            |          r|                    d          }t          j        |                                          dk    rMt          |t          j
                  r$| 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)ru   npisnantakemaisMaskedArrayfilledcount_nonzeroravelr   genericrs   r   nan)ro   resultrl  r_  s       r)   _median_nancheckrx  >  s    * yA~~
2D))**A	u1 HHUOO			""Q&& fbj)) 	+:??26***Fq	Mr6   c                      ddl m} m}m} t	          |          dk    rt	          |          dk    rdS d                    |          }|D ]}| |         r
|d| dz  }|d| dz  }|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   rO   *?)r   r   r   r   rX   r1   )r   r   r   enabled_featuresr(   s        r)   	_opt_infor}  b  s              !!c*:&;&;q&@&@rxx 011# / /G$ 	/G.G.r6   r:   )r-   )Nr   Nr-   )NTFN).r/   re   rY   r   rerF   rQ   numpy.core.numerictypesr   r   r   numpy.core.overridesr   r4   r   r   r	   r-   rm  rH  r   r   r8   rV   r
   r   r   r   r   r   r   r   r   r   r   r   rF  compileIr/  r   r+  rP  r   rx  r}  rc   r6   r)   <module>r     s   				 



   				      H H H H H H H H H H + + + + + + . . . . . . . . . .      I I IX  :A A A A A A A AH  2+ 2+ 2+j# # #>1 1 1r\ \ \ \N  & 		   (3/ 3/ 3/ 3/l GR3 R3 R3 R3j G* -= -= -= -=f  $$=rtDD  G?Dy$ y$ y$ y$vI I IV  3$ 3$ 3$l" " "H    r6   