class_docstr: An one-hot encoding pre-processor for categorical features.
      
docstr: implementation of
  :class:`~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor` interface
docstr_tok: ["implementation","of",":","class",":","`","~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor","`","interface"]
code: def process(self, observation: np.ndarray) -> np.ndarray:
      """implementation of
      :class:`~maze.core.wrappers.observation_preprocessing.preprocessors.base.PreProcessor` interface
      """
      if isinstance(self._original_observation_space, spaces.Box):
          processed_observation = (
              np.arange(self._original_observation_space.high.max() + 1)
              == observation[..., None]
          )
          processed_observation = processed_observation.astype(
              np.float32
          )
      elif isinstance(
          self._original_observation_space, spaces.Discrete
      ):
          observation = np.int64(observation)
          processed_observation = (
              np.arange(self._original_observation_space.n)
              == observation[..., None]
          )
          processed_observation = processed_observation.astype(
              np.float32
          )
      else:
          raise ValueError(
              f"{type(self._original_observation_space)} not supported!"
          )
  
      assert (
          processed_observation.shape[-len(self.processed_shape()) :]
          == self.processed_shape()
      )
  
      return processed_observation
  
file_path: maze/maze/core/wrappers/observation_preprocessing/preprocessors/one_hot.py
imports: from typing import Tuple
  import numpy
  from gym import spaces
  from maze.core.wrappers.observation_preprocessing.preprocessors.base import PreProcessor
  from maze.core.annotations import override
label_desc: Use image node_id 3 for calling the OneHotPreProcessor obj's underlying member method code with example usage: obj.process(observation) and returns: processed_observation