code: def gen_search_param(index_type, metric_type="L2"):
      search_params = []
      if index_type in ["FLAT", "IVF_FLAT", "IVF_SQ8", "IVF_PQ"]:
          for nprobe in [10]:
              ivf_search_params = {
                  "metric_type": metric_type,
                  "params": {"nprobe": nprobe},
              }
              search_params.append(ivf_search_params)
      elif index_type in ["BIN_FLAT", "BIN_IVF_FLAT"]:
          for nprobe in [10]:
              bin_search_params = {
                  "metric_type": "HAMMING",
                  "params": {"nprobe": nprobe},
              }
              search_params.append(bin_search_params)
      elif index_type in ["HNSW"]:
          for ef in [64]:
              hnsw_search_param = {
                  "metric_type": metric_type,
                  "params": {"ef": ef},
              }
              search_params.append(hnsw_search_param)
      elif index_type == "ANNOY":
          for search_k in [1000]:
              annoy_search_param = {
                  "metric_type": metric_type,
                  "params": {"search_k": search_k},
              }
              search_params.append(annoy_search_param)
      else:
          print("Invalid index_type.")
          raise Exception("Invalid index_type.")
      return search_params
  
imports: import json
  from utils.util_log import test_log
label_desc: Use image node_id 2 for calling a global function with example usage: gen_search_param(index_type, metric_type) and returns: search_params