class_docstr: Test the IDSelector filtering for as many (index class, id selector class)
  combinations as possible.
class_docstr_tok: ["Test","the","IDSelector","filtering","for","as","many","(","index","class",",","id","selector","class",")","combinations","as","possible","."]
docstr: verify that the selected subset is the subset  in the list
code: def do_test_id_selector_weak(self, index_key):
      """verify that the selected subset is the subset  in the list"""
      ds = datasets.SyntheticDataset(32, 1000, 100, 20)
      index = faiss.index_factory(ds.d, index_key)
      index.train(ds.get_train())
      index.add(ds.get_database())
      k = 10
      Dref, Iref = index.search(ds.get_queries(), k)
  
      # reference result
      rs = np.random.RandomState(123)
      subset = rs.choice(ds.nb, 50, replace=False).astype("int64")
      sel = faiss.IDSelectorBatch(subset)
      params = faiss.SearchParametersHNSW()
      params.sel = sel
      Dnew, Inew = index.search(ds.get_queries(), k, params=params)
      mask = np.zeros(ds.nb, dtype=bool)
      mask[subset] = True
      for q in range(len(Iref)):
          (mask_q,) = np.where(mask[Iref[q]])
          l = len(mask_q)
          np.testing.assert_array_equal(Iref[q, mask_q], Inew[q, :l])
          np.testing.assert_array_equal(Dref[q, mask_q], Dnew[q, :l])
  
imports: import numpy
  import faiss
  import unittest
  import sys
  import gc
  from faiss.contrib import datasets
  from faiss.contrib.evaluation import sort_range_res_2, check_ref_range_results
label_desc: Use image node_id 17 for calling the TestSelector obj's underlying member method code with example usage: obj.do_test_id_selector_weak(index_key) without return types