code: def rearrange_cols_and_save_to_csv(final_dataframe, out_f):
      col_names = final_dataframe.columns.tolist()
      col_names.remove("fold")
      col_names.remove("corr_type")
      col_names.remove("tune_type")
      col_names.remove("ID")
  
      # filter for scores that appear in the data
      no_ref_metrics = [
          s for s in UNSUPERVISED_SCORES if s in col_names
      ]
      ref_metrics = [s for s in SUPERVISED_SCORES if s in col_names]
  
      for score in no_ref_metrics + ref_metrics:
          col_names.remove(score)
  
      rearranged = (
          ["fold", "corr_type", "tune_type"]
          + no_ref_metrics
          + sorted(col_names)
          + ref_metrics
      )
      final_dataframe = final_dataframe[rearranged]
  
      final_dataframe.to_csv(out_f)
  
      print("Final results path is ", out_f)
  
imports: import csv
  from glob import glob
  import json
  import os
  import pathlib
  import numpy
  import pandas
  from parlai.core.params import ParlaiParser
  from projects.roscoe.meta_evaluation.correlations import Analyzer
  from projects.roscoe.score import EMB_MODEL_SCORES, EMBEDDING_MODEL_NAMES, GRAMMAR_MODEL_SCORES, LANGUAGE_MODEL_SCORES, NLI_MODEL_SCORES, REASONING_SCORES, SCORE_GROUPS, SUPERVISED_SCORES, UNSUPERVISED_SCORES
  from typing import Callable, List
label_desc: Use image node_id 5 for calling a global function with example usage: rearrange_cols_and_save_to_csv(final_dataframe, out_f) without return types