code: def concatenate(
      space: Space, items: Iterable, out: Union[tuple, dict, np.ndarray]
  ) -> Union[tuple, dict, np.ndarray]:
      """Concatenate multiple samples from space into a single object.
  
      Example::
  
          >>> from gym.spaces import Box
          >>> space = Box(low=0, high=1, shape=(3,), dtype=np.float32)
          >>> out = np.zeros((2, 3), dtype=np.float32)
          >>> items = [space.sample() for _ in range(2)]
          >>> concatenate(space, items, out)
          array([[0.6348213 , 0.28607962, 0.60760117],
                 [0.87383074, 0.192658  , 0.2148103 ]], dtype=float32)
  
      Args:
          space: Observation space of a single environment in the vectorized environment.
          items: Samples to be concatenated.
          out: The output object. This object is a (possibly nested) numpy array.
  
      Returns:
          The output object. This object is a (possibly nested) numpy array.
  
      Raises:
          ValueError: Space is not a valid :class:`gym.Space` instance
      """
      raise ValueError(
          f"Space of type `{type(space)}` is not a valid `gym.Space` instance."
      )
  
file_path: gym/gym/vector/utils/numpy_utils.py
imports: from collections import OrderedDict
  from functools import singledispatch
  from typing import Iterable, Union
  import numpy
  from gym.spaces import Box, Dict, Discrete, MultiBinary, MultiDiscrete, Space, Tuple
label_desc: Use image node_id 1 for calling a global function with example usage: concatenate(space, items, out) without return types