code: def test_ivf_kmeans(self):
      ivfk = faiss.IndexIVFFlat(faiss.IndexFlatL2(d), d, ncentroids)
      ivfk.nprobe = kprobe
      res = ev.launch("IndexIVFFlat", ivfk)
      e = ev.evalres(res)
      # should give 0.260  0.260  0.260
      assert e[1] > 0.2
  
      # test parallel mode
      Dref, Iref = ivfk.search(ev.xq, 100)
      ivfk.parallel_mode = 1
      Dnew, Inew = ivfk.search(ev.xq, 100)
      print((Iref != Inew).sum(), Iref.size)
      assert (Iref != Inew).sum() < Iref.size / 5000.0
      assert np.all(Dref == Dnew)
  
imports: from __future__ import absolute_import, division, print_function
  import unittest
  import faiss
  import numpy
  from common_faiss_tests import Randu10k, get_dataset_2, Randu10kUnbalanced
label_desc: Use image node_id 3 for calling the IndexAccuracy obj's underlying member method code with example usage: obj.test_ivf_kmeans() without return types