code: def do_test(self, nbin, n):
      rs = np.random.RandomState(123)
      tab = rs.randint(nbin, size=n).astype("uint16")
      ref_histogram = np.bincount(tab, minlength=nbin)
  
      tab_a = faiss.AlignedTableUint16()
      faiss.copy_array_to_AlignedTable(tab, tab_a)
  
      sp = faiss.swig_ptr
      hist = np.zeros(nbin, "int32")
      if nbin == 8:
          faiss.simd_histogram_8(tab_a.get(), n, 0, -1, sp(hist))
      elif nbin == 16:
          faiss.simd_histogram_16(tab_a.get(), n, 0, -1, sp(hist))
      else:
          raise AssertionError()
      np.testing.assert_array_equal(hist, ref_histogram)
  
imports: import numpy
  import faiss
  import unittest
label_desc: Use image node_id 1 for calling the TestHistograms obj's underlying member method code with example usage: obj.do_test(nbin, n) without return types