code: def generate_global(keep, scores, check_keep, check_scores):
      """
      Use a simple global threshold sweep to predict if the examples in
      check_scores were training data or not, using the ground truth answer from
      check_keep.
      """
      prediction = []
      answers = []
      for ans, sc in zip(check_keep, check_scores):
          prediction.extend(-sc.mean(1))
          answers.extend(ans)
  
      return prediction, answers
  
file_path: privacy/research/mi_lira_2021/plot.py
imports: import os
  import scipy.stats
  import numpy
  import matplotlib.pyplot
  from sklearn.metrics import auc, roc_curve
  import functools
  import matplotlib
label_desc: Use image node_id 5 for calling a global function with example usage: generate_global(keep, scores, check_keep, check_scores) and returns: prediction,  answers