code: def save_roc_curve(
      y_true: Union[List[int], np.ndarray],
      y_score: Union[List[float], np.ndarray],
      plot_dir: Union[str, Path],
      name: str = "roc",
  ):
      assert len(y_true) == len(y_score)
      os.makedirs(plot_dir, exist_ok=True)
      fpr, tpr, _ = roc_curve(
          1 - np.array(y_true), 1 - np.array(y_score)
      )
      RocCurveDisplay(fpr=fpr, tpr=tpr).plot()
      plt.title(name)
      plt.savefig(Path(plot_dir) / Path(name + ".png"), dpi=300)
      plt.clf()
  
file_path: NeMo/nemo/collections/asr/parts/utils/confidence_metrics.py
imports: import math
  import os
  from pathlib import Path
  from typing import List, Optional, Tuple, Union
  import matplotlib.pyplot
  import numpy
  from sklearn.metrics import PrecisionRecallDisplay, RocCurveDisplay, average_precision_score, log_loss, precision_recall_curve, roc_auc_score, roc_curve
label_desc: Use image node_id 8 for calling a global function with example usage: save_roc_curve(y_true, y_score, plot_dir, name) without return types