code: def _concat(values: types.NestedArray) -> np.ndarray:
      """Concatenates the leaves of `values` along the leading dimension.
  
      Treats scalars as 1d arrays and expects that the shapes of all leaves are
      the same except for the leading dimension.
  
      Args:
        values: the nested arrays to concatenate.
  
      Returns:
        The concatenated array.
      """
      leaves = list(map(np.atleast_1d, tree.flatten(values)))
      return np.concatenate(leaves)
  
file_path: acme/acme/wrappers/concatenate_observations.py
imports: from typing import Sequence, Optional
  from acme import types
  from acme.wrappers import base
  import dm_env
  import numpy
  import tree
label_desc: Use image node_id 1 for calling a global function with example usage: _concat(values) and returns: np