code: def test_silverkite_longterm():
      # testing long term forecast
      # generate 3 years of data
      data = generate_df_for_tests(freq="1D", periods=3 * 52 * 7)
      df = data["df"]
      coverage = 0.1  # low value to make sure defaults are overridden
      hyperparameter_grid = {
          "estimator__origin_for_time_vars": [2018],
          "estimator__fs_components_df": [
              pd.DataFrame(
                  {
                      "name": ["tow", "conti_year"],
                      "period": [7.0, 1.0],
                      "order": [3, 5],
                      "seas_names": ["weekly", "yearly"],
                  }
              )
          ],
          "estimator__extra_pred_cols": [["ct_sqrt"]],
          "estimator__fit_algorithm_dict": [
              {"fit_algorithm": "linear"}
          ],
      }
  
      # run pipeline with 42 CV folds, 1 parameter set
      forecast_horizon = 52 * 7
      cv_horizon = forecast_horizon
      test_horizon = forecast_horizon
      periods_between_train_test = 2
      with pytest.warns(UserWarning) as record:
          result = forecast_pipeline(
              df,
              time_col="ts",
              value_col="y",
              date_format=None,  # not recommended, but possible to specify
              freq=None,
              estimator=SilverkiteEstimator(),
              hyperparameter_grid=hyperparameter_grid,
              hyperparameter_budget=1,
              n_jobs=-1,
              forecast_horizon=forecast_horizon,
              coverage=coverage,
              test_horizon=test_horizon,
              periods_between_train_test=periods_between_train_test,
              agg_periods=7,
              agg_func=np.mean,
              score_func=mean_absolute_error,  # callable score_func
              score_func_greater_is_better=False,
              null_model_params=None,
              cv_horizon=cv_horizon,
              cv_expanding_window=True,
              cv_min_train_periods=8 * 7,
              cv_periods_between_splits=7,
              cv_periods_between_train_test=3 * 7,
              cv_max_splits=None,
          )
  
          # gathers all warning messages
          all_warnings = ""
          for i in range(len(record)):
              all_warnings += record[i].message.args[0]
          assert (
              "`min_train_periods` is too small for your `forecast_horizon`. Should be at "
              "least 728=2*`forecast_horizon`." in all_warnings
          )
          assert (
              "There is a high number of CV splits (41). If training is slow, increase "
              "`periods_between_splits` or `min_train_periods`, or decrease `max_splits`"
              in all_warnings
          )
          check_forecast_pipeline_result(
              result,
              coverage=coverage,
              expected_grid_size=1,
              lower_bound_cv=0.0,
              score_func=mean_absolute_error,
              greater_is_better=False,
          )
  
      expected_backtest_train_size = (
          result.timeseries.fit_df.shape[0]
          - test_horizon
          - periods_between_train_test
      )
      assert (
          result.backtest.estimator.model_dict["x_mat"].shape[0]
          == expected_backtest_train_size
      )
      expected_forecast_train_size = result.timeseries.fit_df.shape[0]
      assert (
          result.forecast.estimator.model_dict["x_mat"].shape[0]
          == expected_forecast_train_size
      )
  
imports: import datetime
  import math
  import sys
  import warnings
  import numpy
  import pandas
  import pytest
  from scipy.stats import randint
  from sklearn.metrics import explained_variance_score
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from sklearn.pipeline import Pipeline
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import ADJUSTMENT_DELTA_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import FRACTION_OUTSIDE_TOLERANCE
  from greykite.common.constants import METRIC_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import QUANTILE_SUMMARY_COL
  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.constants import R2_null_model_score
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import add_finite_filter_to_scorer
  from greykite.common.evaluation import add_preaggregation_to_scorer
  from greykite.common.python_utils import assert_equal
  from greykite.common.python_utils import unique_elements_in_list
  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 CV_REPORT_METRICS_ALL
  from greykite.framework.constants import FRACTION_OUTSIDE_TOLERANCE_NAME
  from greykite.framework.input.univariate_time_series import UnivariateTimeSeries
  from greykite.framework.pipeline.pipeline import forecast_pipeline
  from greykite.framework.templates.prophet_template import ProphetTemplate
  from greykite.framework.utils.framework_testing_utils import check_forecast_pipeline_result
  from greykite.framework.utils.framework_testing_utils import mock_pipeline
  from greykite.sklearn.estimator.null_model import DummyEstimator
  from greykite.sklearn.estimator.prophet_estimator import ProphetEstimator
  from greykite.sklearn.estimator.silverkite_estimator import SilverkiteEstimator
  from greykite.sklearn.estimator.simple_silverkite_estimator import SimpleSilverkiteEstimator
  from greykite.sklearn.transform.column_selector import ColumnSelector
  from greykite.sklearn.transform.drop_degenerate_transformer import DropDegenerateTransformer
  from greykite.sklearn.transform.dtype_column_selector import DtypeColumnSelector
  from greykite.sklearn.transform.normalize_transformer import NormalizeTransformer
  from greykite.sklearn.transform.null_transformer import NullTransformer
  from greykite.sklearn.transform.pandas_feature_union import PandasFeatureUnion
  from greykite.sklearn.transform.zscore_outlier_transformer import ZscoreOutlierTransformer
label_desc: Use image node_id 17 for calling a global function with example usage: test_silverkite_longterm() without return types