class_docstr: :class:`~EnvUpdate` that calls set_task with the provided task.
  
  Args:
      env_type (type): Type of environment.
      task (object): Opaque task type.
      wrapper_constructor (Callable[garage.Env, garage.Env] or None):
          Callable that wraps constructed environments.
class_docstr_tok: [":","class",":","`","~EnvUpdate","`","that","calls","set_task","with","the","provided","task",".","Args",":","env_type","(","type",")",":","Type","of","environment",".","task","(","object",")",":","Opaque","task","type",".","wrapper_constructor","(","Callable","[","garage.Env",",","garage.Env","]","or","None",")",":","Callable","that","wraps","constructed","environments","."]
docstr: Update an environment.
  
  Args:
      old_env (Environment or None): Previous environment. Should not be
          used after being passed in, and should not be closed.
  
  Returns:
      Environment: The new, updated environment.
docstr_tok: ["Update","an","environment",".","Args",":","old_env","(","Environment","or","None",")",":","Previous","environment",".","Should","not","be","used","after","being","passed","in",",","and","should","not","be","closed",".","Returns",":","Environment",":","The","new",",","updated","environment","."]
code: def __call__(self, old_env=None):
      """Update an environment.
  
      Args:
          old_env (Environment or None): Previous environment. Should not be
              used after being passed in, and should not be closed.
  
      Returns:
          Environment: The new, updated environment.
  
      """
      # We need exact type equality, not just a subtype
      # pylint: disable=unidiomatic-typecheck
      if old_env is None:
          return self._make_env()
      elif (
          type(getattr(old_env, "unwrapped", old_env)) != self._env_type
      ):
          warnings.warn(
              "SetTaskEnvUpdate is closing an environment. This "
              "may indicate a very slow TaskSampler setup."
          )
          old_env.close()
          return self._make_env()
      else:
          old_env.set_task(self._task)
          return old_env
  
file_path: garage/src/garage/sampler/env_update.py
imports: import warnings
label_desc: Use image node_id 3 for calling the SetTaskUpdate obj's underlying member method code with example usage: obj.__call__(old_env) and returns: self, self, old_env