code: def check_vecenv_spaces(vec_env_class, space, obs_assert):
      """Helper method to check observation spaces in vectorized environments."""
  
      def make_env():
          return CustomGymEnv(space)
  
      vec_env = vec_env_class([make_env for _ in range(N_ENVS)])
      obs = vec_env.reset()
      obs_assert(obs)
  
      dones = [False] * N_ENVS
      while not any(dones):
          actions = [
              vec_env.action_space.sample() for _ in range(N_ENVS)
          ]
          obs, _rews, dones, _infos = vec_env.step(actions)
          obs_assert(obs)
      vec_env.close()
  
imports: import collections
  import functools
  import itertools
  import multiprocessing
  import pytest
  import gym
  import numpy
  from stable_baselines.common.vec_env import DummyVecEnv, SubprocVecEnv, VecNormalize, VecFrameStack
label_desc: Use image node_id 3 for calling a global function with example usage: check_vecenv_spaces(vec_env_class, space, obs_assert) and returns: CustomGymEnv