code: def arrange_output(task_name, results, previous_best, best_dev_acc):
      result = results[0]
      result1 = results[1]
      save_model = False
      if task_name in acc_tasks:
          if task_name in ["sst2", "qnli", "rte"]:
              current_result = f"acc:{result['accuracy']}"
          elif task_name == "mnli":
              current_result = f"acc/mm-acc:{result['accuracy']}/{result1['accuracy']}"
          elif task_name in ["mrpc", "qqp"]:
              current_result = (
                  f"f1/acc:{result['f1']}/{result['accuracy']}"
              )
  
          if result["accuracy"] > best_dev_acc:
              save_model = True
              best_dev_acc = result["accuracy"]
              previous_best = current_result
  
      elif task_name in corr_tasks:
          current_result = f"pearson/spearmanr:{result['pearson']}/{result['spearmanr']}"
          if result["pearson"] > best_dev_acc:
              best_dev_acc = result["pearson"]
              save_model = True
              previous_best = current_result
      elif task_name in mcc_tasks:
          current_result = f"mcc:{result['matthews_correlation']}"
          if result["matthews_correlation"] > best_dev_acc:
              best_dev_acc = result["matthews_correlation"]
              save_model = True
              previous_best = current_result
      return current_result, previous_best, best_dev_acc, save_model
  
imports: import torch
  from torch.nn import CrossEntropyLoss, MSELoss
  import datasets
  from datasets import load_dataset, load_metric
  import copy
  import os
  import json
  import transformers
  from transformers import AutoConfig, PretrainedConfig
  import huggingface_transformer
  from huggingface_transformer.modeling_bert import BertForSequenceClassification
  import logging
  import numpy
  import math
label_desc: Use image node_id 8 for calling a global function with example usage: arrange_output(task_name, results, previous_best, best_dev_acc) and returns: current_result,  previous_best,  best_dev_acc,  save_model