o
    ʩZhe                     @  s  d dl mZ ddlmZmZmZmZmZmZm	Z	m
Z
mZ ddlmZ d dlZdd	d
ZdddZdddZdddZdddZdddZdddZdddZdddZdddZddd Zdd!d"Zdd#d$Zdd%d&Zdd'd(Zdd)d*Zdd+d,Z dd-d.Z!dd/d0Z"dd1d2Z#dd3d4Z$dd5d6Z%dd7d8Z&dd9d:Z'dd;d<Z(dd=d>Z)dd?d@Z*ddAdBZ+ddCdDZ,ddEdFZ-ddGdHZ.ddIdJZ/ddKdLZ0ddMdNZ1ddOdPZ2ddQdRZ3ddSdTZ4ddUdVZ5ddWdXZ6ddYdZZ7dd[d\Z8dd]d^Z9dd_d`Z:ddadbZ;ddcddZ<ddedfZ=ddgdhZ>ddidjZ?ddkdlZ@ddmdnZAddodpZBddqdrZCddsdtZDddudvZEddwdxZFddydzZGdd{d|ZHdd}d~ZIdddZJdS )    )annotations   )	_boolean_dtypes_floating_dtypes_real_floating_dtypes_complex_floating_dtypes_integer_dtypes_integer_or_boolean_dtypes_real_numeric_dtypes_numeric_dtypes_result_type)ArrayNxr   returnc                C  $   | j tvr	tdtt| jS )zv
    Array API compatible wrapper for :py:func:`np.abs <numpy.abs>`.

    See its docstring for more information.
    z&Only numeric dtypes are allowed in abs)dtyper   	TypeErrorr   _newnpabs_arrayr    r   ]/var/www/html/lang_env/lib/python3.10/site-packages/numpy/array_api/_elementwise_functions.pyr         
r   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.arccos <numpy.arccos>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in acos)r   r   r   r   r   r   Zarccosr   r   r   r   r   acos   r   r   c                C  r   )z~
    Array API compatible wrapper for :py:func:`np.arccosh <numpy.arccosh>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in acosh)r   r   r   r   r   r   Zarccoshr   r   r   r   r   acosh+   r   r   x1x2c                C  P   | j tvs
|j tvrtdt| j |j  t| |\} }tt| j	|j	S )zv
    Array API compatible wrapper for :py:func:`np.add <numpy.add>`.

    See its docstring for more information.
    z&Only numeric dtypes are allowed in add)
r   r   r   r   r   _normalize_two_argsr   r   addr   r   r   r   r   r   r!   6   
   r!   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.arcsin <numpy.arcsin>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in asin)r   r   r   r   r   r   Zarcsinr   r   r   r   r   asinE   r   r$   c                C  r   )z~
    Array API compatible wrapper for :py:func:`np.arcsinh <numpy.arcsinh>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in asinh)r   r   r   r   r   r   Zarcsinhr   r   r   r   r   asinhQ   r   r%   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.arctan <numpy.arctan>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in atan)r   r   r   r   r   r   Zarctanr   r   r   r   r   atan]   r   r&   c                C  r   )z~
    Array API compatible wrapper for :py:func:`np.arctan2 <numpy.arctan2>`.

    See its docstring for more information.
    z4Only real floating-point dtypes are allowed in atan2)
r   r   r   r   r   r    r   r   Zarctan2r   r"   r   r   r   atan2i   r#   r'   c                C  r   )z~
    Array API compatible wrapper for :py:func:`np.arctanh <numpy.arctanh>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in atanh)r   r   r   r   r   r   Zarctanhr   r   r   r   r   atanhx   r   r(   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.bitwise_and <numpy.bitwise_and>`.

    See its docstring for more information.
    z9Only integer or boolean dtypes are allowed in bitwise_and)
r   r	   r   r   r   r    r   r   bitwise_andr   r"   r   r   r   r)         

r)   c                C  h   | j tvs
|j tvrtdt| j |j  t| |\} }t|jdk r)t	dt
t| j|jS )z
    Array API compatible wrapper for :py:func:`np.left_shift <numpy.left_shift>`.

    See its docstring for more information.
    z5Only integer dtypes are allowed in bitwise_left_shiftr   z6bitwise_left_shift(x1, x2) is only defined for x2 >= 0)r   r   r   r   r   r    r   anyr   
ValueErrorr   Z
left_shiftr"   r   r   r   bitwise_left_shift      r.   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.invert <numpy.invert>`.

    See its docstring for more information.
    z<Only integer or boolean dtypes are allowed in bitwise_invert)r   r	   r   r   r   r   invertr   r   r   r   r   bitwise_invert   r   r1   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.bitwise_or <numpy.bitwise_or>`.

    See its docstring for more information.
    z8Only integer or boolean dtypes are allowed in bitwise_or)
r   r	   r   r   r   r    r   r   
bitwise_orr   r"   r   r   r   r2      r*   r2   c                C  r+   )z
    Array API compatible wrapper for :py:func:`np.right_shift <numpy.right_shift>`.

    See its docstring for more information.
    z6Only integer dtypes are allowed in bitwise_right_shiftr   z7bitwise_right_shift(x1, x2) is only defined for x2 >= 0)r   r   r   r   r   r    r   r,   r   r-   r   Zright_shiftr"   r   r   r   bitwise_right_shift   r/   r3   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.bitwise_xor <numpy.bitwise_xor>`.

    See its docstring for more information.
    z9Only integer or boolean dtypes are allowed in bitwise_xor)
r   r	   r   r   r   r    r   r   bitwise_xorr   r"   r   r   r   r4      r*   r4   c                C  2   | j tvr	td| j tv r| S tt| jS )zx
    Array API compatible wrapper for :py:func:`np.ceil <numpy.ceil>`.

    See its docstring for more information.
    z,Only real numeric dtypes are allowed in ceil)	r   r
   r   r   r   r   r   ceilr   r   r   r   r   r6      
   

r6   c                C  "   | j tvr	tdtt| S )zx
    Array API compatible wrapper for :py:func:`np.conj <numpy.conj>`.

    See its docstring for more information.
    z6Only complex floating-point dtypes are allowed in conj)r   r   r   r   r   r   conjr   r   r   r   r9         
r9   c                C  r   )zv
    Array API compatible wrapper for :py:func:`np.cos <numpy.cos>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in cos)r   r   r   r   r   r   cosr   r   r   r   r   r;      r   r;   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.cosh <numpy.cosh>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in cosh)r   r   r   r   r   r   coshr   r   r   r   r   r<   
  r   r<   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.divide <numpy.divide>`.

    See its docstring for more information.
    z0Only floating-point dtypes are allowed in divide)
r   r   r   r   r   r    r   r   divider   r"   r   r   r   r=     r#   r=   c                C  4   t | j|j t| |\} }tt| j|jS )zz
    Array API compatible wrapper for :py:func:`np.equal <numpy.equal>`.

    See its docstring for more information.
    )r   r   r   r    r   r   equalr   r"   r   r   r   r?   #     r?   c                C  r   )zv
    Array API compatible wrapper for :py:func:`np.exp <numpy.exp>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in exp)r   r   r   r   r   r   expr   r   r   r   r   rA   /  r   rA   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.expm1 <numpy.expm1>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in expm1)r   r   r   r   r   r   expm1r   r   r   r   r   rB   :  r   rB   c                C  r5   )zz
    Array API compatible wrapper for :py:func:`np.floor <numpy.floor>`.

    See its docstring for more information.
    z-Only real numeric dtypes are allowed in floor)	r   r
   r   r   r   r   r   floorr   r   r   r   r   rC   E  r7   rC   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.floor_divide <numpy.floor_divide>`.

    See its docstring for more information.
    z4Only real numeric dtypes are allowed in floor_divide)
r   r
   r   r   r   r    r   r   floor_divider   r"   r   r   r   rD   S  r#   rD   c                C  r   )z~
    Array API compatible wrapper for :py:func:`np.greater <numpy.greater>`.

    See its docstring for more information.
    z/Only real numeric dtypes are allowed in greater)
r   r
   r   r   r   r    r   r   greaterr   r"   r   r   r   rE   a  r#   rE   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.greater_equal <numpy.greater_equal>`.

    See its docstring for more information.
    z5Only real numeric dtypes are allowed in greater_equal)
r   r
   r   r   r   r    r   r   greater_equalr   r"   r   r   r   rF   o  r#   rF   c                C  r8   )zx
    Array API compatible wrapper for :py:func:`np.imag <numpy.imag>`.

    See its docstring for more information.
    z6Only complex floating-point dtypes are allowed in imag)r   r   r   r   r   r   imagr   r   r   r   rG   }  r:   rG   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.isfinite <numpy.isfinite>`.

    See its docstring for more information.
    z+Only numeric dtypes are allowed in isfinite)r   r   r   r   r   r   isfiniter   r   r   r   r   rH     r   rH   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.isinf <numpy.isinf>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in isinf)r   r   r   r   r   r   isinfr   r   r   r   r   rI     r   rI   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.isnan <numpy.isnan>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in isnan)r   r   r   r   r   r   isnanr   r   r   r   r   rJ     r   rJ   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.less <numpy.less>`.

    See its docstring for more information.
    z,Only real numeric dtypes are allowed in less)
r   r
   r   r   r   r    r   r   lessr   r"   r   r   r   rK     r#   rK   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.less_equal <numpy.less_equal>`.

    See its docstring for more information.
    z2Only real numeric dtypes are allowed in less_equal)
r   r
   r   r   r   r    r   r   
less_equalr   r"   r   r   r   rL     r#   rL   c                C  r   )zv
    Array API compatible wrapper for :py:func:`np.log <numpy.log>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in log)r   r   r   r   r   r   logr   r   r   r   r   rM     r   rM   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.log1p <numpy.log1p>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in log1p)r   r   r   r   r   r   log1pr   r   r   r   r   rN     r   rN   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.log2 <numpy.log2>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in log2)r   r   r   r   r   r   log2r   r   r   r   r   rO     r   rO   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.log10 <numpy.log10>`.

    See its docstring for more information.
    z/Only floating-point dtypes are allowed in log10)r   r   r   r   r   r   log10r   r   r   r   r   rP     r   rP   c                 C  r   )z
    Array API compatible wrapper for :py:func:`np.logaddexp <numpy.logaddexp>`.

    See its docstring for more information.
    z8Only real floating-point dtypes are allowed in logaddexp)
r   r   r   r   r   r    r   r   	logaddexpr   r"   r   r   r   rQ     r#   rQ   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.logical_and <numpy.logical_and>`.

    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_and)
r   r   r   r   r   r    r   r   logical_andr   r"   r   r   r   rR     r#   rR   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.logical_not <numpy.logical_not>`.

    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_not)r   r   r   r   r   r   logical_notr   r   r   r   r   rS     r   rS   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.logical_or <numpy.logical_or>`.

    See its docstring for more information.
    z-Only boolean dtypes are allowed in logical_or)
r   r   r   r   r   r    r   r   
logical_orr   r"   r   r   r   rT     r#   rT   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.logical_xor <numpy.logical_xor>`.

    See its docstring for more information.
    z.Only boolean dtypes are allowed in logical_xor)
r   r   r   r   r   r    r   r   logical_xorr   r"   r   r   r   rU   &  r#   rU   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.multiply <numpy.multiply>`.

    See its docstring for more information.
    z+Only numeric dtypes are allowed in multiply)
r   r   r   r   r   r    r   r   multiplyr   r"   r   r   r   rV   4  r#   rV   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.negative <numpy.negative>`.

    See its docstring for more information.
    z+Only numeric dtypes are allowed in negative)r   r   r   r   r   r   negativer   r   r   r   r   rW   B  r   rW   c                C  r>   )z
    Array API compatible wrapper for :py:func:`np.not_equal <numpy.not_equal>`.

    See its docstring for more information.
    )r   r   r   r    r   r   	not_equalr   r"   r   r   r   rX   M  r@   rX   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.positive <numpy.positive>`.

    See its docstring for more information.
    z+Only numeric dtypes are allowed in positive)r   r   r   r   r   r   positiver   r   r   r   r   rY   Y  r   rY   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.power <numpy.power>`.

    See its docstring for more information.
    z&Only numeric dtypes are allowed in pow)
r   r   r   r   r   r    r   r   powerr   r"   r   r   r   powe  r#   r[   c                C  r8   )zx
    Array API compatible wrapper for :py:func:`np.real <numpy.real>`.

    See its docstring for more information.
    z6Only complex floating-point dtypes are allowed in real)r   r   r   r   r   r   realr   r   r   r   r\   s  r:   r\   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.remainder <numpy.remainder>`.

    See its docstring for more information.
    z1Only real numeric dtypes are allowed in remainder)
r   r
   r   r   r   r    r   r   	remainderr   r"   r   r   r   r]   ~  r#   r]   c                C  r   )zz
    Array API compatible wrapper for :py:func:`np.round <numpy.round>`.

    See its docstring for more information.
    z(Only numeric dtypes are allowed in round)r   r   r   r   r   r   roundr   r   r   r   r   r^     r   r^   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.sign <numpy.sign>`.

    See its docstring for more information.
    z'Only numeric dtypes are allowed in sign)r   r   r   r   r   r   signr   r   r   r   r   r_     r   r_   c                C  r   )zv
    Array API compatible wrapper for :py:func:`np.sin <numpy.sin>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in sin)r   r   r   r   r   r   sinr   r   r   r   r   r`     r   r`   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.sinh <numpy.sinh>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in sinh)r   r   r   r   r   r   sinhr   r   r   r   r   ra     r   ra   c                C  r   )z|
    Array API compatible wrapper for :py:func:`np.square <numpy.square>`.

    See its docstring for more information.
    z)Only numeric dtypes are allowed in square)r   r   r   r   r   r   squarer   r   r   r   r   rb     r   rb   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.sqrt <numpy.sqrt>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in sqrt)r   r   r   r   r   r   sqrtr   r   r   r   r   rc     r   rc   c                C  r   )z
    Array API compatible wrapper for :py:func:`np.subtract <numpy.subtract>`.

    See its docstring for more information.
    z+Only numeric dtypes are allowed in subtract)
r   r   r   r   r   r    r   r   subtractr   r"   r   r   r   rd     r#   rd   c                C  r   )zv
    Array API compatible wrapper for :py:func:`np.tan <numpy.tan>`.

    See its docstring for more information.
    z-Only floating-point dtypes are allowed in tan)r   r   r   r   r   r   tanr   r   r   r   r   re     r   re   c                C  r   )zx
    Array API compatible wrapper for :py:func:`np.tanh <numpy.tanh>`.

    See its docstring for more information.
    z.Only floating-point dtypes are allowed in tanh)r   r   r   r   r   r   tanhr   r   r   r   r   rf     r   rf   c                C  r5   )zz
    Array API compatible wrapper for :py:func:`np.trunc <numpy.trunc>`.

    See its docstring for more information.
    z-Only real numeric dtypes are allowed in trunc)	r   r
   r   r   r   r   r   truncr   r   r   r   r   rg     r7   rg   )r   r   r   r   )r   r   r   r   r   r   )K
__future__r   Z_dtypesr   r   r   r   r   r	   r
   r   r   Z_array_objectr   numpyr   r   r   r   r!   r$   r%   r&   r'   r(   r)   r.   r1   r2   r3   r4   r6   r9   r;   r<   r=   r?   rA   rB   rC   rD   rE   rF   rG   rH   rI   rJ   rK   rL   rM   rN   rO   rP   rQ   rR   rS   rT   rU   rV   rW   rX   rY   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   r   r   r   r   <module>   s~    ,

























































