code: def test_categorical_transform():
      # TODO: Refactor - Use PyTest
      categories = ["apple", "orange", "banana", None, True, False, 3]
      cat = Categorical(categories)
  
      apple = [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
      orange = [0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0]
      banana = [0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0]
      none = [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0]
      true = [0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0]
      false = [0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0]
      three = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0]
  
      assert_equal(cat.transformed_size, 7)
      assert_equal(cat.transformed_size, cat.transform(["apple"]).size)
      assert_array_equal(
          cat.transform(categories),
          [apple, orange, banana, none, true, false, three],
      )
      assert_array_equal(
          cat.transform(["apple", "orange"]), [apple, orange]
      )
      assert_array_equal(
          cat.transform(["apple", "banana"]), [apple, banana]
      )
      assert_array_equal(
          cat.inverse_transform([apple, orange]), ["apple", "orange"]
      )
      assert_array_equal(
          cat.inverse_transform([apple, banana]), ["apple", "banana"]
      )
      ent_inverse = cat.inverse_transform(
          [apple, orange, banana, none, true, false, three]
      )
      assert_array_equal(ent_inverse, categories)
  
imports: from hyperparameter_hunter.optimization.backends.skopt.engine import Optimizer
  from hyperparameter_hunter.space.dimensions import Real, Integer, Categorical
  from hyperparameter_hunter.space.space_core import Space, check_dimension, normalize_dimensions
  import numbers
  import numpy
  import pytest
  from sklearn.utils.testing import assert_array_almost_equal, assert_array_equal, assert_equal
label_desc: Use image node_id 10 for calling a global function with example usage: test_categorical_transform() without return types