code: def knn_search_benchmark(
      self, dry_run, results: Dict[str, Any], index: Index
  ):
      return self.search_benchmark(
          name="knn_search",
          search_func=lambda parameters: index.knn_search(
              dry_run,
              parameters,
              self.query_vectors,
              self.k,
              self.gt_knn_I,
              self.gt_knn_D,
          )[3:],
          key_func=lambda parameters: index.get_knn_search_name(
              search_parameters=parameters,
              query_vectors=self.query_vectors,
              k=self.k,
              reconstruct=False,
          ),
          cost_metrics=["time"],
          perf_metrics=["knn_intersection", "distance_ratio"],
          results=results,
          index=index,
      )
  
imports: import logging
  from copy import copy
  from dataclasses import dataclass
  from operator import itemgetter
  from statistics import median, mean
  from typing import Any, Dict, List, Optional
  from .utils import dict_merge
  from .index import Index, IndexFromCodec, IndexFromFactory
  from .descriptors import DatasetDescriptor, IndexDescriptor
  import faiss
  import numpy
  from scipy.optimize import curve_fit
label_desc: Use image node_id 10 for calling the Benchmark obj's underlying member method code with example usage: obj.knn_search_benchmark(dry_run, results, index) and returns: self