code: def test_plt_compare_series_annotations():
      """Tests ``plt_compare_series_annotations`` function."""
      df = pd.DataFrame(
          {
              "x": list(range(10)),
              "actual": [1, 2, 3, 4, 5, 4, 3, 3, 2, 1],
              "forecast": [1.5, 2.5, 3.5, 4.5, 5.5, 5, 4, 4, 1, 0.5],
              "actual_label": [0] * 5 + [1] * 5,
              "forecast_label": [0, 0, 0, 1, 1, 0, 0, 1, 1, 0],
              "forecast_upper": [
                  2.5,
                  3.5,
                  4.5,
                  5.5,
                  6.5,
                  6,
                  5,
                  5,
                  2,
                  2,
              ],
              "forecast_lower": [
                  0.5,
                  0.5,
                  1.5,
                  3.5,
                  4.5,
                  3,
                  3,
                  2,
                  -0.5,
                  -1,
              ],
          }
      )
  
      fig = plt_compare_series_annotations(
          df=df,
          x_col="x",
          actual_col="actual",
          actual_label_col="actual_label",
          forecast_label_col="forecast_label",
          keep_cols=["forecast_upper", "forecast_lower"],
          forecast_col="forecast",
          standardize_col=None,
      )
  
      assert fig.layout.showlegend is True
      assert fig.layout.xaxis.title.text == "x"
      assert fig.layout.yaxis.title.text is None
      assert len(fig.data) == 6
      assert fig.data[0].mode == "lines"
      assert fig.data[0].name == "actual"
      assert fig.data[1].name == "true_anomaly"
      assert fig.data[2].name == "model_anomaly"
      assert fig.data[3].name == "forecast"
  
      # test with standardize
      fig = plt_compare_series_annotations(
          df=df,
          x_col="x",
          actual_col="actual",
          actual_label_col="actual_label",
          forecast_label_col="forecast_label",
          forecast_col="forecast",
          keep_cols=["forecast_upper", "forecast_lower"],
          standardize_col="actual",
      )
  
      assert fig.layout.showlegend is True
      assert fig.layout.xaxis.title.text == "x"
      assert fig.layout.yaxis.title.text is None
      assert len(fig.data) == 6
      assert fig.data[0].mode == "lines"
      assert fig.data[0].name == "actual"
      assert fig.data[1].name == "true_anomaly"
      assert fig.data[2].name == "model_anomaly"
      assert fig.data[3].name == "forecast"
  
      # test with no ``forecast_col``
      fig = plt_compare_series_annotations(
          df=df,
          x_col="x",
          actual_col="actual",
          actual_label_col="actual_label",
          forecast_label_col="forecast_label",
          forecast_col=None,
          keep_cols=["forecast_upper", "forecast_lower"],
          standardize_col="actual",
      )
  
      assert fig.layout.showlegend is True
      assert fig.layout.xaxis.title.text == "x"
      assert fig.layout.yaxis.title.text is None
      assert len(fig.data) == 5
      assert fig.data[0].mode == "lines"
      assert fig.data[0].name == "actual"
      assert fig.data[1].name == "true_anomaly"
      assert fig.data[2].name == "model_anomaly"
  
imports: import numpy
  import pandas
  import pytest
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import START_TIME_COL
  from greykite.common.python_utils import assert_equal
  from greykite.common.viz.colors_utils import get_distinct_colors
  from greykite.common.viz.timeseries_annotate import add_multi_vrects
  from greykite.common.viz.timeseries_annotate import plot_anomalies_over_forecast_vs_actual
  from greykite.common.viz.timeseries_annotate import plot_event_periods_multi
  from greykite.common.viz.timeseries_annotate import plot_lines_markers
  from greykite.common.viz.timeseries_annotate import plot_overlay_anomalies_multi_metric
  from greykite.common.viz.timeseries_annotate import plot_precision_recall_curve
  from greykite.common.viz.timeseries_annotate import plt_annotate_series
  from greykite.common.viz.timeseries_annotate import plt_compare_series_annotations
label_desc: Use image node_id 2 for calling a global function with example usage: test_plt_compare_series_annotations() without return types