code: def get_scores(edges_pos, edges_neg, adj_rec):
      def sigmoid(x):
          return 1 / (1 + np.exp(-x))
  
      adj_rec = adj_rec.cpu()
      # Predict on test set of edges
      preds = []
      for e in edges_pos:
          preds.append(sigmoid(adj_rec[e[0], e[1]].item()))
  
      preds_neg = []
      for e in edges_neg:
          preds_neg.append(sigmoid(adj_rec[e[0], e[1]].data))
  
      preds_all = np.hstack([preds, preds_neg])
      labels_all = np.hstack(
          [np.ones(len(preds)), np.zeros(len(preds_neg))]
      )
      roc_score = roc_auc_score(labels_all, preds_all)
      ap_score = average_precision_score(labels_all, preds_all)
  
      return roc_score, ap_score
  
file_path: dgl/examples/pytorch/vgae/train.py
imports: import argparse
  import os
  import time
  import dgl
  import model
  import numpy
  import scipy.sparse
  import torch
  import torch.nn.functional
  from dgl.data import CiteseerGraphDataset, CoraGraphDataset, PubmedGraphDataset
  from input_data import load_data
  from preprocess import mask_test_edges, mask_test_edges_dgl, preprocess_graph, sparse_to_tuple
  from sklearn.metrics import average_precision_score, roc_auc_score
label_desc: Use image node_id 3 for calling a global function with example usage: get_scores(edges_pos, edges_neg, adj_rec) and returns: roc_score,  ap_score, unknown