code: def test_record_video_step_trigger():
      env = gym.make("CartPole-v1", render_mode="rgb_array_list")
      env._max_episode_steps = 20
  
      env.reset()
      step_starting_index = 0
      episode_index = 0
      for step_index in range(199):
          action = env.action_space.sample()
          _, _, terminated, truncated, _ = env.step(action)
          if terminated or truncated:
              save_video(
                  env.render(),
                  "videos",
                  fps=env.metadata["render_fps"],
                  step_trigger=modulo_step_trigger(100),
                  step_starting_index=step_starting_index,
                  episode_index=episode_index,
              )
              step_starting_index = step_index + 1
              episode_index += 1
              env.reset()
      env.close()
  
      assert os.path.isdir("videos")
      mp4_files = [
          file for file in os.listdir("videos") if file.endswith(".mp4")
      ]
      shutil.rmtree("videos")
      assert len(mp4_files) == 2
  
file_path: gym/tests/utils/test_save_video.py
imports: import os
  import shutil
  import numpy
  import gym
  from gym.utils.save_video import capped_cubic_video_schedule, save_video
label_desc: Use image node_id 3 for calling a global function with example usage: test_record_video_step_trigger() without return types