class_docstr: Object that manages all the data related to the computation
  except the actual within-bucket matching and the organization of the
  computation (parallel or not)
class_docstr_tok: ["Object","that","manages","all","the","data","related","to","the","computation","except","the","actual","within-bucket","matching","and","the","organization","of","the","computation","(","parallel","or","not",")"]
docstr: prepare the queries and database items for bucket l
docstr_tok: ["prepare","the","queries","and","database","items","for","bucket","l"]
code: def prepare_bucket(self, l):
      """prepare the queries and database items for bucket l"""
      t0 = time.time()
      index = self.index
      # prepare queries
      i0, i1 = self.bucket_lims[l], self.bucket_lims[l + 1]
      q_subset = self.query_ids[i0:i1]
      xq_l = self.xq[q_subset]
      if self.by_residual:
          xq_l = xq_l - index.quantizer.reconstruct(l)
      t1 = time.time()
      # prepare database side
      list_ids, xb_l = get_invlist(index.invlists, l)
  
      if self.decode_func is None:
          xb_l = xb_l.ravel()
      else:
          xb_l = self.decode_func(xb_l)
  
      if self.use_float16:
          xb_l = xb_l.astype("float16")
          xq_l = xq_l.astype("float16")
  
      t2 = time.time()
      self.t_accu[0] += t1 - t0
      self.t_accu[1] += t2 - t1
      return q_subset, xq_l, list_ids, xb_l
  
imports: import time
  import pickle
  import os
  import logging
  from multiprocessing.pool import ThreadPool
  import threading
  import _thread
  from queue import Queue
  import traceback
  import datetime
  import numpy
  import faiss
  from faiss.contrib.inspect_tools import get_invlist
label_desc: Use image node_id 9 for calling the BigBatchSearcher obj's underlying member method code with example usage: obj.prepare_bucket(l) and returns: q_subset,  xq_l,  list_ids,  xb_l