code: def build_and_search(
      doc,
      query,
      topk,
      doc_chunk,
      query_chunk,
      index_path=None,
      threads=4,
      dimension=None,
      measure_name=None,
      need_shuffle=False,
      storage_options=None,
      index_builder=None,
      builder_params=None,
      index_converter=None,
      index_converter_params=None,
      index_searcher=None,
      searcher_params=None,
      index_reformer=None,
      index_reformer_params=None,
  ):
      if measure_name is None:
          measure_name = "SquaredEuclidean"
      if dimension is None:
          dimension = doc.shape[1]
      if index_builder is None:
          index_builder = "SsgBuilder"
      if builder_params is None:
          builder_params = {}
      if index_converter_params is None:
          index_converter_params = {}
      if index_searcher is None:
          index_searcher = ""
      if searcher_params is None:
          searcher_params = {}
      if index_reformer is None:
          index_reformer = ""
      if index_reformer_params is None:
          index_reformer_params = {}
  
      doc = md.DataFrame(
          pd.DataFrame(doc), chunk_size=(doc_chunk, dimension)
      )
      query = mt.tensor(query, chunk_size=(query_chunk, dimension))
  
      index = build_index(
          doc,
          dimension,
          index_path,
          need_shuffle,
          measure_name,
          index_builder,
          builder_params,
          index_converter,
          index_converter_params,
          topk,
          storage_options,
      )
  
      pk2, distance = search_index(
          query,
          topk,
          index,
          threads,
          dimension,
          measure_name,
          index_searcher,
          searcher_params,
          index_reformer,
          index_reformer_params,
          storage_options,
      )
  
      return pk2, distance
  
file_path: mars/mars/learn/proxima/simple_index/knn.py
imports: import random
  import pandas
  from ....None import dataframe
  from ....None import tensor
  from .None import build_index, search_index
label_desc: Use image node_id 3 for calling a global function with example usage: build_and_search(doc, query, topk, doc_chunk, query_chunk, index_path, threads, dimension, measure_name, need_shuffle, storage_options, index_builder, builder_params, index_converter, index_converter_params, index_searcher, searcher_params, index_reformer, index_reformer_params) and returns: pk2,  distance