code: def index_data(self, data: np.array):
      n = len(data)
      # indexing in batches is beneficial for many faiss index types
      logger.info("Indexing data, this may take a while.")
      cnt = 0
      for i in range(0, n, self.buffer_size):
          vectors = [
              np.reshape(t, (1, -1))
              for t in data[i : i + self.buffer_size]
          ]
          vectors = np.concatenate(vectors, axis=0)
          self.index.add(vectors)
          cnt += self.buffer_size
  
      logger.info("Total data indexed %d", n)
  
imports: import os
  import logging
  import pickle
  import faiss
  import numpy
label_desc: Use image node_id 2 for calling the DenseFlatIndexer obj's underlying member method code with example usage: obj.index_data(data) without return types