code: def _pair_downheap(pos: int, sp, limit, ks, vs):
      finished = False
      while not finished:
          min = pos
          left = 2 * pos + 1
          right = 2 * pos + 2
          if left < limit and vs[sp + left] < vs[sp + min]:
              min = left
          if right < limit and vs[sp + right] < vs[sp + min]:
              min = right
          if min != pos:
              # we want to swap!
              swap(vs, sp + pos, sp + min)
              swap(ks, sp + pos, sp + min)
              pos = min
          else:
              finished = True
  
imports: from numba import njit
  from .array import swap
label_desc: Use image node_id 1 for calling a global function with example usage: _pair_downheap(pos, sp, limit, ks, vs) without return types