def METHOD_NAME(
    self,
    feat_dynamic_real: Optional[pd.DataFrame] = None,
):
    """
    Convert the hierarchical time series into
    `gluonts.dataset.PandasDataset`.
    Note: Currently only dynamic real features are used by the hierarchical
    model. However, the model internally creates a categorical feature
    to distinguish between different time series of the hierarchy.
    Parameters
    ----------
    feat_dynamic_real
        A pandas dataframe containing dynamic features as columns.
        Note that features of any (or all) time series in the hierarchy
        can be passed here, since all time series are considered together
        as a single multivariate time series.
    Returns
    -------
    PandasDataset
        An instance of `PandasDataset`.
    """
    future_length = 0
    if feat_dynamic_real is not None:
        assert (
            self.ts_at_all_levels.index[0] == feat_dynamic_real.index[0]
        ), (
            "The staring time point of dynamic features should match "
            "with that of the hierarchical time series. "
            f"Start of `feat_dynamic_real`: "
            f"{feat_dynamic_real.index[0]} and "
            f"the start of hierarchical time series: "
            f"{self.ts_at_all_levels.index[0]}."
        )
        assert feat_dynamic_real.index.intersection(
            self.ts_at_all_levels.index
        ).equals(self.ts_at_all_levels.index), (
            "Dynamic features should be provided for all time "
            "points where the target is defined. "
            f"Index of `feat_dynamic_real`: {feat_dynamic_real.index}, \n"
            f"Index of `ts_at_all_levels` of `hts`: "
            f"{self.ts_at_all_levels.index}. \n "
            "Check if the periods of these indices also match. \n"
        )
        feat_dynamic_real.columns = [
            f"feat_dynamic_real_{col}" for col in feat_dynamic_real.columns
        ]
        future_length = len(feat_dynamic_real.index) - len(
            self.ts_at_all_levels.index
        )
    else:
        feat_dynamic_real = pd.DataFrame()
    pandas_ds = PandasDataset(
        dataframes=pd.concat(
            [self.ts_at_all_levels, feat_dynamic_real],
            axis=1,
        ),
        target=list(self.ts_at_all_levels.columns),
        feat_dynamic_real=list(feat_dynamic_real.columns),
        future_length=future_length,
    )
    return pandas_ds