code: def test_get_agg_dfs(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 = df.iloc[
          1:-1
      ]  # both the beginning period and the end period are incomplete.
      result = model._get_agg_dfs(
          df=df,
          agg_freq="D",
          agg_func=np.mean,
          train_length_in_seconds=60 * 60 * 24 * 30,
          fit_length_in_seconds=60 * 60 * 24 * 30,
          num_points_per_agg_freq=24,
          max_ar_order=5,
          index=0,
      )
      assert len(result["train_df"]) == 30
      assert (
          len(result["fit_df"]) == 32
      )  # fit includes incomplete periods on purpose
      # ``past_df`` includes 1 more period to avoid errors
      # This is to ensure there is no gap between ``past_df`` and ``train_df``,
      # as well as to ensure we have at least the length of ``past_df`` needed for AR.
      # Extra terms of ``past_df`` will be handled in ``SilverkiteForecast``.
      assert len(result["past_df"]) == 6
      assert result["fit_df_has_incomplete_period"] is True
  
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 16 for calling a global function with example usage: test_get_agg_dfs(params, hourly_data_with_reg) without return types