code: def _check_types(
      left, right, check_categorical=True, exact="equiv", obj="Index"
  ):
      if not exact or exact == "equiv":
          if (
              isinstance(left, cudf.RangeIndex)
              and isinstance(
                  right,
                  (
                      cudf.Int8Index,
                      cudf.Int16Index,
                      cudf.Int32Index,
                      cudf.Int64Index,
                  ),
              )
          ) or (
              isinstance(right, cudf.RangeIndex)
              and isinstance(
                  left,
                  (
                      cudf.Int8Index,
                      cudf.Int16Index,
                      cudf.Int32Index,
                      cudf.Int64Index,
                  ),
              )
          ):
              return
  
      if type(left) != type(right):
          raise_assert_detail(
              obj,
              "Class types are different",
              f"{type(left)}",
              f"{type(right)}",
          )
  
      if (
          exact
          and not isinstance(left, cudf.MultiIndex)
          and is_categorical_dtype(left)
      ):
          if left.dtype != right.dtype:
              raise_assert_detail(
                  obj, "Categorical difference", f"{left}", f"{right}"
              )
  
file_path: cudf/python/cudf/cudf/testing/testing.py
imports: from __future__ import annotations
  from typing import Union
  import cupy
  import numpy
  import pandas
  import cudf
  from cudf._lib.unary import is_nan
  from cudf.api.types import is_categorical_dtype, is_numeric_dtype, is_string_dtype
  from cudf.core.missing import NA, NaT
label_desc: Use image node_id 4 for calling a global function with example usage: _check_types(left, right, check_categorical, exact, obj) without return types