code: def evaluate(model, true_edges, false_edges, num_workers):
      true_list = list()
      prediction_list = list()
      true_num = 0
  
      # Start all worker processes
      pool = multiprocessing.Pool(processes=num_workers)
      tmp_true_score_list = pool.map(
          partial(get_score, model), true_edges
      )
      tmp_false_score_list = pool.map(
          partial(get_score, model), false_edges
      )
      pool.close()
  
      prediction_list += [
          tmp_score
          for tmp_score in tmp_true_score_list
          if tmp_score is not None
      ]
      true_num = len(prediction_list)
      true_list += [1] * true_num
  
      prediction_list += [
          tmp_score
          for tmp_score in tmp_false_score_list
          if tmp_score is not None
      ]
      true_list += [0] * (len(prediction_list) - true_num)
  
      sorted_pred = prediction_list[:]
      sorted_pred.sort()
      threshold = sorted_pred[-true_num]
  
      y_pred = np.zeros(len(prediction_list), dtype=np.int32)
      for i in range(len(prediction_list)):
          if prediction_list[i] >= threshold:
              y_pred[i] = 1
  
      y_true = np.array(true_list)
      y_scores = np.array(prediction_list)
      ps, rs, _ = precision_recall_curve(y_true, y_scores)
      return (
          roc_auc_score(y_true, y_scores),
          f1_score(y_true, y_pred),
          auc(rs, ps),
      )
  
file_path: dgl/examples/pytorch/GATNE-T/src/utils.py
imports: import argparse
  import multiprocessing
  import time
  from collections import defaultdict
  from functools import partial, reduce, wraps
  import networkx
  import numpy
  import torch
  from gensim.models.keyedvectors import Vocab
  from six import iteritems
  from sklearn.metrics import auc, f1_score, precision_recall_curve, roc_auc_score
label_desc: Use image node_id 9 for calling a global function with example usage: evaluate(model, true_edges, false_edges, num_workers) and returns: roc_auc_score,  f1_score,  auc