code: def test_record_episode_statistics_with_vectorenv(
      num_envs, asynchronous
  ):
      envs = gym.vector.make(
          "CartPole-v1",
          render_mode=None,
          num_envs=num_envs,
          asynchronous=asynchronous,
          disable_env_checker=True,
      )
      envs = RecordEpisodeStatistics(envs)
      max_episode_step = (
          envs.env_fns[0]().spec.max_episode_steps
          if asynchronous
          else envs.env.envs[0].spec.max_episode_steps
      )
      envs.reset()
      for _ in range(max_episode_step + 1):
          _, _, terminateds, truncateds, infos = envs.step(
              envs.action_space.sample()
          )
          if any(terminateds) or any(truncateds):
              assert "episode" in infos
              assert "_episode" in infos
              assert all(
                  infos["_episode"]
                  == np.bitwise_or(terminateds, truncateds)
              )
              assert all(
                  [item in infos["episode"] for item in ["r", "l", "t"]]
              )
              break
          else:
              assert "episode" not in infos
              assert "_episode" not in infos
  
file_path: gym/tests/wrappers/test_record_episode_statistics.py
imports: import numpy
  import pytest
  import gym
  from gym.wrappers import RecordEpisodeStatistics, VectorListInfo
  from gym.wrappers.record_episode_statistics import add_vector_episode_statistics
label_desc: Use image node_id 3 for calling a global function with example usage: test_record_episode_statistics_with_vectorenv(num_envs, asynchronous) without return types