code: def adist(self, codes):
          
  
          assert codes.ndim == 2
          N, M = codes.shape
          assert M == self.dtable.shape[0]
  
          # Fetch distance values using codes. The following codes are
          dists = np.sum(self.dtable[range(M), codes], axis=1)
  
          # The above line is equivalent to the followings:
          # dists = np.zeros((N, )).astype(np.float32)
          # for n in range(N):
          #     for m in range(M):
          #         dists[n] += self.dtable[m][codes[n][m]]
  
          return dists
docs: Given PQ-codes, compute Asymmetric Distances between the query (self.dtable)
          and the PQ-codes.
  
          Args:
              codes (np.ndarray): PQ codes with shape=(N, M) and
                  dtype=pq.code_dtype where pq is a pq instance that creates the codes
  
          Returns:
              np.ndarray: Asymmetric Distances with shape=(N, ) and dtype=np.float32