code: def glue_compute_metrics(task_name, preds, labels):
      warnings.warn(DEPRECATION_WARNING, FutureWarning)
      requires_backends(glue_compute_metrics, "sklearn")
      assert len(preds) == len(
          labels
      ), f"Predictions and labels have mismatched lengths {len(preds)} and {len(labels)}"
      if task_name == "cola":
          return {"mcc": matthews_corrcoef(labels, preds)}
      elif task_name == "sst-2":
          return {"acc": simple_accuracy(preds, labels)}
      elif task_name == "mrpc":
          return acc_and_f1(preds, labels)
      elif task_name == "sts-b":
          return pearson_and_spearman(preds, labels)
      elif task_name == "qqp":
          return acc_and_f1(preds, labels)
      elif task_name == "mnli":
          return {"mnli/acc": simple_accuracy(preds, labels)}
      elif task_name == "mnli-mm":
          return {"mnli-mm/acc": simple_accuracy(preds, labels)}
      elif task_name == "qnli":
          return {"acc": simple_accuracy(preds, labels)}
      elif task_name == "rte":
          return {"acc": simple_accuracy(preds, labels)}
      elif task_name == "wnli":
          return {"acc": simple_accuracy(preds, labels)}
      elif task_name == "hans":
          return {"acc": simple_accuracy(preds, labels)}
      else:
          raise KeyError(task_name)
  
imports: import warnings
  from ...utils import is_sklearn_available, requires_backends
label_desc: Use image node_id 4 for calling a global function with example usage: glue_compute_metrics(task_name, preds, labels) and returns: dict, dict, acc_and_f1, pearson_and_spearman, acc_and_f1, dict, dict, dict, dict, dict, dict