code: def test_kvp_sort(values):
      "Test that sorting logic works"
      ks = np.full(10, -1, dtype=np.int32)
      vs = np.zeros(10)
  
      n = 0
  
      for k in range(20):
          v = values[k]
          n = kvp_minheap_insert(0, n, 10, k, v, ks, vs)
  
      assert n == 10
  
      ovs = vs.copy()
      oks = ks.copy()
      ord = np.argsort(ovs)
      ord = ord[::-1]
  
      kvp_minheap_sort(0, n, ks, vs)
      assert vs[0] == np.max(ovs)
      assert vs[-1] == np.min(ovs)
      assert all(ks == oks[ord])
      assert all(vs == ovs[ord])
  
file_path: lkpy/tests/test_util_accum.py
imports: import numpy
  from lenskit.util.accum import kvp_minheap_insert, kvp_minheap_sort
  from hypothesis import given, assume, settings
  import hypothesis.strategies
  import hypothesis.extra.numpy
label_desc: Use image node_id 7 for calling a global function with example usage: test_kvp_sort(values) without return types