
    2ЦiE                    
   % S SK Jr  S SKJr  S SKJr  S SKrS SKrS SKJ	r	  S SK
r
S SKJrJr  S SKrS SKJr  S SKJrJrJr  S S	KJr  S SKrS S
KJrJrJrJrJrJr  S SK J!r!J"r"J#r#  S SK$J%r%J&r&  S SK'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=  S SK>J?r?J@r@  S SKAJBrBJCrCJDrDJErE  S SKFJGrGJHrHJIrI  S SKJJKrK  S SKLJMrM  \(       a  S SKNJOrO  S SKPJQrQJRrR  / SQrSS\TS'   / SQrUS\TS'   \VSSSS/rWS\TS'   / S QrXS\TS!'   \S\W-   rY\U\X-   rZ/ \YQ\ZQr[S\TS"'   \\S#S$/r]S\TS%'   S&S'/r^S\TS('   / \]Q\^Qr_S\TS)'   \`S*S+/raS\TS,'   \" 5       (       a	  S-/rbS\TS.'   O
\cS/S-/rbS\TS.'   / \aQ\]QrdS\TS0'   S1S2/reS\TS3'   S4S5/rfS\TS6'   \gS7/rhS\TS8'   \iS9/rjS\TS:'   \kS;/rlS\TS<'   \]\Y-   rm\^\Z-   rn/ \mQ\nQroS\TS='   / \oQ\aQrpS\TS>'   \m\a-   \b-   \e-   \f-   \h-   \l-   \j-   rq\R                  \R                  \R                  \R                  \R                  \R                  \R                  \R                  /rz\c\V\\\`\{\|\}\~\\\g\i\\/rS?S@SA.\	   rS\GR
                  \GR                  \\" SB5      \GR                  \" SC5      /r\GR                  \GR                  4 V Vs/ s H  n SD  H  nU " SEU5      PM     M     snn r\(       Ga  S SKr\R                  " 5       \R                  " 5       \R                  " 5       \GR                  " 5       /r\R                  " 5       \R                  " 5       \R                  " 5       \GR                   " 5       /r\\-   r\ Vs/ s H  n\c" \" U5      5      PM     snr\R                  " 5       \GR(                  " 5       /r\ Vs/ s H  n\c" \" U5      5      PM     snr\GR.                  " SFSG5      /r\GR2                  " 5       /r\GR6                  " 5       /r\GR:                  " SH5      \GR:                  " SI5      \GR<                  " SJ5      \GR<                  " SK5      /r\GR@                  " 5       \GRB                  " 5       /rSL VVs/ s H  nSM  H  n\GRG                  XSN9PM     M     snnrSL Vs/ s H  n\GRK                  U5      PM     snr\GRN                  " 5       /r\\-   \-   \-   \-   \-   \-   \-   \-   \-   r\\-   rO/ r/ r/ r/ r\]\n-   \-   r/ SOQr/ SPQrSeSfSQ jjrSR r " SS ST\5      r " SU SV\5      rSgSW jrShSX jrSY rSiSZ jrS[ rS\ rS] rS^ rS_ rS` r/ SLQrSjSa jrSkSb jrSlSc jr/ SdQrgs  snn f s  snf s  snf s  snnf s  snf )m    )annotations)ThreadPoolExecutor)DecimalN)	byteorder)TYPE_CHECKINGContextManager)using_string_dtype)can_set_localeget_locales
set_locale)HAS_PYARROW)
ArrowDtype	DataFrameIndex
MultiIndex
RangeIndexSeries)round_trip_pathlibround_trip_picklewrite_to_compressed)assert_produces_warningmaybe_produces_warning)assert_almost_equalassert_attr_equalassert_categorical_equalassert_class_equalassert_contains_allassert_copyassert_datetime_array_equalassert_dict_equalassert_equalassert_extension_array_equalassert_frame_equalassert_index_equal!assert_indexing_slices_equivalentassert_interval_array_equalassert_is_sortedassert_metadata_equivalentassert_numpy_array_equalassert_period_array_equalassert_series_equalassert_sp_array_equalassert_timedelta_array_equalraise_assert_detail)	get_dtypeget_obj)decompress_fileraises_chained_assignment_errorset_timezonewith_csv_dialect)ArrowExtensionArrayBaseMaskedArrayNumpyExtensionArray)NDArrayBackedExtensionArray)extract_array)Callable)DtypeNpDtype)uint8uint16uint32uint64zlist[NpDtype]UNSIGNED_INT_NUMPY_DTYPES)UInt8UInt16UInt32UInt64zlist[Dtype]UNSIGNED_INT_EA_DTYPESint8int16int32int64SIGNED_INT_NUMPY_DTYPES)Int8Int16Int32Int64SIGNED_INT_EA_DTYPESALL_INT_DTYPESfloat32float64FLOAT_NUMPY_DTYPESFloat32Float64FLOAT_EA_DTYPESALL_FLOAT_DTYPES	complex64
complex128COMPLEX_DTYPESUSTRING_DTYPESstrCOMPLEX_FLOAT_DTYPESzdatetime64[ns]zM8[ns]DATETIME64_DTYPESztimedelta64[ns]zm8[ns]TIMEDELTA64_DTYPESboolBOOL_DTYPESbytesBYTES_DTYPESobjectOBJECT_DTYPESALL_REAL_DTYPESALL_NUMERIC_DTYPES<>)littlebignanNaN)YMWDhmsmsusnspsfsasNaT      rv   rw   rx   ry   )rv   rw   rx   ry   )NUTCz
US/Pacificz
US/Eastern)unittz)__add____radd____sub____rsub____mul____rmul____floordiv____rfloordiv____truediv____rtruediv____pow____rpow____mod____rmod__)__eq____ne____le____lt____ge____gt__c                   U[         R                  L aX  [        U [        5      (       a+  [	        [
        R                  " U R                  5      5      n U $ [         R                  " U SS9n  U $ U[        L a  [        U SS9n U $ U[        L a  [        U 5      n U $ U[        L aG  [        U 5      R                  5       n U(       a%  U R                  n [         R                  " U /S-  SS9n U $ U[
        R                  L d  U[
        R                  L a  [
        R                  " U 5      n U $ U[        L a  [        U 5      n U $ [!        U5      e)z
Helper function to wrap the expected output of a test in a given box_class.

Parameters
----------
expected : np.ndarray, Index, Series
box_cls : {Index, Series, DataFrame}

Returns
-------
subclass of box_cls
F)copy   T)ignore_index)pdarray
isinstancer   r7   npasarray_valuesr   r   r   to_frameTconcatndarrayto_arrayNotImplementedError)expectedbox_cls	transposes      W/var/www/html/ai-image-ml/venv/lib/python3.13/site-packages/pandas/_testing/__init__.pybox_expectedr     s,    "((h
++*2::h6F6F+GHH, O) xxu5H( O' 
E	.$ O# 
F	(#  O 
I	(#,,.
  zzHyy(adCH O 
BJJ	'RXX"588H%
 O	 
H	H% O "'**    c                b    [        U SS5      nUc  [        R                  " U 5      $ [        U SS9$ )zI
Similar to pd.array, but does not cast numpy dtypes to nullable dtypes.
dtypeNT)extract_numpy)getattrr   r   r9   )objr   s     r   r   r   ;  s2    
 C$'E}zz#D11r   c                  <    \ rS rSrSS/r\S 5       r\S 5       rSrg)SubclassedSeriesiH  testattrnamec                    S $ )Nc                     [        U 0 UD6$ Nr   argskwargss     r   <lambda>/SubclassedSeries._constructor.<locals>.<lambda>R      '7'H'Hr    selfs    r   _constructorSubclassedSeries._constructorK  s     IHr   c                    S $ )Nc                     [        U 0 UD6$ r   SubclassedDataFramer   s     r   r   9SubclassedSeries._constructor_expanddim.<locals>.<lambda>V      ':D'KF'Kr   r   r   s    r   _constructor_expanddim'SubclassedSeries._constructor_expanddimT      KKr   r   N)	__name__
__module____qualname____firstlineno__	_metadatapropertyr   r   __static_attributes__r   r   r   r   r   H  s6    V$II I L Lr   r   c                  :    \ rS rSrS/r\S 5       r\S 5       rSrg)r   iY  r   c                    S $ )Nc                     [        U 0 UD6$ r   r   r   s     r   r   2SubclassedDataFrame._constructor.<locals>.<lambda>^  r   r   r   r   s    r   r    SubclassedDataFrame._constructor\  r   r   c                    S $ )Nc                     [        U 0 UD6$ r   r   r   s     r   r   9SubclassedDataFrame._constructor_sliced.<locals>.<lambda>c  r   r   r   r   s    r   _constructor_sliced'SubclassedDataFrame._constructor_sliceda  s    HHr   r   N)	r   r   r   r   r   r   r   r   r   r   r   r   r   r   Y  s3    IL L I Ir   r   c                J    [         R                  nUR                  U 5      U-   $ )a+  
Convert list of CSV rows to single CSV-formatted string for current OS.

This method is used for creating expected value of to_csv() method.

Parameters
----------
rows_list : List[str]
    Each element represents the row of csv.

Returns
-------
str
    Expected output of to_csv() in current OS.
)oslinesepjoin)	rows_listseps     r   convert_rows_list_to_csv_strr   f  s!      **C88I$$r   c                *    SSK nUR                  U SS9$ )z
Helper function to mark pytest.raises that have an external error message.

Parameters
----------
expected_exception : Exception
    Expected error to raise.

Returns
-------
Callable
    Regular `pytest.raises` function with `match` equal to `None`.
r   N)match)pytestraises)expected_exceptionr   s     r   external_error_raisedr   z  s     ==+4=88r   c                F    / nU H  u  p4UR                  XU45        M     U$ )a~  
Combine frame, functions from com._cython_table
keys and expected result.

Parameters
----------
ndframe : DataFrame or Series
func_names_and_expected : Sequence of two items
    The first item is a name of an NDFrame method ('sum', 'prod') etc.
    The second item is the expected return value.

Returns
-------
list
    List of three items (DataFrame, function, expected result)
)append)ndframefunc_names_and_expectedresults	func_namer   s        r   get_cython_table_paramsr     s,    " G6	H56  7Nr   c                   ^ U R                  S5      n [        [        U5      nU$ ! [         a    [        [        USS 5      mU4S jn U$ f = f)z
The operator function for a given op name.

Parameters
----------
op_name : str
    The op name, in form of "add" or "__add__".

Returns
-------
function
    A function performing the operation.
_   Nc                   > T" X5      $ r   r   )xyrops     r   r   "get_op_from_name.<locals>.<lambda>  s	    #a)r   )stripr   operatorAttributeError)op_nameshort_opnameopr   s      @r   get_op_from_namer    sY     ==%L$X|, I  $hQR 01#I$s   & #AAc                    U $ r   r   r   s    r   getitemr        Hr   c                    U $ r   r   r  s    r   setitemr    r  r   c                    U R                   $ r   )locr  s    r   r	  r	        55Lr   c                    U R                   $ r   )ilocr  s    r   r  r    s    66Mr   c                    U R                   $ r   )atr  s    r   r  r    s    44Kr   c                    U R                   $ r   )iatr  s    r   r  r    r
  r   c                b    [         R                  U 5      [         R                  U5      :  a  U $ U$ )z*
Find the higher of two datetime64 units.
)_UNITSindex)leftrights     r   get_finest_unitr    s(     ||DV\\%00Lr   c                   [        U [        R                  5      (       a5  [        U[        R                  5      (       a  [        R                  " X5      $ [        U [        R                  5      (       a  [        X5      $ [        U [        5      (       a  g[        U [
        5      (       a  [        U R                  U5      $ [        U [        [        45      (       aQ  [        U[        [        45      (       a   [        U R                  UR                  5      $ [        U R                  U5      $ [        U [        5      (       a  [        U R                  U5      $ [        U [        R                  R                  R                  5      (       a  [        U R                   U5      $ [        U [        R                  R                  R"                  5      (       a3  [        U R$                  U5      =(       d    [        U R&                  U5      $ [        U [(        5      (       a  [        U[(        5      (       au  U R*                  nUR*                  nUR-                  S5      R/                  5       S   nUR-                  S5      R/                  5       S   nUR0                  UR0                  :H  $ [        R                  " X5      $ [        U [2        5      (       ar  [        U[2        5      (       a]  [        R                  " U R4                  UR4                  5      =(       d+    [        R                  " U R6                  UR6                  5      $ [        U [8        5      (       aQ  [;        U R<                  R>                  5      S:X  a.  U R<                  R>                  S   R@                  n[        Xa5      $ [C        [E        U 5      [E        U5      5      e)z%
Pandas-compat for np.shares_memory.
Fr   r   )#r   r   r   shares_memoryr   r   _codesr   r   r   r8   _ndarrayr   corearraysSparseArray	sp_valuesIntervalArray_left_rightr5   	_pa_arraychunkbuffersaddressr6   _data_maskr   len_mgrblocksvaluesr   type)r  r  left_pa_dataright_pa_data	left_buf1
right_buf1arrs          r   r  r    s    $

##
5"**(E(E,,	D"**	%	%U))$
##$
##T[[%00$((eeV_-- u}}==T\\511$344T]]E22$2233T^^U33$4455TZZ/T=e3TT$+,,e011>>L!OOM$**1-557:I&,,Q/779!<J$$
(:(::: ##D00$((Z-O-O 

EKK8 
B<L<LJJ=
 	
 $	""s499+;+;'<'Aiiq!((S((
d4j$u+
66r   c           	     v   [        US9 nUc  / nO[        U5      nU(       a'  [        R                  " U5      nUR	                  U5         / n[        U5       H%  nUR	                  UR                  " U /UQ76 5        M'     [        W5      U:  a  U(       a  WR                  5         U H  n
U
R                  5         M     S S S 5        g ! [         a'  nSS Kn	U	R                  SU SU< S35         S nANtS nAff = f! [        W5      U:  a  U(       a  WR                  5         f f f = f! , (       d  f       g = f)N)max_workersr   z	Spawning z threads failed with error z@ (likely due to resource limits on the system running the tests))r   list	threadingBarrierr   rangesubmitRuntimeErrorr   skipr(  abortresult)closurer3  	argumentspass_barriertpebarrierfuturesr   er   fs              r   run_multithreadedrE    s   		4IYI''4GW%	 G;'szz'>I>? ( 7|k)lAHHJ 3 
5	4  	KKK= ) ,, 	 7|k)l /;)/ 
5	4sB   A D*6C	?D*	
C:C50C=5C::C==*D''D**
D8)JALL_INT_EA_DTYPESALL_INT_NUMPY_DTYPESALL_NUMPY_DTYPESALL_REAL_NUMPY_DTYPESrc   re   r[   r`   ENDIANrW   rT   NARROW_NP_DTYPESNP_NAT_OBJECTSNULL_OBJECTSrg   rP   rK   r]   ra   rF   rA   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   r1   r   r   r/   r  r   r0   r  r  r  r  r	  r   r.   r2   r   r   rE  r   r3   r  r  r   r4   r   )T)r   rb   )r   z	list[str]returnr^   )r   ztype[Exception]rN  r   )r   r^   rN  r:   )r  r^   r  r^   rN  r^   )rN  rb   )NF)
__future__r   concurrent.futuresr   decimalr   r   r   sysr   r5  typingr   r   numpyr   pandas._configr	   pandas._config.localizationr
   r   r   pandas.compatr   pandasr   r   r   r   r   r   r   pandas._testing._ior   r   r   pandas._testing._warningsr   r   pandas._testing.assertersr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   r,   r-   r.   pandas._testing.compatr/   r0   pandas._testing.contextsr1   r2   r3   r4   pandas.core.arraysr5   r6   r7   pandas.core.arrays._mixinsr8   pandas.core.constructionr9   collections.abcr:   pandas._typingr;   r<   rA   __annotations__rF   intrK   rP   rG  rF  rQ   floatrT   rW   rX   complexr[   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rI  ALL_REAL_EXTENSION_DTYPESrh   ri   rH  float16rR   rG   rH   rI   r=   r>   r?   rK  r4  tupler7  dictset	frozenset	bytearray
memoryviewPYTHON_DATA_TYPESrJ  rn   r}   NArM  
datetime64timedelta64rL  pyarrowpar@   UNSIGNED_INT_PYARROW_DTYPESrJ   SIGNED_INT_PYARROW_DTYPESALL_INT_PYARROW_DTYPESALL_INT_PYARROW_DTYPES_STR_REPRrS   FLOAT_PYARROW_DTYPESFLOAT_PYARROW_DTYPES_STR_REPR
decimal128DECIMAL_PYARROW_DTYPESstringSTRING_PYARROW_DTYPESbinaryBINARY_PYARROW_DTYPEStime32time64TIME_PYARROW_DTYPESdate32date64DATE_PYARROW_DTYPES	timestampDATETIME_PYARROW_DTYPESdurationTIMEDELTA_PYARROW_DTYPESbool_BOOL_PYARROW_DTYPESALL_PYARROW_DTYPES ALL_REAL_PYARROW_DTYPES_STR_REPRALL_REAL_NULLABLE_DTYPESarithmetic_dunder_methodscomparison_dunder_methodsr   r   r   r   r   r   r   r  r  r  r	  r  r  r  r  r  r  rE  __all__)clsr   typr   s   0000r   <module>r     sF   " 1   	  
  -  &   
     0  
 C 2( ,S = R&M  M*-vw)Q  Q$G k G03JJ *-AA I 4I7HI I%*Iy$A M A )95 5 G"4 G G + G&\B B"%M;&"%uc!2M;2$Jn$J7I$J k J"2H!= ; =#4h"? K ? &>[ )"G,k ,$h/{ /*-AA +.?? S!6S9RS S"EO"En"E K E   	
     JJJJGGHHHHHHIIII	  				 " 	$Y	/bffbffeElBEE75>J r~~.. t .( #%88:ryy{BIIK"U!#BHHJ
BHHJ O8;TT(>'(>JsO(>'# JJL"**,7(<%(<JsO(<%! !mmAq12YY[MYY[M 			#
		$
		$
		$	 99;		4 ,+D;B 	$&; 	'+
 ?VV>UdD 1>UV88:,
 	
	
 	!  	   		 
 	 	 "	" #	# 		  	(*GG % %'!&(#')$ 225UU  " Y &R
2Lv L"
I) 
I%(9&.: 
!27j<Kg4'%
  Ws   UUU$UU%