
    Bwg#                        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 ddlmZ  ed       G 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z  dz   ee%dz        z           e# ee%d       e& ee%d                    e# e&e% e ed       ee%            z                e# ee%d              e# ee%             y
y
)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	transpose)
set_moduleznumpy.lib.user_arrayc                      e Zd ZdZdCdZd ZdDdZd Zd Zd Z	d	 Z
d
 Zd ZeZd Zd Zd Zd Zd ZeZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d  Z#d! Z$d" Z%d# Z&d$ Z'd% Z(d& Z)d' Z*d( Z+d) Z,d* Z-d+ Z.d, Z/d- Z0d. Z1d/ Z2d0 Z3d1 Z4d2 Z5d3 Z6d4 Z7d5 Z8d6 Z9d7 Z:d8 Z;d9 Z<d: Z=d; Z>d< Z?d= Z@d> ZAd? ZBd@ ZCdA ZDdB ZEy)E	containerz
    container(data, dtype=None, copy=True)

    Standard container-class for easy multiple-inheritance.

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

    Nc                 *    t        |||      | _         y )N)copy)r   )selfdatadtyper"   s       Q/var/www/horilla/myenv/lib/python3.12/site-packages/numpy/lib/_user_array_impl.py__init__zcontainer.__init__"   s    4T2
    c                     | j                   dkD  r8| j                  j                  t        | j                        t        d      d  z   S | j                  j                  dz   t        | j                        z   dz   S )Nr   r   ())ndim	__class____name__reprr   lenr#   s    r&   __repr__zcontainer.__repr__%   s^    99q=>>**T$**-=c'lm-LLL>>**S04

3CCcIIr(   c                 T    |r| j                   j                  |      S | j                   S N)r   astype)r#   ts     r&   	__array__zcontainer.__array__+   s$    ::$$Q''zzr(   c                 ,    t        | j                        S r4   )r0   r   r1   s    r&   __len__zcontainer.__len__1   s    4::r(   c                 >    | j                  | j                  |         S r4   _rcr   )r#   indexs     r&   __getitem__zcontainer.__getitem__4   s    xx

5)**r(   c                 J    t        || j                        | j                  |<   y r4   )r   r%   r   )r#   r=   values      r&   __setitem__zcontainer.__setitem__7   s    #E4::6

5r(   c                 J    | j                  t        | j                              S r4   )r<   r   r   r1   s    r&   __abs__zcontainer.__abs__:   s    xx,--r(   c                 :    | j                  | j                         S r4   r;   r1   s    r&   __neg__zcontainer.__neg__=   s    xx$$r(   c                 P    | j                  | j                  t        |      z         S r4   r<   r   r   r#   others     r&   __add__zcontainer.__add__@       xx

WU^344r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __iadd__zcontainer.__iadd__E   s    DJJtzz*r(   c                 P    | j                  | j                  t        |      z
        S r4   rG   rH   s     r&   __sub__zcontainer.__sub__I   rK   r(   c                 P    | j                  t        |      | j                  z
        S r4   )r<   r   r   rH   s     r&   __rsub__zcontainer.__rsub__L   s    xx344r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __isub__zcontainer.__isub__O       UDJJ/r(   c                 ^    | j                  t        | j                  t        |                  S r4   )r<   r   r   r   rH   s     r&   __mul__zcontainer.__mul__S   s     xxWU^<==r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __imul__zcontainer.__imul__X   rT   r(   c                 ^    | j                  t        | j                  t        |                  S r4   )r<   r	   r   r   rH   s     r&   __div__zcontainer.__div__\   s     xxtzz75>:;;r(   c                 ^    | j                  t        t        |      | j                              S r4   )r<   r	   r   r   rH   s     r&   __rdiv__zcontainer.__rdiv___   s     xxwu~tzz:;;r(   c                 H    t        | j                  || j                         | S r4   )r	   r   rH   s     r&   __idiv__zcontainer.__idiv__b   s    tzz5$**-r(   c                 L    | j                  t        | j                  |            S r4   r<   r
   r   rH   s     r&   __mod__zcontainer.__mod__f       xx	$**e455r(   c                 L    | j                  t        || j                              S r4   r`   rH   s     r&   __rmod__zcontainer.__rmod__i   s    xx	%455r(   c                 H    t        | j                  || j                         | S r4   )r
   r   rH   s     r&   __imod__zcontainer.__imod__l   s    $**eTZZ0r(   c                     | j                  t        | j                  |            | j                  t        | j                  |            fS r4   r<   r	   r   r
   rH   s     r&   
__divmod__zcontainer.__divmod__p   s:    

E234::u568 	8r(   c                     | j                  t        || j                              | j                  t        || j                              fS r4   rh   rH   s     r&   __rdivmod__zcontainer.__rdivmod__t   s:    tzz235$**568 	8r(   c                 ^    | j                  t        | j                  t        |                  S r4   )r<   r   r   r   rH   s     r&   __pow__zcontainer.__pow__x   s     xxdjj'%.9::r(   c                 ^    | j                  t        t        |      | j                              S r4   )r<   r   r   r   rH   s     r&   __rpow__zcontainer.__rpow__{   s     xxgendjj9::r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __ipow__zcontainer.__ipow__~   s    djj%,r(   c                 L    | j                  t        | j                  |            S r4   r<   r   r   rH   s     r&   
__lshift__zcontainer.__lshift__       xx
4::u566r(   c                 L    | j                  t        | j                  |            S r4   r<   r   r   rH   s     r&   
__rshift__zcontainer.__rshift__       xxDJJ677r(   c                 L    | j                  t        || j                              S r4   rs   rH   s     r&   __rlshift__zcontainer.__rlshift__       xx
5$**566r(   c                 L    | j                  t        || j                              S r4   rw   rH   s     r&   __rrshift__zcontainer.__rrshift__       xxE4::677r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __ilshift__zcontainer.__ilshift__       4::udjj1r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __irshift__zcontainer.__irshift__       DJJtzz2r(   c                 L    | j                  t        | j                  |            S r4   r<   r   r   rH   s     r&   __and__zcontainer.__and__   ry   r(   c                 L    | j                  t        || j                              S r4   r   rH   s     r&   __rand__zcontainer.__rand__   r   r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __iand__zcontainer.__iand__   r   r(   c                 L    | j                  t        | j                  |            S r4   r<   r   r   rH   s     r&   __xor__zcontainer.__xor__   ry   r(   c                 L    | j                  t        || j                              S r4   r   rH   s     r&   __rxor__zcontainer.__rxor__   r   r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __ixor__zcontainer.__ixor__   r   r(   c                 L    | j                  t        | j                  |            S r4   r<   r   r   rH   s     r&   __or__zcontainer.__or__   ru   r(   c                 L    | j                  t        || j                              S r4   r   rH   s     r&   __ror__zcontainer.__ror__   r|   r(   c                 H    t        | j                  || j                         | S r4   )r   r   rH   s     r&   __ior__zcontainer.__ior__   r   r(   c                 8    | j                  | j                        S r4   r;   r1   s    r&   __pos__zcontainer.__pos__   s    xx

##r(   c                 J    | j                  t        | j                              S r4   )r<   r   r   r1   s    r&   
__invert__zcontainer.__invert__   s    xxtzz*++r(   c                 L    | j                   dk(  r || d         S t        d      )Nr   z6only rank-0 arrays can be converted to Python scalars.)r,   	TypeError)r#   funcs     r&   _scalarfunczcontainer._scalarfunc   s-    99>Q= HJ Jr(   c                 ,    | j                  t              S r4   )r   complexr1   s    r&   __complex__zcontainer.__complex__   s    ((r(   c                 ,    | j                  t              S r4   )r   floatr1   s    r&   	__float__zcontainer.__float__   s    &&r(   c                 ,    | j                  t              S r4   )r   intr1   s    r&   __int__zcontainer.__int__       $$r(   c                 ,    | j                  t              S r4   )r   hexr1   s    r&   __hex__zcontainer.__hex__   r   r(   c                 ,    | j                  t              S r4   )r   octr1   s    r&   __oct__zcontainer.__oct__   r   r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __lt__zcontainer.__lt__   s    xxTZZ/00r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __le__zcontainer.__le__   ru   r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __eq__zcontainer.__eq__   s    xxdjj%011r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __ne__zcontainer.__ne__   rb   r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __gt__zcontainer.__gt__   s    xx

E233r(   c                 L    | j                  t        | j                  |            S r4   )r<   r   r   rH   s     r&   __ge__zcontainer.__ge__   s    xxdjj%899r(   c                 T    | j                  | j                  j                               S  )r<   r   r"   r1   s    r&   r"   zcontainer.copy   s    xx

)**r(   c                 6    | j                   j                         S r   )r   tostringr1   s    r&   r   zcontainer.tostring   s    zz""$$r(   c                 6    | j                   j                         S r   )r   tobytesr1   s    r&   r   zcontainer.tobytes   s    zz!!##r(   c                 T    | j                  | j                  j                               S r   )r<   r   byteswapr1   s    r&   r   zcontainer.byteswap   s    xx

++-..r(   c                 V    | j                  | j                  j                  |            S r   )r<   r   r5   )r#   typecodes     r&   r5   zcontainer.astype   s     xx

))(344r(   c                 V    t        t        |            dk(  r|S | j                  |      S Nr   )r0   r   r-   )r#   as     r&   r<   zcontainer._rc   s&    uQx=AH>>!$$r(   c                 *    | j                  |d         S r   )r-   )r#   argss     r&   __array_wrap__zcontainer.__array_wrap__   s    ~~d1g&&r(   c                     |dk(  rt         j                  | ||       y 	 | j                  j                  ||       y # t        $ r t         j                  | ||       Y y w xY wNr   )object__setattr__r   AttributeError)r#   attrr@   s      r&   r   zcontainer.__setattr__   sX    7?tT51	2JJ""4/ 	2tT51	2s   <  AAc                 n    |dk(  rt         j                  | |      S | j                  j                  |      S r   )r   __getattribute__r   )r#   r   s     r&   __getattr__zcontainer.__getattr__	  s1    GO**466zz**400r(   )NTr4   )Fr.   
__module____qualname____doc__r'   r2   r7   r9   r>   rA   rC   rE   rJ   __radd__rM   rO   rQ   rS   rV   __rmul__rX   rZ   r\   r^   ra   rd   rf   ri   rk   rm   ro   rq   rt   rx   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"   r   r   r   r5   r<   r   r   r    r(   r&   r    r       sW   3J+7.%5 H55> H<<6688;;7878888877$,J)'%%%17264:+%$/5%'21r(   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   numpy._core.overridesr   r    r.   tempuaprintdirua_smalltyper   r(   r&   <module>r      sT          - "#x1 x1 $x1| z6%=*-D	4B	#b'N	%)RXX"1"bqb&zH	(OHTN	(4."T(#	#h-"
r
!DQ$7
78	$x
tD3$789	$x'&*eHo>>
?@	'(F
#$	)H
# r(   