def assert_series_equal(left, right, check_dtype=True,<EOL>check_index_type='<STR_LIT>',<EOL>check_series_type=True,<EOL>check_less_precise=False,<EOL>check_names=True,<EOL>check_exact=False,<EOL>check_datetimelike_compat=False,<EOL>check_categorical=True,<EOL>obj='<STR_LIT>'):
__tracebackhide__ = True<EOL>_check_isinstance(left, right, Series)<EOL>if check_series_type:<EOL><INDENT>assert isinstance(left, type(right))<EOL><DEDENT>if len(left) != len(right):<EOL><INDENT>msg1 = '<STR_LIT>'.format(len=len(left), left=left.index)<EOL>msg2 = '<STR_LIT>'.format(len=len(right), right=right.index)<EOL>raise_assert_detail(obj, '<STR_LIT>', msg1, msg2)<EOL><DEDENT>assert_index_equal(left.index, right.index, exact=check_index_type,<EOL>check_names=check_names,<EOL>check_less_precise=check_less_precise,<EOL>check_exact=check_exact,<EOL>check_categorical=check_categorical,<EOL>obj='<STR_LIT>'.format(obj=obj))<EOL>if check_dtype:<EOL><INDENT>if (is_categorical_dtype(left) and is_categorical_dtype(right) and<EOL>not check_categorical):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>assert_attr_equal('<STR_LIT>', left, right)<EOL><DEDENT><DEDENT>if check_exact:<EOL><INDENT>assert_numpy_array_equal(left.get_values(), right.get_values(),<EOL>check_dtype=check_dtype,<EOL>obj='<STR_LIT>'.format(obj=obj),)<EOL><DEDENT>elif check_datetimelike_compat:<EOL><INDENT>if (is_datetimelike_v_numeric(left, right) or<EOL>is_datetimelike_v_object(left, right) or<EOL>needs_i8_conversion(left) or<EOL>needs_i8_conversion(right)):<EOL><INDENT>if not Index(left.values).equals(Index(right.values)):<EOL><INDENT>msg = ('<STR_LIT>'<EOL>'<STR_LIT>').format(left=left.values, right=right.values)<EOL>raise AssertionError(msg)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>assert_numpy_array_equal(left.get_values(), right.get_values(),<EOL>check_dtype=check_dtype)<EOL><DEDENT><DEDENT>elif is_interval_dtype(left) or is_interval_dtype(right):<EOL><INDENT>assert_interval_array_equal(left.array, right.array)<EOL><DEDENT>elif (is_extension_array_dtype(left.dtype) and<EOL>is_datetime64tz_dtype(left.dtype)):<EOL><INDENT>assert is_extension_array_dtype(right.dtype)<EOL>return assert_extension_array_equal(left._values, right._values)<EOL><DEDENT>elif (is_extension_array_dtype(left) and not is_categorical_dtype(left) and<EOL>is_extension_array_dtype(right) and not is_categorical_dtype(right)):<EOL><INDENT>return assert_extension_array_equal(left.array, right.array)<EOL><DEDENT>else:<EOL><INDENT>_testing.assert_almost_equal(left.get_values(), right.get_values(),<EOL>check_less_precise=check_less_precise,<EOL>check_dtype=check_dtype,<EOL>obj='<STR_LIT>'.format(obj=obj))<EOL><DEDENT>if check_names:<EOL><INDENT>assert_attr_equal('<STR_LIT:name>', left, right, obj=obj)<EOL><DEDENT>if check_categorical:<EOL><INDENT>if is_categorical_dtype(left) or is_categorical_dtype(right):<EOL><INDENT>assert_categorical_equal(left.values, right.values,<EOL>obj='<STR_LIT>'.format(obj=obj))<EOL><DEDENT><DEDENT>
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 / string {'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_less_precise : bool or int, default False
        Specify comparison precision. Only used when check_exact is False.
        5 digits (False) or 3 digits (True) after decimal points are compared.
        If int, then specify the digits to compare.

        When comparing two numbers, if the first number has magnitude less
        than 1e-5, we compare the two numbers directly and check whether
        they are equivalent within the specified precision. Otherwise, we
        compare the **ratio** of the second number to the first number and
        check whether it is equivalent to 1 within the specified precision.
    check_names : bool, default True
        Whether to check the Series and Index names attribute.
    check_exact : bool, default False
        Whether to compare number exactly.
    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.
    obj : str, default 'Series'
        Specify object name being compared, internally used to show appropriate
        assertion message.