docstr: tests whether the max nb codes is taken into account 
code: def test_max_codes(self):
      "tests whether the max nb codes is taken into account"
      ds = datasets.SyntheticDataset(32, 1000, 100, 20)
      index = faiss.index_factory(ds.d, "IVF32,Flat")
      index.train(ds.get_train())
      index.add(ds.get_database())
  
      stats = faiss.cvar.indexIVF_stats
      stats.reset()
      D0, I0 = index.search(
          ds.get_queries(),
          10,
          params=faiss.SearchParametersIVF(nprobe=8),
      )
      ndis0 = stats.ndis
      target_ndis = (
          ndis0 // ds.nq
      )  # a few queries will be below, a few above
      for q in range(ds.nq):
          stats.reset()
          Dq, Iq = index.search(
              ds.get_queries()[q : q + 1],
              10,
              params=faiss.SearchParametersIVF(
                  nprobe=8, max_codes=target_ndis
              ),
          )
          self.assertLessEqual(stats.ndis, target_ndis)
          if stats.ndis < target_ndis:
              np.testing.assert_equal(I0[q], Iq[0])
  
imports: import numpy
  import faiss
  import unittest
  import sys
  import gc
  from faiss.contrib import datasets
  from faiss.contrib.evaluation import sort_range_res_2, check_ref_range_results
label_desc: Use image node_id 6 for calling the TestSearchParams obj's underlying member method code with example usage: obj.test_max_codes() without return types