code: def test_redo(self):
      d = 64
      n = 1000
  
      rs = np.random.RandomState(123)
      x = rs.uniform(size=(n, d)).astype("float32")
  
      # make sure that doing 10 redos yields a better objective than just 1
  
      clus = faiss.Clustering(d, 20)
      clus.nredo = 1
      clus.train(x, faiss.IndexFlatL2(d))
      obj1 = clus.iteration_stats.at(
          clus.iteration_stats.size() - 1
      ).obj
  
      clus = faiss.Clustering(d, 20)
      clus.nredo = 10
      clus.train(x, faiss.IndexFlatL2(d))
      obj10 = clus.iteration_stats.at(
          clus.iteration_stats.size() - 1
      ).obj
  
      self.assertGreater(obj1, obj10)
  
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import faiss
  import unittest
  import array
  from common_faiss_tests import get_dataset_2
label_desc: Use image node_id 1 for calling the TestCompositeClustering obj's underlying member method code with example usage: obj.test_redo() without return types