code: def aggregate_optimality_gap(scores: np.ndarray, gamma=1):
      """Computes optimality gap across all runs and tasks.
  
      Args:
        scores: A matrix of size (`num_runs` x `num_tasks`) where scores[n][m]
          represent the score on run `n` of task `m`.
        gamma: Threshold for optimality gap. All scores above `gamma` are clipped
         to `gamma`.
  
      Returns:
        Optimality gap at threshold `gamma`.
      """
      return gamma - np.mean(np.minimum(scores, gamma))
  
imports: import numpy
  import scipy.stats
label_desc: Use image node_id 3 for calling a global function with example usage: aggregate_optimality_gap(scores, gamma) and returns: unknown