code: def do_plot_all(
      fn,
      keep,
      scores,
      legend="",
      metric="auc",
      sweep_fn=sweep,
      **plot_kwargs,
  ):
      """
      Generate the ROC curves by using one model as test model and the rest to train,
      with a full leave-one-out cross-validation.
      """
  
      all_predictions = []
      all_answers = []
      for i in range(0, len(keep)):
          mask = np.zeros(len(keep), dtype=bool)
          mask[i : i + 1] = True
          prediction, answers = fn(
              keep[~mask], scores[~mask], keep[mask], scores[mask]
          )
          all_predictions.extend(prediction)
          all_answers.extend(answers)
  
      fpr, tpr, auc, acc = sweep_fn(
          np.array(all_predictions), np.array(all_answers, dtype=bool)
      )
  
      low = tpr[np.where(fpr < 0.001)[0][-1]]
      print(
          "Attack %s   AUC %.4f, Accuracy %.4f, TPR@0.1%%FPR of %.4f"
          % (legend, auc, acc, low)
      )
  
      metric_text = ""
      if metric == "auc":
          metric_text = "auc=%.3f" % auc
      elif metric == "acc":
          metric_text = "acc=%.3f" % acc
  
      plt.plot(fpr, tpr, label=legend + metric_text, **plot_kwargs)
      return acc, auc
  
imports: import os
  import numpy
  import matplotlib.pyplot
  import functools
  import matplotlib
  from plot import sweep, load_data, generate_ours, generate_global
label_desc: Use image node_id 1 for calling a global function with example usage: do_plot_all(fn, keep, scores, legend, metric, sweep_fn) and returns: acc,  auc