code: def generate_df_for_tests(
      freq,
      periods,
      train_start_date=datetime.datetime(2018, 7, 1),
      train_end_date=None,
      train_frac=0.8,
      conti_year_origin=None,
      noise_std=2.0,
      remove_extra_cols=True,
      autoreg_coefs=None,
      fs_coefs=[-1, 3, 4],
      growth_coef=3.0,
      growth_pow=1.1,
      intercept=0.0,
      seed=123,
  ):
      """Generates dataset for unit tests.
  
      :param freq: str
          pd.date_range freq parameter, e.g. H or D
      :param periods: int
          number of periods to generate
      :param train_start_date: datetime.datetime
          train start date
      :param train_end_date: Optional[datetime.datetime]
          train end date
      :param train_frac: Optional[float]
          fraction of data to use for training
          only used if train_end_date isn't provided
      :param noise_std: float
          standard deviation of gaussian noise
      :param conti_year_origin: float
          the time origin for continuous time variables
      :param remove_extra_cols: bool
          whether to remove extra columns besides TIME_COL, VALUE_COL
      :param autoreg_coefs: Optional[List[int]]
          The coefficients for the autoregressive terms.
          If provided the generated series denoted mathematically by Y(t) will be
          converted as follows:
          Y(t) -> Y(t) + c1 Y(t-1) + c2 Y(t-2) + c3 Y(t-3) + ...
          where autoreg_coefs = [c1, c2, c3, ...]
          In this fashion, the obtained series will have autoregressive
          properties not explained by seasonality and growth.
      :param fs_coefs: List[float]
          The fourier series coefficients used.
      :param growth_coef: float
          Multiplier for growth
      :param growth_pow: float
          Power for growth, as function of continuous time
      :param intercept: float
          Constant term added to Y(t)
      :param seed: int
          seed for reproducible result
  
      :return: Dict[str, any]
          contains full dataframe, train dataframe, test dataframe,
          and nrows in test dataframe
      """
      if seed is not None:
          np.random.seed(seed)
  
      date_list = pd.date_range(
          start=train_start_date, periods=periods, freq=freq
      ).tolist()
  
      df0 = pd.DataFrame({TIME_COL: date_list})
      if conti_year_origin is None:
          conti_year_origin = get_default_origin_for_time_vars(
              df0, TIME_COL
          )
      time_df = build_time_features_df(
          dt=df0[TIME_COL], conti_year_origin=conti_year_origin
      )
      df = pd.concat([df0, time_df], axis=1)
      df["growth"] = growth_coef * (
          df[TimeFeaturesEnum.ct1.value] ** growth_pow
      )
  
      func = fourier_series_multi_fcn(
          col_names=[
              TimeFeaturesEnum.toy.value,
              TimeFeaturesEnum.tow.value,
              TimeFeaturesEnum.tod.value,
          ],
          periods=[1.0, 7.0, 24.0],
          orders=[1, 1, 1],
          seas_names=None,
      )
  
      res = func(df)
      df_seas = res["df"]
      df = pd.concat([df, df_seas], axis=1)
  
      df[VALUE_COL] = (
          intercept
          + df["growth"]
          + fs_coefs[0]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.tod.value, function_name="sin"
              )
          ]
          + fs_coefs[1]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.tow.value, function_name="sin"
              )
          ]
          + fs_coefs[2]
          * df[
              get_fourier_col_name(
                  1, TimeFeaturesEnum.toy.value, function_name="sin"
              )
          ]
          + noise_std * np.random.normal(size=df.shape[0])
      )
  
      if autoreg_coefs is not None:
          df["temporary_new_value"] = df[VALUE_COL]
          k = len(autoreg_coefs)
          for i in range(k):
              df["temporary_new_value"] = (
                  df["temporary_new_value"]
                  + autoreg_coefs[i] * df[VALUE_COL].shift(-i)
              ).bfill()
          df[VALUE_COL] = df["temporary_new_value"]
          del df["temporary_new_value"]
  
      if train_end_date is None:
          train_rows = np.floor(train_frac * df.shape[0]).astype(int)
          train_end_date = df[TIME_COL][train_rows]
  
      if remove_extra_cols:
          df = df[[TIME_COL, VALUE_COL]]
      train_df = df.loc[df[TIME_COL] <= train_end_date]
      test_df = df.loc[df[TIME_COL] > train_end_date]
      fut_time_num = test_df.shape[0]
  
      return {
          "df": df,
          "train_df": train_df.reset_index(drop=True),
          "test_df": test_df.reset_index(drop=True),
          "fut_time_num": fut_time_num,
      }
  
imports: import datetime
  import warnings
  import numpy
  import pandas
  from greykite.common.constants import ADJUSTMENT_DELTA_COL
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import EVENT_DF_LABEL_COL
  from greykite.common.constants import METRIC_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 TimeFeaturesEnum
  from greykite.common.features.timeseries_features import add_daily_events
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_default_origin_for_time_vars
  from greykite.common.features.timeseries_features import get_fourier_col_name
  from greykite.common.features.timeseries_features import get_holidays
  from greykite.common.python_utils import assert_equal
label_desc: Use image node_id 1 for calling a global function with example usage: generate_df_for_tests(freq, periods, train_start_date, train_end_date, train_frac, conti_year_origin, noise_std, remove_extra_cols, autoreg_coefs, fs_coefs, growth_coef, growth_pow, intercept, seed) and returns: dict