code: def plot_anoms_plotly(fig, anomaly_labels: TimeSeries):
      """
      Plots anomalies as pink windows on the plotly ``Figure`` object ``fig``.
      """
      if anomaly_labels is None:
          return fig
      anomaly_labels = anomaly_labels.to_pd()
      t, y = anomaly_labels.index, anomaly_labels.values
      splits = np.where(y[1:] != y[:-1])[0] + 1
      splits = np.concatenate(([0], splits, [len(y) - 1]))
      for k in range(len(splits) - 1):
          if y[splits[k]]:  # If splits[k] is anomalous
              fig.add_vrect(
                  t[splits[k]],
                  t[splits[k + 1]],
                  line_width=0,
                  fillcolor="#e07070",
                  opacity=0.4,
              )
      return fig
  
imports: import logging
  from typing import Dict
  from copy import copy
  from matplotlib.colors import to_rgb
  from matplotlib.dates import AutoDateLocator, AutoDateFormatter
  import matplotlib.pyplot
  import numpy
  import pandas
  import plotly
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from merlion.utils import TimeSeries, UnivariateTimeSeries
label_desc: Use image node_id 2 for calling a global function with example usage: plot_anoms_plotly(fig, anomaly_labels) and returns: fig, fig