code: def test_categorical_identity():
      # TODO: Refactor - Use PyTest
      categories = ["cat", "dog", "rat"]
      cat = Categorical(categories, transform="identity")
      samples = cat.rvs(100)
      assert all([t in categories for t in cat.rvs(100)])
      transformed = cat.transform(samples)
      assert_array_equal(transformed, samples)
      assert_array_equal(samples, cat.inverse_transform(transformed))
  
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 18 for calling a global function with example usage: test_categorical_identity() without return types