class_docstr: An observation pre-processing wrapper.
  It provides functionality for:
  
  - pre-processing observations (flattening, one-hot encoding, ...)
  - adopting the observation spaces accordingly
  
  :param env: Environment/wrapper to wrap.
  :param pre_processor_mapping: The pre-processing configuration.
         Example mappings can be found in our reference documentation.
class_docstr_tok: ["An","observation","pre-processing","wrapper",".","It","provides","functionality","for",":","-","pre-processing","observations","(","flattening",",","one-hot","encoding",",","...",")","-","adopting","the","observation","spaces","accordingly",":","param","env",":","Environment\/wrapper","to","wrap",".",":","param","pre_processor_mapping",":","The","pre-processing","configuration",".","Example","mappings","can","be","found","in","our","reference","documentation","."]
docstr: Pre-processes observations.
  
  :param observation: The observation to be pre-processed.
  :return: The pre-processed observation.
docstr_tok: ["Pre-processes","observations",".",":","param","observation",":","The","observation","to","be","pre-processed",".",":","return",":","The","pre-processed","observation","."]
code: def observation(self, observation: Any) -> Any:
      """Pre-processes observations.
  
      :param observation: The observation to be pre-processed.
      :return: The pre-processed observation.
      """
  
      # iteratively pre-process observations
      for obs_key, processor, keep_original in self._preprocessors:
          # check if obs_key is in the observation
          if obs_key in observation:
              tag = f"{obs_key}-{processor.tag()}"
              observation[tag] = processor.process(
                  observation=observation[obs_key]
              )
  
              # drop original observation
              if not keep_original:
                  del observation[obs_key]
  
      return observation
  
file_path: maze/maze/core/wrappers/observation_preprocessing/preprocessing_wrapper.py
imports: from typing import Any, Dict, List, Tuple, Mapping
  from maze.core.annotations import override
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.utils.factory import Factory
  from maze.core.utils.structured_env_utils import flat_structured_space
  from maze.core.wrappers.observation_preprocessing.preprocessors.base import PreProcessor
  from maze.core.wrappers.wrapper import ObservationWrapper
label_desc: Use image node_id 2 for calling the PreProcessingWrapper obj's underlying member method code with example usage: obj.observation(observation) and returns: observation