code: def df_categories_equals(df1, df2):
      if not hasattr(df1, "select_dtypes"):
          if isinstance(df1, pandas.CategoricalDtype):
              return categories_equals(df1, df2)
          elif isinstance(
              getattr(df1, "dtype"), pandas.CategoricalDtype
          ) and isinstance(
              getattr(df1, "dtype"), pandas.CategoricalDtype
          ):
              return categories_equals(df1.dtype, df2.dtype)
          else:
              return True
  
      categories_columns = df1.select_dtypes(include="category").columns
      for column in categories_columns:
          assert_extension_array_equal(
              df1[column].values,
              df2[column].values,
              check_dtype=False,
          )
  
file_path: ray/python/ray/tests/modin/modin_test_utils.py
imports: import pandas
  import modin.pandas
  from modin.utils import to_pandas
  from pandas.testing import assert_series_equal, assert_frame_equal, assert_extension_array_equal, assert_index_equal
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: df_categories_equals(df1, df2) and returns: categories_equals, categories_equals, True