code: def eval_recalls(name, I, gt, times):
      k = I.shape[1]
      s = "%-40s recall" % name
      nq = len(gt)
      for rank in 1, 10, 100, 1000:
          if rank > k:
              break
          recall = (I[:, :rank] == gt[:, :1]).sum() / nq
          s += "@%d: %.4f " % (rank, recall)
      s += "time: %.4f s (± %.4f)" % (np.mean(times), np.std(times))
      print(s)
  
file_path: faiss/benchs/bench_all_ivf/cmp_with_scann.py
imports: import time
  import sys
  import os
  import argparse
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: eval_recalls(name, I, gt, times) without return types