class_docstr: Wraps either a single action space or a tuple action space into dictionary space.
  
  :param env: The environment to wrap.
class_docstr_tok: ["Wraps","either","a","single","action","space","or","a","tuple","action","space","into","dictionary","space",".",":","param","env",":","The","environment","to","wrap","."]
code: def __init__(self, env):
      super().__init__(env)
      assert not isinstance(
          env.action_space, gym.spaces.Dict
      ), "Action spaces is already a dict space!"
  
      # remember original action space
      self._original_space = env.action_space
  
      # tuple action spaces
      if isinstance(self._original_space, gym.spaces.Tuple):
          self._space_dict = dict()
          for i, space in enumerate(self._original_space.spaces):
              self._space_dict[f"action_{i}"] = space
          self.action_space = gym.spaces.Dict(self._space_dict)
      # single action spaces
      else:
          self._space_dict = {"action": self._original_space}
          self.action_space = gym.spaces.Dict(self._space_dict)
  
file_path: maze/maze/core/wrappers/dict_action_wrapper.py
imports: from typing import Dict, Tuple, Union
  import gym
  import numpy
  from maze.core.annotations import override
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.wrappers.wrapper import ActionWrapper
label_desc: Use image node_id 1 to create a new DictActionWrapper object from inherited base classes: ActionWrapper with example: obj = DictActionWrapper(env)