code: def test_forecast_simple_silverkite_freq():
      """Tests if ``forecast_silverkite`` can run with the parameters
      from ``convert_simple_silverkite_params`` on any frequency.
  
      Main purpose is to check that the constructed ``extra_pred_cols``
      are available for forecasting. The values of passthrough parameters
      are tested above, and test cases of ``forecast_silverkite`` show that
      they work.
      """
      # Sets recursion limit to make the test case pass for pytest 5.3.5 and above.
      # The final test_setting below has 494 terms in the model formula.
      # Patsy uses recursion to generate the model formula, so the number
      # of terms is limited by recursion depth (see https://github.com/pydata/patsy/issues/18)
      # Within pytest, the default recursion limit is 3000.
      # Setting it explicitly here makes the test pass.
      sys.setrecursionlimit(3000)
  
      test_settings = [
          # freq, period, forecast_horizon
          ("Y", 10, 1),  # short-range train/predict
          ("MS", 20, 2),
          ("W-TUE", 100, 20),
          ("D", 10, 1),
          ("D", 400, 30),
          (
              "H",
              20 * 24,
              2 * 365 * 24,
          ),  # long-range prediction to test unobserved categorical levels
          (
              "H",
              400 * 24,
              100 * 24,
          ),  # long-range training to make sure all features are present
      ]
      with warnings.catch_warnings():
          warnings.simplefilter("ignore")
          # suppresses test case warnings that can be ignored
          #   - The granularity of data is larger than daily. Ensure the daily events data match the timestamps
          #   - The default of the `iid` parameter will change from True to False...
          #   - R^2 score is not well-defined with less than two samples.
          #   - y_true is constant. Correlation is not defined.
          for freq, periods, forecast_horizon in test_settings:
              iteration = f"freq={freq}, periods={periods}, horizon={forecast_horizon}"
              data = generate_df_for_tests(freq=freq, periods=periods)[
                  "df"
              ]
  
              # trains a model
              silverkite = SimpleSilverkiteForecast()
              trained_model = silverkite.forecast_simple(
                  df=data,
                  time_col=cst.TIME_COL,
                  value_col=cst.VALUE_COL,
                  forecast_horizon=forecast_horizon,
              )
  
              # checks the parameters
              parameters = silverkite.convert_params(
                  df=data,
                  time_col=cst.TIME_COL,
                  value_col=cst.VALUE_COL,
                  forecast_horizon=forecast_horizon,
              )
              keys_to_check = [
                  "time_col",
                  "value_col",
                  "origin_for_time_vars",
                  "uncertainty_dict",
              ]
              actual = {
                  k: v
                  for k, v in trained_model.items()
                  if k in keys_to_check
              }
              expected = {
                  k: v
                  for k, v in parameters.items()
                  if k in keys_to_check
              }
              assert_equal(actual, expected)
              # all the requests prediction columns are included
              expected_pred_cols = set(parameters["extra_pred_cols"])
              actual_pred_cols = set(trained_model["pred_cols"])
              assert expected_pred_cols.issubset(
                  actual_pred_cols
              ), f"Missing prediction cols for {iteration}"
  
              # able to predict into the future
              result = silverkite.predict_n_no_sim(
                  fut_time_num=forecast_horizon,
                  trained_model=trained_model,
                  freq=freq,
              )["fut_df"]
              assert (
                  result.shape[0] == forecast_horizon
              ), f"Wrong size for {iteration}"
  
              expected_cols = {"ts", "y"}
              assert expected_cols.issubset(
                  set(result.columns)
              ), f"Missing columns for {iteration}"
  
imports: import datetime
  import math
  import sys
  import warnings
  from datetime import timedelta
  import pandas
  import pytest
  from testfixtures import LogCapture
  import greykite.common.constants
  from greykite.algo.changepoint.adalasso.changepoint_detector import ChangepointDetector
  from greykite.algo.forecast.silverkite.constants.silverkite_column import SilverkiteColumn
  from greykite.algo.forecast.silverkite.constants.silverkite_holiday import SilverkiteHoliday
  from greykite.algo.forecast.silverkite.constants.silverkite_seasonality import SilverkiteSeasonality
  from greykite.algo.forecast.silverkite.constants.silverkite_seasonality import SilverkiteSeasonalityEnum
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite import SimpleSilverkiteForecast
  from greykite.algo.forecast.silverkite.forecast_simple_silverkite_helper import generate_holiday_events
  from greykite.common.constants import CHANGEPOINT_COL_PREFIX
  from greykite.common.constants import EVENT_DF_DATE_COL
  from greykite.common.constants import EVENT_DF_LABEL_COL
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.data_loader import DataLoader
  from greykite.common.enums import SimpleTimeFrequencyEnum
  from greykite.common.enums import TimeEnum
  from greykite.common.features.timeseries_features import get_available_holidays_across_countries
  from greykite.common.features.timeseries_features import get_holidays
  from greykite.common.python_utils import assert_equal
  from greykite.common.python_utils import update_dictionary
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils import generate_df_with_reg_for_tests
label_desc: Use image node_id 10 for calling a global function with example usage: test_forecast_simple_silverkite_freq() without return types