code: def test_apply_default_model_components(
      model_components_param, silverkite
  ):
      model_components = apply_default_model_components()
      assert_equal(
          model_components.seasonality,
          {
              "fs_components_df": [
                  pd.DataFrame(
                      {
                          "name": ["tod", "tow", "tom", "toq", "toy"],
                          "period": [24.0, 7.0, 1.0, 1.0, 1.0],
                          "order": [3, 3, 1, 1, 5],
                          "seas_names": [
                              "daily",
                              "weekly",
                              "monthly",
                              "quarterly",
                              "yearly",
                          ],
                      }
                  )
              ],
          },
      )
      assert model_components.growth == {}
      assert model_components.events == {
          "daily_event_df_dict": [None],
          "daily_event_neighbor_impact": [None],
          "daily_event_shifted_effect": [None],
      }
      assert model_components.changepoints == {
          "changepoints_dict": [None],
          "seasonality_changepoints_dict": [None],
      }
      assert model_components.autoregression == {
          "autoreg_dict": [None],
          "simulation_num": [10],
          "fast_simulation": [False],
      }
      assert model_components.regressors == {}
      assert model_components.uncertainty == {
          "uncertainty_dict": [None],
      }
      assert_equal(
          model_components.custom,
          {
              "silverkite": [SilverkiteForecast()],
              "origin_for_time_vars": [None],
              "extra_pred_cols": ["ct1"],  # linear growth
              "drop_pred_cols": [None],
              "explicit_pred_cols": [None],
              "fit_algorithm_dict": [
                  {
                      "fit_algorithm": "linear",
                      "fit_algorithm_params": None,
                  }
              ],
              "min_admissible_value": [None],
              "max_admissible_value": [None],
              "regression_weight_col": [None],
              "remove_intercept": [False],
              "normalize_method": [None],
          },
          ignore_keys={
              "silverkite": None,
          },
      )
      assert (
          model_components.custom["silverkite"][0] != silverkite
      )  # a different instance was created
  
      # overwrite some parameters
      time_properties = {"origin_for_time_vars": 2020}
      original_components = dataclasses.replace(
          model_components_param
      )  # creates a copy
      updated_components = apply_default_model_components(
          model_components=model_components_param,
          time_properties=time_properties,
      )
      assert (
          original_components == model_components_param
      )  # not mutated by the function
      assert (
          updated_components.seasonality
          == model_components_param.seasonality
      )
      assert updated_components.events == {
          "daily_event_df_dict": [None],
          "daily_event_neighbor_impact": [None],
          "daily_event_shifted_effect": [None],
      }
      assert updated_components.changepoints == {
          "changepoints_dict": {  # combination of defaults and provided params
              "method": "uniform",
              "n_changepoints": 20,
          },
          "seasonality_changepoints_dict": [None],
      }
      assert updated_components.autoregression == {
          "autoreg_dict": [None],
          "simulation_num": [10],
          "fast_simulation": [False],
      }
      assert (
          updated_components.uncertainty
          == model_components_param.uncertainty
      )
      assert (
          updated_components.custom
          == {  # combination of defaults and provided params
              "silverkite": silverkite,  # the same object that was passed in (not a copy)
              "origin_for_time_vars": [
                  time_properties["origin_for_time_vars"]
              ],  # from time_properties
              "extra_pred_cols": [
                  ["ct1"],
                  ["ct2"],
                  ["regressor1", "regressor3"],
              ],
              "drop_pred_cols": [None],
              "explicit_pred_cols": [None],
              "max_admissible_value": 4,
              "fit_algorithm_dict": [
                  {
                      "fit_algorithm": "linear",
                      "fit_algorithm_params": None,
                  }
              ],
              "min_admissible_value": [None],
              "normalize_method": [None],
              "regression_weight_col": [None],
              "remove_intercept": [False],
          }
      )
  
      # `time_properties` without start_year key
      updated_components = apply_default_model_components(
          model_components=model_components_param, time_properties={}
      )
      assert updated_components.custom["origin_for_time_vars"] == [None]
  
      updated_components = apply_default_model_components(
          model_components=ModelComponentsParam(
              autoregression={
                  "autoreg_dict": {
                      "lag_dict": {"orders": [7]},
                      "agg_lag_dict": {
                          "orders_list": [[7, 7 * 2, 7 * 3]],
                          "interval_list": [(7, 7 * 2)],
                      },
                      "series_na_fill_func": lambda s: s.bfill().ffill(),
                  }
              }
          )
      )
  
      autoreg_dict = updated_components.autoregression["autoreg_dict"]
      assert autoreg_dict["lag_dict"] == {"orders": [7]}
      assert autoreg_dict["agg_lag_dict"]["orders_list"] == [
          [7, 14, 21]
      ]
      assert autoreg_dict["agg_lag_dict"]["interval_list"] == [(7, 14)]
  
      updated_components = apply_default_model_components(
          model_components=ModelComponentsParam(
              lagged_regressors={
                  "lagged_regressor_dict": {
                      "regressor2": {
                          "lag_dict": {"orders": [5]},
                          "agg_lag_dict": {
                              "orders_list": [[7, 7 * 2, 7 * 3]],
                              "interval_list": [(8, 7 * 2)],
                          },
                          "series_na_fill_func": lambda s: s.bfill().ffill(),
                      }
                  }
              }
          )
      )
      lagged_regressor_dict = updated_components.lagged_regressors[
          "lagged_regressor_dict"
      ]
      assert list(lagged_regressor_dict.keys()) == ["regressor2"]
      assert lagged_regressor_dict["regressor2"]["lag_dict"] == {
          "orders": [5]
      }
      assert lagged_regressor_dict["regressor2"]["agg_lag_dict"][
          "orders_list"
      ] == [[7, 14, 21]]
      assert lagged_regressor_dict["regressor2"]["agg_lag_dict"][
          "interval_list"
      ] == [(8, 14)]
  
imports: import dataclasses
  import datetime
  import warnings
  import numpy
  import pandas
  import pytest
  from greykite.algo.forecast.silverkite.forecast_silverkite import SilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import generate_holiday_events
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import get_event_pred_cols
  from greykite.common.constants import ADJUSTMENT_DELTA_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import METRIC_COL
  from greykite.common.constants import PREDICTION_BAND_COVERAGE
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
  from greykite.framework.constants import COMPUTATION_N_JOBS
  from greykite.framework.constants import CV_REPORT_METRICS_ALL
  from greykite.framework.templates.autogen.forecast_config import ComputationParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationMetricParam
  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.model_templates import ModelTemplateEnum
  from greykite.framework.templates.silverkite_template import SilverkiteTemplate
  from greykite.framework.templates.silverkite_template import apply_default_model_components
  from greykite.framework.templates.silverkite_template import get_extra_pred_cols
  from greykite.framework.utils.framework_testing_utils import assert_basic_pipeline_equal
  from greykite.framework.utils.framework_testing_utils import check_forecast_pipeline_result
  from greykite.sklearn.estimator.silverkite_estimator import SilverkiteEstimator
label_desc: Use image node_id 4 for calling a global function with example usage: test_apply_default_model_components(model_components_param, silverkite) without return types