code: def assert_class_equal(
      left, right, exact: bool | str = True, obj: str = "Input"
  ) -> None:
      """
      Checks classes are equal.
      """
      __tracebackhide__ = True
  
      def repr_class(x):
          if isinstance(x, Index):
              # return Index as it is to include values in the error message
              return x
  
          return type(x).__name__
  
      def is_class_equiv(idx: Index) -> bool:
          """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.
          """
          return type(idx) is Index or isinstance(idx, RangeIndex)
  
      if type(left) == type(right):
          return
  
      if exact == "equiv":
          if is_class_equiv(left) and is_class_equiv(right):
              return
  
      msg = f"{obj} classes are different"
      raise_assert_detail(obj, msg, repr_class(left), repr_class(right))
  
imports: from __future__ import annotations
  import operator
  from typing import Literal, cast
  import numpy
  from pandas._libs.missing import is_matching_na
  from pandas._libs.sparse import SparseIndex
  import pandas._libs.testing
  from pandas._libs.tslibs.np_datetime import compare_mismatched_resolutions
  from pandas.core.dtypes.common import is_bool, is_categorical_dtype, is_extension_array_dtype, is_integer_dtype, is_interval_dtype, is_number, is_numeric_dtype, needs_i8_conversion
  from pandas.core.dtypes.dtypes import CategoricalDtype, DatetimeTZDtype, PandasDtype
  from pandas.core.dtypes.missing import array_equivalent
  import pandas
  from pandas import Categorical, DataFrame, DatetimeIndex, Index, IntervalIndex, MultiIndex, PeriodIndex, RangeIndex, Series, TimedeltaIndex
  from pandas.core.algorithms import take_nd
  from pandas.core.arrays import DatetimeArray, ExtensionArray, IntervalArray, PeriodArray, TimedeltaArray
  from pandas.core.arrays.datetimelike import DatetimeLikeArrayMixin
  from pandas.core.arrays.string_ import StringDtype
  from pandas.core.indexes.api import safe_sort_index
  from pandas.io.formats.printing import pprint_thing
label_desc: Use image node_id 5 for calling a global function with example usage: assert_class_equal(left, right, exact, obj) and returns: type, unknown, x