class_docstr: Splits an actions into separate ones.
  
  An example is given by the LunarLanderContinuous-v2 env. Here we have a box action spaces with shape (2,) such that
  dimension 0 is the up/down action and dimension 1 is the left/right action. Now if we would like to split this
  action correspondingly we can wrap the env with the following config:
  
  split_config:
      action:
          action_up:
              indices: [0]
          action_side:
              indices: [1]
  
  Now the actions as well as the action space is consists of two actions (action_up/action_side).
  
  :param env: Environment/wrapper to wrap.
  :param split_config: The action splitting configuration.
class_docstr_tok: ["Splits","an","actions","into","separate","ones",".","An","example","is","given","by","the","LunarLanderContinuous-v2","env",".","Here","we","have","a","box","action","spaces","with","shape","(","2",",",")","such","that","dimension","0","is","the","up\/down","action","and","dimension","1","is","the","left\/right","action",".","Now","if","we","would","like","to","split","this","action","correspondingly","we","can","wrap","the","env","with","the","following","config",":","split_config",":","action",":","action_up",":","indices",":","[","0","]","action_side",":","indices",":","[","1","]","Now","the","actions","as","well","as","the","action","space","is","consists","of","two","actions","(","action_up\/action_side",")",".",":","param","env",":","Environment\/wrapper","to","wrap",".",":","param","split_config",":","The","action","splitting","configuration","."]
docstr: Implementation of :class:`~maze.core.wrappers.wrapper.ActionWrapper` interface.
          
docstr_tok: ["Implementation","of",":","class",":","`","~maze.core.wrappers.wrapper.ActionWrapper","`","interface","."]
code: def action(
      self, action: Dict[str, np.ndarray]
  ) -> Dict[str, np.ndarray]:
      """Implementation of :class:`~maze.core.wrappers.wrapper.ActionWrapper` interface."""
      reversed_action = dict()
      tmp_corresponding_actions = dict()
      for action_name, action_value in action.items():
          if action_name in self.reverse_action_ref:
              action_indices = self.split_config[
                  self.reverse_action_ref[action_name]
              ][action_name]["indices"]
              if (
                  self.reverse_action_ref[action_name]
                  not in tmp_corresponding_actions
              ):
                  tmp_corresponding_actions[
                      self.reverse_action_ref[action_name]
                  ] = dict()
              for elem, index in enumerate(action_indices):
                  tmp_corresponding_actions[
                      self.reverse_action_ref[action_name]
                  ][index] = action_value[elem]
          else:
              reversed_action[action_name] = action_value
  
      for (
          org_action_name,
          split_action,
      ) in tmp_corresponding_actions.items():
          org_action = np.stack(
              [
                  split_action[index]
                  for index in range(len(split_action))
              ]
          )
          reversed_action[org_action_name] = org_action
  
      return reversed_action
  
file_path: maze/maze/core/wrappers/split_actions_wrapper.py
imports: from typing import Union, Dict, Tuple, List
  import gym
  import numpy
  from maze.core.annotations import override
  from maze.core.env.simulated_env_mixin import SimulatedEnvMixin
  from maze.core.env.structured_env import StructuredEnv
  from maze.core.env.structured_env_spaces_mixin import StructuredEnvSpacesMixin
  from maze.core.wrappers.wrapper import ActionWrapper, EnvType
label_desc: Use image node_id 6 for calling the SplitActionsWrapper obj's underlying member method code with example usage: obj.action(action) and returns: reversed_action