code: def hit_at_k(r, k):
      r = np.array(r)[:k]
      if np.sum(r) > 0:
          return 1.0
      else:
          return 0.0
  
file_path: dgl/examples/pytorch/NGCF/NGCF/utility/metrics.py
imports: import numpy
  from sklearn.metrics import roc_auc_score
label_desc: Use image node_id 8 for calling a global function with example usage: hit_at_k(r, k) and returns: int, int