code: def _iterate_tuple(space, items):
      # If this is a tuple of custom subspaces only, then simply iterate over items
      if all(
          isinstance(subspace, Space)
          and (not isinstance(subspace, BaseGymSpaces + (Tuple, Dict)))
          for subspace in space.spaces
      ):
          return iter(items)
  
      return zip(
          *[
              iterate(subspace, items[i])
              for i, subspace in enumerate(space.spaces)
          ]
      )
  
imports: from collections import OrderedDict
  from copy import deepcopy
  from functools import singledispatch
  from typing import Iterator
  import numpy
  from gym.error import CustomSpaceError
  from gym.spaces import Box, Dict, Discrete, MultiBinary, MultiDiscrete, Space, Tuple
label_desc: Use image node_id 12 for calling a global function with example usage: _iterate_tuple(space, items) and returns: zip, iter