code: def compute_metrics(
      task_name: str, preds: List[int], labels: List[int]
  ) -> Dict[str, float]:
      """
      Computes metrics for GLUE tasks
      Args:
          task_name: GLUE task name
          preds: model predictions
          labels: golden labels
      Returns:
          metrics
      """
      if len(preds) != len(labels):
          raise ValueError(
              "Predictions and labels must have the same length"
          )
  
      metric_fn = accuracy
      if task_name == "cola":
          metric_fn = mcc
      elif task_name in ["mrpc", "qqp"]:
          metric_fn = acc_and_f1
      elif task_name == "sts-b":
          metric_fn = pearson_and_spearman
  
      return metric_fn(preds, labels)
  
imports: from typing import Dict, List
  from scipy.stats import pearsonr, spearmanr
  from sklearn.metrics import f1_score, matthews_corrcoef
label_desc: Use image node_id 5 for calling a global function with example usage: compute_metrics(task_name, preds, labels) and returns: metric_fn