class_docstr: Base class for (gym style) environments wrapping a core environment and defining state and execution interfaces.
  The aim of this class is to provide reusable functionality across different gym environments.
  This functionality comprises for example the reset-function, the step-function or the render-function.
  
  :param core_env: Core environment.
  :param action_conversion_dict: A dictionary with action conversion interface implementation
                                   and policy names as keys.
  :param observation_conversion_dict: A dictionary with observation conversion interface implementation
                                    and policy names as keys.
class_docstr_tok: ["Base","class","for","(","gym","style",")","environments","wrapping","a","core","environment","and","defining","state","and","execution","interfaces",".","The","aim","of","this","class","is","to","provide","reusable","functionality","across","different","gym","environments",".","This","functionality","comprises","for","example","the","reset-function",",","the","step-function","or","the","render-function",".",":","param","core_env",":","Core","environment",".",":","param","action_conversion_dict",":","A","dictionary","with","action","conversion","interface","implementation","and","policy","names","as","keys",".",":","param","observation_conversion_dict",":","A","dictionary","with","observation","conversion","interface","implementation","and","policy","names","as","keys","."]
docstr: Convert MazeState and MazeAction back into observations and actions using the space conversion interfaces.
  
  :param maze_state: State of the environment
  :param maze_action: MazeAction (the one following the state given as the first param)
  :param first_step_in_episode: True if this is the first step in the episode.
  :return: observation and action dictionaries (keys are substep_ids)
docstr_tok: ["Convert","MazeState","and","MazeAction","back","into","observations","and","actions","using","the","space","conversion","interfaces",".",":","param","maze_state",":","State","of","the","environment",":","param","maze_action",":","MazeAction","(","the","one","following","the","state","given","as","the","first","param",")",":","param","first_step_in_episode",":","True","if","this","is","the","first","step","in","the","episode",".",":","return",":","observation","and","action","dictionaries","(","keys","are","substep_ids",")"]
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]],
  ]:
      """Convert MazeState and MazeAction back into observations and actions using the space conversion interfaces.
  
      :param maze_state: State of the environment
      :param maze_action: MazeAction (the one following the state given as the first param)
      :param first_step_in_episode: True if this is the first step in the episode.
      :return: observation and action dictionaries (keys are substep_ids)
      """
  
      if maze_state is not None:
          observation_dict = {
              policy_id: obs_conv.maze_to_space(maze_state)
              for policy_id, obs_conv in self.observation_conversion_dict.items()
          }
      else:
          observation_dict = None
  
      if maze_action is not None:
          action_dict = {
              policy_id: act_conv.maze_to_space(maze_action)
              for policy_id, act_conv in self.action_conversion_dict.items()
          }
      else:
          action_dict = None
  
      return observation_dict, action_dict
  
imports: from copy import deepcopy
  from typing import Any, Tuple, Dict, Iterable, Optional, Union, TypeVar, Generic
  import gym
  import numpy
  from maze.core.annotations import override
  from maze.core.env.action_conversion import ActionConversionInterface, ActionType
  from maze.core.env.base_env import BaseEnv
  from maze.core.env.core_env import CoreEnv
  from maze.core.env.event_env_mixin import EventEnvMixin
  from maze.core.env.maze_action import MazeActionType
  from maze.core.env.maze_state import MazeStateType
  from maze.core.env.observation_conversion import ObservationConversionInterface, ObservationType
  from maze.core.env.recordable_env_mixin import RecordableEnvMixin
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.structured_env import StructuredEnv, StepKeyType, ActorID
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.env.time_env_mixin import TimeEnvMixin
  from maze.core.events.event_record import EventRecord
  from maze.core.log_events.kpi_calculator import KpiCalculator
  from maze.core.log_events.monitoring_events import RewardEvents
  from maze.core.rendering.renderer import Renderer
  from maze.core.wrappers.wrapper import Wrapper
label_desc: Use image node_id 25 for calling the MazeEnv 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: observation_dict,  action_dict