code: def recall_one_byid(linear_key, ann_key, ann_score, topk_ids):
      idx, length = 0, len(linear_key)
      topk_matchs, result_topk_matchs = {}, {}
  
      for ids in topk_ids:
          topk_matchs[ids] = 0
          result_topk_matchs[ids] = 0
  
      while idx < length:
          for k in topk_ids:
              dynamic_size = k
              while dynamic_size + 1 < length:
                  if math.isclose(
                      ann_score[dynamic_size - 1],
                      ann_score[dynamic_size],
                  ):
                      dynamic_size += 1
                  else:
                      break
  
              items = 0
              while items < len(ann_score) and items < dynamic_size:
                  if linear_key[idx] == ann_key[items]:
                      topk_matchs[k] += 1
                      break
                  else:
                      items += 1
  
          idx += 1
          if idx in topk_ids:
              result_topk_matchs[idx] = topk_matchs[idx] / idx
  
      return result_topk_matchs
  
file_path: mars/mars/learn/proxima/simple_index/recall.py
imports: import math
  import numpy
  from ....None import remote
  from .knn import sample_data, linear_build_and_search
label_desc: Use image node_id 2 for calling a global function with example usage: recall_one_byid(linear_key, ann_key, ann_score, topk_ids) and returns: result_topk_matchs