class_docstr: A wrapper which can transform an environment from new step API to old and vice-versa.
  
  Old step API refers to step() method returning (observation, reward, done, info)
  New step API refers to step() method returning (observation, reward, terminated, truncated, info)
  (Refer to docs for details on the API change)
  
  Args:
      env (gym.Env): the env to wrap. Can be in old or new API
      apply_step_compatibility (bool): Apply to convert environment to use new step API that returns two bools. (False by default)
  
  Examples:
      >>> env = gym.make("CartPole-v1")
      >>> env # wrapper not applied by default, set to new API
      <TimeLimit<OrderEnforcing<PassiveEnvChecker<CartPoleEnv<CartPole-v1>>>>>
      >>> env = gym.make("CartPole-v1", apply_api_compatibility=True) # set to old API
      <StepAPICompatibility<TimeLimit<OrderEnforcing<PassiveEnvChecker<CartPoleEnv<CartPole-v1>>>>>>
      >>> env = StepAPICompatibility(CustomEnv(), apply_step_compatibility=False) # manually using wrapper on unregistered envs
docstr: A wrapper which can transform an environment from new step API to old and vice-versa.
  
  Args:
      env (gym.Env): the env to wrap. Can be in old or new API
      output_truncation_bool (bool): Whether the wrapper's step method outputs two booleans (new API) or one boolean (old API)
docstr_tok: ["A","wrapper","which","can","transform","an","environment","from","new","step","API","to","old","and","vice-versa",".","Args",":","env","(","gym.Env",")",":","the","env","to","wrap",".","Can","be","in","old","or","new","API","output_truncation_bool","(","bool",")",":","Whether","the","wrapper","'s","step","method","outputs","two","booleans","(","new","API",")","or","one","boolean","(","old","API",")"]
code: def __init__(self, env: gym.Env, output_truncation_bool: bool = True):
      """A wrapper which can transform an environment from new step API to old and vice-versa.
  
      Args:
          env (gym.Env): the env to wrap. Can be in old or new API
          output_truncation_bool (bool): Whether the wrapper's step method outputs two booleans (new API) or one boolean (old API)
      """
      super().__init__(env)
      self.output_truncation_bool = output_truncation_bool
      if not self.output_truncation_bool:
          deprecation(
              "Initializing environment in old step API which returns one bool instead of two."
          )
  
imports: import gym
  from gym.logger import deprecation
  from gym.utils.step_api_compatibility import convert_to_done_step_api, convert_to_terminated_truncated_step_api
label_desc: Use image node_id 1 to create a new StepAPICompatibility object from inherited base classes: gym with example: obj = StepAPICompatibility(env, output_truncation_bool)