class_docstr: Combine query results from a sliced dataset (for k-nn search) 
class_docstr_tok: ["Combine","query","results","from","a","sliced","dataset","(","for","k-nn","search",")"]
code: def add_batch_result(self, D, I, i0):
      assert D.shape == (self.nq, self.k)
      assert I.shape == (self.nq, self.k)
      I += i0
      self.heaps.addn_with_ids(
          self.k, faiss.swig_ptr(D), faiss.swig_ptr(I), self.k
      )
  
imports: import time
  from faiss.contrib import rpc
  import combined_index
  import argparse
  from multiprocessing.pool import ThreadPool
  import faiss
  import numpy
label_desc: Use image node_id 2 for calling the ResultHeap obj's underlying member method code with example usage: obj.add_batch_result(D, I, i0) without return types