code: def ranklist_by_heapq(user_pos_test, test_items, rating, Ks):
      item_score = {}
      for i in test_items:
          item_score[i] = rating[i]
  
      K_max = max(Ks)
      K_max_item_score = heapq.nlargest(
          K_max, item_score, key=item_score.get
      )
  
      r = []
      for i in K_max_item_score:
          if i in user_pos_test:
              r.append(1)
          else:
              r.append(0)
      auc = 0.0
      return r, auc
  
file_path: dgl/examples/pytorch/NGCF/NGCF/utility/batch_test.py
imports: import heapq
  import multiprocessing
  import utility.metrics
  from utility.load_data import *
  from utility.parser import parse_args
label_desc: Use image node_id 1 for calling a global function with example usage: ranklist_by_heapq(user_pos_test, test_items, rating, Ks) and returns: r,  auc