HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyc
�
�9Zc
@`sadZddlmZmZmZddddddd	d
ddd
ddg
ZddljjZ	ddlm
Z
mZmZm
Z
mZmZddlmZmZdZddd�Ze	jd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!d"�Zd#�Z id$d%6d&d'6d(d)6d*d+6d,d-6d.d/6d0d16d2d36d4d56d6d76d8d96d:d;6d<d=6d>d6d?d@6dAdB6dCdD6dEdF6dGdH6dIdJ6dKdL6dMdN6Z!dO�Z"e	j#e	j$e	j%e	j&gde	j(e	j)e	j*ggZ+ide	j#6de	j$6dPe	j%6dQe	j&6de	j(6dPe	j)6dQe	j*6Z,dR�Z-dS(Ss@Automatically adapted for numpy Sep 19, 2005 by convertcode.py

i(tdivisiontabsolute_importtprint_functiontiscomplexobjt	isrealobjtimagt	iscomplextisrealt
nan_to_numtrealt
real_if_closettypenametasfarraytmintypecodetasscalartcommon_typeN(tasarrayt
asanyarraytarraytisnant
obj2sctypetzerosi(tisneginftisposinfsGDFgdfQqLlIiHhBb?tGDFgdftdcC`s�g|D]-}t|t�r"|p1t|�jj^q}g|D]}||krA|^qA}|si|Sd|kr�d|kr�dSg}x0|D](}tj|�}|j||f�q�W|j�|ddS(s�
    Return the character for the minimum-size type to which given types can
    be safely cast.

    The returned type character must represent the smallest size dtype such
    that an array of the returned type can handle the data from an array of
    all types in `typechars` (or if `typechars` is an array, then its
    dtype.char).

    Parameters
    ----------
    typechars : list of str or array_like
        If a list of strings, each string should represent a dtype.
        If array_like, the character representation of the array dtype is used.
    typeset : str or list of str, optional
        The set of characters that the returned character is chosen from.
        The default set is 'GDFgdf'.
    default : str, optional
        The default character, this is returned if none of the characters in
        `typechars` matches a character in `typeset`.

    Returns
    -------
    typechar : str
        The character representing the minimum-size type that was found.

    See Also
    --------
    dtype, sctype2char, maximum_sctype

    Examples
    --------
    >>> np.mintypecode(['d', 'f', 'S'])
    'd'
    >>> x = np.array([1.1, 2-3.j])
    >>> np.mintypecode(x)
    'D'

    >>> np.mintypecode('abceh', default='G')
    'G'

    tFRtDii(	t
isinstancetstrRtdtypetchart_typecodes_by_elsizetindextappendtsort(t	typecharsttypesettdefaultttt	typecodestintersectiontlti((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR
s+7%

cC`s=tj|�}t|tj�s-tj}nt|d|�S(sM
    Return an array converted to a float type.

    Parameters
    ----------
    a : array_like
        The input array.
    dtype : str or dtype object, optional
        Float type code to coerce input array `a`.  If `dtype` is one of the
        'int' dtypes, it is replaced with float64.

    Returns
    -------
    out : ndarray
        The input `a` as a float ndarray.

    Examples
    --------
    >>> np.asfarray([2, 3])
    array([ 2.,  3.])
    >>> np.asfarray([2, 3], dtype='float')
    array([ 2.,  3.])
    >>> np.asfarray([2, 3], dtype='int8')
    array([ 2.,  3.])

    R(t_nxRt
issubclasstinexacttfloat_R(taR((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyRKscC`s
t|�jS(s�
    Return the real part of the elements of the array.

    Parameters
    ----------
    val : array_like
        Input array.

    Returns
    -------
    out : ndarray
        Output array. If `val` is real, the type of `val` is used for the
        output.  If `val` has complex elements, the returned type is float.

    See Also
    --------
    real_if_close, imag, angle

    Examples
    --------
    >>> a = np.array([1+2j, 3+4j, 5+6j])
    >>> a.real
    array([ 1.,  3.,  5.])
    >>> a.real = 9
    >>> a
    array([ 9.+2.j,  9.+4.j,  9.+6.j])
    >>> a.real = np.array([9, 8, 7])
    >>> a
    array([ 9.+2.j,  8.+4.j,  7.+6.j])

    (RR	(tval((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR	ks cC`s
t|�jS(sO
    Return the imaginary part of the elements of the array.

    Parameters
    ----------
    val : array_like
        Input array.

    Returns
    -------
    out : ndarray
        Output array. If `val` is real, the type of `val` is used for the
        output.  If `val` has complex elements, the returned type is float.

    See Also
    --------
    real, angle, real_if_close

    Examples
    --------
    >>> a = np.array([1+2j, 3+4j, 5+6j])
    >>> a.imag
    array([ 2.,  4.,  6.])
    >>> a.imag = np.array([8, 10, 12])
    >>> a
    array([ 1. +8.j,  3.+10.j,  5.+12.j])

    (RR(R1((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�scC`sHt|�}t|jjtj�r1|jdkSt|jt	�}|
S(se
    Returns a bool array, where True if input element is complex.

    What is tested is whether the input has a non-zero imaginary part, not if
    the input type is complex.

    Parameters
    ----------
    x : array_like
        Input array.

    Returns
    -------
    out : ndarray of bools
        Output array.

    See Also
    --------
    isreal
    iscomplexobj : Return True if x is a complex type or an array of complex
                   numbers.

    Examples
    --------
    >>> np.iscomplex([1+1j, 1+0j, 4.5, 3, 2, 2j])
    array([ True, False, False, False, False,  True], dtype=bool)

    i(
RR-RttypeR,tcomplexfloatingRRtshapetbool(txtaxtres((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�s

cC`st|�dkS(s>
    Returns a bool array, where True if input element is real.

    If element has complex type with zero complex part, the return value
    for that element is True.

    Parameters
    ----------
    x : array_like
        Input array.

    Returns
    -------
    out : ndarray, bool
        Boolean array of same shape as `x`.

    See Also
    --------
    iscomplex
    isrealobj : Return True if x is not a complex type.

    Examples
    --------
    >>> np.isreal([1+1j, 1+0j, 4.5, 3, 2, 2j])
    array([False,  True,  True,  True,  True, False], dtype=bool)

    i(R(R6((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�scC`stt|�jjtj�S(s�
    Check for a complex type or an array of complex numbers.

    The type of the input is checked, not the value. Even if the input
    has an imaginary part equal to zero, `iscomplexobj` evaluates to True.

    Parameters
    ----------
    x : any
        The input can be of any type and shape.

    Returns
    -------
    iscomplexobj : bool
        The return value, True if `x` is of a complex type or has at least
        one complex element.

    See Also
    --------
    isrealobj, iscomplex

    Examples
    --------
    >>> np.iscomplexobj(1)
    False
    >>> np.iscomplexobj(1+0j)
    True
    >>> np.iscomplexobj([3, 1+0j, True])
    True

    (R-RRR2R,R3(R6((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�s cC`stt|�jjtj�S(s�
    Return True if x is a not complex type or an array of complex numbers.

    The type of the input is checked, not the value. So even if the input
    has an imaginary part equal to zero, `isrealobj` evaluates to False
    if the data type is complex.

    Parameters
    ----------
    x : any
        The input can be of any type and shape.

    Returns
    -------
    y : bool
        The return value, False if `x` is of a complex type.

    See Also
    --------
    iscomplexobj, isreal

    Examples
    --------
    >>> np.isrealobj(1)
    True
    >>> np.isrealobj(1+0j)
    False
    >>> np.isrealobj([3, 1+0j, True])
    False

    (R-RRR2R,R3(R6((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyRs cC`s/ddlm}|j|�}|j|jfS(Ni(t	getlimits(t
numpy.coreR9tfinfotmaxtmin(R'R9tf((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyt
_getmaxmin3scC`stj|dt�}|jj}t|tj�s7|St|tj�}|jdk}|rh|dn|}|r�|j
|jfn|f}t|j
j�\}}xb|D]Z}tj
|ddt|��tj
||dt|��tj
||dt|��q�W|r|dS|S(s�
    Replace nan with zero and inf with finite numbers.

    Returns an array or scalar replacing Not a Number (NaN) with zero,
    (positive) infinity with a very large number and negative infinity
    with a very small (or negative) number.

    Parameters
    ----------
    x : array_like
        Input data.

    Returns
    -------
    out : ndarray
        New Array with the same shape as `x` and dtype of the element in
        `x`  with the greatest precision. If `x` is inexact, then NaN is
        replaced by zero, and infinity (-infinity) is replaced by the
        largest (smallest or most negative) floating point value that fits
        in the output dtype. If `x` is not inexact, then a copy of `x` is
        returned.

    See Also
    --------
    isinf : Shows which elements are negative or negative infinity.
    isneginf : Shows which elements are negative infinity.
    isposinf : Shows which elements are positive infinity.
    isnan : Shows which elements are Not a Number (NaN).
    isfinite : Shows which elements are finite (not NaN, not infinity)

    Notes
    -----
    Numpy uses the IEEE Standard for Binary Floating-Point for Arithmetic
    (IEEE 754). This means that Not a Number is not equivalent to infinity.


    Examples
    --------
    >>> np.set_printoptions(precision=8)
    >>> x = np.array([np.inf, -np.inf, np.nan, -128, 128])
    >>> np.nan_to_num(x)
    array([  1.79769313e+308,  -1.79769313e+308,   0.00000000e+000,
            -1.28000000e+002,   1.28000000e+002])

    tsubokigtwhereN(R,RtTrueRR2R-R.R3tndimtNoneR	RR?tcopytoRRR(R6txtypeRtisscalartdesttmaxftminfR((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR8s.!
 idcC`s�t|�}t|jjtj�s(|S|dkriddlm}|j|jj�}|j	|}ntj
|jdd|�r�|j}n|S(sK
    If complex input returns a real array if complex parts are close to zero.

    "Close to zero" is defined as `tol` * (machine epsilon of the type for
    `a`).

    Parameters
    ----------
    a : array_like
        Input array.
    tol : float
        Tolerance in machine epsilons for the complex part of the elements
        in the array.

    Returns
    -------
    out : ndarray
        If `a` is real, the type of `a` is used for the output.  If `a`
        has complex elements, the returned type is float.

    See Also
    --------
    real, imag, angle

    Notes
    -----
    Machine epsilon varies from machine to machine and between data types
    but Python floats on most platforms have a machine epsilon equal to
    2.2204460492503131e-16.  You can use 'np.finfo(np.float).eps' to print
    out the machine epsilon for floats.

    Examples
    --------
    >>> np.finfo(np.float).eps
    2.2204460492503131e-16

    >>> np.real_if_close([2.1 + 4e-14j], tol=1000)
    array([ 2.1])
    >>> np.real_if_close([2.1 + 4e-13j], tol=1000)
    array([ 2.1 +4.00000000e-13j])

    ii(R9tatol(
RR-RR2R,R3R:R9R;tepstallcloseRR	(R0ttolR9R>((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR
ys+cC`s
|j�S(sx
    Convert an array of size 1 to its scalar equivalent.

    Parameters
    ----------
    a : ndarray
        Input array of size 1.

    Returns
    -------
    out : scalar
        Scalar representation of `a`. The output data type is the same type
        returned by the input's `item` method.

    Examples
    --------
    >>> np.asscalar(np.array([24]))
    24

    (titem(R0((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�st	charactertS1R5t?ssigned chartbs
unsigned chartBtshortthsunsigned shorttHtintegerR+sunsigned integertIslong integerR*sunsigned long integertLslong long integertqsunsigned long long integertQssingle precisionR>sdouble precisionslong precisiontgscomplex single precisionRscomplex double precisionRscomplex long double precisiontGtstringtStunicodetUtvoidtVtobjecttOcC`st|S(sD
    Return a description for the given data type code.

    Parameters
    ----------
    char : str
        Data type code.

    Returns
    -------
    out : str
        Description of the input data type code.

    See Also
    --------
    dtype, typecodes

    Examples
    --------
    >>> typechars = ['S1', '?', 'B', 'D', 'G', 'F', 'I', 'H', 'L', 'O', 'Q',
    ...              'S', 'U', 'V', 'b', 'd', 'g', 'f', 'i', 'h', 'l', 'q']
    >>> for typechar in typechars:
    ...     print(typechar, ' : ', np.typename(typechar))
    ...
    S1  :  character
    ?  :  bool
    B  :  unsigned char
    D  :  complex double precision
    G  :  complex long double precision
    F  :  complex single precision
    I  :  unsigned integer
    H  :  unsigned short
    L  :  unsigned long integer
    O  :  object
    Q  :  unsigned long long integer
    S  :  string
    U  :  unicode
    V  :  void
    b  :  signed char
    d  :  double precision
    g  :  long precision
    f  :  single precision
    i  :  integer
    h  :  short
    l  :  long integer
    q  :  long long integer

    (t
_namefromtype(R((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR�s1iicG`s�t}d}x�|D]~}|jj}t|�r:t}nt|tj�rUd}n-tj	|d�}|dkr�td��nt||�}qW|r�t
d|St
d|SdS(s�
    Return a scalar type which is common to the input arrays.

    The return type will always be an inexact (i.e. floating point) scalar
    type, even if all the arrays are integer arrays. If one of the inputs is
    an integer array, the minimum precision type that is returned is a
    64-bit floating point dtype.

    All input arrays can be safely cast to the returned dtype without loss
    of information.

    Parameters
    ----------
    array1, array2, ... : ndarrays
        Input arrays.

    Returns
    -------
    out : data type code
        Data type code.

    See Also
    --------
    dtype, mintypecode

    Examples
    --------
    >>> np.common_type(np.arange(2, dtype=np.float32))
    <type 'numpy.float32'>
    >>> np.common_type(np.arange(2, dtype=np.float32), np.arange(2))
    <type 'numpy.float64'>
    >>> np.common_type(np.arange(4), np.array([45, 6.j]), np.array([45.0]))
    <type 'numpy.complex128'>

    iis+can't get common type for non-numeric arrayiN(tFalseRR2RRBR-R,RXtarray_precisiontgetRDt	TypeErrorR<t
array_type(tarrayst
is_complext	precisionR0R'tp((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyR s$
		(.t__doc__t
__future__RRRt__all__tnumpy.core.numerictcoretnumericR,RRRRRRt	ufunclikeRRR R
R/RR	RRRRRR?RR
RRgRthalftsingletdoublet
longdoubleRDtcsingletcdoubletclongdoubleRlRiR(((sG/opt/alt/python27/lib64/python2.7/site-packages/numpy/lib/type_check.pyt<module>sl	.9 	"		#		"	$		A7	

	6