code: def test_coarse_quantizer(self):
      ds = datasets.SyntheticDataset(32, 5000, 1000, 100)
      gt = ds.get_groundtruth(10)
  
      quantizer = faiss.LocalSearchCoarseQuantizer(ds.d, 2, 4)
      quantizer.lsq.nperts
      quantizer.lsq.nperts = 2
  
      index = faiss.IndexIVFFlat(quantizer, ds.d, 256)
      index.quantizer_trains_alone = True
  
      index.train(ds.get_train())
  
      index.add(ds.get_database())
      index.nprobe = 4
  
      Dref, Iref = index.search(ds.get_queries(), 10)
  
      inter_ref = faiss.eval_intersection(Iref, gt)
  
      # 249
      self.assertGreater(inter_ref, 235)
  
imports: import numpy
  import faiss
  import unittest
  from faiss.contrib import datasets
label_desc: Use image node_id 2 for calling the TestIndexLocalSearchQuantizer obj's underlying member method code with example usage: obj.test_coarse_quantizer() without return types