code: def unpivot(df: pd.DataFrame) -> pd.DataFrame:
      """
      Unpivot data frame.
  
      The input dataframe has as index the time stamps,
      and one column per each time series of the hierarchy.
      We unpivot this so that the final dataframe has
      three columns, i.e. ``"unique_id"``, ``"ds"``, and ``"y"``, where
      1) ``"unique_id"`` has the name of the corresponding time series,
      2) ``"ds"`` has the corresponding time stamps,
      3) ``"y"`` has the actuals.
      """
  
      n, k = df.shape
      return pd.DataFrame(
          {
              "unique_id": np.asarray(df.columns).repeat(n),
              "ds": np.tile(np.asarray(df.index), k),
              "y": df.to_numpy().ravel("F"),
          }
      )
  
imports: from typing import List, Optional, Union, Any, Dict
  import numpy
  import pandas
  from statsforecast import StatsForecast
  from hierarchicalforecast.core import HierarchicalReconciliation
  from hierarchicalforecast.core import _build_fn_name
  from gluonts.core.component import validated
  from gluonts.dataset import DataEntry
  from gluonts.dataset.util import forecast_start
  from gluonts.model.predictor import RepresentablePredictor
  from gluonts.model.forecast import QuantileForecast
  from gluonts.ext.statsforecast import ModelConfig
label_desc: Use image node_id 3 for calling a global function with example usage: unpivot(df) and returns: pd