code: def test_range_search(self):
      index_flat = faiss.IndexFlat(self.xb.shape[1])
      index_flat.add(self.xb)
      D, _ = index_flat.search(self.xq, 10)
      radius = np.median(D[:, -1])
      lims_ref, Dref, Iref = index_flat.range_search(self.xq, radius)
  
      index = faiss.IndexHNSWFlat(self.xb.shape[1], 16)
      index.add(self.xb)
      lims, D, I = index.range_search(self.xq, radius)
  
      nmiss = 0
      # check if returned resutls are a subset of the reference results
      for i in range(len(self.xq)):
          ref = Iref[lims_ref[i] : lims_ref[i + 1]]
          new = I[lims[i] : lims[i + 1]]
          self.assertLessEqual(set(new), set(ref))
          nmiss += len(ref) - len(new)
      # currenly we miss 405 / 6019 neighbors
      self.assertLessEqual(nmiss, lims_ref[-1] * 0.1)
  
imports: import numpy
  import unittest
  import faiss
  import tempfile
  import os
  from common_faiss_tests import get_dataset_2
label_desc: Use image node_id 3 for calling the TestHNSW obj's underlying member method code with example usage: obj.test_range_search() without return types