class_docstr: Low-level lattice tests 
class_docstr_tok: ["Low-level","lattice","tests"]
code: def test_repeats(self):
      rs = np.random.RandomState(123)
      dim = 32
      for _i in range(1000):
          vec = np.floor((rs.rand(dim) ** 7) * 3).astype("float32")
          vecs = vec.copy()
          vecs.sort()
          repeats = faiss.Repeats(dim, swig_ptr(vecs))
          code = repeats.encode(swig_ptr(vec))
          vec2 = np.zeros(dim, dtype="float32")
          repeats.decode(code, swig_ptr(vec2))
          # print(vec2)
          assert np.all(vec == vec2)
  
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 LatticeTest obj's underlying member method code with example usage: obj.test_repeats() without return types