code: def _unpack(batched) -> Iterator:
      """
      Unpack batches.
  
      This assumes that arrays are wrapped in a  nested structure of lists and
      tuples, and each array has the same shape::
  
          >>> a = np.arange(5)
          >>> batched = [a, (a, [a, a, a])]
          >>> list(_unpack(batched))
          [[0, (0, [0, 0, 0])],
           [1, (1, [1, 1, 1])],
           [2, (2, [2, 2, 2])],
           [3, (3, [3, 3, 3])],
           [4, (4, [4, 4, 4])]]
      """
  
      if isinstance(batched, (list, tuple)):
          T = type(batched)
  
          return map(T, zip(*map(_unpack, batched)))
  
      return batched
  
imports: import logging
  from functools import singledispatch
  from typing import Callable, Iterator, List, Optional
  import numpy
  from gluonts.core.component import validated
  from gluonts.dataset.common import DataEntry
  from gluonts.dataset.field_names import FieldName
  from gluonts.itertools import select
  from gluonts.dataset.loader import DataLoader
  from gluonts.model.forecast import Forecast, QuantileForecast, SampleForecast
label_desc: Use image node_id 3 for calling a global function with example usage: _unpack(batched) and returns: batched, map