code: def plot_instance_score(
      preds: Dict,
      target: np.ndarray,
      labels: np.ndarray,
      threshold: float,
      ylim: tuple = (None, None),
  ) -> None:
      """
      Scatter plot of a batch of outlier or adversarial scores compared to the threshold.
  
      Parameters
      ----------
      preds
          Dictionary returned by predictions of an outlier or adversarial detector.
      target
          Ground truth.
      labels
          List with names of classification labels.
      threshold
          Threshold used to classify outliers or adversarial instances.
      ylim
          Min and max y-axis values.
      """
      scores = preds["data"]["instance_score"]
      df = pd.DataFrame(
          dict(idx=np.arange(len(scores)), score=scores, label=target)
      )
      groups = df.groupby("label")
      fig, ax = plt.subplots()
      for name, group in groups:
          ax.plot(
              group.idx,
              group.score,
              marker="o",
              linestyle="",
              ms=6,
              label=labels[name],
          )
      plt.plot(
          np.arange(len(scores)),
          np.ones(len(scores)) * threshold,
          color="g",
          label="Threshold",
      )
      plt.ylim(ylim)
      plt.xlabel("Number of Instances")
      plt.ylabel("Instance Level Score")
      ax.legend()
      plt.show()
  
file_path: alibi-detect/alibi_detect/utils/visualize.py
imports: import matplotlib.pyplot
  import numpy
  import pandas
  from sklearn.metrics import roc_curve, auc
  from typing import Dict, Union
  import warnings
label_desc: Use image node_id 1 for calling a global function with example usage: plot_instance_score(preds, target, labels, threshold, ylim) without return types