
    Mh              	         % S SK Jr  S SKJr  S SKrS SKrS SKrS SK	J
r  \R                   V s/ s H  n \R                  / SQU S9PM     sn rS/\" \5      -  rS\S'   \\R$                   V s/ s H  n \R                  / S	QU S9PM     sn -  r\S
S
/-  r\\R                  " / SQSS9/-  r\S/-  r\R&                  " \" \\5      \ Vs/ s H  oR*                  R,                  PM     snS9S 5       rS rS rS rS rS rS rS rS rS r \RB                  RE                  S/ SQ5      S 5       r#gs  sn f s  sn f s  snf )    )annotations)AnyN)         Ndtyper   z	list[Any]scalars)g?皙?g333333?Nr   )TFTNbooleanF)paramsidsc                    U R                   $ )zFixture returning parametrized (array, scalar) tuple.

Used to test equivalence of scalars, numpy arrays with array ops, and the
equivalence of DataFrame and Series ops.
)param)requests    \/var/www/html/env/lib/python3.13/site-packages/pandas/tests/arrays/masked/test_arithmetic.pydatar      s     ==    c                    [        U R                  [        R                  5      (       a  SU;   a  [        R
                  " S5        g g g )Nsubz$subtract not implemented for boolean)
isinstancer	   pdBooleanDtypepytestskipr   op_names     r   
check_skipr       s4    $**boo..5G3C:; 4D.r   c                    U R                   R                  S:H  =(       a#    UR                  S5      R                  S5      S;   $ )Nb_r)powtruedivfloordiv)r	   kindstriplstripr   s     r   is_bool_not_implementedr)   %   s=    ::??c! gmmC&8&?&?&D I ' r   c                N   U u  p[         R                  " U5      n[        X5        [        R                  " U/[        U 5      -  U R                  S9nX R                  R                  U5      4 H  n[        X5      (       aX  Sn[        R                  " [        US9   U" X5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        Mk  U" X5      nU" X5      n[         R                  " Xg5        M     g ! , (       d  f       Ne= f! , (       d  f       M  = fNr   -operator '.*' not implemented for bool dtypesmatch)tmget_op_from_namer   r   arraylenr	   typer)   r   raisesNotImplementedErrorassert_extension_array_equal)r   all_arithmetic_operatorsscalaropscalar_arraymsgresultexpecteds           r   "test_array_scalar_like_equivalencer>   2   s    LD			5	6Bt.88VHs4y0

CL ::??623"4BBAC2#>4  ?2#>4& ?> %F$-H++F= 4 ?>>>s   	D	D
D	
D$	c                   U u  p[         R                  " U5      n[        X5        [        R                  n[        R
                  " [        R                  /[        U 5      -  U R                  S9nU R                  R                  5       n[        X5      (       aM  Sn[        R                  " [        US9   U" X5        S S S 5        [         R                  " X`R                  5        g U" X5      n[         R                  " X`R                  5        U" X5      n	[         R                  " X`R                  5        [         R                  " X5        g ! , (       d  f       N= fr+   )r/   r0   r   r   NAr1   r2   r	   _maskcopyr)   r   r4   r5   assert_numpy_array_equalr6   )
r   r7   r!   r9   r8   r:   maskr;   r<   r=   s
             r   test_array_NArE   G   s    GD			5	6Bt.UUF88RUUGc$i/tzzBL::??Dt>>=]].c:t ; 	##D**5Fjj1$%Hjj1##F5 ;:s   5	E
Ec                T   U u  p[         R                  " U5      n[        X5        [        R                  " U/[        U 5      -  U R                  R                  S9n[        R                  " X@R                  S9n[        X5      (       aW  Sn[        R                  " [        US9   U" X5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        g U" X5      nU" X5      n[         R                  " Xx5        g ! , (       d  f       N`= f! , (       d  f       g = fr+   )r/   r0   r   npr1   r2   r	   numpy_dtyper   r)   r   r4   r5   r6   )	r   r7   r8   r9   numpy_arraypd_arrayr;   r<   r=   s	            r   test_numpy_array_equivalencerK   c   s    LD			5	6Bt.((F8c$i/tzz7M7MNKxx::6Ht>>=]].c:t! ;]].c:t ;"F$!H##F5 ;:::s   %	D	D
D
D'c                   U u  p[         R                  " U5      n[        X5        [        R                  " SU 05      n[        X5      (       aW  Sn[        R                  " [        US9   U" XB5        S S S 5        [        R                  " [        US9   U" X5        S S S 5        g U" XB5      n[        R                  " SU" X5      05      n[         R                  " Xg5        g ! , (       d  f       Nv= f! , (       d  f       g = f)NAr,   r-   )
r/   r0   r   r   	DataFramer)   r   r4   r5   assert_frame_equal)r   r7   r8   r9   dfr;   r<   r=   s           r   
test_framerQ   |   s    LD			5	6Bt. 
sDk	"Bt>>=]].c:rN ;]].c:t ;^F||S"T"234H&+ ;:::s   )	C"	C3"
C03
Dc           	        U u  p[         R                  " U5      n[        X5        [        R                  " U 5      nU[
        R                  " U/[        U 5      -  U R                  R                  S9[        R                  " U/[        U 5      -  U R                  S9[        R                  " U/[        U 5      -  U R                  S9/nU H{  n[        X5      (       a.  Sn[        R                  " [        US9   U" XF5        S S S 5        MA  U" XF5      n[        R                  " U" X5      5      n	[         R                  " X5        M}     g ! , (       d  f       M  = fr+   )r/   r0   r   r   SeriesrG   r1   r2   r	   rH   r)   r   r4   r5   assert_series_equal)
r   r7   r8   r9   serothersotherr;   r<   r=   s
             r   test_seriesrX      s   LD			5	6Bt.
))D/C 	
&CI%TZZ-C-CD
&CI%TZZ8
		6(SY&djj9	F "4BBAC2#>3 ?> ^FyyD1H""64  ?>s   :	E
E	c           	     ^   U u  pUn[        X5      nU" [        R                  " SU 05      5      nU[        L d   eSn[        R
                  " [        US9   U" [        R                  " [        U 5      5      R                  S[        U 5      5      5        S S S 5        g ! , (       d  f       g = f)NrM   z(can only perform ops with 1-d structuresr-   )getattrr   rN   NotImplementedr   r4   r5   rG   aranger2   reshape)r   r7   r!   r9   opar<   r;   s          r   test_error_invalid_objectr`      s    GD	!B
$
C sDk*+F^###
5C	*#	6BIIc$i ((SY78 
7	6	6s   ?B
B,c                r   U u  p[         R                  " U5      nU/[        U 5      S-
  -  n[        nSR	                  SS/5      nU R
                  R                  S:X  a  UR                  S5      S;   a	  [        nSnO[        X5      (       a  S	n[        nU[        R                  " U5      4 Hc  n[        R                  " XVS
9   U" X5        S S S 5        [        R                   " U 5      n[        R                  " XVS
9   U" Xt5        S S S 5        Me     g ! , (       d  f       NN= f! , (       d  f       M  = f)Nr   |zBoperands could not be broadcast together with shapes \(3,\) \(4,\)zBoperands could not be broadcast together with shapes \(4,\) \(3,\)r    r!   )r   rsubznumpy boolean subtract, the `\-` operator, is not supported, use the bitwise_xor, the `\^` operator, or the logical_xor function insteadr,   r-   )r/   r0   r2   
ValueErrorjoinr	   r&   r'   	TypeErrorr)   r5   rG   r1   r   r4   r   rS   )r   r7   r8   r9   rW   errr;   ss           r   test_error_len_mismatchri      s	   LD			5	6BHD	A&E
C
((QQ	
C zz#":"@"@"E J # W 	 
!	@	@=!%)]]3*tO + IIdO]]3*qL +* *** +*s   	D 	D'
D$	'
D6	r9   )__neg____abs__
__invert__c                   U u  p[         R                  " U 5      nUS:X  a  U R                  R                  S:X  a  Sn[        R
                  " [        US9   [        X15      " 5         S S S 5        [        R
                  " [        US9   [        X5      " 5         S S S 5        [        R
                  " [        US9   [        U R                  U5      " 5         S S S 5        g [        X15      " 5       nUR                  SS9nS US'   [        R                  " XV5        g ! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)Nrl   fz0ufunc 'invert' not supported for the input typesr-   T)deepr   )r   rS   r	   r&   r   r4   rf   r[   _datarB   r/   rT   )r   r9   r!   rU   r;   r<   r=   s          r   %test_unary_op_does_not_propagate_maskrq      s     GD
))D/C	\djjoo4@]]9C0C 1]]9C0D 1]]9C0DJJ#% 1 	SF{{{%HCF6, 100000 	s$   DD+:D<
D(+
D9<
E
)$
__future__r   typingr   numpyrG   r   pandasr   pandas._testing_testingr/   ALL_INT_EA_DTYPESr1   arraysr2   r
   __annotations__FLOAT_EA_DTYPESfixturezipr	   namer   r   r)   r>   rE   rK   rQ   rX   r`   ri   markparametrizerq   )r	   as   00r   <module>r      s^   "      ?A>R>R	S>RU"((?%(
0>R	SS3v;& & REWEW
XEWE288)87EW
X X C:  288-Y?
@ @ E7  s67+1O1'',,1OP Q<
>*6862,*5<9!H CD- E-o 
T Y 2Ps   D4-D9
D>
