code: def generate_anomalous_data(periods=10):
      ts = pd.date_range(start="1/1/2018", periods=periods)
      df = pd.DataFrame(
          {"ts": ts, "y": range(periods), "z": range(20, 20 + periods)}
      )
      df["y"] = df["y"].astype(float)
      df["z"] = df["z"].astype(float)
  
      anomaly_df = pd.DataFrame(
          {
              METRIC_COL: ["y", "y", "z", "z", "z"],
              "dimension1": [
                  "level_1",
                  "level_1",
                  "level_2",
                  "level_2",
                  "level_2",
              ],
              "dimension2": [
                  "level_1",
                  "level_2",
                  "level_1",
                  "level_1",
                  "level_1",
              ],
              START_TIME_COL: [
                  "1/1/2018",
                  "1/4/2018",
                  "1/8/2018",
                  "1/10/2018",
                  "1/1/2099",
              ],
              END_TIME_COL: [
                  "1/2/2018",
                  "1/6/2018",
                  "1/9/2018",
                  "1/10/2018",
                  "1/2/2099",
              ],
              ADJUSTMENT_DELTA_COL: [np.nan, 3.0, -5.0, np.nan, np.nan],
          }
      )
  
      for col in [START_TIME_COL, END_TIME_COL]:
          anomaly_df[col] = pd.to_datetime(anomaly_df[col])
  
      return {"df": df, "anomaly_df": anomaly_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 7 for calling a global function with example usage: generate_anomalous_data(periods) and returns: dict