code: def test_onehot_categories(as_array):
      X = DataFrame({"chars": ["a", "b"], "int": [0, 2]})
      categories = DataFrame(
          {"chars": ["a", "b", "c"], "int": [0, 1, 2]}
      )
      if as_array:
          X = _from_df_to_cupy(X)
          categories = _from_df_to_cupy(categories).transpose()
  
      enc = OneHotEncoder(categories=categories, sparse=False)
      ref = cp.array(
          [
              [1.0, 0.0, 0.0, 1.0, 0.0, 0.0],
              [0.0, 1.0, 0.0, 0.0, 0.0, 1.0],
          ]
      )
      res = enc.fit_transform(X)
      cp.testing.assert_array_equal(res, ref)
  
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 5 for calling a global function with example usage: test_onehot_categories(as_array) without return types