code: def generate_test_changepoint_df(
      freq="D",
      periods=200,
      n_changepoints=3,
      signal_strength=1 / 5,
      err_std=1.0,
      seed=123,
  ):
      """Generates df to test change points
  
      The generated df is simple zigzag shaped over time with noise,
      with user specified frequency, length and number of change points.
  
      Parameters
      ----------
      freq : `DateOffset`, `Timedelta` or `str`, default is "D"
          The data frequency.
      periods : `int`, default is 200
          How many observation in frequency ``freq`` to be generated.
      n_changepoints : `int`
          How many change points to be included.
      signal_strength : `float`
          Time series signal strength.
      err_std : `float`
          Standard deviation of error.
      seed : `int`, default is 123
          Seed for reporducible result.
  
      Returns
      -------
      df : `pandas.DataFrame`
          The generated df with columns:
              `"ts"` : time column.
              `"y"` : value column.
      """
      if seed is not None:
          np.random.seed(seed)
      start = "2020-01-01"
      y = np.array([0])
      nochange_period = np.ceil(periods / (n_changepoints + 1))
      for i in range(n_changepoints + 1):
          temp = np.arange(nochange_period + 1)
          if i % 2 == 1:
              temp = temp[::-1]
          temp = temp[1:]  # remove the repeated term
          y = np.concatenate([y, temp])
      y = y * signal_strength + np.random.randn(len(y)) * err_std
      df = pd.DataFrame(
          {
              "ts": pd.date_range(
                  start=start, freq=freq, periods=periods
              ),
              "y": y[:periods],
          }
      )
      return df
  
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 6 for calling a global function with example usage: generate_test_changepoint_df(freq, periods, n_changepoints, signal_strength, err_std, seed) and returns: df