o
    z¨ÊhÒ  ã                   @   sp  d Z ddlmZmZmZmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ G dd„ dƒZedkr¶eedƒdƒZeeƒZ e!e"e ƒƒ e!ee ƒe jƒ e dd	…dd
…f Z#e!e#ƒ de#d< e!e#d e d ƒ e!ee#ƒd d ee#d ƒ ƒ e!ee#dƒe$ee#dƒƒƒ e!e$e#eedƒee#ƒƒ ƒƒ e!ee#dƒƒ e!ee#ƒƒ dS dS )a7  
Container class for backward compatibility with NumArray.

The user_array.container class exists for backward compatibility with NumArray
and is not meant to be used in new code. If you need to create an array
container class, we recommend either creating a class that wraps an ndarray
or subclasses ndarray.

é    )ÚarrayÚasarrayÚabsoluteÚaddÚsubtractÚmultiplyÚdivideÚ	remainderÚpowerÚ
left_shiftÚright_shiftÚbitwise_andÚ
bitwise_orÚbitwise_xorÚinvertÚlessÚ
less_equalÚ	not_equalÚequalÚgreaterÚgreater_equalÚshapeÚreshapeÚarangeÚsinÚsqrtÚ	transposec                   @   s  e Zd ZdZd„dd„Zdd„ Zd…dd	„Zd
d„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ ZeZdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZeZd d!„ Zd"d#„ Zd$d%„ Zd&d'„ Zd(d)„ Zd*d+„ Zd,d-„ Zd.d/„ Zd0d1„ Zd2d3„ Zd4d5„ Zd6d7„ Zd8d9„ Z d:d;„ Z!d<d=„ Z"d>d?„ Z#d@dA„ Z$dBdC„ Z%dDdE„ Z&dFdG„ Z'dHdI„ Z(dJdK„ Z)dLdM„ Z*dNdO„ Z+dPdQ„ Z,dRdS„ Z-dTdU„ Z.dVdW„ Z/dXdY„ Z0dZd[„ Z1d\d]„ Z2d^d_„ Z3d`da„ Z4dbdc„ Z5ddde„ Z6dfdg„ Z7dhdi„ Z8djdk„ Z9dldm„ Z:dndo„ Z;dpdq„ Z<drds„ Z=dtdu„ Z>dvdw„ Z?dxdy„ Z@dzd{„ ZAd|d}„ ZBd~d„ ZCd€d�„ ZDd‚dƒ„ ZEdS )†Ú	containerzµ
    container(data, dtype=None, copy=True)

    Standard container-class for easy multiple-inheritance.

    Methods
    -------
    copy
    tostring
    byteswap
    astype

    NTc                 C   s   t |||d�| _ d S )N)Úcopy)r   )ÚselfÚdataÚdtyper   © r"   úL/var/www/html/env/lib/python3.10/site-packages/numpy/lib/_user_array_impl.pyÚ__init__    ó   zcontainer.__init__c                 C   sB   | j dkr| jjt| jƒtdƒd …  S | jjd t| jƒ d S )Nr   r   ú(ú))ÚndimÚ	__class__Ú__name__Úreprr   Úlen©r   r"   r"   r#   Ú__repr__#   s   
zcontainer.__repr__c                 C   s   |r| j  |¡S | j S ©N)r   Úastype)r   Útr"   r"   r#   Ú	__array__)   s   zcontainer.__array__c                 C   s
   t | jƒS r/   )r,   r   r-   r"   r"   r#   Ú__len__/   ó   
zcontainer.__len__c                 C   s   |   | j| ¡S r/   ©Ú_rcr   )r   Úindexr"   r"   r#   Ú__getitem__2   ó   zcontainer.__getitem__c                 C   s   t || jƒ| j|< d S r/   )r   r!   r   )r   r7   Úvaluer"   r"   r#   Ú__setitem__5   ó   zcontainer.__setitem__c                 C   ó   |   t| jƒ¡S r/   )r6   r   r   r-   r"   r"   r#   Ú__abs__8   r9   zcontainer.__abs__c                 C   s   |   | j ¡S r/   r5   r-   r"   r"   r#   Ú__neg__;   ó   zcontainer.__neg__c                 C   s   |   | jt|ƒ ¡S r/   ©r6   r   r   ©r   Úotherr"   r"   r#   Ú__add__>   r%   zcontainer.__add__c                 C   ó   t | j|| jƒ | S r/   )r   r   rB   r"   r"   r#   Ú__iadd__C   ó   zcontainer.__iadd__c                 C   s   |   | jt|ƒ ¡S r/   rA   rB   r"   r"   r#   Ú__sub__G   r%   zcontainer.__sub__c                 C   s   |   t|ƒ| j ¡S r/   )r6   r   r   rB   r"   r"   r#   Ú__rsub__J   r%   zcontainer.__rsub__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__isub__M   rG   zcontainer.__isub__c                 C   ó   |   t| jt|ƒƒ¡S r/   )r6   r   r   r   rB   r"   r"   r#   Ú__mul__Q   r<   zcontainer.__mul__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__imul__V   rG   zcontainer.__imul__c                 C   rK   r/   )r6   r   r   r   rB   r"   r"   r#   Ú__div__Z   r<   zcontainer.__div__c                 C   ó   |   tt|ƒ| jƒ¡S r/   )r6   r   r   r   rB   r"   r"   r#   Ú__rdiv__]   r<   zcontainer.__rdiv__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__idiv__`   rG   zcontainer.__idiv__c                 C   ó   |   t| j|ƒ¡S r/   ©r6   r	   r   rB   r"   r"   r#   Ú__mod__d   ó   zcontainer.__mod__c                 C   ó   |   t|| jƒ¡S r/   rS   rB   r"   r"   r#   Ú__rmod__g   rU   zcontainer.__rmod__c                 C   rE   r/   )r	   r   rB   r"   r"   r#   Ú__imod__j   rG   zcontainer.__imod__c                 C   s$   |   t| j|ƒ¡|   t| j|ƒ¡fS r/   ©r6   r   r   r	   rB   r"   r"   r#   Ú
__divmod__n   ó   ÿzcontainer.__divmod__c                 C   s$   |   t|| jƒ¡|   t|| jƒ¡fS r/   rY   rB   r"   r"   r#   Ú__rdivmod__r   r[   zcontainer.__rdivmod__c                 C   rK   r/   )r6   r
   r   r   rB   r"   r"   r#   Ú__pow__v   r<   zcontainer.__pow__c                 C   rO   r/   )r6   r
   r   r   rB   r"   r"   r#   Ú__rpow__y   r<   zcontainer.__rpow__c                 C   rE   r/   )r
   r   rB   r"   r"   r#   Ú__ipow__|   rG   zcontainer.__ipow__c                 C   rR   r/   ©r6   r   r   rB   r"   r"   r#   Ú
__lshift__€   rU   zcontainer.__lshift__c                 C   rR   r/   ©r6   r   r   rB   r"   r"   r#   Ú
__rshift__ƒ   rU   zcontainer.__rshift__c                 C   rV   r/   r`   rB   r"   r"   r#   Ú__rlshift__†   rU   zcontainer.__rlshift__c                 C   rV   r/   rb   rB   r"   r"   r#   Ú__rrshift__‰   rU   zcontainer.__rrshift__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__ilshift__Œ   rG   zcontainer.__ilshift__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__irshift__�   rG   zcontainer.__irshift__c                 C   rR   r/   ©r6   r   r   rB   r"   r"   r#   Ú__and__”   rU   zcontainer.__and__c                 C   rV   r/   rh   rB   r"   r"   r#   Ú__rand__—   rU   zcontainer.__rand__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__iand__š   rG   zcontainer.__iand__c                 C   rR   r/   ©r6   r   r   rB   r"   r"   r#   Ú__xor__ž   rU   zcontainer.__xor__c                 C   rV   r/   rl   rB   r"   r"   r#   Ú__rxor__¡   rU   zcontainer.__rxor__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__ixor__¤   rG   zcontainer.__ixor__c                 C   rR   r/   ©r6   r   r   rB   r"   r"   r#   Ú__or__¨   rU   zcontainer.__or__c                 C   rV   r/   rp   rB   r"   r"   r#   Ú__ror__«   rU   zcontainer.__ror__c                 C   rE   r/   )r   r   rB   r"   r"   r#   Ú__ior__®   rG   zcontainer.__ior__c                 C   s   |   | j¡S r/   r5   r-   r"   r"   r#   Ú__pos__²   s   zcontainer.__pos__c                 C   r=   r/   )r6   r   r   r-   r"   r"   r#   Ú
__invert__µ   r9   zcontainer.__invert__c                 C   s   | j dkr|| d ƒS tdƒ‚)Nr   z6only rank-0 arrays can be converted to Python scalars.)r(   Ú	TypeError)r   Úfuncr"   r"   r#   Ú_scalarfunc¸   s
   
ÿzcontainer._scalarfuncc                 C   ó
   |   t¡S r/   )rx   Úcomplexr-   r"   r"   r#   Ú__complex__¿   r4   zcontainer.__complex__c                 C   ry   r/   )rx   Úfloatr-   r"   r"   r#   Ú	__float__Â   r4   zcontainer.__float__c                 C   ry   r/   )rx   Úintr-   r"   r"   r#   Ú__int__Å   r4   zcontainer.__int__c                 C   ry   r/   )rx   Úhexr-   r"   r"   r#   Ú__hex__È   r4   zcontainer.__hex__c                 C   ry   r/   )rx   Úoctr-   r"   r"   r#   Ú__oct__Ë   r4   zcontainer.__oct__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__lt__Î   rU   zcontainer.__lt__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__le__Ñ   rU   zcontainer.__le__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__eq__Ô   rU   zcontainer.__eq__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__ne__×   rU   zcontainer.__ne__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__gt__Ú   rU   zcontainer.__gt__c                 C   rR   r/   )r6   r   r   rB   r"   r"   r#   Ú__ge__Ý   rU   zcontainer.__ge__c                 C   ó   |   | j ¡ ¡S ©Ú )r6   r   r   r-   r"   r"   r#   r   à   ó   zcontainer.copyc                 C   ó
   | j  ¡ S r‹   )r   Útostringr-   r"   r"   r#   r�   ä   ó   
zcontainer.tostringc                 C   rŽ   r‹   )r   Útobytesr-   r"   r"   r#   r‘   è   r�   zcontainer.tobytesc                 C   rŠ   r‹   )r6   r   Úbyteswapr-   r"   r"   r#   r’   ì   r�   zcontainer.byteswapc                 C   s   |   | j |¡¡S r‹   )r6   r   r0   )r   Útypecoder"   r"   r#   r0   ð   s   zcontainer.astypec                 C   s   t t|ƒƒdkr
|S |  |¡S ©Nr   )r,   r   r)   )r   Úar"   r"   r#   r6   ô   s   
zcontainer._rcc                 G   s   |   |d ¡S r”   )r)   )r   Úargsr"   r"   r#   Ú__array_wrap__ú   r@   zcontainer.__array_wrap__c                 C   sR   |dkrt  | ||¡ d S z
| j ||¡ W d S  ty(   t  | ||¡ Y d S w ©Nr   )ÚobjectÚ__setattr__r   ÚAttributeError)r   Úattrr:   r"   r"   r#   rš   ý   s   ÿzcontainer.__setattr__c                 C   s    |dkr
t  | |¡S | j |¡S r˜   )r™   Ú__getattribute__r   )r   rœ   r"   r"   r#   Ú__getattr__  s   zcontainer.__getattr__)NTr/   )Fr*   Ú
__module__Ú__qualname__Ú__doc__r$   r.   r2   r3   r8   r;   r>   r?   rD   Ú__radd__rF   rH   rI   rJ   rL   Ú__rmul__rM   rN   rP   rQ   rT   rW   rX   rZ   r\   r]   r^   r_   ra   rc   rd   re   rf   rg   ri   rj   rk   rm   rn   ro   rq   rr   rs   rt   ru   rx   r{   r}   r   r�   rƒ   r„   r…   r†   r‡   rˆ   r‰   r   r�   r‘   r’   r0   r6   r—   rš   rž   r"   r"   r"   r#   r      sˆ    


r   Ú__main__i'  )éd   r¥   Né   é   é
   )r   r   g      @g      @é   ég   é   )r§   r¦   )%r¡   Únumpy._corer   r   r   r   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r*   ÚtempÚuaÚprintÚdirÚua_smallÚtyper"   r"   r"   r#   Ú<module>   s&    t	  ï