class_docstr: comparative accuracy of a few types of indexes 
class_docstr_tok: ["comparative","accuracy","of","a","few","types","of","indexes"]
code: def compare_accuracy(self, lowac, highac, max_errs=(1e10, 1e10)):
      d = 96
      nb = 1000
      nq = 0
      nt = 2000
  
      xt, x, _ = get_dataset_2(d, nt, nb, nq)
  
      errs = []
  
      for factory_string in lowac, highac:
          codec = faiss.index_factory(d, factory_string)
          print("sa codec: code size %d" % codec.sa_code_size())
          codec.train(xt)
  
          codes = codec.sa_encode(x)
          x2 = codec.sa_decode(codes)
  
          err = ((x - x2) ** 2).sum()
          errs.append(err)
  
      print(errs)
      self.assertGreater(errs[0], errs[1])
  
      self.assertGreater(max_errs[0], errs[0])
      self.assertGreater(max_errs[1], errs[1])
  
      # just a small IndexLattice I/O test
      if "Lattice" in highac:
          codec2 = faiss.deserialize_index(faiss.serialize_index(codec))
          codes = codec2.sa_encode(x)
          x3 = codec2.sa_decode(codes)
          self.assertTrue(np.all(x2 == x3))
  
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 1 for calling the TestAccuracy obj's underlying member method code with example usage: obj.compare_accuracy(lowac, highac, max_errs) without return types