code: def eval_index_accuracy(self, factory_key):
      ds = datasets.SyntheticDataset(32, 1000, 1000, 100)
      index = faiss.index_factory(ds.d, factory_key)
  
      index.train(ds.get_train())
      index.add(ds.get_database())
  
      inters = []
      for nprobe in 1, 2, 4, 8, 16:
          index.nprobe = nprobe
          D, I = index.search(ds.get_queries(), 10)
          inter = faiss.eval_intersection(I, ds.get_groundtruth(10))
          inters.append(inter)
  
      inters = np.array(inters)
      self.assertTrue(np.all(inters[1:] >= inters[:-1]))
  
      # do a little I/O test
      index2 = faiss.deserialize_index(faiss.serialize_index(index))
      D2, I2 = index2.search(ds.get_queries(), 10)
      np.testing.assert_array_equal(I2, I)
      np.testing.assert_array_equal(D2, D)
  
      return inter
  
imports: import numpy
  import faiss
  import unittest
  from faiss.contrib import datasets
label_desc: Use image node_id 1 for calling the TestIndexIVFProductLocalSearchQuantizer obj's underlying member method code with example usage: obj.eval_index_accuracy(factory_key) and returns: inter