class_docstr: Internal wrapper to translate any gym.Envs into a VectorEnv object.
class_docstr_tok: ["Internal","wrapper","to","translate","any","gym.Envs","into","a","VectorEnv","object","."]
code: def restart_at(self, index: Optional[int] = None) -> None:
      if index is None:
          index = 0
  
      # Try closing down the old (possibly faulty) sub-env, but ignore errors.
      try:
          self.envs[index].close()
      except Exception as e:
          if log_once("close_sub_env"):
              logger.warning(
                  "Trying to close old and replaced sub-environment (at vector "
                  f"index={index}), but closing resulted in error:\n{e}"
              )
  
      # Re-create the sub-env at the new index.
      logger.warning(
          f"Trying to restart sub-environment at index {index}."
      )
      self.envs[index] = self.make_env(index)
      logger.warning(
          f"Sub-environment at index {index} restarted successfully."
      )
  
imports: import logging
  import gymnasium
  import numpy
  from typing import Callable, List, Optional, Tuple, Union, Set
  from ray.rllib.env.base_env import BaseEnv, _DUMMY_AGENT_ID
  from ray.rllib.utils.annotations import Deprecated, override, PublicAPI
  from ray.rllib.utils.typing import EnvActionType, EnvID, EnvInfoDict, EnvObsType, EnvType, MultiEnvDict, AgentID
  from ray.util import log_once
label_desc: Use image node_id 4 for calling the _VectorizedGymEnv obj's underlying member method code with example usage: obj.restart_at(index) without return types