code: def kmin(array, k):
      """return k smallest values (and their indices) of the lines of a
      float32 array"""
      array = np.ascontiguousarray(array, dtype="float32")
      m, n = array.shape
      I = np.zeros((m, k), dtype="int64")
      D = np.zeros((m, k), dtype="float32")
      ha = faiss.float_maxheap_array_t()
      ha.ids = swig_ptr(I)
      ha.val = swig_ptr(D)
      ha.nh = m
      ha.k = k
      ha.heapify()
      ha.addn(n, swig_ptr(array))
      ha.reorder()
      return D, I
  
imports: import numpy
  from faiss.loader import *
  import faiss
  import collections.abc
label_desc: Use image node_id 1 for calling a global function with example usage: kmin(array, k) and returns: D,  I