code: def binary_insert_get_rank(rank_list: list, new_item: List) -> int:
      """
      Insert the new_item to rank_list, then get the rank of it.
      :param rank_list: 0: id, 1: score
      :param new_item:
      :return:
      """
      index = search_position(rank_list, new_item)
      # search the position to insert into
      rank_list.insert(index, new_item)
      return index
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/tools/compute.py
imports: from typing import List
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: binary_insert_get_rank(rank_list, new_item) and returns: index