code: def evaluate_hits(name, pos_pred, neg_pred, K):
      """
      Compute hits
      Args:
          name(str): name of dataset
          pos_pred(Tensor): predict value of positive edges
          neg_pred(Tensor): predict value of negative edges
          K(int): num of hits
  
      Returns:
          hits(float): score of hits
  
  
      """
      evaluator = Evaluator(name)
      evaluator.K = K
      hits = evaluator.eval(
          {
              "y_pred_pos": pos_pred,
              "y_pred_neg": neg_pred,
          }
      )[f"hits@{K}"]
  
      return hits
  
file_path: dgl/examples/pytorch/seal/utils.py
imports: import argparse
  import dgl
  import numpy
  import pandas
  import torch
  from ogb.linkproppred import DglLinkPropPredDataset, Evaluator
  from scipy.sparse.csgraph import shortest_path
label_desc: Use image node_id 4 for calling a global function with example usage: evaluate_hits(name, pos_pred, neg_pred, K) and returns: hits