code: def mean_metric(
      ground_truth: Dict, retrieved: Dict, metric: str = None
  ) -> float:
      """
      Get mean of specified metric.
  
      Args:
          metric_func: metric function on which mean is to be calculated across all queries
  
      Returns:
          float representing mean of the metric across all queries
      """
      metric = metric.lower()
      metric_lookup = {
          "map": avg_prec,
          "ndcg": ndcg,
          "jaccard": jaccard_similarity,
      }
  
      metric_func = metric_lookup[metric]
      metric_vals = []
  
      for k in ground_truth.keys():
          metric_vals.append(metric_func(ground_truth[k], retrieved[k]))
      return np.mean(metric_vals)
  
imports: from typing import List, Dict
  import numpy
label_desc: Use image node_id 4 for calling a global function with example usage: mean_metric(ground_truth, retrieved, metric) and returns: np