code: def test_recall_simple_cases():
      prec = _test_recall([1, 3], [1, 3])
      assert prec == approx(1.0)
  
      prec = _test_recall([1], [1, 3])
      assert prec == approx(0.5)
  
      prec = _test_recall([1, 2, 3, 4], [1, 3])
      assert prec == approx(1.0)
  
      prec = _test_recall([1, 2, 3, 4], [1, 3, 5])
      assert prec == approx(2.0 / 3)
  
      prec = _test_recall([1, 2, 3, 4], range(5, 10))
      assert prec == approx(0.0)
  
      prec = _test_recall([1, 2, 3, 4], range(4, 9))
      assert prec == approx(0.2)
  
file_path: lkpy/tests/test_topn_recall.py
imports: import logging
  import numpy
  import pandas
  from pytest import approx
  from lenskit.metrics.topn import recall
  from lenskit.util.test import demo_recs
  from lenskit import topn
label_desc: Use image node_id 4 for calling a global function with example usage: test_recall_simple_cases() without return types