code: def daily_data():
      """Generates data for testing `GreykiteDetector`."""
  
      df = generate_df_for_tests(
          freq="D",
          train_start_date=datetime.datetime(2020, 1, 1),
          intercept=50,
          train_frac=0.99,
          periods=200,
      )["df"]
  
      anomaly_block_list = [
          np.arange(10, 15),
          np.arange(33, 35),
          np.arange(60, 65),
          np.arange(82, 85),
          np.arange(94, 98),
          np.arange(100, 105),
          np.arange(111, 113),
          np.arange(125, 130),
          np.arange(160, 163),
          np.arange(185, 190),
          np.arange(198, 200),
      ]
  
      # Contaminates `df` with anomalies at the specified locations,
      # via `anomaly_block_list`.
      # If original value is y, the anomalous value is: (1 +/- delta)*y.
      df = contaminate_df_with_anomalies(
          df=df,
          anomaly_block_list=anomaly_block_list,
          delta_range_lower=0.25,
          delta_range_upper=0.5,
          value_col=VALUE_COL,
          min_admissible_value=None,
          max_admissible_value=None,
      )
  
      df = df.drop(columns=[VALUE_COL]).rename(
          columns={"contaminated_y": VALUE_COL}
      )
      df[ANOMALY_COL] = df[ANOMALY_COL] == 1
  
      assert len(df) == 200
      assert sum(df[ANOMALY_COL]) == 41
  
      train_size = int(100)
      df_train = df[:train_size].reset_index(drop=True)
      df_test = df[train_size:].reset_index(drop=True)
  
      assert len(df_train) == 100
      assert len(df_test) == 100
  
      return {"df_train": df_train, "df_test": df_test, "df": df}
  
imports: import datetime
  import inspect
  import sys
  from collections import OrderedDict
  import dill
  import numpy
  import pandas
  import pytest
  from patsy.desc import Term
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.common.testing_utils_anomalies import contaminate_df_with_anomalies
  from greykite.common.viz.timeseries_annotate import plot_anomalies_over_forecast_vs_actual
  from greykite.detection.common.ad_evaluation import f1_score
  from greykite.detection.common.ad_evaluation import precision_score
  from greykite.detection.common.ad_evaluation import recall_score
  from greykite.detection.common.pickler import GreykitePickler
  from greykite.detection.detector.ad_utils import partial_return
  from greykite.detection.detector.config import ADConfig
  from greykite.detection.detector.constants import FIG_SHOW
  from greykite.detection.detector.data import DetectorData
  from greykite.detection.detector.greykite import DETECTOR_PREDICT_COLS
  from greykite.detection.detector.greykite import GreykiteDetector
  from greykite.detection.detector.reward import Reward
  from greykite.framework.templates.autogen.forecast_config import ComputationParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.framework.utils.result_summary import summarize_grid_search_results
label_desc: Use image node_id 1 for calling a global function with example usage: daily_data() and returns: dict