code: def compute_scores(gold_list, pred):
      # tests for exact match and on the normalised answer (compute_exact)
      # test for overlap (compute_f1)
      f1_sum = 0.0
      em_sum = 0.0
      if len(gold_list) > 1:
          for i in range(len(gold_list)):
              gold_answers = gold_list[0:i] + gold_list[i + 1 :]
              # predictions compared against (n) golds and take maximum
              em_sum += max(
                  squad_metrics.compute_exact(a, pred)
                  for a in gold_answers
              )
              f1_sum += max(
                  squad_metrics.compute_f1(a, pred)
                  for a in gold_answers
              )
      else:
          em_sum += max(
              squad_metrics.compute_exact(a, pred) for a in gold_list
          )
          f1_sum += max(
              squad_metrics.compute_f1(a, pred) for a in gold_list
          )
  
      return {
          "em": em_sum / max(1, len(gold_list)),
          "f1": f1_sum / max(1, len(gold_list)),
      }
  
imports: import inspect
  import transformers.data.metrics.squad_metrics
  import lm_eval.datasets.coqa.coqa
  from lm_eval.base import Task, rf, mean
  from itertools import zip_longest
label_desc: Use image node_id 12 for calling the CoQA obj's underlying member method code with example usage: obj.compute_scores(gold_list, pred) and returns: dict