code: def _test_rr(items, rel, **kw):
      recs = pd.DataFrame({"item": items})
      truth = pd.DataFrame({"item": rel}).set_index("item")
      return recip_rank(recs, truth, **kw)
  
file_path: lkpy/tests/test_topn_mrr.py
imports: import numpy
  import pandas
  from pytest import approx, mark
  from lenskit.topn import RecListAnalysis, recip_rank
  from lenskit.util.test import ml_test, demo_recs
  from lenskit.algorithms.basic import Popular
  from lenskit.batch import recommend
  from lenskit.crossfold import simple_test_pair
label_desc: Use image node_id 1 for calling a global function with example usage: _test_rr(items, rel) and returns: recip_rank