code: def scann_eval_search(
      searcher,
      searcher_reo,
      xq,
      xb,
      nprobe_tab,
      pre_reorder_k_tab,
      k,
      gt,
      nrun,
      measure,
  ):
      # warmup
      for _run in range(5):
          searcher.search_batched(xq)
  
      for nprobe in nprobe_tab:
          for pre_reorder_k in pre_reorder_k_tab:
              times = []
              for _run in range(nrun):
                  if pre_reorder_k == 0:
                      t0 = time.time()
                      I, D = searcher.search_batched(
                          xq,
                          leaves_to_search=nprobe,
                          final_num_neighbors=k,
                      )
                      t1 = time.time()
                  else:
                      t0 = time.time()
                      I, D = searcher_reo.search_batched(
                          xq,
                          leaves_to_search=nprobe,
                          final_num_neighbors=k,
                          pre_reorder_num_neighbors=pre_reorder_k,
                      )
                      t1 = time.time()
  
                  times.append(t1 - t0)
              header = "SCANN nprobe=%4d reo=%4d" % (
                  nprobe,
                  pre_reorder_k,
              )
              if measure == "1-recall":
                  eval_recalls(header, I, gt, times)
              else:
                  eval_inters(header, I, gt, times)
  
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 5 for calling a global function with example usage: scann_eval_search(searcher, searcher_reo, xq, xb, nprobe_tab, pre_reorder_k_tab, k, gt, nrun, measure) without return types