code: def test_java_equiv():
      dir = Path(__file__).parent
      metrics = pd.read_csv(str(dir / "topn-java-metrics.csv"))
      recs = pd.read_csv(str(dir / "topn-java-recs.csv"))
      truth = pd.read_csv(str(dir / "topn-java-truth.csv"))
  
      rla = topn.RecListAnalysis()
      rla.add_metric(topn.ndcg)
      res = rla.compute(recs, truth)
  
      umm = pd.merge(metrics, res.reset_index())
      umm["err"] = umm["ndcg"] - umm["Java.nDCG"]
      _log.info("merged: \n%s", umm)
      assert umm["err"].values == approx(0, abs=1.0e-6)
  
imports: from pathlib import Path
  import logging
  import numpy
  import pandas
  from pytest import approx, mark
  from lenskit.algorithms.user_knn import UserUser
  from lenskit.algorithms.item_knn import ItemItem
  from lenskit.algorithms.basic import PopScore
  from lenskit.algorithms.ranking import PlackettLuce
  from lenskit.algorithms import Recommender
  from lenskit.util.test import ml_test, demo_recs
  from lenskit.metrics.topn import _dcg, precision, recall
  from lenskit import topn, batch, crossfold
label_desc: Use image node_id 7 for calling a global function with example usage: test_java_equiv() without return types