def _unpack_sf_dict(
    forecast_dict: dict,
    levels: Optional[list[float]],
) -> np.ndarray:
    """Unpack the dictionary that is returned by the StatsForecast 'predict()' method.

    Into an array of quantile predictions with shape (n (horizon), n quantiles) ordered by increasing quantile.
    """
    mu = np.expand_dims(forecast_dict["mean"], -1)
    if levels is None:
        return mu

    lows = np.concatenate(
        [np.expand_dims(forecast_dict[f"lo-{level}"], -1) for level in levels], axis=1
    )
    highs = np.concatenate(
        [np.expand_dims(forecast_dict[f"hi-{level}"], -1) for level in levels[::-1]],
        axis=1,
    )
    return np.concatenate([lows, mu, highs], axis=1)
Unpack the dictionary that is returned by the StatsForecast 'predict()' method.

    Into an array of quantile predictions with shape (n (horizon), n quantiles) ordered by increasing quantile.
    
darts/models/forecasting/sf_model.py