code: def test_aggregate_values(params, hourly_data_with_reg):
      model = MultistageForecastEstimator(**params)
      model.time_col_ = cst.TIME_COL
      model.value_col_ = cst.VALUE_COL
      model._initialize()
      df = model._add_agg_freq_cols(df=hourly_data_with_reg)
      df_agg = model._aggregate_values(
          df=df[[f"{cst.TIME_COL}__0__D", cst.VALUE_COL, "regressor"]],
          agg_freq="D",
          agg_func=np.nanmean,
          index=0,
      )
      assert len(df_agg) == 7 * 8  # data is 8 weeks.
      assert round(df_agg[cst.VALUE_COL].iloc[0], 3) == round(
          df[cst.VALUE_COL].iloc[:24].mean(), 3
      )
      assert round(df_agg["regressor"].iloc[0], 3) == round(
          df["regressor"].iloc[:24].mean(), 3
      )
  
imports: import datetime
  import numpy
  import pandas
  import pytest
  from testfixtures import LogCapture
  import greykite.common.constants
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.sklearn.estimator.lag_based_estimator import LagBasedEstimator
  from greykite.sklearn.estimator.multistage_forecast_estimator import MultistageForecastEstimator
  from greykite.sklearn.estimator.multistage_forecast_estimator import MultistageForecastModelConfig
  from greykite.sklearn.estimator.simple_silverkite_estimator import SimpleSilverkiteEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 15 for calling a global function with example usage: test_aggregate_values(params, hourly_data_with_reg) without return types