code: def test_iterate_custom_space(space, batch_space):
      items = batch_space.sample()
      iterator = iterate(batch_space, items)
      i = 0
      for i, item in enumerate(iterator):
          assert item in space
      assert i == 3
  
file_path: gym/tests/vector/test_spaces.py
imports: import copy
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from gym.spaces import Box, Dict, MultiDiscrete, Space, Tuple
  from gym.vector.utils.spaces import batch_space, iterate
  from tests.vector.utils import CustomSpace, assert_rng_equal, custom_spaces, spaces
label_desc: Use image node_id 4 for calling a global function with example usage: test_iterate_custom_space(space, batch_space) without return types