code: def produce_batches(args):
      x = fvecs_mmap(args.input)
  
      if args.i1 == -1:
          args.i1 = len(x)
  
      print(
          "Iterating on vectors %d:%d from %s by batches of size %d"
          % (args.i0, args.i1, args.input, args.bs)
      )
  
      for j0 in range(args.i0, args.i1, args.bs):
          j1 = min(j0 + args.bs, args.i1)
          yield np.arange(j0, j1), x[j0:j1]
  
file_path: faiss/benchs/distributed_ondisk/make_index_vslice.py
imports: import os
  import time
  import numpy
  import faiss
  import argparse
  from multiprocessing.pool import ThreadPool
label_desc: Use image node_id 3 for calling a global function with example usage: produce_batches(args) without return types