Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/pandas/_testing/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/pandas/_testing/__pycache__/asserters.cpython-312.pyc

�

Mٜga����ddlmZddlZddlmZmZmZmZddlZ	ddl
mZddlm
Z
ddlmZddlmcmZddlmZddlmZmZmZmZmZmZdd	lmZmZm Z m!Z!dd
l"m#Z#ddl$Z%ddl$m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4m5Z5m6Z6dd
l7m8Z8ddl9m:Z:ddl;m<Z<ddl=m>Z>erddl?m@Z@			d2							d3d�ZAd4d�ZBd5d6d�ZC								d7																					d8d�ZD	d9					d:d�ZEd;d<d�ZFd4d�ZGd4d�ZH			d=							d>d�ZI	d?					d@d�ZJdAdBd�ZK	dC					dDd�ZL	dE					dDd �ZM	dF	dGd!�ZN						dH							dId#�ZOddej�ej�ej�d$f											dJd%�ZQddddej�d"ddddej�ej�d&f
dd"d'�																															dKd(�ZRdddddd"ej�d"dd"ddej�ej�d)f																															dLd*�ZSd4d+�ZTd4d,�ZUd4d-�ZVd4d.�ZW						dMd/�ZXdNd0�ZY	dO					dPd1�ZZy)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��t|t�rt||fd|||d�|��yt|t�rt	||fd|||d�|��yt|t
�rt
||fd|||d�|��y|rut|�rt|�rn^t|�rt|�rnGt|tj�st|tj�rd}nd}t|||��tj||ft|�||d�|��y)	a�
    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_dtyper0r1�numpy array�Input��obj)r2r0r1N)�
isinstancer�assert_index_equalr �assert_series_equalr�assert_frame_equalrr�np�ndarray�assert_class_equal�_testing�assert_almost_equal�bool)�left�rightr2r0r1�kwargsr6s       �D/usr/local/lib/python3.12/site-packages/pandas/_testing/asserters.pyr?r?Bs,��6�$������	
�����
	
��	
�
�D�&�	!����	
��#���
	
��	
�
�D�)�	$����	
��#���
	
��	
�����9�U�#3�����7�5�>���d�B�J�J�/�:�e�R�Z�Z�3P�'�C�!�C�"�4��C�8�	�$�$��%�	
�%)�+�%6�T��	
�PV�	
�c	��|j}t||�st|�d|�dt|��d���t||�st|�d|�dt|��d���y)a�
    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)rArB�cls�cls_names    rD�_check_isinstancerL�sv�� �|�|�H��d�C� ���j���u�H�T�$�Z�L��I�
�	
��e�S�!���j���u�H�T�%�[�M��J�
�	
�"rETc�V�t||t�tj|||��y)N)�compare_keys)rL�dictr>�assert_dict_equal)rArBrNs   rDrPrP�s ���d�E�4�(����t�U��FrEc

�t���d}
dd��fd�
}t||t�||||	��|j|jk7r5|	�d�}|j�d|��}
|j�d|��}t|	||
|�t	|�t	|�k7r3|	�d�}t	|��d|��}
t	|��d|��}t|	||
|�|st|�}t|�}t
|t�r�tt|�}t|j�D]�}d|�d�}	t|j||j|�||�|||�	�	t|j||j|�||j||j||	�����n|rÉr�|j!|�s�|j"|j"k7}t
|t$j&�std
|�j)d�}t%j*|j-t.��dzt	|�z}|	�dt%j0|d
��d�}t|	|||�n<t3��}t5j6|j8|j8||||	||��|rt;d|||	��t
|t<�st
|t<�rt;d|||	��t
|t>�st
|t>�r tA|j"|j"��r[t
|jBtD�st
|jBtD�r&tG|j"|j"|	�d���yyy#t$r:|j|�}|j|�}t||�||�|||�	�	Y��JwxYw)ak
    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�6���syt||�|��td|||��t|jt�rNt|jt�r4�r1td|||��t|j|j���ytd|||��y)N)r/r6�
inferred_typer5�dtype)r/)r=�assert_attr_equalr7rTrr8�
categories)rArBr6�check_categoricalr/s   ��rD�_check_typesz(assert_index_equal.<locals>._check_types�s�������4��e��=��/�4��C�@��d�j�j�"2�3�
��K�K�)�9
�!�!�'�4��C�@�"�4�?�?�E�4D�4D�E�R���'�4��C�8rEr5z levels are different�, z length are differentzMultiIndex level [�])r/�check_namesr.rWr0r1r6r#�Y@� values are different (�� %))r0r1r2r6�lobj�robj�namesrT�	 categoryN)r�r6�str�return�None)$rLr�nlevels�raise_assert_detail�lenr)r7rr�ranger8�levels�assert_numpy_array_equal�codesrH�get_level_values�equals�_valuesr;r<�fillna�sum�astype�int�roundr@r>r?�valuesrUrr�assert_interval_array_equalrTr�assert_categorical_equal)rArBr/r[r.rW�check_orderr0r1r6�__tracebackhide__rX�msg1�msg2�msg3�levelr`�llevel�rlevel�mismatch�diff�msg�
exact_bools  `  `                 rDr8r8�sw���`��9�&�d�E�5�)���u�#�&��|�|�u�}�}�$���+�,���,�,��r�$��(���-�-���5�'�*���C��t�T�2��4�y�C��J����+�,���d�)��B�t�f�%���e�*��R��w�'���C��t�T�2���t�$����&���$�
�#��Z��'���4�<�<�(�E�'��w�a�0�D�
�"��K�K��&��L�L��'�� +� +�&7����
�)����E�):�E�K�K��<N�O�"
����U�+�U�\�\�%�-@�c�J�A)�F
�*��{�{�5�!��|�|�u�}�}�4�H��h��
�
�3�� 0�(�;�B�B�4�H���6�6�(�/�/�#�.�/�%�7�#�d�)�C�D��E�0����$��1B�0C�3�G�C���S�$��6��%�[�
��$�$��K�K��L�L���"����		
���'�4��C�8��$��$�
�5�+�(F��'�4��C�8��$�
�&�*�U�M�*J�#�D�L�L�%�-�-�@���d�j�j�"2�3�z��K�K�)�8
�
%�T�\�\�5�=�=���Y�FW�X�8
���g"�
��.�.�u�5���/�/��6��"���� +� +�&7����
�
�	
�s�AM4�4?N7�6N7c��d}d�}dd�}t|�t|�k(ry|dk(r||�r	||�ry|�d�}t||||�||��y)z#
    Checks classes are equal.
    Tc�P�t|t�r|St|�jS�N)r7rrIrG)�xs rD�
repr_classz&assert_class_equal.<locals>.repr_classhs!���a����H��A�w���rEc�H�t|�tuxst|t�S)z�Classes 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.
        )rIrr7r)�idxs rD�is_class_equivz*assert_class_equal.<locals>.is_class_equivos���C�y�E�!�@�Z��Z�%@�@rENr,z classes are different)r�rrfr@)rIri)rArBr/r6r{r�r�r�s        rDr=r=`si���� �A��D�z�T�%�[� ������$��N�5�$9��
�E�'�
(�C���S�*�T�"2�J�u�4E�FrEc�D�d}t||�}t||�}||ust||�ry	||k(}|tju|tjuzrd}n t|t�s|j�}|sd|�d�}t||||�y#t$rd}Y�lwxYw)aO
    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
    TNFzAttribute "z" are different)	�getattrr	�	TypeError�pd�NAr7r@�allri)	�attrrArBr6r{�	left_attr�
right_attr�resultr�s	         rDrUrU�s�������d�#�I����%�J��J��.��J�"G����j�(��	�R�U�U��z�R�U�U�2�3���
���
%��������D�6��1���C��i��<��������s�B�B�Bc��ddlm}ddlm}t	|t
tjf�rlt	|t
�r|j}|j�D]<}dtt|�j���}t	||tf�r�7J|��ydtt|�j���}t	||ttf�sJ|��y)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�r7r r;r<rq�ravel�reprrIrGrO�tuple)�objsr�r��elr�s     rD�"assert_is_valid_plot_return_objectr��s���(�$��$�����,�-��d�F�#��<�<�D��*�*�,�B�$�$(��b��):�):�$;�#<�>�
��b�4��,�/�4��4�/��
B��D��J�'�'�(�)�
+�	�
�$���� 5�6�;��;�6rEc��t|ttf�r|j}t|tj
�r3t
|t	jt	j|���yt|||j��y)z#Assert that the sequence is sorted.N)r7rr rwr;r<rm�sort�array�assert_extension_array_equal�argsort)�seqs rD�assert_is_sortedr��sW���#��v��'��j�j���#�r�z�z�"� ��b�g�g�b�h�h�s�m�&<�=�$�S�#�c�k�k�m�*<�=rEc���t||t�t|jt�st|jt�rd}nd}|rMt|j|j|�d�|��t
|j|j||�d���n�	|jj�}|jj�}t|||�d�|��t|jj|j�|jj|j�|�d�|��td|||�	�y
#t$r|j|j}}Y��wxYw)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)r6r/z.codes�r2r6z.values�orderedr5N)rLrr7rVrr8rmrn�sort_valuesr��takerU)rArBr2�check_category_orderr6r/�lc�rcs        rDryry�s>��2�d�E�;�/��$�/�/�:�.�*�
���*�3��������O�O�U�-�-�c�U�+�3F�e�	
�	!��J�J�����S�E��.�	
�	7����,�,�.�B��!�!�-�-�/�B�	�2�r�#��k�':�%�H���O�O� � ����,����!�!�%�+�+�.��%�w���		
��i��u�#�6���	7��_�_�e�&6�&6��B�	7�s�4E	�	!E-�,E-c�.�t||t�i}|jjjdvrd|d<t|j|jfd|�d�i|��t|j|jfd|�d�i|��td|||��y)	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_freqr6z.left�closedr5N)rLr$�_leftrT�kind�assert_equal�_rightrU)rArBr/r6rCs     rDrxrxs���$�d�E�=�1�
�F��z�z������$�$��|������U�[�[�F���U�m�F�v�F�����e�l�l�H�3�%�u�
�H��H��h��e��5rEc��t||t�t|j|j|�d���t	d|||��y)N�	._ndarrayr5rT)rLr%rm�_ndarrayrU)rArBr6s   rD�assert_period_array_equalr�&s7���d�E�;�/��T�]�]�E�N�N�3�%�y�@Q�R��g�t�U��4rEc��d}t||t�t|j|j|�d���|rt	d|||��t	d|||��y)NTr�r5�freq�tz)rLr"rmr�rU�rArBr6r�r{s     rD�assert_datetime_array_equalr�-sP�����d�E�=�1��T�]�]�E�N�N�3�%�y�@Q�R���&�$��3�7��d�D�%�S�1rEc��d}t||t�t|j|j|�d���|rt	d|||��yy)NTr�r5r�)rLr&rmr�rUr�s     rD�assert_timedelta_array_equalr�9sG�����d�E�>�2��T�]�]�E�N�N�3�%�y�@Q�R���&�$��3�7�rEc�8�d}|�d|��}t|t�rtj|�}t|tj�r|dt|���z
}t|tj�rt|�}n&t|tttf�rt|�}t|tj�rt|�}n&t|tttf�rt|�}|d|�d|��z
}|�|d|��z
}|�|d|��z
}t|��)NTz are different

z

[index]: z

[left]:  z

[right]: z	
[diff]: �
)r7rr;�asarrayr<r*rrr(r�rH)	r6�messagerArBr��
first_diff�index_valuesr{r�s	         rDririCs#�����e���	�
�C��,��&��z�z�,�/���,��
�
�+���\�,�7�8�9�9���$��
�
�#��D�!��	�D�+�\�;�G�	H��D�z���%����$��U�#��	�E�,�l�K�H�	I��U����
�
��
�
����C�����D�6�"�"������J�<� � ��
��
�rEFc�����d}t||���t||tj�d�}	|	|�}
|	|�}|dk(r&|
|urMt	t|
��dt|�����|dk(r&|
|ur"t	t|
��dt|�����d���fd�}t
||��	�s
||||�|rFt|tj�r+t|tj�rtd
||���yyyy)
a3
    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.
    Tr5c�8�t|dd��|jS|S)N�base)r�r�r5s rD�	_get_basez+assert_numpy_array_equal.<locals>._get_base�s��"�3���5�A�s�x�x�J�s�JrE�samez is not �copyz is c�j��|��|j|jk7r%t���d�|j|j�d}t||�D]\}}t||�	��r�|dz
}�|dz|jz}��dtj|d��d�}t�|||��	�t|��)
Nz shapes are differentr��
strict_nan�r\r]r^r_)r�)�shaperi�zipr�sizer;rvrH)
rArB�err_msgr��left_arr�	right_arrr�r�r6r�s
       ���rD�_raisez(assert_numpy_array_equal.<locals>._raise�s�����?��z�z�U�[�[�(�#��C�5� 5�6��
�
�E�K�K���D�'*�4��'7�#��)�'��)�
�S��A�I�D�(8�
�%�<�$�)�)�+�D��E�0����$��1B�0C�3�G�C���S�$��L�Q��W�%�%rEr�rTN�rfr)	r=rLr;r<rHr�rr7rU)
rArBr�r2r��
check_samer6r�r{r��	left_base�
right_baser�s
  `   ``     rDrmrmis����>���t�U��,��d�E�2�:�:�.�K��$��I��5�!�J��V���J�&� �D��O�#4�H�T�*�=M�<N�!O�P�P�	�v�	��
�"� �D��O�#4�D��j�9I�8J�!K�L�L�&�(�D�%�J�?��t�U�G�$���d�B�J�J�'�J�u�b�j�j�,I��g�t�U��<�-J�'�rEr#c	�&�|tjur�|tjuro|tjur]t|j�xrt	|j�xs-t|j�xrt	|j�}n|tjurd}|tjur|nd}|tjur|nd}t|t�sJd��t|t�sJd��|rtd||d|����t|t��r�t|t��r�t|�t|�k(�r|�s2|jjd	v�rt|jtj�s%tt|j�j}n"tj|j�d
}t|jtj�s%tt|j�j}	n"tj|j�d
}	||	k7r>t!|j"|j"t$j&�j)�ryt+tj,|j.�tj,|j.�||��ytj,|j1��}
tj,|j1��}t+|
||�d
�|��||
j3t4��}||j3t4��}
|rt+||
||��yt7j8||
t;|�||||��y)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)
    F��h㈵��>�:�0�yE>zleft is not an ExtensionArrayzright is not an ExtensionArrayrT�Attributes of r5r�rN)r�r6z NA mask)r6r�)rT)r2r0r1r6r�)r�
no_defaultrrTr
r7r#rUr'rIr�r;rr�unit�
datetime_datarr��operator�eqr�rmr��asi8�isna�to_numpy�objectr>r?r@)rArBr2r�r.r0r1r6�l_unit�r_unit�left_na�right_na�
left_valid�right_valids              rDr�r��s���h	�s�~�~�%��C�N�N�"��C�N�N�"�
�T�Z�Z�(�
/�"�4�:�:�.�.�
0�����,�0�"�5�;�;�/�/�		�
����	&����s�~�~�-�4�6�D��s�~�~�-�4�6�D��d�N�+�L�-L�L�+��e�^�,�N�.N�N�,���'�4��n�S�E�4J�K�	�4�/�0��u�4�5���K�4��:�%��t�z�z���$�6��d�j�j�"�(�(�3��o�t�z�z�:�?�?���)�)�$�*�*�5�a�8���e�k�k�2�8�8�4��o�u�{�{�;�@�@���)�)�%�+�+�6�q�9���&� �2��M�M�5�>�>�8�;�;���#�%���	!��J�J�t�y�y�!��J�J�u�z�z�"�%��		
�	��j�j�����%�G��z�z�%�*�*�,�'�H����#��h�/�l���w�h��(�(�v�(�6�J���	�"�+�+�&�+�9�K�� ����<�	
�	�$�$����[�)����%�	
rEr )�check_index�
check_likec
��
�d}|tjurdn|}|tjur�|tjuro|
tjur]t|j�xrt	|j�xs-t|j�xrt	|j�}n|tjurd}|tjur|nd}|
tjur|
nd}
|s
|rtd��t
||t�|rt|||��t|�t|�k7rBt|��d|j��}t|��d|j��}t|d||�|rK|j|jk(s2Jt|j��d	t|j�����|r-t|j|j|||||||
|�d
���
|r|j|�}|
rnt!|jt"t$f�rN|j}|j}|j&|j&k(sJ|j&|j&f��|rIt!|jt(�rt!|jt(�r|snt+d||d
|����|r�|j,}|j,}t!|t.�r5t!|t.�r%t1||||jt3|����nb||}}t!|t.�r|j5�}t!|t.�r|j5�}t7|||t3|�|j���n�|r�t9|j�st9|j�r`t;|j,�j=t;|j,���s�d|j,�d|j,�d�}t?|��t!|jt@�r<t!|jt@�r"tC|jD|jD��nt!|jt(�st!|jt(�rNtGjH|j,|j,||
tK|�t3|�|j���n�t!|jtL�rUt!|jtL�r;t1|j,|j,||
||jt3|����n&tO|j|j�s tO|j|j�r8t1|j,|j,||jt3|���n�t9|j�rMt9|j�r8t1|j,|j,||jt3|���nLtGjH|j,|j,||
tK|�t3|�|j��|rt+d|||��|r\t!|jt(�st!|jt(�r'tQ|j,|j,|�d�|	��yyy)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 Falser5rYzSeries length are different� != �.index�r/r[r.rWrzr0r1r6rTr�)r2r�r6)r2r6r�zatetimelike_compat=True] z is not equal to �.)r0r1r2r6r�)r0r1r2r�r6�namerc)r6r�N))rr�rrTr
�
ValueErrorrLr r=rj�indexri�flagsr�r8�reindex_liker7rr!r�rrUrqr#r�rer�rmrrrprHrrxr�r>r?r@r�0is_extension_array_dtype_and_needs_i8_conversionry)rArBr2�check_index_type�check_series_typer[r.�check_datetimelike_compatrWr�r��check_flagsr0r1r6r�r�r{�check_exact_indexr|r}�lidx�ridx�left_values�right_values�lv�rvr�s                            rDr9r9;s~��Z��!,����!>��K���s�~�~�%��C�N�N�"��C�N�N�"�
�T�Z�Z�(�
/�"�4�:�:�.�.�
0�����,�0�"�5�;�;�/�/�		�
����	&����s�~�~�-�4�6�D��s�~�~�-�4�6�D��:��K�L�L��d�E�6�*���4��C�0��4�y�C��J���d�)��B�t�z�z�l�+���e�*��R����}�-���C�!>��d�K���z�z�U�[�[�(�V�T�$�*�*�-=�,>�d�4����CT�BU�*V�V�(����J�J��K�K�"�#�)�/�&�����%�v��	
��� � ��'���j����m�^�-L�M��z�z���{�{���y�y�D�I�I�%�=��	�	�4�9�9�'=�=�%��

�t�z�z�#3�4��5�;�;�(8�9�%���g�t�U�.���8N�O���l�l���}�}���k�>�2�z��.�8
�
)���'�!�Z�Z���H�
�!�,��B��+�~�6� �)�)�+���,��7�!�*�*�,��$���'���H�!�Z�Z�
�
#��D�J�J�'�+>�u�{�{�+K��T�\�\�"�)�)�%��
�
�*>�?�-�d�l�l�^�<#�#(�=�=�/��4�
�!��%�%�	�D�J�J�
�	.�:�
���]�4�	$�D�J�J����<�	�D�J�J� 0�	1�Z�
���%�6�	�$�$��L�L��M�M����[�)��C�����	
�
�D�J�J��	/�J�
���^�5�	%��L�L��M�M���#�����C��	
�
:��
�
�E�K�K�
�	9�%�+�+�t�z�z�	R�$��L�L��M�M�#�����C��	
�
�T�Z�Z�	(�-@����-M�$��L�L��M�M�#�����C��	
�	�$�$��L�L��M�M����[�)��C�����	
���&�$��3�7���d�j�j�"2�3�z��K�K�)�8
�
%�����
�
��e�9�%�%9�	
�8
�rErc���d}|tjur|nd}|tjur|nd}|tjur|nd}t||t�|rt	|t|��sJ�|j|jk7r9t||�d�t|j��t|j���|
rK|j|jk(s2Jt|j��dt|j�����t|j|j||||
||||�d���
t|j|j||||
||||�d	���
|r|j|�}|r�|j�}|j�}tt!t|j#��t|j#��z��D]#}||vsJ�||vsJ�t%||||||�
��%yt'|j�D]M\}}|j)|d��}|j)|d��}t+|||||||	|
||�d
|�d|�d�||dd���Oy)a�

    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"))r2rr.r[rrWr�r6r0r1r�rN)rr�rLrr7rIr�rir�r�r8r��columnsr��_to_dict_of_blocks�list�set�keysr:�	enumerate�_ixsr9)rArBr2r�check_column_type�check_frame_typer[�	by_blocksr.rrWr�r�rr0r1r6r{�_rtol�_atol�_check_exact�rblocks�lblocksrT�i�col�lcol�rcols                            rDr:r:Fsz��\������.�D�F�E�����.�D�F�E�"-�S�^�^�"C�;��L��d�E�9�-���$��U��,�,�,��z�z�U�[�[� ���C�5��(�T�$�*�*�-=�,>�D����DU�CV�	
���z�z�U�[�[�(�V�T�$�*�*�-=�,>�d�4����CT�BU�*V�V�(���
�
�
����� �+�"�N�
�
��e�6�N������
�
�
��� �+�"�N�
�
��e�8����� � ��'����*�*�,���)�)�+���#�d�7�<�<�>�2�T�'�,�,�.�5I�I�J�K�E��G�#�#�#��G�#�#�#��������K�S�
�L� ����-�F�A�s��9�9�Q�Q�9�'�D��:�:�a�a�:�(�D�
 ���'�!1�'�'�*C�"3�%��e�9�Q�C�'7��u�B�?���!�!�
�.rEc�6�d}t|t�r[t||fi|��t|ttf�r7|j
|j
k(sJ|j
|j
f��yyt|t�rt||fi|��yt|t�rt||fi|��yt|t�rt||fi|��yt|t�rt||fi|��yt|t�rt||fi|��yt|t �rt#||fi|��yt|t$�rt'||fi|��yt|t(j*�rt-||fi|��yt|t.�r|ik(sJ�||k(sJ�y|ik(sJ�t1||�y)aC
    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)r7rr8rr!r�r r9rr:r$rxr%r�r"r�r&r�r#r�r;r<rmrer?)rArBrCr{s    rDr�r�sc�����$����4��1�&�1��d�]�N�;�<��9�9��
�
�*�C�T�Y�Y��
�
�,C�C�*�=�	�D�&�	!��D�%�2�6�2�	�D�)�	$��4��1�&�1�	�D�-�	(�#�D�%�:�6�:�	�D�+�	&�!�$��8��8�	�D�-�	(�#�D�%�:�6�:�	�D�.�	)�$�T�5�;�F�;�	�D�.�	)�$�T�5�;�F�;�	�D�"�*�*�	%� ��u�7��7�	�D�#�	���|��|��u�}��}���|��|��D�%�(rEc���t||tjj�t	|j
|j
�t
|jt�sJ�t
|jt�sJ�|j}|j}|j|�stdd||�n	td||�td||�t	|j�|j��y)z�
    Check that the left and right SparseArray are equal.

    Parameters
    ----------
    left : SparseArray
    right : SparseArray
    zSparseArray.indexzindex are not equal�
fill_valuerTN)
rLr��arrays�SparseArrayrm�	sp_valuesr7�sp_indexr
rprirU�to_dense)rArB�
left_index�right_indexs    rD�assert_sp_array_equalr*:s����d�E�2�9�9�#8�#8�9��T�^�^�U�_�_�=��d�m�m�[�1�1�1��e�n�n�k�2�2�2����J��.�.�K����[�)���!6�
�K�	
�
	
��l�D�%�0��g�t�U�+��T�]�]�_�e�n�n�.>�?rEc�@�|D]}||vr�Jdt|�����y)NzDid not contain item: )r�)�iterable�dic�ks   rD�assert_contains_allr/[s)��
���C�x�;�1�$�q�'��;�;�x�rEc	��t||�D]J\}}t||fi|��dtt|���dtt|���d�}||ur�EJ|��y)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)
    zExpected 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_copyr6`sp���E�5�)���u��E�5�7�J�7��t�D��K�0�1��d�4��;�>O�=P�Q@�
@�	��E�!�&�3�&�!�
*rEc�<�t|t�xrt|�S)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
    )r7rr)�
left_dtype�right_dtypes  rDr�r�rs���j�.�1�V�6I�+�6V�VrEc��|j|}t|j||�t|j�st|||�yy)z_
    Check that ser.iloc[i_slc] matches ser.loc[l_slc] and, if applicable,
    ser[l_slc].
    N)�ilocr9�locrr�)�ser�l_slc�i_slc�expecteds    rD�!assert_indexing_slices_equivalentrA�sB��
�x�x���H��������1��C�I�I�&��C��J��1�'rEc�r�|jD](}t||d�}|�|��J�|t||d�k(r�(J�y)z:
    Check that ._metadata attributes are equivalent.
    N)�	_metadatar�)rArBr��vals    rD�assert_metadata_equivalentrE�sF�������d�D�$�'���=��;��;��'�%��t�4�4�4�4�rE)r,r�r�)r2�bool | Literal['equiv']r0�floatr1rGrfrg)rfrg)T)rNr@rfrg)r,TTTTr�r�r)rArrBrr/�
bool | strr[r@r.r@rWr@rzr@r0rGr1rGr6rerfrg)Tr4)r/rHr6rerfrg)�
Attributes)r�rer6rerfrg)TTr)r2r@r�r@r6rerfrg)r,r$)r/rFr6rerfrg)r%rd)r"T)r6rer�r@rfrg)r&T)NNNr�)FTNNr3N)r�r@r2rFr6rerfrg)r2rFr.�bool | lib.NoDefaultr0�float | lib.NoDefaultr1rKr6rerfrg) r2rFrrFrr@r[r@r.rJrr@rWr@r�r@r�r@rr@r0rKr1rKr6rer�r@r�r@rfrg) r2rFrrFrrFrr@r[r@rr@r.rJrr@rWr@r�r@r�r@rr@r0rKr1rKr6rerfrg)r8r+r9r+rfr@)r=r r>�slicer?rLrfrgr�)rAzDataFrame | SeriesrBzDataFrame | Series | Nonerfrg)[�
__future__rr��typingrrrr�numpyr;�pandas._libsr�pandas._libs.missingr	�pandas._libs.sparser
�pandas._libs.testing�_libs�testingr>�pandas._libs.tslibs.np_datetimer�pandas.core.dtypes.commonrr
rrrr�pandas.core.dtypes.dtypesrrrr�pandas.core.dtypes.missingr�pandasr�rrrrrrrrrr 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?rLrPr8r=rUr�r�ryrxr�r�r�rirmr�r�r9r:r�r*r/r6r�rArE�rErD�<module>rbsY��"������/�+�'�'�J�����8��������C�2�3�3��'�,3���O
�)�O
��	O
�
�O
�
�O
�d
�8G� ���"�����hY�
�hY��hY��hY��	hY�
�hY��
hY��hY��hY��hY�

�hY�
�hY�X7>�G�"�G�03�G�	�G�D$�N<�,>��!%��:7��:7��	:7�


�:7�
�
:7�|GV�6�/�6�@C�6�	�6�>5�AE�	2��	2�9=�	2�	�	2�BF�8��8�:>�8�	�8�IM�#�
�#�R�+/�����M=��M=�)�	M=�

�M=�
�M=�f,0��(+���"%�.�.�"%�.�.��~
�)�~
�
&�~
� �
~
� �~
�

�~
�
�~
�J,0�07�"��(+���&+�"�!%���"%�.�.�"%�.�.��G�"��%G�)�G�.�	G�
�G��
G�&�G� $�G��G��G��G��G� �G� �G�

�G�"�#G�$�%G�&
�'G�\,0�07�18�!���(+���&+�"����"%�.�.�"%�.�.��#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�BF�5�
�5�%>�5�	�5rE

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists