code: def test_get_estimators_and_params_from_template_configs(
      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,
      )
  
      (
          estimator_list,
          estimator_params_list,
      ) = template._MultistageForecastTemplate__get_estimators_and_params_from_template_configs(
          new_configs=new_configs
      )
  
      # We can't test ``time_properties``
      for d in estimator_params_list:
          del d["estimator__time_properties"]
  
      assert estimator_list == [
          SimpleSilverkiteEstimator,
          SimpleSilverkiteEstimator,
      ]
      assert estimator_params_list == [
          {
              "estimator__auto_seasonality": [False],
              "estimator__yearly_seasonality": [12],
              "estimator__quarterly_seasonality": [5],
              "estimator__monthly_seasonality": [5],
              "estimator__weekly_seasonality": [1, 2],
              "estimator__daily_seasonality": [0],
              "estimator__auto_growth": [False],
              "estimator__growth_term": ["linear"],
              "estimator__changepoints_dict": [None],
              "estimator__seasonality_changepoints_dict": [None],
              "estimator__auto_holiday": [False],
              "estimator__holidays_to_model_separately": ["auto"],
              "estimator__holiday_lookup_countries": ["auto"],
              "estimator__holiday_pre_num_days": [1],
              "estimator__holiday_post_num_days": [1],
              "estimator__holiday_pre_post_num_dict": [None],
              "estimator__daily_event_df_dict": [None],
              "estimator__auto_holiday_params": [None],
              "estimator__daily_event_neighbor_impact": [None],
              "estimator__daily_event_shifted_effect": [None],
              "estimator__feature_sets_enabled": ["auto"],
              "estimator__fit_algorithm_dict": [
                  {
                      "fit_algorithm": "ridge",
                      "fit_algorithm_params": None,
                  }
              ],
              "estimator__max_daily_seas_interaction_order": [0],
              "estimator__max_weekly_seas_interaction_order": [2],
              "estimator__extra_pred_cols": [[]],
              "estimator__drop_pred_cols": [None],
              "estimator__explicit_pred_cols": [None],
              "estimator__min_admissible_value": [None],
              "estimator__max_admissible_value": [None],
              "estimator__normalize_method": ["zero_to_one"],
              "estimator__autoreg_dict": ["auto"],
              "estimator__simulation_num": [10],
              "estimator__fast_simulation": [False],
              "estimator__regressor_cols": [[]],
              "estimator__lagged_regressor_dict": [None],
              "estimator__regression_weight_col": [None],
              "estimator__remove_intercept": [False],
              "estimator__uncertainty_dict": [None],
              "estimator__origin_for_time_vars": [None],
              "estimator__train_test_thresh": [None],
              "estimator__training_fraction": [None],
          },
          {
              "estimator__auto_seasonality": [False],
              "estimator__yearly_seasonality": [0],
              "estimator__quarterly_seasonality": [0],
              "estimator__monthly_seasonality": [0],
              "estimator__weekly_seasonality": [0],
              "estimator__daily_seasonality": [10, 12],
              "estimator__auto_growth": [False],
              "estimator__growth_term": [None],
              "estimator__changepoints_dict": [None],
              "estimator__seasonality_changepoints_dict": [None],
              "estimator__auto_holiday": [False],
              "estimator__holidays_to_model_separately": [[]],
              "estimator__holiday_lookup_countries": [[]],
              "estimator__holiday_pre_num_days": [0],
              "estimator__holiday_post_num_days": [0],
              "estimator__holiday_pre_post_num_dict": [None],
              "estimator__daily_event_df_dict": [None],
              "estimator__auto_holiday_params": [None],
              "estimator__daily_event_neighbor_impact": [None],
              "estimator__daily_event_shifted_effect": [None],
              "estimator__feature_sets_enabled": ["auto"],
              "estimator__fit_algorithm_dict": [
                  {
                      "fit_algorithm": "ridge",
                      "fit_algorithm_params": None,
                  }
              ],
              "estimator__max_daily_seas_interaction_order": [5],
              "estimator__max_weekly_seas_interaction_order": [2],
              "estimator__extra_pred_cols": [[]],
              "estimator__drop_pred_cols": [None],
              "estimator__explicit_pred_cols": [None],
              "estimator__min_admissible_value": [None],
              "estimator__max_admissible_value": [None],
              "estimator__normalize_method": ["zero_to_one"],
              "estimator__autoreg_dict": ["auto"],
              "estimator__simulation_num": [10],
              "estimator__fast_simulation": [False],
              "estimator__regressor_cols": [[]],
              "estimator__lagged_regressor_dict": [None],
              "estimator__regression_weight_col": [None],
              "estimator__remove_intercept": [False],
              "estimator__uncertainty_dict": [None],
              "estimator__origin_for_time_vars": [None],
              "estimator__train_test_thresh": [None],
              "estimator__training_fraction": [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 12 for calling a global function with example usage: test_get_estimators_and_params_from_template_configs(df, forecast_config) without return types