class_docstr: An wrapper stacking the observations of multiple subsequent time steps.
  
  Provides functionality for:
  
      - selecting which observations to stack
      - how many past observations should be stacked
      - stacking deltas with the current step observation (instead of the observations itself)
  
  :param env: Environment/wrapper to wrap.
  :param stack_config: The observation stacking configuration.
  
      observation:        The name (key) of the respective observation
      keep_original:      Bool, indicates weather to keep or remove the original observation from the dictionary.
      tag:                Optional[str], tag to add to observation (e.g. stacked)
      delta:              Bool, if true deltas are stacked to the previous observation
      stack_steps:        Int, number of past steps to be stacked
code: def __init__(
      self,
      env: StructuredEnvSpacesMixin,
      stack_config: List[Dict[str, Any]],
  ):
      super().__init__(env)
  
      self.stack_config = stack_config
      self.drop_original = False
  
      # initialize observation collection and statistics
      self._original_observation_spaces_dict = copy.deepcopy(
          env.observation_spaces_dict
      )
  
      # flatten the structured observation space
      self._flat_observation_space = flat_structured_space(
          self._original_observation_spaces_dict
      )
  
      # Initialize normalization strategies for all sub step hierarchies and observations
      self._initialize_stacking()
  
      # initialize observation stack
      self.max_steps = max(
          [c["stack_steps"] for c in self.stack_config]
      )
      self._observation_stack: Dict[
          str, List[np.ndarray]
      ] = defaultdict(list)
  
imports: import copy
  from collections import defaultdict
  from typing import Any, Dict, List, Tuple, Union, Optional
  import numpy
  from gym import spaces
  from maze.core.annotations import override
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_env import MazeEnv
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.utils.structured_env_utils import flat_structured_space
  from maze.core.wrappers.wrapper import ObservationWrapper, Wrapper
label_desc: Use image node_id 1 to create a new ObservationStackWrapper object from inherited base classes: ObservationWrapper with example: obj = ObservationStackWrapper(env, stack_config)