code: def data():
      """Generates data for testing."""
      sampler = np.random.default_rng(1317)
      # Defines two clean vectors, one for `fit` and one for `detect`.
      y_clean = np.arange(0, 100)
      # Add small noise
      y_clean = y_clean + sampler.normal(
          loc=0.0, scale=3, size=len(y_clean)
      )
      y_clean_test = np.arange(30, 40)
      y_clean_test = y_clean_test + sampler.normal(
          loc=0.0, scale=3, size=len(y_clean_test)
      )
  
      # Constructs two scenarios:
      # Easy to detect (`y_easy_outlier`): there is an outlier in position two which is 10X the max
      # Hard to detect (`y_hard_outlier`): there is an outlier in position 3 which is equal to max,
      # however locally it is much larger than neighboring points.
      y_easy_outlier = y_clean.copy()
      y_hard_outlier = y_clean.copy()
      y_easy_outlier_test = y_clean_test.copy()
      y_hard_outlier_test = y_clean_test.copy()
  
      # Add outlier to `fit` data.
      y_easy_outlier[2] = 1000
      y_hard_outlier[2] = 100
  
      # Add outlier to test / `detect` data.
      y_easy_outlier_test[5] = 2000
      y_hard_outlier_test[5] = 150
  
      return {
          "y_clean": y_clean,
          "y_clean_test": y_clean_test,
          "y_easy_outlier": y_easy_outlier,
          "y_easy_outlier_test": y_easy_outlier_test,
          "y_hard_outlier": y_hard_outlier,
          "y_hard_outlier_test": y_hard_outlier_test,
      }
  
imports: import numpy
  import pandas
  import pytest
  from greykite.common.features.outlier import EXPONENTIAL_SMOOTHING
  from greykite.common.features.outlier import MOVING_MEDIAN
  from greykite.common.features.outlier import BaseOutlierDetector
  from greykite.common.features.outlier import DetectionResult
  from greykite.common.features.outlier import DiffMethod
  from greykite.common.features.outlier import TukeyOutlierDetector
  from greykite.common.features.outlier import ZScoreOutlierDetector
  from greykite.common.viz.timeseries_annotate import plot_lines_markers
label_desc: Use image node_id 1 for calling a global function with example usage: data() and returns: dict