code: def helper_plot_outliers(y, detection_result, title):
      """This is just a helper function to generate plots for outlier detection during tests.
      This plots the raw input and marks the discovered anomalies.
  
      Parameters
      ----------
      y: `pandas.Series`
          Input data.
      detection_result: `~greykite.common.features.outlier.DetectionResult`
          Outlier detection results.
      title: `str`
          Title of plot.
      Returns
      -------
      "fig" : `plotly.graph_objects.Figure`
  
      """
      df = pd.DataFrame(
          {
              "ind": range(len(y)),
              "y": y,
              "scores": detection_result.scores,
              "is_outlier": detection_result.is_outlier,
          }
      )
  
      df["y_normal"] = None
      df["y_outlier"] = None
  
      df.loc[~df["is_outlier"], "y_normal"] = df.loc[
          ~df["is_outlier"], "y"
      ]
      df.loc[df["is_outlier"], "y_outlier"] = df.loc[
          df["is_outlier"], "y"
      ]
  
      fig = plot_lines_markers(
          df=df,
          x_col="ind",
          line_cols=["y", "scores"],
          marker_cols=["y_outlier"],
          title=title,
      )
  
      return fig
  
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 2 for calling a global function with example usage: helper_plot_outliers(y, detection_result, title) and returns: fig