code: def compute_recall(
      pk_l,
      distance_l,
      pk_p,
      distance_p,
      topk_ids,
      method="BYID",
      epsilon=1e-6,
  ):
      pk_l, distance_l, pk_p, distance_p = (
          np.array(pk_l),
          np.array(distance_l),
          np.array(pk_p),
          np.array(distance_p),
      )
      topk_matchs = {}
      for ids in topk_ids:
          topk_matchs[ids] = 0
      for linear_res_k, linear_res_s, knn_res_k, knn_res_s in zip(
          pk_l, distance_l, pk_p, distance_p
      ):
          if method == "BYID":
              res_t = recall_one_byid(
                  linear_res_k, knn_res_k, knn_res_s, topk_ids
              )
          else:
              res_t = recall_one(
                  linear_res_s, knn_res_s, topk_ids, epsilon
              )
          for k, v in res_t.items():
              topk_matchs[k] += v
  
      length = len(pk_l)
      for k, v in topk_matchs.items():
          topk_matchs[k] = min(v / length, 1)
      return 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 3 for calling a global function with example usage: compute_recall(pk_l, distance_l, pk_p, distance_p, topk_ids, method, epsilon) and returns: topk_matchs