
    Mha                       S SK Jr  S SKrS SKJrJrJrJr  S SKr	S SK
Jr  S SKJr  S SKJr  S SKJs  Jr  S SKJ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 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+J,r,J-r-J.r.J/r/J0r0  S SK1J2r2J3r3J4r4J5r5J6r6  S SK7J8r8  S SK9J:r:  S SK;J<r<  S SK=J>r>  \(       a  S SK?J@r@     S2       S3S jjrAS4S jrBS5S6S jjrC        S7                     S8S jjrD S9     S:S jjrES;S<S jjrFS4S jrGS4S jrH   S=       S>S jjrI S?     S@S jjrJSASBS jjrK SC     SDS jjrL SE     SDS  jjrM SF SGS! jjrN      SH       SIS# jjrOSS\R                  \R                  \R                  S$4           SJS% jjrQSSSS\R                  S"SSSS\R                  \R                  S&4SS"S'.                               SKS( jjjrRSSSSSS"\R                  S"SS"SS\R                  \R                  S)4                               SLS* jjrSS4S+ jrTS4S, jrUS4S- jrVS4S. jrW      SMS/ jrXSNS0 jrY SO     SPS1 jjrZg)Q    )annotationsN)TYPE_CHECKINGLiteralNoReturncast)lib)is_matching_na)SparseIndex)compare_mismatched_resolutions)is_boolis_float_dtypeis_integer_dtype	is_numberis_numeric_dtypeneeds_i8_conversion)CategoricalDtypeDatetimeTZDtypeExtensionDtypeNumpyEADtype)array_equivalent)Categorical	DataFrameDatetimeIndexIndexIntervalDtypeIntervalIndex
MultiIndexPeriodIndex
RangeIndexSeriesTimedeltaIndex)DatetimeArrayExtensionArrayIntervalArrayPeriodArrayTimedeltaArray)DatetimeLikeArrayMixin)StringDtype)safe_sort_index)pprint_thing)DtypeObjequivc                f   [        U [        5      (       a  [        U U4SUUUS.UD6  g[        U [        5      (       a  [	        U U4SUUUS.UD6  g[        U [
        5      (       a  [        U U4SUUUS.UD6  gU(       a  [        U 5      (       a  [        U5      (       a  On[        U 5      (       a  [        U5      (       a  OM[        U [        R                  5      (       d  [        U[        R                  5      (       a  SnOSn[        XUS9  [        R                  " X4[        U5      X4S.UD6  g)	aV  
Check that the left and right objects are approximately equal.

By approximately equal, we refer to objects that are numbers or that
contain numbers which may be equivalent to specific levels of precision.

Parameters
----------
left : object
right : object
check_dtype : bool or {'equiv'}, default 'equiv'
    Check dtype if both a and b are the same type. If 'equiv' is passed in,
    then `RangeIndex` and `Index` with int64 dtype are also considered
    equivalent when doing type checking.
rtol : float, default 1e-5
    Relative tolerance.
atol : float, default 1e-8
    Absolute tolerance.
F)check_exactexactrtolatol)r.   check_dtyper0   r1   numpy arrayInputobj)r2   r0   r1   N)
isinstancer   assert_index_equalr    assert_series_equalr   assert_frame_equalr   r   npndarrayassert_class_equal_testingassert_almost_equalbool)leftrightr2   r0   r1   kwargsr6   s          K/var/www/html/env/lib/python3.13/site-packages/pandas/_testing/asserters.pyr?   r?   B   s>   6 $	
 	
 	
 
D&	!	!	
 #	
 	
 
D)	$	$	
 #	
 	
 9U#3#375>>dBJJ//:eRZZ3P3P'C!C"4C8 	$$	
%)+%6T	
PV	
    c           	         UR                   n[        X5      (       d  [        U SU S[        U 5       S35      e[        X5      (       d  [        U SU S[        U5       S35      eg)az  
Helper method for our assert_* methods that ensures that
the two objects being compared have the right type before
proceeding with the comparison.

Parameters
----------
left : The first object being compared.
right : The second object being compared.
cls : The class type to check against.

Raises
------
AssertionError : Either `left` or `right` is not an instance of `cls`.
z Expected type z, found z insteadN)__name__r7   AssertionErrortype)rA   rB   clscls_names       rD   _check_isinstancerL      sx      ||Hd  juHT$ZLI
 	
 e!!juHT%[MJ
 	
 "rE   Tc                N    [        X[        5        [        R                  " XUS9  g )N)compare_keys)rL   dictr>   assert_dict_equal)rA   rB   rN   s      rD   rP   rP      s    d4(tFrE   c
                  ^^ Sn
SSUU4S jjjn[        X[        5        U" XU	S9  U R                  UR                  :w  a3  U	 S3nU R                   SU  3nUR                   SU 3n[        XX5        [	        U 5      [	        U5      :w  a1  U	 S3n[	        U 5       SU  3n[	        U5       SU 3n[        XX5        U(       d  [        U 5      n [        U5      n[        U [        5      (       a  [        [        U5      n[        U R                  5       H}  nSU S3n [        U R                  U   UR                  U   TUUTUUUS	9	  [        U R                  U   UR                  U   5        U" U R                  U   UR                  U   U	S9  M     GOU(       a  T(       a  U R!                  U5      (       d  U R"                  UR"                  :g  n[        U[$        R&                  5      (       d  [        S
U5      R)                  S5      n[$        R*                  " UR-                  [.        5      5      S-  [	        U 5      -  nU	 S[$        R0                  " US5       S3n[        U	UX5        O:[3        T5      n[4        R6                  " U R8                  UR8                  UUUU	U US9  U(       a  [;        SXU	S9  [        U [<        5      (       d  [        U[<        5      (       a  [;        SXU	S9  [        U [>        5      (       d  [        U[>        5      (       a   [A        U R"                  UR"                  5        T(       ab  [        U RB                  [D        5      (       d  [        URB                  [D        5      (       a#  [G        U R"                  UR"                  U	 S3S9  ggg! [         a7    U R                  U5      nUR                  U5      n[        UUTUUTUUUS	9	   GNwf = f)a  
Check that left and right Index are equal.

Parameters
----------
left : Index
right : Index
exact : bool or {'equiv'}, default 'equiv'
    Whether to check the Index class, dtype and inferred_type
    are identical. If 'equiv', then RangeIndex can be substituted for
    Index with an int64 dtype as well.
check_names : bool, default True
    Whether to check the names attribute.
check_exact : bool, default True
    Whether to compare number exactly.
check_categorical : bool, default True
    Whether to compare internal Categorical exactly.
check_order : bool, default True
    Whether to compare the order of index entries as well as their values.
    If True, both indexes must contain the same elements, in the same order.
    If False, both indexes must contain the same elements, but in any order.
rtol : float, default 1e-5
    Relative tolerance. Only used when check_exact is False.
atol : float, default 1e-8
    Absolute tolerance. Only used when check_exact is False.
obj : str, default 'Index'
    Specify object name being compared, internally used to show appropriate
    assertion message.

Examples
--------
>>> from pandas import testing as tm
>>> a = pd.Index([1, 2, 3])
>>> b = pd.Index([1, 2, 3])
>>> tm.assert_index_equal(a, b)
Tc                8  > T(       d  g [        XTUS9  [        SXUS9  [        U R                  [        5      (       aQ  [        UR                  [        5      (       a2  T(       a*  [        SXUS9  [        U R                  UR                  TS9  g [        SXUS9  g )N)r/   r6   inferred_typer5   dtype)r/   )r=   assert_attr_equalr7   rT   r   r8   
categories)rA   rB   r6   check_categoricalr/   s      rD   _check_types(assert_index_equal.<locals>._check_types   s    4e=/4C@ djj"233
KK)9
 9
 !!'4C@"4??E4D4DER'4C8rE   r5   z levels are different, z length are differentzMultiIndex level [])r/   check_namesr.   rW   r0   r1   r6   r#         Y@ values are different (    %))r0   r1   r2   r6   lobjrobjnamesrT   	 categoryN)r   r6   strreturnNone)$rL   r   nlevelsraise_assert_detaillenr)   r7   r   r   ranger8   levelsassert_numpy_array_equalcodesrH   get_level_valuesequals_valuesr;   r<   fillnasumastypeintroundr@   r>   r?   valuesrU   r   r   assert_interval_array_equalrT   r   assert_categorical_equal)rA   rB   r/   r\   r.   rW   check_orderr0   r1   r6   __tracebackhide__rX   msg1msg2msg3levelra   llevelrlevelmismatchdiffmsg
exact_bools     `  `                 rD   r8   r8      s   ` 9 9& d5) #& ||u}}$+,,,r$(--5'*Ct2 4yCJ+,d)Btf%e*Rw'Ct2 t$& $
##Z'4<<(E'wa0D"KK&LL' + +&7
 )E):EKK<NO" U+U\\%-@cJA )F 
*{{5!!||u}}4Hh

33 0(;BB4H66(//#./%7#d)CDE0$1B0C3GCS$6 %[
$$KKLL"		
 '4C8$$$
5+(F(F'4C8$&&*UM*J*J#DLL%--@djj"233zKK)8
 8
 %T\\5==YFWX8
 g " ..u5//6" + +&7
	s   AN&&=O'&O'c                    SnS nSS jn[        U 5      [        U5      :X  a  gUS:X  a  U" U 5      (       a  U" U5      (       a  gU S3n[        X7U" U 5      U" U5      5        g)z
Checks classes are equal.
Tc                Z    [        U [        5      (       a  U $ [        U 5      R                  $ N)r7   r   rI   rG   )xs    rD   
repr_class&assert_class_equal.<locals>.repr_classh  s$    aHAwrE   c                R    [        U 5      [        L =(       d    [        U [        5      $ )zClasses that are a RangeIndex (sub-)instance or exactly an `Index` .

This only checks class equivalence. There is a separate check that the
dtype is int64.
)rI   r   r7   r   )idxs    rD   is_class_equiv*assert_class_equal.<locals>.is_class_equivo  s     CyE!@ZZ%@@rE   Nr,   z classes are different)r   r   rg   r@   )rI   rj   )rA   rB   r/   r6   r|   r   r   r   s           rD   r=   r=   `  sm      A DzT%[ $N5$9$9E'
(C*T"2Ju4EFrE   c                b   Sn[        X5      n[        X 5      nXVL d  [        XV5      (       a  g XV:H  nU[        R                  L U[        R                  L -  (       a  SnO%[        U[        5      (       d  UR                  5       nU(       d  SU  S3n[        X8XV5        g! [         a    Sn Nzf = f)a#  
Check attributes are equal. Both objects must have attribute.

Parameters
----------
attr : str
    Attribute name being compared.
left : object
right : object
obj : str, default 'Attributes'
    Specify object name being compared, internally used to show appropriate
    assertion message
TNFzAttribute "z" are different)	getattrr	   	TypeErrorpdNAr7   r@   allrj   )	attrrA   rB   r6   r|   	left_attr
right_attrresultr   s	            rD   rU   rU     s     #I%J."G"G( 	RUUzRUU23%%D61Ci<  s   B B.-B.c                   SSK Jn  SSKJn  [	        U [
        [        R                  45      (       aw  [	        U [
        5      (       a  U R                  n U R                  5        HA  nS[        [        U5      R                  5       3n[	        X2[        45      (       a  M<   U5       e   g S[        [        U 5      R                  5       3n[	        X[        [        45      (       d   U5       eg )Nr   )Artist)AxeszBone of 'objs' is not a matplotlib Axes instance, type encountered zoobjs is neither an ndarray of Artist instances nor a single ArtistArtist instance, tuple, or dict, 'objs' is a )matplotlib.artistr   matplotlib.axesr   r7   r    r;   r<   rr   ravelreprrI   rG   rO   tuple)objsr   r   elr   s        rD   "assert_is_valid_plot_return_objectr     s    ($$,--dF##<<D**,B$$(b):):$;#<>  b,//44/ BDJ''()+ 	
 $ 566;;6rE   c                2   [        U [        [        45      (       a  U R                  n [        U [        R
                  5      (       a5  [        U [        R                  " [        R                  " U 5      5      5        g[        X U R                  5          5        g)z#Assert that the sequence is sorted.N)r7   r   r    rx   r;   r<   rn   sortarrayassert_extension_array_equalargsort)seqs    rD   assert_is_sortedr     s[    #v''jj#rzz"" bggbhhsm&<=$Sckkm*<=rE   c                   [        X[        5        [        U R                  [        5      (       d  [        UR                  [        5      (       a  SnOSnU(       aF  [        U R                  UR                  U S3US9  [        U R                  UR                  X$ S3S9  O U R                  R                  5       nUR                  R                  5       n[        XgU S3US9  [        U R                  R                  U R                  5      UR                  R                  UR                  5      U S3US9  [        SXUS	9  g
! [         a    U R                  UR                  pv Nf = f)a=  
Test that Categoricals are equivalent.

Parameters
----------
left : Categorical
right : Categorical
check_dtype : bool, default True
    Check that integer dtype of the codes are the same.
check_category_order : bool, default True
    Whether the order of the categories should be compared, which
    implies identical integer codes.  If False, only the resulting
    values are compared.  The ordered attribute is
    checked regardless.
obj : str, default 'Categorical'
    Specify object name being compared, internally used to show appropriate
    assertion message.
r,   Tz.categories)r6   r/   z.codesr2   r6   z.valuesorderedr5   N)rL   r   r7   rV   r   r8   rn   ro   sort_valuesr   takerU   )rA   rB   r2   check_category_orderr6   r/   lcrcs           rD   rz   rz     s<   2 d;/ $//:..**3 3  OOU--cU+3Fe	
 	!JJE.	
	7,,.B!!--/B 	2#k':%HOO  ,!!%++.%w		
 i#6  	7__e&6&6	7s   "4E !E)(E)c                (   [        X[        5        0 nU R                  R                  R                  S;   a  SUS'   [        U R                  UR                  4SU S30UD6  [        U R                  UR                  4SU S30UD6  [        SXUS9  g)	a  
Test that two IntervalArrays are equivalent.

Parameters
----------
left, right : IntervalArray
    The IntervalArrays to compare.
exact : bool or {'equiv'}, default 'equiv'
    Whether to check the Index class, dtype and inferred_type
    are identical. If 'equiv', then RangeIndex can be substituted for
    Index with an int64 dtype as well.
obj : str, default 'IntervalArray'
    Specify object name being compared, internally used to show appropriate
    assertion message
mMF
check_freqr6   z.leftclosedr5   N)rL   r$   _leftrT   kindassert_equal_rightrU   )rA   rB   r/   r6   rC   s        rD   ry   ry     s    $ d=1Fzz$$|U[[FUmFvFellH3%uHHh5rE   c                ~    [        X[        5        [        U R                  UR                  U S3S9  [	        SXUS9  g )N	._ndarrayr5   rT   )rL   r%   rn   _ndarrayrU   )rA   rB   r6   s      rD   assert_period_array_equalr   &  s3    d;/T]]ENN3%y@QRgt4rE   c                    Sn[        X[        5        [        U R                  UR                  U S3S9  U(       a  [	        SXUS9  [	        SXUS9  g )NTr   r5   freqtz)rL   r"   rn   r   rU   rA   rB   r6   r   r|   s        rD   assert_datetime_array_equalr   -  sJ     d=1T]]ENN3%y@QR&$37dDS1rE   c                    Sn[        X[        5        [        U R                  UR                  U S3S9  U(       a  [	        SXUS9  g g )NTr   r5   r   )rL   r&   rn   r   rU   r   s        rD   assert_timedelta_array_equalr   9  sC     d>2T]]ENN3%y@QR&$37 rE   c                z   SnU  SU 3n[        U[        5      (       a  [        R                  " U5      n[        U[        R                  5      (       a  US[        U5       3-  n[        U[        R                  5      (       a  [        U5      nO+[        U[        [        [        45      (       a  [        U5      n[        U[        R                  5      (       a  [        U5      nO+[        U[        [        [        45      (       a  [        U5      nUSU SU 3-  nUb  USU 3-  nUb  USU 3-  n[        U5      e)NTz are different

z

[index]: z

[left]:  z

[right]: z	
[diff]: 
)r7   r   r;   asarrayr<   r*   r   r   r(   r   rH   )	r6   messagerA   rB   r   
first_diffindex_valuesr|   r   s	            rD   rj   rj   C  s5    e 	C ,&&zz,/,

++\,7899$

##D!	D+\;G	H	HDz%$$U#	E,lKH	I	IU 

 

 C D6""J<  

rE   Fc                  ^^^ Sn[        XTS9  [        X[        R                  5        S n	U	" U 5      n
U	" U5      nUS:X  a'  XLa"  [	        [        U
5       S[        U5       35      eO,US:X  a&  XL a"  [	        [        U
5       S[        U5       35      eSUUU4S jjn[        XTS	9(       d	  U" XU5        U(       aL  [        U [        R                  5      (       a,  [        U[        R                  5      (       a  [        S
XTS9  gggg)a  
Check that 'np.ndarray' is equivalent.

Parameters
----------
left, right : numpy.ndarray or iterable
    The two arrays to be compared.
strict_nan : bool, default False
    If True, consider NaN and None to be different.
check_dtype : bool, default True
    Check dtype if both a and b are np.ndarray.
err_msg : str, default None
    If provided, used as assertion message.
check_same : None|'copy'|'same', default None
    Ensure left and right refer/do not refer to the same memory area.
obj : str, default 'numpy array'
    Specify object name being compared, internally used to show appropriate
    assertion message.
index_values : Index | numpy.ndarray, default None
    optional index (shared by both left and right), used in output.
Tr5   c                :    [        U SS 5      b  U R                  $ U $ )Nbase)r   r   r5   s    rD   	_get_base+assert_numpy_array_equal.<locals>._get_base  s    "35AsxxJsJrE   samez is not copyz is c                l  > Uc  U R                   UR                   :w  a%  [        TT S3U R                   UR                   5        Sn[        X5       H  u  pE[        XET	S9(       a  M  US-  nM     US-  U R                  -  nT S[
        R                  " US5       S3n[        TX`UTS	9  [        U5      e)
Nz shapes are differentr   
strict_nan   r]   r^   r_   r`   )r   )shaperj   zipr   sizer;   rw   rH   )
rA   rB   err_msgr   left_arr	right_arrr   r   r6   r   s
          rD   _raise(assert_numpy_array_equal.<locals>._raise  s    ?zzU[[(#C5 56

EKK D'*4'7#'
SSAID (8
 %<$))+DE0$1B0C3GCSLQW%%rE   r   rT   Nrg   r   )	r=   rL   r;   r<   rH   r   r   r7   rU   )rA   rB   r   r2   r   
check_samer6   r   r|   r   	left_base
right_baser   s     `   ``     rD   rn   rn   i  s   >  t,d2::.K $I5!JV& DO#4HT*=M<N!OPP '	v	" DO#4Dj9I8J!KLL& &( DJ?tG$dBJJ''Jubjj,I,Igt< -J' rE   r#   c           
        U[         R                  L a  U[         R                  L a  U[         R                  L at  [        U R                  5      =(       a    [	        U R                  5      (       + =(       d6    [        UR                  5      =(       a    [	        UR                  5      (       + nOU[         R                  L a  SnU[         R                  La  UOSnU[         R                  La  UOSn[        U [        5      (       d   S5       e[        U[        5      (       d   S5       eU(       a  [        SXSU 3S9  [        U [        5      (       Ga  [        U[        5      (       Ga  [        U5      [        U 5      :X  Ga  U(       GdE  U R                  R                  S	;   Ga*  [        U R                  [        R                  5      (       d%  [        [        U R                  5      R                  nO#[        R                  " U R                  5      S
   n[        UR                  [        R                  5      (       d%  [        [        UR                  5      R                  n	O#[        R                  " UR                  5      S
   n	X:w  aC  [!        U R"                  UR"                  [$        R&                  5      R)                  5       (       a  g[+        [        R,                  " U R.                  5      [        R,                  " UR.                  5      UUS9  g[        R,                  " U R1                  5       5      n
[        R,                  " UR1                  5       5      n[+        XU S3US9  X
)    R3                  [4        S9nX)    R3                  [4        S9nU(       a  [+        XXsS9  g[6        R8                  " UU[;        U5      UUUUS9  g)a  
Check that left and right ExtensionArrays are equal.

Parameters
----------
left, right : ExtensionArray
    The two arrays to compare.
check_dtype : bool, default True
    Whether to check if the ExtensionArray dtypes are identical.
index_values : Index | numpy.ndarray, default None
    Optional index (shared by both left and right), used in output.
check_exact : bool, default False
    Whether to compare number exactly.

    .. versionchanged:: 2.2.0

        Defaults to True for integer dtypes if none of
        ``check_exact``, ``rtol`` and ``atol`` are specified.
rtol : float, default 1e-5
    Relative tolerance. Only used when check_exact is False.
atol : float, default 1e-8
    Absolute tolerance. Only used when check_exact is False.
obj : str, default 'ExtensionArray'
    Specify object name being compared, internally used to show appropriate
    assertion message.

    .. versionadded:: 2.0.0

Notes
-----
Missing values are checked separately from valid values.
A mask of missing values is computed for each and checked to match.
The remaining all-valid values are cast to object dtype and checked.

Examples
--------
>>> from pandas import testing as tm
>>> a = pd.Series([1, 2, 3, 4])
>>> b, c = a.array, a.array
>>> tm.assert_extension_array_equal(b, c)
Fh㈵>:0yE>zleft is not an ExtensionArrayzright is not an ExtensionArrayrT   Attributes of r5   r   r   N)r   r6   z NA mask)r6   r   )rT   )r2   r0   r1   r6   r   )r   
no_defaultr   rT   r   r7   r#   rU   r'   rI   r   r;   r   r   unitdatetime_datar   r   operatoreqr   rn   r   asi8isnato_numpyobjectr>   r?   r@   )rA   rB   r2   r   r.   r0   r1   r6   l_unitr_unitleft_naright_na
left_validright_valids                 rD   r   r     s   h 	s~~%CNN"CNN" TZZ( /"4::..0, 0"5;;//	 	 
	&s~~-46Ds~~-46DdN++L-LL+e^,,N.NN,'4nSE4JK 	4/00u455K4:% tzz$6djj"((33otzz:??))$**5a8ekk28844ou{{;@@))%++6q9 2MM5>>8;;#%  	!JJtyy!JJuzz"%		
 	jj%Gzz%**,'H#h/l h((v(6J	"++&+9K 	
 	$$[)%	
rE   r    )check_index
check_likec               >   SnU[         R                  L a  SOUnU[         R                  L a  U[         R                  L a  U[         R                  L at  [        U R                  5      =(       a    [	        U R                  5      (       + =(       d6    [        UR                  5      =(       a    [	        UR                  5      (       + nOU[         R                  L a  SnU[         R                  La  UOSnU[         R                  La  UOSnU(       d  U(       a  [        S5      e[        X[        5        U(       a
  [        XUS9  [        U 5      [        U5      :w  aB  [        U 5       SU R                   3n[        U5       SUR                   3n[        USUU5        U(       aL  U R                  UR                  :X  d2   [        U R                  5       S	[        UR                  5       35       eU(       a.  [        U R                  UR                  UUUUU(       + UUU S
3S9
  U(       a  U R                  U5      n U
(       at  [!        U R                  ["        [$        45      (       aO  U R                  nUR                  nUR&                  UR&                  :X  d   UR&                  UR&                  45       eU(       aT  [!        U R                  [(        5      (       a'  [!        UR                  [(        5      (       a  U(       d  O[+        SXSU 3S9  U(       a  U R,                  nUR,                  n[!        U[.        5      (       a7  [!        U[.        5      (       a"  [1        UUUU R                  [3        U5      S9  GOUUnn[!        U[.        5      (       a  UR5                  5       n[!        U[.        5      (       a  UR5                  5       n[7        UUU[3        U5      U R                  S9  GO3U(       a  [9        U R                  5      (       d  [9        UR                  5      (       af  [;        U R,                  5      R=                  [;        UR,                  5      5      (       d(  SU R,                   SUR,                   S3n[?        U5      eGO[!        U R                  [@        5      (       aA  [!        UR                  [@        5      (       a"  [C        U RD                  URD                  5        GO2[!        U R                  [(        5      (       d  [!        UR                  [(        5      (       aL  [F        RH                  " U R,                  UR,                  UU[K        U5      [3        U5      U R                  S9  GO[!        U R                  [L        5      (       aW  [!        UR                  [L        5      (       a8  [1        U R,                  UR,                  UUUU R                  [3        U5      S9  GO2[O        U R                  UR                  5      (       d%  [O        UR                  U R                  5      (       a5  [1        U R,                  UR,                  UU R                  [3        U5      S9  O[9        U R                  5      (       aO  [9        UR                  5      (       a5  [1        U R,                  UR,                  UU R                  [3        U5      S9  OJ[F        RH                  " U R,                  UR,                  UU[K        U5      [3        U5      U R                  S9  U(       a  [+        SXUS9  U(       ac  [!        U R                  [(        5      (       d  [!        UR                  [(        5      (       a$  [Q        U R,                  UR,                  U S3U	S9  ggg)a  
Check that left and right Series are equal.

Parameters
----------
left : Series
right : Series
check_dtype : bool, default True
    Whether to check the Series dtype is identical.
check_index_type : bool or {'equiv'}, default 'equiv'
    Whether to check the Index class, dtype and inferred_type
    are identical.
check_series_type : bool, default True
     Whether to check the Series class is identical.
check_names : bool, default True
    Whether to check the Series and Index names attribute.
check_exact : bool, default False
    Whether to compare number exactly.

    .. versionchanged:: 2.2.0

        Defaults to True for integer dtypes if none of
        ``check_exact``, ``rtol`` and ``atol`` are specified.
check_datetimelike_compat : bool, default False
    Compare datetime-like which is comparable ignoring dtype.
check_categorical : bool, default True
    Whether to compare internal Categorical exactly.
check_category_order : bool, default True
    Whether to compare category order of internal Categoricals.
check_freq : bool, default True
    Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
check_flags : bool, default True
    Whether to check the `flags` attribute.
rtol : float, default 1e-5
    Relative tolerance. Only used when check_exact is False.
atol : float, default 1e-8
    Absolute tolerance. Only used when check_exact is False.
obj : str, default 'Series'
    Specify object name being compared, internally used to show appropriate
    assertion message.
check_index : bool, default True
    Whether to check index equivalence. If False, then compare only values.

    .. versionadded:: 1.3.0
check_like : bool, default False
    If True, ignore the order of the index. Must be False if check_index is False.
    Note: same labels must be with the same data.

    .. versionadded:: 1.5.0

Examples
--------
>>> from pandas import testing as tm
>>> a = pd.Series([1, 2, 3, 4])
>>> b = pd.Series([1, 2, 3, 4])
>>> tm.assert_series_equal(a, b)
TFr   r   z0check_like must be False if check_index is Falser5   rZ   zSeries length are different != .indexr/   r\   r.   rW   r{   r0   r1   r6   rT   r   )r2   r   r6   )r2   r6   r   z[datetimelike_compat=True] z is not equal to .)r0   r1   r2   r6   r   )r0   r1   r2   r   r6   namerd   )r6   r   N))r   r   r   rT   r   
ValueErrorrL   r    r=   rk   indexrj   flagsr   r8   reindex_liker7   r   r!   r   r   rU   rr   r#   r   rf   r   rn   r   r   rq   rH   r   ry   r   r>   r?   r@   r   0is_extension_array_dtype_and_needs_i8_conversionrz   )rA   rB   r2   check_index_typecheck_series_typer\   r.   check_datetimelike_compatrW   r   r   check_flagsr0   r1   r6   r   r   r|   check_exact_indexr}   r~   lidxridxleft_valuesright_valueslvrvr   s                               rD   r9   r9   ;  s   Z !,!>Ks~~%CNN"CNN" TZZ( /"4::..0, 0"5;;//	 	 
	&s~~-46Ds~~-46D:KLL d6*4C0 4yCJd)Btzzl+e*R}-C!>dKzzU[[(VT$**-=,>d4CTBU*VV(JJKK"#)/&%v	
   'jm^-LMMzz{{yyDII%=		499'==%
 tzz#3445;;(899%gt.8NOll}}k>22z.8
 8
 )'!ZZH !,B+~66 ))+,77!**,$'H!ZZ 
#DJJ''+>u{{+K+K T\\"))%*>??-dll^ <##(==/4  !%% @ 
DJJ	.	.:]4 4 	$DJJ<	DJJ 0	1	1Z%6 6 	$$LLMM[)C	
 
DJJ	/	/J^5 5 	%LLMM#C	
 
:

EKK
 
	9%++tzz	R	R$LLMM#C	
 
TZZ	(	(-@-M-M$LLMM#C	
 	$$LLMM[)C	
 &$37djj"233zKK)8
 8
 %e9%%9	8
 rE   r   c                   SnU[         R                  La  UOSnU[         R                  La  UOSnU[         R                  La  UOSn[        X[        5        U(       a  [	        U [        U5      5      (       d   eU R                  UR                  :w  a9  [        UU S3[        U R                  5       [        UR                  5       5        U(       aL  U R                  UR                  :X  d2   [        U R                  5       S[        UR                  5       35       e[        U R                  UR                  UUUU
U(       + UUU S3S9
  [        U R                  UR                  UUUU
U(       + UUU S	3S9
  U(       a  U R                  U5      n U(       a  UR                  5       nU R                  5       n[        [!        [        UR#                  5       5      [        UR#                  5       5      -   5      5       H%  nUU;   d   eUU;   d   e[%        UU   UU   UUS
9  M'     g['        U R                  5       HE  u  nnU R)                  USS9nUR)                  USS9n[+        UUUUUUU	U
UU SU SU S3UUSSS9  MG     g)ak  
Check that left and right DataFrame are equal.

This function is intended to compare two DataFrames and output any
differences. It is mostly intended for use in unit tests.
Additional parameters allow varying the strictness of the
equality checks performed.

Parameters
----------
left : DataFrame
    First DataFrame to compare.
right : DataFrame
    Second DataFrame to compare.
check_dtype : bool, default True
    Whether to check the DataFrame dtype is identical.
check_index_type : bool or {'equiv'}, default 'equiv'
    Whether to check the Index class, dtype and inferred_type
    are identical.
check_column_type : bool or {'equiv'}, default 'equiv'
    Whether to check the columns class, dtype and inferred_type
    are identical. Is passed as the ``exact`` argument of
    :func:`assert_index_equal`.
check_frame_type : bool, default True
    Whether to check the DataFrame class is identical.
check_names : bool, default True
    Whether to check that the `names` attribute for both the `index`
    and `column` attributes of the DataFrame is identical.
by_blocks : bool, default False
    Specify how to compare internal data. If False, compare by columns.
    If True, compare by blocks.
check_exact : bool, default False
    Whether to compare number exactly.

    .. versionchanged:: 2.2.0

        Defaults to True for integer dtypes if none of
        ``check_exact``, ``rtol`` and ``atol`` are specified.
check_datetimelike_compat : bool, default False
    Compare datetime-like which is comparable ignoring dtype.
check_categorical : bool, default True
    Whether to compare internal Categorical exactly.
check_like : bool, default False
    If True, ignore the order of index & columns.
    Note: index labels must match their respective rows
    (same as in columns) - same labels must be with the same data.
check_freq : bool, default True
    Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex.
check_flags : bool, default True
    Whether to check the `flags` attribute.
rtol : float, default 1e-5
    Relative tolerance. Only used when check_exact is False.
atol : float, default 1e-8
    Absolute tolerance. Only used when check_exact is False.
obj : str, default 'DataFrame'
    Specify object name being compared, internally used to show appropriate
    assertion message.

See Also
--------
assert_series_equal : Equivalent method for asserting Series equality.
DataFrame.equals : Check DataFrame equality.

Examples
--------
This example shows comparing two DataFrames that are equal
but with columns of differing dtypes.

>>> from pandas.testing import assert_frame_equal
>>> df1 = pd.DataFrame({'a': [1, 2], 'b': [3, 4]})
>>> df2 = pd.DataFrame({'a': [1, 2], 'b': [3.0, 4.0]})

df1 equals itself.

>>> assert_frame_equal(df1, df1)

df1 differs from df2 as column 'b' is of a different type.

>>> assert_frame_equal(df1, df2)
Traceback (most recent call last):
...
AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="b") are different

Attribute "dtype" are different
[left]:  int64
[right]: float64

Ignore differing dtypes in columns with check_dtype.

>>> assert_frame_equal(df1, df2, check_dtype=False)
Tr   r   Fz shape mismatchr   r   r   z.columnsr   r   )axisz	.iloc[:, z] (column name="z"))r2   r  r.   r\   r  rW   r   r6   r0   r1   r   r  N)r   r   rL   r   r7   rI   r   rj   r   r  r8   r  columnsr  _to_dict_of_blockslistsetkeysr:   	enumerate_ixsr9   )rA   rB   r2   r  check_column_typecheck_frame_typer\   	by_blocksr.   r  rW   r   r   r  r0   r1   r6   r|   _rtol_atol_check_exactrblockslblocksrT   icollcolrcols                               rD   r:   r:   F  s{   \ .DFE.DFE"-S^^"C;L d9-$U,,,, zzU[[ C5(T$**-=,>DDUCV	
 zzU[[(VT$**-=,>d4CTBU*VV( 

 +"Ne6N  +"Ne8   ' **,))+#d7<<>2T',,.5IIJKEG###G###KS L  -FAs 99QQ9'D::aa:(D  '!1''*C"3%e9QC'7uB?!! .rE   c                   Sn[        U [        5      (       a`  [        X40 UD6  [        U [        [        45      (       a8  U R
                  UR
                  :X  d   U R
                  UR
                  45       egg[        U [        5      (       a  [        X40 UD6  g[        U [        5      (       a  [        X40 UD6  g[        U [        5      (       a  [        X40 UD6  g[        U [        5      (       a  [        X40 UD6  g[        U [        5      (       a  [        X40 UD6  g[        U [         5      (       a  [#        X40 UD6  g[        U [$        5      (       a  ['        X40 UD6  g[        U [(        R*                  5      (       a  [-        X40 UD6  g[        U [.        5      (       a  U0 :X  d   eX:X  d   egU0 :X  d   e[1        X5        g)a#  
Wrapper for tm.assert_*_equal to dispatch to the appropriate test function.

Parameters
----------
left, right : Index, Series, DataFrame, ExtensionArray, or np.ndarray
    The two items to be compared.
**kwargs
    All keyword arguments are passed through to the underlying assert method.
TN)r7   r   r8   r   r!   r   r    r9   r   r:   r$   ry   r%   r   r"   r   r&   r   r#   r   r;   r<   rn   rf   r?   )rA   rB   rC   r|   s       rD   r   r     sn    $41&1d]N;<<99

*CTYY

,CC* =	D&	!	!D262	D)	$	$41&1	D-	(	(#D:6:	D+	&	&!$88	D-	(	(#D:6:	D.	)	)$T;F;	D.	)	)$T;F;	D"**	%	% 77	D#		||}}||D(rE   c                
   [        X[        R                  R                  5        [	        U R
                  UR
                  5        [        U R                  [        5      (       d   e[        UR                  [        5      (       d   eU R                  nUR                  nUR                  U5      (       d  [        SSX#5        O [        SX5        [        SX5        [	        U R                  5       UR                  5       5        g)zt
Check that the left and right SparseArray are equal.

Parameters
----------
left : SparseArray
right : SparseArray
zSparseArray.indexzindex are not equal
fill_valuerT   N)rL   r   arraysSparseArrayrn   	sp_valuesr7   sp_indexr
   rq   rj   rU   to_dense)rA   rB   
left_indexright_indexs       rD   assert_sp_array_equalr/  :  s     d299#8#89T^^U__= dmm[1111ennk2222J..K[))!6
	

 	lD0gt+T]]_enn.>?rE   c                F    U  H  nX!;   a  M
   S[        U5       35       e   g )NzDid not contain item: )r   )iterabledicks      rD   assert_contains_allr4  [  s'    x;1$q';;x rE   c           	         [        X5       HI  u  p4[        X440 UD6  S[        [        U5      5       S[        [        U5      5       S3nX4La  MD   U5       e   g)z
iter1, iter2: iterables that produce elements
comparable with assert_almost_equal

Checks that the elements are equal, but not
the same object. (Does not check that items
in sequences are also not the same object)
zExpected object z and object z8 to be different objects, but they were the same object.N)r   r?   r   rI   )iter1iter2
eql_kwargselem1elem2r   s         rD   assert_copyr;  `  sh     E)E7J7tDK01d4;>O=P Q@ @ 	 !&3&! *rE   c                F    [        U [        5      =(       a    [        U5      $ )z
Checks that we have the combination of an ExtensionArraydtype and
a dtype that should be converted to int64

Returns
-------
bool

Related to issue #37609
)r7   r   r   )
left_dtyperight_dtypes     rD   r  r  r  s     j.1V6I+6VVrE   c                    U R                   U   n[        U R                  U   U5        [        U R                  5      (       d  [        X   U5        gg)zS
Check that ser.iloc[i_slc] matches ser.loc[l_slc] and, if applicable,
ser[l_slc].
N)ilocr9   locr   r  )serl_slci_slcexpecteds       rD   !assert_indexing_slices_equivalentrF    sC    
 xxH1CII&&CJ1 'rE   c                z    U R                    H+  n[        XS5      nUc  Ub   eM  U[        XS5      :X  a  M+   e   g)z2
Check that ._metadata attributes are equivalent.
N)	_metadatar   )rA   rB   r   vals       rD   assert_metadata_equivalentrJ    sB     d$'=;;'%t4444 rE   )r,   r   r   )r2   bool | Literal['equiv']r0   floatr1   rL  rg   rh   )rg   rh   )T)rN   r@   rg   rh   )r,   TTTTr   r   r   )rA   r   rB   r   r/   
bool | strr\   r@   r.   r@   rW   r@   r{   r@   r0   rL  r1   rL  r6   rf   rg   rh   )Tr4   )r/   rM  r6   rf   rg   rh   )
Attributes)r   rf   r6   rf   rg   rh   )TTr   )r2   r@   r   r@   r6   rf   rg   rh   )r,   r$   )r/   rK  r6   rf   rg   rh   )r%   re   )r"   T)r6   rf   r   r@   rg   rh   )r&   T)NNNr   )FTNNr3   N)r   r@   r2   rK  r6   rf   rg   rh   )r2   rK  r.   bool | lib.NoDefaultr0   float | lib.NoDefaultr1   rP  r6   rf   rg   rh   ) r2   rK  r  rK  r  r@   r\   r@   r.   rO  r  r@   rW   r@   r   r@   r   r@   r  r@   r0   rP  r1   rP  r6   rf   r   r@   r   r@   rg   rh   ) r2   rK  r  rK  r  rK  r  r@   r\   r@   r  r@   r.   rO  r  r@   rW   r@   r   r@   r   r@   r  r@   r0   rP  r1   rP  r6   rf   rg   rh   )r=  r+   r>  r+   rg   r@   )rB  r    rC  slicerD  rQ  rg   rh   r   )rA   zDataFrame | SeriesrB   zDataFrame | Series | Nonerg   rh   )[
__future__r   r   typingr   r   r   r   numpyr;   pandas._libsr   pandas._libs.missingr	   pandas._libs.sparser
   pandas._libs.testing_libstestingr>   pandas._libs.tslibs.np_datetimer   pandas.core.dtypes.commonr   r   r   r   r   r   pandas.core.dtypes.dtypesr   r   r   r   pandas.core.dtypes.missingr   pandasr   r   r   r   r   r   r   r   r   r   r    r!   pandas.core.arraysr"   r#   r$   r%   r&   pandas.core.arrays.datetimeliker'   pandas.core.arrays.string_r(   pandas.core.indexes.apir)   pandas.io.formats.printingr*   pandas._typingr+   r?   rL   rP   r8   r=   rU   r   r   rz   ry   r   r   r   rj   rn   r   r   r9   r:   r   r/  r4  r;  r  rF  rJ   rE   rD   <module>rg     sY   "     / + ' ' J   8      C 2 3 3' ,3O
 )O
 	O

 O
 
O
d
8G  "hY
hYhY hY 	hY
 hY hY hY hY hY 
hY 
hYX 7>G"G03G	GD$N<,> !%:7 :7 	:7
 
:7 
:7| GV6/6@C6	6>5 AE	2	29=	2		2 BF88:>8	8 IM##R +/M= M= )	M= 
M= 
M=f ,0(+"%.."%..~
 )~

 &~
  ~
  ~
 
~
 
~
J ,007"(+&+"!%"%.."%..G" %G )G .	G
 G G &G  $G G G G G  G  G 
G" #G$ %G& 
'G\ ,00718!(+&+""%.."%..#H )H .	H
 /H H H H &H  $H H H H H  H   !H" 
#H$ 
%HV&)R@B<
'$WW'/W	W 2 BF5
5%>5	5rE   