code: def test_one_batch(X, topks):
      sorted_items = X[0].numpy()
      groundTrue = X[1]
      r = getLabel(groundTrue, sorted_items)
      pre, recall, ndcg = [], [], []
      for k in topks:
          ret = RecallPrecision_ATk(groundTrue, r, k)
          pre.append(ret["precision"])
          recall.append(ret["recall"])
          ndcg.append(NDCGatK_r(groundTrue, r, k))
      return {
          "recall": np.array(recall),
          "precision": np.array(pre),
          "ndcg": np.array(ndcg),
      }
  
file_path: PGL/examples/ngcf/train.py
imports: import pgl
  import paddle
  import paddle.nn
  from dataloader import Loader
  from model import *
  from utils import *
  import numpy
  import paddle
  import paddle.nn
  import paddle.nn.functional
  import time
  import multiprocessing
  from tqdm import tqdm
  from time import time
  import argparse
label_desc: Use image node_id 2 for calling a global function with example usage: test_one_batch(X, topks) and returns: dict