code: def test_mrr_k_trunc():
      rr = _test_rr(np.arange(1, 21, 1, "u4"), [20, 10], k=5)
      assert rr == approx(0.0)
  
      rr = _test_rr(np.arange(1, 21, 1, "u4"), [20, 10, 5], k=5)
      assert rr == approx(0.2)
  
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 9 for calling a global function with example usage: test_mrr_k_trunc() without return types