U
    O8c3                     @   sv  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ddddd	d
dddddddgZdd Zdd
 ZG dd dZdd Zdd Zdd	 Zdd Zd3ddZdd Zdadad4dd Zd5d!d"Z edd6d$dZ!edej"fd%dZ#i Z$e%d&ej&Z'edd7d)dZ(d*d+ Z)d,d- Z*d.d Z+d/d0 Z,d1d2 Z-dS )8    N)issubclass_issubsctype
issubdtype)
set_module)ndarrayufuncasarrayr   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 ]"}| | rJ|| q2|| q2|d|||di zddlm} ||  W n t	k
r   t
d Y nX || 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__)pprintZsimd_extensions)Z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   appendZthreadpoolctlr   extendImportErrorprint)	r   r   r   r   Zconfig_foundZfeatures_foundZfeatures_not_foundfeaturer    r!   3/tmp/pip-unpacked-wheel-fd_gsd75/numpy/lib/utils.pyr      s*    /
c                  C   sV   ddl } | jdkr.tjtj| jdd}n$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)	numpyZshow_configospathjoindirname__file__
numpy.corer#   )r%   dr#   r!   r!   r"   r   a   s    
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)selfr/   r0   r1   r!   r!   r"   __init__   s    z_Deprecate.__init__c                    s2  | j }| j}| j}|dkr j}|dkr2d|  nd||f  |dk	rR d| 7  t fdd}||_j}|dkr }n| d}	t	|	dd }
|	d 
 r|
d	 | }nNt|	d d }|	dd D ]$}t||
kr q|t|d 7 }q||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 | |S )N   )
stacklevel)warningswarnDeprecationWarning)argskwdsZdepdocfuncr!   r"   newfunc   s    z$_Deprecate.__call__.<locals>.newfunc   r    z

)r/   r0   r1   __name__	functoolswraps__doc__
expandtabssplit_get_indentlstriplentextwrapindentr(   )r2   r=   r:   kwargsr/   r0   r1   r>   doclinesrK   skipliner!   r<   r"   __call__   s@    
z_Deprecate.__call__)NNN)rA   
__module____qualname__rD   r3   rQ   r!   r!   r!   r"   r-   ~   s   
r-   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maxsizerI   rH   min)rN   rK   rP   contentr!   r!   r"   rG      s    
rG   c                  O   s4   | r&| d }| dd } t | ||S t | |S d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   r?   Nr-   )r:   rL   fnr!   r!   r"   r	      s
    ,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

    )r1   rX   )msgr!   r!   r"   r
     s    c           
      C   s   | j }|d d }|d }|d }t| jj}| }}|dkrN|| j| 7 }nFt||D ]2\}}	|	dk rz||d |	 7 }qX||d |	 7 }qX||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shapeNr?   )Z__array_interface__r   dtypeitemsizesizezip)
aZaiZa_dataZastridesZashapeZbytes_aZa_lowZa_highr]   Zstrider!   r!   r"   r   $  s     c                 C   s$  | dkrt  j}|j} g }i }|  D ]}t| | tr(| | }t|}|| krl|d||   }d}n|||< |}d}dt	t
|j}	t
|j}
|||	|
|jj|g q(d}d}d}d}|D ]t}|t|d k rt|d }|t|d k rt|d }|t|d k r"t|d }|d r|t|d 7 }qt|dkrtd|}td|}td|}d	|d
 |d
 |d
 f }t|d dt|d   d  |D ]l}td|d d
|t|d  d  |d d
|t|d  d  |d d
|t|d  d  |d f  qt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   r?   z x r5      
   zName %s Shape %s Bytes %s Typer@   r4   =   z%s %s %s %s %s %s %s   z'
Upper bound on total bytes  =       %d)rT   	_getframef_back	f_globalskeys
isinstancer   idr(   mapstrr]   nbytesr   r^   namerI   intmaxr   )vardictframeZstacacherq   varZidvnamestroriginalZshapestrZbytestrZmaxnameZmaxshapeZmaxbyteZ
totalbytesvalZsp1Zsp2Zsp3Zprvalr!   r!   r"   r   ]  sb    ,




    c           
      C   s   t | }|}| }d}||}|D ]h}||kr4d}	n|}	|t | t |	 }||kr~|d t | }|d d|d   | }q"||	 | }q"|S )Nz,  r?   z,
r@   r5   )rI   rF   )
rq   	argumentswidthZ
firstwidthkZnewstrZsepstrZarglistargumentZ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<q|d}| D ]L}t|| t	j
rN|| j}||krN|| j}|| || |||< qNq.||fS )Nr   )
__import__globalslocalsrA   __dict__rI   poprk   rl   types
ModuleTyper   )moduleZthedictZdictlistZ
totraverseZthisdictxmodnameZmoddictr!   r!   r"   _makenamedict  s     




r   c           
      C   s  d}d}dd }t | dt| }t |d|}| j}| jj}|dkrHt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krtd|tj|f |d d}	nH|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 r.   r!   )r   r!   r!   r"   <lambda>      z_info.<locals>.<lambda>	__class__rA   Nzclass: filezshape: z	strides: z
itemsize: z	aligned: zcontiguous: z	fortran: zdata pointer: %s%szbyteorder: r@   )endr   )|re   z%s%s%sF>z%sbig%sbigz
%slittle%slittlez
byteswap: ztype: %s)getattrtyper\   r^   	byteorderrT   stdoutr   r]   r_   flagsZaligned
contiguousZfortranhexctypesZ_as_parameter_value)
objoutputextraZticZbpclsnmr\   ZendianZbyteswapr!   r!   r"   _info  s>    


r   L   c              	   C   s^  ddl }ddl}t| ds$t| dr,| j} nt| dr<| j} |dkrJtj}| dkr^tt nt| t	rxt
| |d nt| tr^tdkrt|\aad}g }tD ]}zlt| |  }	t|	|krtd| |d n6|t|	 td	| |d t|	 td
| |d |d7 }W q tk
r*   Y qX q|dkrJtd|  |d ntd| |d n|| sv|| r| j}
zt|| }W n tk
r   d}Y nX t|
| |krt|
||}n|
| }td| d |d t|| |d n^|| r<| j}
zt|| }W n tk
r:   d}Y nX t|
| |kr\t|
||}n|
| }td| d |d || }|dkrt| drt|| j|d nt|| |d || }dd |D }|rZtd|d |D ]J}t| |d}|dk	r"|||pd\}}td||f |d qnt| drZt|| |d 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   NZ_ppimport_importer_ppimport_module_ppimport_attr)r   z+
     *** Repeat reference found in %s *** r   z     *** Found in %s ***-r?   zHelp for %s not found.z+
     *** Total of %d references found. ***z()r@   r4   r3   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  --  %srD   ) pydocinspecthasattrr   r   rT   r   r   rl   r   r   ro   	_namedictr   	_dictlistrm   r   r   KeyError
isfunctionismethodrA   	signature	ExceptionrI   r   getdocisclassr3   Z
allmethodsr   Zsplitdoc)objectZmaxwidthr   toplevelr   r   ZnumfoundZobjlistrx   r   rq   r|   ZargstrZdoc1methodsZpublic_methodsr   ZthisobjZmethstrotherr!   r!   r"   r   &  s    5










c                 C   sZ   ddl }z,td||  |d t|| |d W n  tk
rT   td|d Y nX dS )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    )z[a-z0-9_]+\(.*[,=].*\)TFc              	      s  ddl }t||| g }t|   s0dS   D ]@\}\}}	}
|	dkrPq8| tfddD r8|| q8d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k
rH   d}Y nX |d||f  q|sn|d |dk	r|d	| n4t
|dkr| }|d	| n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   | ]}| kV  qd S r.   r!   r   w)rM   r!   r"   	<genexpr>7  s     zlookfor.<locals>.<genexpr>i  )r=   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   r4   rg   c                    s   g | ]}| krd qS )   r!   r   )	first_docr!   r"   r   E  s      z.lookfor.<locals>.relevance.<locals>.<listcomp>c                    s   g | ]}| krd qS )   r!   r   )rq   r!   r"   r   G  s      rf   r   .rd   d   i)	r(   lowerstriprF   sumrI   getcountrs   )rq   Zdocstrkindindexr)kind_relevancewhats)r   rq   r"   	relevanceA  s     zlookfor.<locals>.relevancec                    s   | f |   S r.   r!   )rb   )rv   r   r!   r"   relevance_valueQ  s    z lookfor.<locals>.relevance_value)keyzSearch results for '%s'r@   r   c                 S   s   g | ]}|  r|  qS r!   )r   )r   rP   r!   r!   r"   r   [  s    zlookfor.<locals>.<listcomp>r4   r?   r{   z	%s
    %szNothing found.rd   )r   _lookfor_generate_cachero   r   rF   itemsallr   sortr(   rI   r   _function_signature_research
IndexErrorwriteZgetpagerr   )whatr   import_modules
regenerater   r   r   rq   Z	docstringr   r   r   s	help_textixZdoclinesr   Zpagerr!   )rv   rM   r   r   r   r"   r     sN    / 


c              
   C   s  ddl }ddlm} | dkr d} t| tr\zt|  W n tk
rN   i  Y S X tj|  } n8t| t	spt| t
ri }| D ]}|t||| qx|S t| tkr|stt|  S i }|tt| < i }d}| j| fg}	|	r|	d\}
}t||krqd|t|< |d7 }d}||r6d}z
|j}W n tk
rB   d}Y nX |rZt|d	rZ|jD ]}t|D ]}tj||}tj||d
}tj|r|dr|dd }ntj|rj|}nqj|dkrڐqjzDtj}tj}z$| t_| t_td|
|f  W 5 |t_|t_X W n2 tk
r6    Y n tk
rP   Y qjY nX qjq\t |D ]\}}z$t!|dd|
|f }t!|dd}W n& t"k
r   d|
|f }d}Y nX d|kr|rd||f }|#|
d st|t$rbnqbn$||s|dks||ksqb|	%d|
|f |f qbnL|&|rrd}t |D ] \}}|	%d|
|f |f qNnt|drd}z|'|}W n t"k
r   d}Y nX |dk	r|||f||
< q|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%   Tr?   r   r   __path__z__init__.pyz.pyr3   z%s.%srA   rR   r   r   rQ   r=   )(r   ior   rl   ro   r   r   rT   moduleslisttupleupdater   rm   _lookfor_cachesrA   r   ismodule__all__AttributeErrorr   r   r&   listdirr'   r(   isfileendswithr   stderrKeyboardInterruptBaseException_getmembersr   	NameError
startswithr   r   r   r   )r   r   r   r   r   rv   modseenr   stackrq   itemr   Z_allpthZmod_pathZthis_pyZinit_pyZ	to_importZ
old_stdoutZ
old_stderrnvZ	item_namemod_namerM   r!   r!   r"   r   s  s    







 
r   c                    sF   dd l }z| }W n* tk
r@    fddt D }Y nX |S )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!   r  r"   r     s    r   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   r  r!   r!   r"   r     s    2c                 C   sr   | j dkr|S t| jd|d}tj|r8|d}t| dkrnt	|tj
rd| 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)r`   npisnanZtakemaZisMaskedArrayZfilledZcount_nonzeroZravelrl   Zgenericr^   r   nan)r[   resultr	  r   r!   r!   r"   _median_nancheck>  s    


r  c                  C   sr   ddl m} m}m} t|dkr0t|dkr0d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{   r@   *?)r   r   r   r   rI   r(   )r   r   r   Zenabled_featuresr    r!   r!   r"   	_opt_infob  s    
r  )N)r%   )N)Nr   Nr%   )NTFN).r&   rT   rJ   r   rer7   rB   Znumpy.core.numerictypesr   r   r   Znumpy.core.overridesr   r+   r   r   r   r%   r
  r   r   r   r-   rG   r	   r
   r   r   r   r   r   r   r   r   r   r   r   compileIr   r   r   r   r   r  r  r!   r!   r!   r"   <module>   sl             LD59
g

6 3  { 
6$