code: def evaluate(final_model, edge_types, data):
      """Calculate the AUC score, F1 score and PR score of the final model"""
      edge_types_count = len(edge_types)
      AUC, F1, PR = [], [], []
  
      true_edge_data_by_type = data[0]
      fake_edge_data_by_type = data[1]
  
      for i in range(edge_types_count):
          try:
              local_model = final_model[edge_types[i]]
              true_edges = true_edge_data_by_type[edge_types[i]]
              fake_edges = fake_edge_data_by_type[edge_types[i]]
          except Exception as e:
              logging.warn("edge type not exists. %s" % str(e))
              continue
          tmp_auc, tmp_f1, tmp_pr = calculate_score(
              local_model, true_edges, fake_edges
          )
          AUC.append(tmp_auc)
          F1.append(tmp_f1)
          PR.append(tmp_pr)
  
      return {"AUC": np.mean(AUC), "F1": np.mean(F1), "PR": np.mean(PR)}
  
imports: import os
  import argparse
  import time
  import numpy
  import logging
  import pickle
  import pgl
  from pgl.utils import paddle_helper
  import paddle
  import paddle.fluid
  import paddle.fluid.layers
  from utils import *
  import Dataset
  import model
  from sklearn.metrics import auc, f1_score, precision_recall_curve, roc_auc_score
label_desc: Use image node_id 3 for calling a global function with example usage: evaluate(final_model, edge_types, data) and returns: dict