code: def evaluate_nn(dataset, h_item, k, batch_size):
      g = dataset["train-graph"]
      val_matrix = dataset["val-matrix"].tocsr()
      test_matrix = dataset["test-matrix"].tocsr()
      item_texts = dataset["item-texts"]
      user_ntype = dataset["user-type"]
      item_ntype = dataset["item-type"]
      user_to_item_etype = dataset["user-to-item-type"]
      timestamp = dataset["timestamp-edge-column"]
  
      rec_engine = LatestNNRecommender(
          user_ntype,
          item_ntype,
          user_to_item_etype,
          timestamp,
          batch_size,
      )
  
      recommendations = (
          rec_engine.recommend(g, k, None, h_item).cpu().numpy()
      )
      return prec(recommendations, val_matrix)
  
file_path: dgl/examples/pytorch/pinsage/evaluation.py
imports: import argparse
  import pickle
  import dgl
  import numpy
  import torch
label_desc: Use image node_id 2 for calling a global function with example usage: evaluate_nn(dataset, h_item, k, batch_size) and returns: prec