code: def test_mrr_bulk(demo_recs, drop_rating):
      "bulk and normal match"
      train, test, recs = demo_recs
      if drop_rating:
          test = test[["user", "item"]]
  
      rla = RecListAnalysis()
      rla.add_metric(recip_rank)
      rla.add_metric(recip_rank, name="rr_k", k=10)
      # metric without the bulk capabilities
      rla.add_metric(lambda *a: recip_rank(*a), name="ind_rr")
      rla.add_metric(
          lambda *a, **k: recip_rank(*a, **k), name="ind_rr_k", k=10
      )
      res = rla.compute(recs, test)
  
      assert all(res.recip_rank == res.ind_rr)
      assert all(res.rr_k == res.ind_rr_k)
  
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 11 for calling a global function with example usage: test_mrr_bulk(demo_recs, drop_rating) without return types