code: def make_rendered(env, *render_args, **render_kwargs):
      base_step = env.step
      base_close = env.close
  
      def step(action):
          ret = base_step(action)
          env.render(*render_args, **render_kwargs)
          return ret
  
      def close():
          env.render(*render_args, close=True, **render_kwargs)
          base_close()
  
      env.step = step
      env.close = close
  
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: make_rendered(env) and returns: ret