class_docstr: A wrapper class to handle multiple environments.
  
  This wrapper adds an integer 'task_id' to env_info every timestep.
  
  Args:
      envs (list(Environment)):
          A list of objects implementing Environment.
      sample_strategy (function(int, int)):
          Sample strategy to be used when sampling a new task.
      mode (str): A string from 'vanilla`, 'add-onehot' and 'del-onehot'.
          The type of observation to use.
          - 'vanilla' provides the observation as it is.
            Use case: metaworld environments with MT* algorithms,
                      gym environments with Task Embedding.
          - 'add-onehot' will append an one-hot task id to observation.
            Use case: gym environments with MT* algorithms.
          - 'del-onehot' assumes an one-hot task id is appended to
            observation, and it excludes that.
            Use case: metaworld environments with Task Embedding.
      env_names (list(str)): The names of the environments corresponding to
          envs. The index of an env_name must correspond to the index of the
          corresponding env in envs. An env_name in env_names must be unique.
class_docstr_tok: ["A","wrapper","class","to","handle","multiple","environments",".","This","wrapper","adds","an","integer","'task_id","'","to","env_info","every","timestep",".","Args",":","envs","(","list","(","Environment",")",")",":","A","list","of","objects","implementing","Environment",".","sample_strategy","(","function","(","int",",","int",")",")",":","Sample","strategy","to","be","used","when","sampling","a","new","task",".","mode","(","str",")",":","A","string","from","'vanilla","`",",","'add-onehot","'","and","'del-onehot","'",".","The","type","of","observation","to","use",".","-","'vanilla","'","provides","the","observation","as","it","is",".","Use","case",":","metaworld","environments","with","MT","*","algorithms",",","gym","environments","with","Task","Embedding",".","-","'add-onehot","'","will","append","an","one-hot","task","id","to","observation",".","Use","case",":","gym","environments","with","MT","*","algorithms",".","-","'del-onehot","'","assumes","an","one-hot","task","id","is","appended","to","observation",",","and","it","excludes","that",".","Use","case",":","metaworld","environments","with","Task","Embedding",".","env_names","(","list","(","str",")",")",":","The","names","of","the","environments","corresponding","to","envs",".","The","index","of","an","env_name","must","correspond","to","the","index","of","the","corresponding","env","in","envs",".","An","env_name","in","env_names","must","be","unique","."]
docstr: Observation space.
  
  Returns:
      akro.Box: Observation space.
docstr_tok: ["Observation","space",".","Returns",":","akro.Box",":","Observation","space","."]
code: def observation_space(self):
      """Observation space.
  
      Returns:
          akro.Box: Observation space.
  
      """
      if self._mode == "vanilla":
          return self._env.observation_space
      elif self._mode == "add-onehot":
          task_lb, task_ub = self.task_space.bounds
          env_lb, env_ub = self._env.observation_space.bounds
          return akro.Box(
              np.concatenate([env_lb, task_lb]),
              np.concatenate([env_ub, task_ub]),
          )
      else:  # self._mode == 'del-onehot'
          env_lb, env_ub = self._env.observation_space.bounds
          num_tasks = self._num_tasks
          return akro.Box(env_lb[:-num_tasks], env_ub[:-num_tasks])
  
file_path: garage/src/garage/envs/multi_env_wrapper.py
imports: import random
  import akro
  import numpy
  from garage import EnvSpec, EnvStep, Wrapper
label_desc: Use image node_id 2 for calling the MultiEnvWrapper obj's underlying member method code with example usage: obj.observation_space() and returns: self, akro, akro