code: def plot_anomalies_over_forecast_vs_actual(
      df,
      time_col=TIME_COL,
      actual_col=ACTUAL_COL,
      predicted_col=PREDICTED_COL,
      predicted_anomaly_col=PREDICTED_ANOMALY_COL,
      anomaly_col=ANOMALY_COL,
      marker_opacity=1,
      predicted_anomaly_marker_color="rgba(0, 90, 181, 0.9)",
      anomaly_marker_color="rgba(250, 43, 20, 0.7)",
      **kwargs,
  ):
      """Utility function which overlayes the predicted anomalies or anomalies on the forecast vs actual plot.
      The function calls the internal function `~greykite.common.viz.timeseries_plotting.plot_forecast_vs_actual`
      and then adds markers on top.
  
      Parameters
      ----------
      df : `pandas.DataFrame`
          The input dataframe.
      time_col : `str`, default `~greykite.common.constants.TIME_COL`
          Column in ``df`` with timestamp (x-axis).
      actual_col : `str`, default `~greykite.common.constants.ACTUAL_COL`
          Column in ``df`` with actual values.
      predicted_col : `str`, default `~greykite.common.constants.PREDICTED_COL`
          Column in ``df`` with predicted values.
      predicted_anomaly_col : `str` or None, default `~greykite.common.constants.PREDICTED_ANOMALY_COL`
          Column in ``df`` with predicted anomaly labels (boolean) in the time series.
          `True` denotes a predicted anomaly.
      anomaly_col : `str` or None, default `~greykite.common.constants.ANOMALY_COL`
          Column in ``df`` with anomaly labels (boolean) in the time series.
          `True` denotes an anomaly.
      marker_opacity : `float`, default 0.5
          The opacity of the marker colors.
      predicted_anomaly_marker_color : `str`, default "green"
          The color of the marker(s) for the predicted anomalies.
      anomaly_marker_color : `str`, default "red"
          The color of the marker(s) for the anomalies.
      **kwargs
          Additional arguments on how to decorate your plot.
          The keyword arguments are passed to `~greykite.common.viz.timeseries_plotting.plot_forecast_vs_actual`.
  
      Returns
      -------
      fig : `plotly.graph_objs._figure.Figure`
          Plot figure.
      """
      fig = plot_forecast_vs_actual(
          df=df,
          time_col=time_col,
          actual_col=actual_col,
          predicted_col=predicted_col,
          **kwargs,
      )
      if anomaly_col is not None:
          fig.add_trace(
              go.Scatter(
                  x=df.loc[
                      df[anomaly_col].apply(lambda val: val is True),
                      time_col,
                  ],
                  y=df.loc[
                      df[anomaly_col].apply(lambda val: val is True),
                      actual_col,
                  ],
                  mode="markers",
                  marker_size=10,
                  marker_symbol="square",
                  marker=go.scatter.Marker(color=anomaly_marker_color),
                  name=anomaly_col.title(),
                  showlegend=True,
                  opacity=marker_opacity,
              )
          )
      if predicted_anomaly_col is not None:
          fig.add_trace(
              go.Scatter(
                  x=df.loc[
                      df[predicted_anomaly_col].apply(
                          lambda val: val is True
                      ),
                      time_col,
                  ],
                  y=df.loc[
                      df[predicted_anomaly_col].apply(
                          lambda val: val is True
                      ),
                      actual_col,
                  ],
                  mode="markers",
                  marker_size=7,
                  marker_symbol="diamond",
                  marker=go.scatter.Marker(
                      color=predicted_anomaly_marker_color
                  ),
                  name=predicted_anomaly_col.title(),
                  showlegend=True,
                  opacity=marker_opacity,
              )
          )
  
      return fig
  
file_path: greykite/greykite/common/viz/timeseries_annotate.py
imports: import pandas
  import plotly.graph_objects
  from greykite.common.constants import ACTUAL_COL
  from greykite.common.constants import ANOMALY_COL
  from greykite.common.constants import END_TIME_COL
  from greykite.common.constants import PREDICTED_ANOMALY_COL
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import START_TIME_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.features.adjust_anomalous_data import label_anomalies_multi_metric
  from greykite.common.viz.colors_utils import get_distinct_colors
  from greykite.common.viz.timeseries_plotting import plot_forecast_vs_actual
label_desc: Use image node_id 8 for calling a global function with example usage: plot_anomalies_over_forecast_vs_actual(df, time_col, actual_col, predicted_col, predicted_anomaly_col, anomaly_col, marker_opacity, predicted_anomaly_marker_color, anomaly_marker_color) and returns: fig