code: def test_get_multistage_forecast_configs_override(
      df, forecast_config
  ):
      template = MultistageForecastTemplate()
      template.df = df
      # Adds a list of length 2 to each submodel.
      # The result hyperparameter grid should have 2 * 2 = 4 grids.
      forecast_config.model_components_param.custom[
          "multistage_forecast_configs"
      ][0].model_components.seasonality["weekly_seasonality"] = [1, 2]
      forecast_config.model_components_param.custom[
          "multistage_forecast_configs"
      ][1].model_components.seasonality["daily_seasonality"] = [10, 12]
      template.config = forecast_config
  
      default_model_components = template._MultistageForecastTemplate__get_default_model_components(
          forecast_config.model_template
      )
      default_multistage_forecast_configs = (
          default_model_components.custom.get(
              "multistage_forecast_configs"
          )
      )
  
      new_configs = template._MultistageForecastTemplate__get_multistage_forecast_configs_override(
          custom=forecast_config.model_components_param.custom,
          model_template="SILVERKITE_TWO_STAGE",
          default_multistage_forecast_configs=default_multistage_forecast_configs,
      )
  
      assert new_configs == [
          MultistageForecastTemplateConfig(
              train_length="30D",
              fit_length=None,
              agg_func="nanmean",
              agg_freq="D",
              model_template="SILVERKITE",
              model_components=ModelComponentsParam(
                  autoregression={"autoreg_dict": "auto"},
                  changepoints={
                      "changepoints_dict": None,
                      "seasonality_changepoints_dict": None,
                  },
                  custom={
                      "fit_algorithm_dict": {
                          "fit_algorithm": "ridge",
                          "fit_algorithm_params": None,
                      },
                      "feature_sets_enabled": "auto",
                      "max_daily_seas_interaction_order": 0,
                      "max_weekly_seas_interaction_order": 2,
                      "extra_pred_cols": [],
                      "min_admissible_value": None,
                      "max_admissible_value": None,
                      "drop_pred_cols": None,
                      "explicit_pred_cols": None,
                      "regression_weight_col": None,
                      "remove_intercept": False,
                      "normalize_method": "zero_to_one",
                  },
                  events={
                      "holidays_to_model_separately": "auto",
                      "holiday_lookup_countries": "auto",
                      "holiday_pre_num_days": 1,
                      "holiday_post_num_days": 1,
                      "holiday_pre_post_num_dict": None,
                      "daily_event_df_dict": None,
                      "daily_event_neighbor_impact": None,
                      "daily_event_shifted_effect": None,
                  },
                  growth={"growth_term": "linear"},
                  hyperparameter_override={},
                  regressors={"regressor_cols": []},
                  lagged_regressors={"lagged_regressor_dict": None},
                  seasonality={
                      "yearly_seasonality": 12,
                      "quarterly_seasonality": 5,
                      "monthly_seasonality": 5,
                      "weekly_seasonality": [1, 2],
                      "daily_seasonality": 0,
                  },
                  uncertainty={"uncertainty_dict": None},
              ),
          ),
          MultistageForecastTemplateConfig(
              train_length="7D",
              fit_length=None,
              agg_func="nanmean",
              agg_freq=None,
              model_template="SILVERKITE",
              model_components=ModelComponentsParam(
                  autoregression={"autoreg_dict": "auto"},
                  changepoints={
                      "changepoints_dict": None,
                      "seasonality_changepoints_dict": None,
                  },
                  custom={
                      "fit_algorithm_dict": {
                          "fit_algorithm": "ridge",
                          "fit_algorithm_params": None,
                      },
                      "feature_sets_enabled": "auto",
                      "max_daily_seas_interaction_order": 5,
                      "max_weekly_seas_interaction_order": 2,
                      "extra_pred_cols": [],
                      "min_admissible_value": None,
                      "max_admissible_value": None,
                      "drop_pred_cols": None,
                      "explicit_pred_cols": None,
                      "regression_weight_col": None,
                      "remove_intercept": False,
                      "normalize_method": "zero_to_one",
                  },
                  events={
                      "holidays_to_model_separately": [],
                      "holiday_lookup_countries": [],
                      "holiday_pre_num_days": 0,
                      "holiday_post_num_days": 0,
                      "holiday_pre_post_num_dict": None,
                      "daily_event_df_dict": None,
                      "daily_event_neighbor_impact": None,
                      "daily_event_shifted_effect": None,
                  },
                  growth={"growth_term": None},
                  hyperparameter_override={},
                  regressors={"regressor_cols": []},
                  lagged_regressors={"lagged_regressor_dict": None},
                  seasonality={
                      "yearly_seasonality": 0,
                      "quarterly_seasonality": 0,
                      "monthly_seasonality": 0,
                      "weekly_seasonality": 0,
                      "daily_seasonality": [10, 12],
                  },
                  uncertainty={"uncertainty_dict": None},
              ),
          ),
      ]
  
imports: import datetime
  import numpy
  import pytest
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.multistage_forecast_template import MultistageForecastTemplate
  from greykite.framework.templates.multistage_forecast_template_config import SILVERKITE_TWO_STAGE
  from greykite.framework.templates.multistage_forecast_template_config import MultistageForecastTemplateConfig
  from greykite.framework.templates.simple_silverkite_template import SimpleSilverkiteTemplate
  from greykite.sklearn.estimator.simple_silverkite_estimator import SimpleSilverkiteEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 11 for calling a global function with example usage: test_get_multistage_forecast_configs_override(df, forecast_config) without return types