code: def assert_eq(left, right, **kwargs):
      """Assert that two cudf-like things are equivalent
  
      This equality test works for pandas/cudf dataframes/series/indexes/scalars
      in the same way, and so makes it easier to perform parametrized testing
      without switching between assert_frame_equal/assert_series_equal/...
      functions.
      """
      # dtypes that we support but Pandas doesn't will convert to
      # `object`. Check equality before that happens:
      if kwargs.get("check_dtype", True):
          if hasattr(left, "dtype") and hasattr(right, "dtype"):
              if isinstance(
                  left.dtype, cudf.core.dtypes._BaseDtype
              ) and not isinstance(
                  left.dtype, cudf.CategoricalDtype
              ):  # leave categorical comparison to Pandas
                  assert_eq(left.dtype, right.dtype)
  
      if hasattr(left, "to_pandas"):
          left = left.to_pandas()
      if hasattr(right, "to_pandas"):
          right = right.to_pandas()
      if isinstance(left, cupy.ndarray):
          left = cupy.asnumpy(left)
      if isinstance(right, cupy.ndarray):
          right = cupy.asnumpy(right)
  
      if isinstance(left, (pd.DataFrame, pd.Series, pd.Index)):
          # TODO: A warning is emitted from the function
          # pandas.testing.assert_[series, frame, index]_equal for some inputs:
          # "DeprecationWarning: elementwise comparison failed; this will raise
          # an error in the future."
          # or "FutureWarning: elementwise ..."
          # This warning comes from a call from pandas to numpy. It is ignored
          # here because it cannot be fixed within cudf.
          with warnings.catch_warnings():
              warnings.simplefilter(
                  "ignore", (DeprecationWarning, FutureWarning)
              )
              if isinstance(left, pd.DataFrame):
                  tm.assert_frame_equal(left, right, **kwargs)
              elif isinstance(left, pd.Series):
                  tm.assert_series_equal(left, right, **kwargs)
              else:
                  tm.assert_index_equal(left, right, **kwargs)
  
      elif isinstance(left, np.ndarray) and isinstance(
          right, np.ndarray
      ):
          if np.issubdtype(left.dtype, np.floating) and np.issubdtype(
              right.dtype, np.floating
          ):
              assert np.allclose(left, right, equal_nan=True)
          else:
              assert np.array_equal(left, right)
      else:
          # Use the overloaded __eq__ of the operands
          if left == right:
              return True
          elif any(
              np.issubdtype(type(x), np.floating) for x in (left, right)
          ):
              np.testing.assert_almost_equal(left, right)
          else:
              np.testing.assert_equal(left, right)
      return True
  
imports: import itertools
  import string
  import warnings
  from collections import abc
  from contextlib import contextmanager
  from decimal import Decimal
  import cupy
  import numpy
  import pandas
  import pytest
  from numba.core.typing import signature
  from numba.core.typing.templates import AbstractTemplate
  from numba.cuda.cudadecl import registry
  from numba.cuda.cudaimpl import lower
  from pandas import testing
  import cudf
  from cudf._lib.null_mask import bitmask_allocation_size_bytes
  from cudf.api.types import is_scalar
  from cudf.core.column.timedelta import _unit_to_nanoseconds_conversion
  from cudf.core.udf.strings_lowering import cast_string_view_to_udf_string
  from cudf.core.udf.strings_typing import StringView, string_view, udf_string
  from cudf.utils import dtypes
label_desc: Use image node_id 5 for calling a global function with example usage: assert_eq(left, right) and returns: True, True