code: def search_position(rank_list_m: list, new_item: ModelScore):
      if len(rank_list_m) == 0:
          return 0
      left = 0
      right = len(rank_list_m) - 1
      while left + 1 < right:
          mid = int((left + right) / 2)
          if rank_list_m[mid].score <= new_item.score:
              left = mid
          else:
              right = mid
  
      # consider the time.
      if rank_list_m[right].score <= new_item.score:
          return right + 1
      elif rank_list_m[left].score <= new_item.score:
          return left + 1
      else:
          return left
  
file_path: singa/examples/model_selection/TRAILS-Database-Native-Model-Selection/internal/ml/model_selection/src/controller/controler.py
imports: import time
  from src.controller.core.sample import Sampler
  from src.third_pkg.models import CellStructure
label_desc: Use image node_id 2 for calling a global function with example usage: search_position(rank_list_m, new_item) and returns: int, unknown, unknown, left