class_docstr: A wrapper which can transform an environment from the old API to the new API.
  
  Old step API refers to step() method returning (observation, reward, done, info), and reset() only retuning the observation.
  New step API refers to step() method returning (observation, reward, terminated, truncated, info) and reset() returning (observation, info).
  (Refer to docs for details on the API change)
  
  Known limitations:
  - Environments that use `self.np_random` might not work as expected.
class_docstr_tok: ["A","wrapper","which","can","transform","an","environment","from","the","old","API","to","the","new","API",".","Old","step","API","refers","to","step","(",")","method","returning","(","observation",",","reward",",","done",",","info",")",",","and","reset","(",")","only","retuning","the","observation",".","New","step","API","refers","to","step","(",")","method","returning","(","observation",",","reward",",","terminated",",","truncated",",","info",")","and","reset","(",")","returning","(","observation",",","info",")",".","(","Refer","to","docs","for","details","on","the","API","change",")","Known","limitations",":","-","Environments","that","use","`","self.np_random","`","might","not","work","as","expected","."]
docstr: A wrapper which converts old-style envs to valid modern envs.
  
  Some information may be lost in the conversion, so we recommend updating your environment.
  
  Args:
      old_env (LegacyEnv): the env to wrap, implemented with the old API
      render_mode (str): the render mode to use when rendering the environment, passed automatically to env.render
docstr_tok: ["A","wrapper","which","converts","old-style","envs","to","valid","modern","envs",".","Some","information","may","be","lost","in","the","conversion",",","so","we","recommend","updating","your","environment",".","Args",":","old_env","(","LegacyEnv",")",":","the","env","to","wrap",",","implemented","with","the","old","API","render_mode","(","str",")",":","the","render","mode","to","use","when","rendering","the","environment",",","passed","automatically","to","env.render"]
code: def __init__(
      self, old_env: LegacyEnv, render_mode: Optional[str] = None
  ):
      """A wrapper which converts old-style envs to valid modern envs.
  
      Some information may be lost in the conversion, so we recommend updating your environment.
  
      Args:
          old_env (LegacyEnv): the env to wrap, implemented with the old API
          render_mode (str): the render mode to use when rendering the environment, passed automatically to env.render
      """
      self.metadata = getattr(old_env, "metadata", {"render_modes": []})
      self.render_mode = render_mode
      self.reward_range = getattr(old_env, "reward_range", None)
      self.spec = getattr(old_env, "spec", None)
      self.env = old_env
  
      self.observation_space = old_env.observation_space
      self.action_space = old_env.action_space
  
imports: import sys
  from typing import Any, Dict, Optional, Tuple
  import gym
  from gym.core import ObsType
  from gym.utils.step_api_compatibility import convert_to_terminated_truncated_step_api
label_desc: Use image node_id 1 to create a new EnvCompatibility object from inherited base classes: gym with example: obj = EnvCompatibility(old_env, render_mode)