class_docstr: Example stateful wrapper -- observation depends on the observation from the previous step (both are stacked).
docstr: If this is the first step in an episode, reset the observation stack.
docstr_tok: ["If","this","is","the","first","step","in","an","episode",",","reset","the","observation","stack","."]
code: def get_observation_and_action_dicts(
      self,
      maze_state: Optional[MazeStateType],
      maze_action: Optional[MazeActionType],
      first_step_in_episode: bool,
  ) -> Tuple[
      Optional[Dict[Union[int, str], Any]],
      Optional[Dict[Union[int, str], Any]],
  ]:
      """If this is the first step in an episode, reset the observation stack."""
      if first_step_in_episode:
          self.last_observation_value = None
  
      return super().get_observation_and_action_dicts(
          maze_state, maze_action, first_step_in_episode
      )
  
imports: import pickle
  from typing import Any, Dict, Union, Tuple, List, Optional
  import gym
  import numpy
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.structured_env import ActorID
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.log_events.step_event_log import StepEventLog
  from maze.core.trajectory_recording.datasets.trajectory_processor import IdentityTrajectoryProcessor
  from maze.core.trajectory_recording.records.spaces_record import SpacesRecord
  from maze.core.trajectory_recording.records.structured_spaces_record import StructuredSpacesRecord
  from maze.core.trajectory_recording.records.state_record import StateRecord
  from maze.core.trajectory_recording.records.trajectory_record import StateTrajectoryRecord, SpacesTrajectoryRecord
  from maze.core.wrappers.maze_gym_env_wrapper import make_gym_maze_env
  from maze.core.wrappers.wrapper import ObservationWrapper
  from maze.test.shared_test_utils.dummy_env.dummy_core_env import DummyCoreEnvironment
  from maze.test.shared_test_utils.dummy_env.dummy_maze_env import DummyEnvironment
  from maze.test.shared_test_utils.dummy_env.space_interfaces.action_conversion.double import DoubleActionConversion
  from maze.test.shared_test_utils.dummy_env.space_interfaces.observation_conversion.double import DoubleObservationConversion
  from maze.test.shared_test_utils.run_maze_utils import run_maze_job
  from maze.core.trajectory_recording.datasets.in_memory_dataset import InMemoryDataset
label_desc: Use image node_id 3 for calling the _MockObservationStackWrapper obj's underlying member method code with example usage: obj.get_observation_and_action_dicts(maze_state, maze_action, first_step_in_episode) and returns: super