docstr: make sure that the IVFSpectralHash sa_encode function gives the same
  result as the concatenated RQ + LSH index sa_encode 
code: def test_equiv_sh(self):
      """make sure that the IVFSpectralHash sa_encode function gives the same
      result as the concatenated RQ + LSH index sa_encode"""
      ds = SyntheticDataset(32, 500, 100, 0)
      index1 = faiss.index_factory(ds.d, "RQ1x4,Refine(ITQ16,LSH)")
      index1.train(ds.get_train())
  
      # reproduce this in an IndexIVFSpectralHash
      coarse_quantizer = faiss.IndexFlat(ds.d)
      rq = faiss.downcast_index(index1.base_index).rq
      centroids = get_additive_quantizer_codebooks(rq)[0]
      coarse_quantizer.add(centroids)
  
      encoder = faiss.downcast_index(index1.refine_index)
  
      # larger than the magnitude of the vectors
      # negative because otherwise the bits are flipped
      period = -100000.0
  
      index2 = faiss.IndexIVFSpectralHash(
          coarse_quantizer,
          ds.d,
          coarse_quantizer.ntotal,
          encoder.sa_code_size() * 8,
          period,
      )
  
      # replace with the vt of the encoder. Binarization is performed by
      # the IndexIVFSpectralHash itself
      index2.replace_vt(encoder)
  
      codes1 = index1.sa_encode(ds.get_database())
      codes2 = index2.sa_encode(ds.get_database())
  
      np.testing.assert_array_equal(codes1, codes2)
  
imports: from __future__ import print_function
  import numpy
  import unittest
  import faiss
  from common_faiss_tests import get_dataset_2
  from faiss.contrib.datasets import SyntheticDataset
  from faiss.contrib.inspect_tools import get_additive_quantizer_codebooks
label_desc: Use image node_id 3 for calling the TestRefine obj's underlying member method code with example usage: obj.test_equiv_sh() without return types