code: def do_partition(self, n, q, maxval=65536, seed=None):
      if seed is None:
          for i in range(50):
              self.do_partition(n, q, maxval, i + 1234)
  
      # print("seed=", seed)
      rs = np.random.RandomState(seed)
      vals = rs.randint(maxval, size=n).astype("uint16")
      ids = (rs.permutation(n) + 12345).astype("int64")
      dic = dict(zip(ids, vals))
  
      sp = faiss.swig_ptr
      vals_orig = vals.copy()
  
      tab_a = faiss.AlignedTableUint16()
      faiss.copy_array_to_AlignedTable(vals, tab_a)
  
      # print("tab a type", tab_a.get())
      if type(q) == int:
          faiss.CMax_uint16_partition_fuzzy(
              tab_a.get(), sp(ids), n, q, q, None
          )
      else:
          q_min, q_max = q
          q = pointer_to_minus1()
          faiss.CMax_uint16_partition_fuzzy(
              tab_a.get(), sp(ids), n, q_min, q_max, sp(q)
          )
          q = q[0]
          assert q_min <= q <= q_max
  
      vals = faiss.AlignedTable_to_array(tab_a)
  
      o = vals_orig.argsort()
      thresh = vals_orig[o[q]]
      n_eq = (vals_orig[o[:q]] == thresh).sum()
  
      for i in range(q):
          self.assertEqual(vals[i], dic[ids[i]])
          self.assertLessEqual(vals[i], thresh)
          if vals[i] == thresh:
              n_eq -= 1
      self.assertEqual(n_eq, 0)
  
imports: import numpy
  import faiss
  import unittest
label_desc: Use image node_id 1 for calling the TestPartitioningUint16 obj's underlying member method code with example usage: obj.do_partition(n, q, maxval, seed) without return types