code: def test_precision_simple_cases():
      prec = _test_prec([1, 3], [1, 3])
      assert prec == approx(1.0)
  
      prec = _test_prec([1], [1, 3])
      assert prec == approx(1.0)
  
      prec = _test_prec([1, 2, 3, 4], [1, 3])
      assert prec == approx(0.5)
  
      prec = _test_prec([1, 2, 3, 4], [1, 3, 5])
      assert prec == approx(0.5)
  
      prec = _test_prec([1, 2, 3, 4], range(5, 10))
      assert prec == approx(0.0)
  
      prec = _test_prec([1, 2, 3, 4], range(4, 10))
      assert prec == approx(0.25)
  
file_path: lkpy/tests/test_topn_precision.py
imports: import numpy
  import pandas
  from pytest import approx
  from lenskit.topn import precision
  from lenskit.util.test import demo_recs
  from lenskit import topn
label_desc: Use image node_id 3 for calling a global function with example usage: test_precision_simple_cases() without return types