code: def make_timestep_limited(env, timestep_limit):
      t = [1]
      old_step = env.step
      old_reset = env.reset
  
      def step(action):
          observation, reward, done, info = old_step(action)
          if t[0] >= timestep_limit:
              done = True
          t[0] += 1
          return observation, reward, done, info
  
      def reset():
          t[0] = 1
          return old_reset()
  
      env.step = step
      env.reset = reset
  
imports: import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: make_timestep_limited(env, timestep_limit) and returns: observation,  reward,  done,  info, old_reset