code: def test_OPQ(self):
      M = 4
  
      ev = Randu10kUnbalanced()
      d = ev.d
      index = faiss.IndexPQ(d, M, 8)
  
      res = ev.launch("PQ", index)
      e_pq = ev.evalres(res)
  
      index_pq = faiss.IndexPQ(d, M, 8)
      opq_matrix = faiss.OPQMatrix(d, M)
      # opq_matrix.verbose = true
      opq_matrix.niter = 10
      opq_matrix.niter_pq = 4
      index = faiss.IndexPreTransform(opq_matrix, index_pq)
  
      res = ev.launch("OPQ", index)
      e_opq = ev.evalres(res)
  
      print("e_pq=%s" % e_pq)
      print("e_opq=%s" % e_opq)
  
      # verify that OPQ better than PQ
      for r in 1, 10, 100:
          assert e_opq[r] > e_pq[r]
  
imports: from __future__ import absolute_import, division, print_function
  import unittest
  import faiss
  import numpy
  from common_faiss_tests import Randu10k, get_dataset_2, Randu10kUnbalanced
label_desc: Use image node_id 1 for calling the OPQRelativeAccuracy obj's underlying member method code with example usage: obj.test_OPQ() without return types