code: def test(dataloader, hits_K=["hits@100"]):
      model.eval()
  
      if isinstance(hits_K, (int, str)):
          hits_K = [hits_K]
      y_pred, y_true = [], []
      for batch in tqdm(dataloader, ncols=70):
          g, z, x, edge_weights, y = [
              item.to(device) if item is not None else None
              for item in batch
          ]
          logits = model(g, z, x, edge_weight=edge_weights)
          y_pred.append(logits.view(-1).cpu())
          y_true.append(y.view(-1).cpu().to(torch.float))
      y_pred, y_true = torch.cat(y_pred), torch.cat(y_true)
      pos_y_pred = y_pred[y_true == 1]
      neg_y_pred = y_pred[y_true == 0]
  
      if dataset.eval_metric.startswith("hits@"):
          results = evaluate_hits(pos_y_pred, neg_y_pred, hits_K)
      elif dataset.eval_metric == "mrr":
          results = evaluate_mrr(pos_y_pred, neg_y_pred)
      elif dataset.eval_metric == "rocauc":
          results = evaluate_rocauc(pos_y_pred, neg_y_pred)
  
      return results
  
imports: import argparse
  import datetime
  import os
  import sys
  import time
  import dgl
  import torch
  from dgl.data.utils import load_graphs, save_graphs
  from dgl.dataloading import GraphDataLoader
  from ogb.linkproppred import DglLinkPropPredDataset, Evaluator
  from torch.nn import BCEWithLogitsLoss
  from torch.utils.data import Dataset
  from tqdm import tqdm
  from models import *
  from utils import *
label_desc: Use image node_id 3 for calling a global function with example usage: test(dataloader, hits_K) and returns: results