class_docstr: This wrapper will issue a `truncated` signal if a maximum number of timesteps is exceeded.
  
  If a truncation is not defined inside the environment itself, this is the only place that the truncation signal is issued.
  Critically, this is different from the `terminated` signal that originates from the underlying environment as part of the MDP.
  
  Example:
     >>> from gym.envs.classic_control import CartPoleEnv
     >>> from gym.wrappers import TimeLimit
     >>> env = CartPoleEnv()
     >>> env = TimeLimit(env, max_episode_steps=1000)
docstr: Steps through the environment and if the number of steps elapsed exceeds ``max_episode_steps`` then truncate.
  
  Args:
      action: The environment step action
  
  Returns:
      The environment step ``(observation, reward, terminated, truncated, info)`` with `truncated=True`
      if the number of steps elapsed >= max episode steps
docstr_tok: ["Steps","through","the","environment","and","if","the","number","of","steps","elapsed","exceeds","``","max_episode_steps","``","then","truncate",".","Args",":","action",":","The","environment","step","action","Returns",":","The","environment","step","``","(","observation",",","reward",",","terminated",",","truncated",",","info",")","``","with","`","truncated=True","`","if","the","number","of","steps","elapsed",">","=","max","episode","steps"]
code: def step(self, action):
      """Steps through the environment and if the number of steps elapsed exceeds ``max_episode_steps`` then truncate.
  
      Args:
          action: The environment step action
  
      Returns:
          The environment step ``(observation, reward, terminated, truncated, info)`` with `truncated=True`
          if the number of steps elapsed >= max episode steps
  
      """
      observation, reward, terminated, truncated, info = self.env.step(
          action
      )
      self._elapsed_steps += 1
  
      if self._elapsed_steps >= self._max_episode_steps:
          truncated = True
  
      return observation, reward, terminated, truncated, info
  
imports: from typing import Optional
  import gym
label_desc: Use image node_id 2 for calling the TimeLimit obj's underlying member method code with example usage: obj.step(action) and returns: observation,  reward,  terminated,  truncated,  info