code: def batch_search(index, query, k, bs, verbose=False):
      n = len(query)
      dists = np.zeros((n, k), dtype=np.float32)
      nbrs = np.zeros((n, k), dtype=np.int64)
  
      for sid in tqdm(
          range(0, n, bs),
          desc="faiss searching...",
          disable=not verbose,
      ):
          eid = min(n, sid + bs)
          dists[sid:eid], nbrs[sid:eid] = index.search(
              query[sid:eid], k
          )
      return dists, nbrs
  
file_path: dgl/examples/pytorch/hilander/utils/faiss_gpu.py
imports: import gc
  import os
  import faiss
  import numpy
  from tqdm import tqdm
label_desc: Use image node_id 1 for calling a global function with example usage: batch_search(index, query, k, bs, verbose) and returns: dists,  nbrs