o
    _~#g                     @  s2  U d dl mZ d dlmZ d dlZd dlZd dlZd dl	m
Z dd ejD Zdgee Zded< ed	d ejD 7 Zed
d
g7 Zeejg dddg7 Zedg7 Zejeeedd eD ddd 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d#d$ Zej d%g d&d'd( Z!dS ))    )annotations)AnyNc                 C     g | ]}t jg d |dqS ))         Ndtypepdarray.0r	    r   /var/www/static.ux5.de/https/Moving-Object-Detection-with-OpenCV/env/lib/python3.10/site-packages/pandas/tests/arrays/masked/test_arithmetic.py
<listcomp>       r   r   z	list[Any]scalarsc                 C  r   ))g?皙?g333333?Nr   r
   r   r   r   r   r      r   r   )TFTNbooleanr   Fc                 C  s   g | ]}|j jqS r   )r	   name)r   ar   r   r   r      s    )paramsidsc                 C  s   | j S )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)requestr   r   r   data   s   r   c                 C  s,   t | jtjrd|v rtd d S d S d S )Nsubz$subtract not implemented for boolean)
isinstancer	   r   BooleanDtypepytestskipr   op_namer   r   r   
check_skip    s   r$   c                 C  s    | j jdko|dddv S )Nb_r)powtruedivfloordiv)r	   kindstriplstripr"   r   r   r   is_bool_not_implemented%   s    r.   c              	   C  s   | \} }t |}t| | tj|gt|  | jd}|| j|fD ]R}t| |red}t	j
t|d || | W d    n1 sCw   Y  t	j
t|d || | W d    n1 s_w   Y  q#|| |}|| |}t || q#d S Nr   -operator '.*' not implemented for bool dtypesmatch)tmget_op_from_namer$   r   r   lenr	   typer.   r    raisesNotImplementedErrorassert_extension_array_equal)r   all_arithmetic_operatorsscalaropscalar_arraymsgresultexpectedr   r   r   "test_array_scalar_like_equivalence2   s$   




rA   c           
      C  s   | \} }t |}t| | tj}tjtjgt|  | jd}| j	 }t
| |rPd}tjt|d || | W d    n1 sBw   Y  t || j d S || |}t || j || |}	t || j t ||	 d S r/   )r3   r4   r$   r   NAr   r5   r	   _maskcopyr.   r    r7   r8   assert_numpy_array_equalr9   )
r   r:   r&   r<   r;   r=   maskr>   r?   r@   r   r   r   test_array_NAG   s$   





rG   c           	      C  s   | \} }t |}t| | tj|gt|  | jjd}tj|| jd}t	| |rfd}t
jt|d || | W d    n1 sBw   Y  t
jt|d || | W d    d S 1 s_w   Y  d S || |}|| |}t || d S r/   )r3   r4   r$   npr   r5   r	   numpy_dtyper   r.   r    r7   r8   r9   )	r   r:   r;   r<   numpy_arraypd_arrayr>   r?   r@   r   r   r   test_numpy_array_equivalencec   s&   





rL   c                 C  s   | \} }t |}t| | td| i}t| |rWd}tjt|d ||| W d    n1 s3w   Y  tjt|d || | W d    d S 1 sPw   Y  d S |||}td|| |i}t 	|| d S )NAr0   r1   )
r3   r4   r$   r   	DataFramer.   r    r7   r8   assert_frame_equal)r   r:   r;   r<   dfr>   r?   r@   r   r   r   
test_frame|   s$   




rQ   c           
   	   C  s   | \} }t |}t| | t| }|tj|gt|  | jj	dtj|gt|  | jdtj|gt|  | jdg}|D ]9}t
| |rcd}tjt|d ||| W d    n1 s]w   Y  q=|||}t|| |}	t ||	 q=d S r/   )r3   r4   r$   r   SeriesrH   r   r5   r	   rI   r.   r    r7   r8   assert_series_equal)
r   r:   r;   r<   serothersotherr>   r?   r@   r   r   r   test_series   s(   




rW   c                 C  s   | \} }|}t | |}|td| i}|tu sJ d}tjt|d |tt	| 
dt	|  W d    d S 1 s>w   Y  d S )NrM   z(can only perform ops with 1-d structuresr1   )getattrr   rN   NotImplementedr    r7   r8   rH   aranger5   reshape)r   r:   r&   r<   opar?   r>   r   r   r   test_error_invalid_object   s   
 "r^   c              	   C  s   | \} }t |}|gt| d  }t}dddg}| jjdkr-|ddv r-t}d}n	t	| |r6d	}t
}|t|fD ]?}tj||d
 || | W d    n1 sVw   Y  t| }tj||d
 ||| W d    n1 sww   Y  q=d S )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 insteadr0   r1   )r3   r4   r5   
ValueErrorjoinr	   r+   r,   	TypeErrorr.   r8   rH   r   r    r7   r   rR   )r   r:   r;   r<   rV   errr>   sr   r   r   test_error_len_mismatch   s4   


rf   r<   )__neg____abs__
__invert__c                 C  s  | \} }t | }|dkrp| jjdkrpd}tjt|d t||  W d    n1 s-w   Y  tjt|d t| |  W d    n1 sJw   Y  tjt|d t| j|  W d    d S 1 siw   Y  d S t|| }|j	dd}d |d< t
|| d S )Nri   fz0ufunc 'invert' not supported for the input typesr1   T)deepr   )r   rR   r	   r+   r    r7   rc   rY   _datarD   r3   rS   )r   r<   r&   rT   r>   r?   r@   r   r   r   %test_unary_op_does_not_propagate_mask   s(   

rm   )"
__future__r   typingr   numpyrH   r    pandasr   pandas._testing_testingr3   ALL_INT_EA_DTYPESarraysr5   r   __annotations__FLOAT_EA_DTYPESr   fixturezipr   r$   r.   rA   rG   rL   rQ   rW   r^   rf   markparametrizerm   r   r   r   r   <module>   s2    

	$