code: def test_one_hot_pre_processors():
      """perception test"""
  
      obs_space = build_dict_obs_space()
      space_dict = obs_space.spaces
      sample = obs_space.sample()
  
      processor = OneHotPreProcessor(
          observation_space=space_dict["categorical_feature"]
      )
      assert processor.tag() == "one_hot"
  
      processed = processor.process(sample["categorical_feature"])
      assert processed.shape == (12,)
      assert np.sum(processed) == 1
      assert processed[sample["categorical_feature"]] == 1
  
      processor = OneHotPreProcessor(
          observation_space=space_dict["categorical_feature_series"]
      )
  
      processed = processor.process(
          sample["categorical_feature_series"]
      )
      assert processed.shape == (64, 12)
      assert np.allclose(np.sum(processed, axis=1), 1)
      for i in range(processed.shape[0]):
          assert (
              processed[i][sample["categorical_feature_series"][i]] == 1
          )
  
file_path: maze/maze/test/core/wrappers/observation_preprocessing/preprocessors/test_preprocessors.py
imports: import gym
  import numpy
  from maze.core.wrappers.observation_preprocessing.preprocessors.flatten import FlattenPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.one_hot import OneHotPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.resize_img import ResizeImgPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.rgb2gray import Rgb2GrayPreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.transpose import TransposePreProcessor
  from maze.core.wrappers.observation_preprocessing.preprocessors.unsqueeze import UnSqueezePreProcessor
  from maze.test.shared_test_utils.space_testing_utils import build_dict_obs_space
label_desc: Use image node_id 1 for calling a global function with example usage: test_one_hot_pre_processors() without return types