code: def to_dataframe_it(test):
      def period_index(entry: DataEntry, freq=None) -> pd.DatetimeIndex:
          if freq is None:
              freq = entry[FieldName.START].freq
  
          return pd.period_range(
              start=entry[FieldName.START],
              periods=entry[FieldName.TARGET].shape[-1],
              freq=freq,
          )
  
      def _to_dataframe(entry: Dict):
          return pd.DataFrame(
              entry["target"], index=period_index(entry)
          )
  
      return map(_to_dataframe, test)
  
file_path: gluonts/src/gluonts/nursery/temporal_hierarchical_forecasting/utils/gluonts_helper.py
imports: from typing import Dict
  import numpy
  import pandas
  from gluonts.dataset.common import DataEntry, Dataset
  from gluonts.dataset.field_names import FieldName
label_desc: Use image node_id 3 for calling a global function with example usage: to_dataframe_it(test) and returns: map, pd, pd