code: def test_shards_ivf(self):
      ds = SyntheticDataset(32, 1000, 100, 20)
      ref_index = faiss.index_factory(ds.d, "IVF32,SQ8")
      ref_index.train(ds.get_train())
      xb = ds.get_database()
      ref_index.add(ds.get_database())
  
      Dref, Iref = ref_index.search(ds.get_database(), 10)
      ref_index.reset()
  
      sharded_index = faiss.IndexShardsIVF(
          ref_index.quantizer, ref_index.nlist, False, True
      )
      for shard in range(3):
          index_i = faiss.clone_index(ref_index)
          index_i.add(xb[shard * nb // 3 : (shard + 1) * nb // 3])
          sharded_index.add_shard(index_i)
  
      Dnew, Inew = sharded_index.search(ds.get_database(), 10)
  
      np.testing.assert_equal(Inew, Iref)
      np.testing.assert_allclose(Dnew, Dref)
  
file_path: faiss/tests/test_meta_index.py
imports: import os
  import numpy
  import faiss
  import unittest
  from common_faiss_tests import Randu10k
  from faiss.contrib.datasets import SyntheticDataset
label_desc: Use image node_id 2 for calling the Shards obj's underlying member method code with example usage: obj.test_shards_ivf() without return types