code: def decode_ref(x, codebooks, codes):
      n, d = x.shape
      _, M = codes.shape
      decoded_x = np.zeros((n, d), dtype=np.float32)
      for i in range(n):
          for m in range(M):
              decoded_x[i] += codebooks[m, codes[i, m]]
  
      return decoded_x
  
imports: import numpy
  import faiss
  import unittest
  from faiss.contrib import datasets
label_desc: Use image node_id 6 for calling a global function with example usage: decode_ref(x, codebooks, codes) and returns: decoded_x