code: def save_custom_confidence_curve(
      thresholds: Union[List[float], np.ndarray],
      values: Union[List[float], np.ndarray],
      plot_dir: Union[str, Path],
      name: str = "my_awesome_curve",
      xlabel: Optional[str] = None,
      ylabel: Optional[str] = None,
  ):
      assert len(thresholds) == len(values)
      os.makedirs(plot_dir, exist_ok=True)
      plt.plot(thresholds, values)
      plt.xlim([0, 1])
      plt.ylim([0, 1])
      plt.title(name)
      if xlabel is not None:
          plt.xlabel(xlabel)
      if ylabel is not None:
          plt.ylabel(ylabel)
      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 11 for calling a global function with example usage: save_custom_confidence_curve(thresholds, values, plot_dir, name, xlabel, ylabel) without return types