code: def do_test_range(self, metric):
      ds = datasets.SyntheticDataset(32, 0, 1000, 10)
      xq = ds.get_queries()
      xb = ds.get_database()
      D, I = faiss.knn(xq, xb, 10, metric=metric)
      threshold = float(D[:, -1].mean())
  
      index = faiss.IndexFlat(32, metric)
      index.add(xb)
      ref_lims, ref_D, ref_I = index.range_search(xq, threshold)
  
      new_lims, new_D, new_I = range_ground_truth(
          xq,
          ds.database_iterator(bs=100),
          threshold,
          metric_type=metric,
      )
  
      evaluation.check_ref_range_results(
          ref_lims, ref_D, ref_I, new_lims, new_D, new_I
      )
  
imports: import unittest
  import faiss
  import numpy
  from common_faiss_tests import get_dataset_2
  from faiss.contrib import datasets, evaluation, big_batch_search
  from faiss.contrib.exhaustive_search import knn_ground_truth, range_ground_truth, range_search_gpu, range_search_max_results, exponential_query_iterator
label_desc: Use image node_id 2 for calling the TestComputeGT obj's underlying member method code with example usage: obj.do_test_range(metric) without return types