code: def step_env(env, n=10, visualize=True):
      """Step env helper.
  
      Args:
          env (Environment): Input environment.
          n (int): Steps.
          visualize (bool): Whether visualize the environment.
  
      """
      env.reset()
      if visualize and issubclass(type(env), Environment):
          env.visualize()
      for _ in range(n):
          print("itr:", _)
          es = env.step(env.action_space.sample())
          if es.last:
              break
  
file_path: garage/tests/helpers.py
imports: import cloudpickle
  import numpy
  import pytest
  from garage import Environment
  from tests.quirks import KNOWN_GYM_RENDER_NOT_IMPLEMENTED
label_desc: Use image node_id 1 for calling a global function with example usage: step_env(env, n, visualize) without return types