code: def test_onehot_get_categories(as_array):
      X = DataFrame({"chars": ["c", "b", "d"], "ints": [2, 1, 0]})
      ref = [np.array(["b", "c", "d"]), np.array([0, 1, 2])]
      if as_array:
          X = _from_df_to_cupy(X)
          ref[0] = np.array([ord(x) for x in ref[0]])
  
      enc = OneHotEncoder().fit(X)
      cats = enc.categories_
  
      for i in range(len(ref)):
          np.testing.assert_array_equal(ref[i], cats[i].to_numpy())
  
imports: from sklearn.preprocessing import OneHotEncoder
  from cuml.testing.utils import stress_param, from_df_to_numpy, assert_inverse_equal, generate_inputs_from_categories
  from cuml.preprocessing import OneHotEncoder
  from cuml.internals.safe_imports import gpu_only_import_from
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  import math
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 13 for calling a global function with example usage: test_onehot_get_categories(as_array) without return types