code: def generate_every_dataset_final_summary_table(
      summaries_by_dataset: Dict[str, pandas.DataFrame],
      summary_column: str,
      out_dir: str,
  ):
      summary_all_datasets = pandas.concat(
          [
              df.rename(columns={summary_column: name})
              for name, df in summaries_by_dataset.items()
              if df is not None
          ],
          axis=1,
      )
  
      summary_out_path = os.path.join(out_dir, "seq_summary.csv")
      summary_all_datasets.to_csv(summary_out_path)
      print(f"Summary written to: {summary_out_path}")
  
      return summary_all_datasets
  
imports: import argparse
  from collections import defaultdict
  import csv
  import math
  import os
  import pathlib
  from typing import Dict, Iterable, List, Optional, Set, Tuple, Union
  import pandas
  from projects.roscoe.meta_evaluation.correlations import Analyzer
  from projects.roscoe.score import ROSCOE_SA, ROSCOE_SS, ROSCOE_LI, ROSCOE_LC, SUPERVISED_SCORES, UNSUPERVISED_SCORES
  from projects.roscoe.utils import assert_all_elements_same_length, ordered_union, split_list
  from projects.roscoe.meta_evaluation.table_file_writing import ANNOTATION_COLUMN_ORDER, COLUMN_RENAMES, MODELS, ROSCOE_SECTIONS, STEP_COLUMN_RENAMES, section_rows, write_every_dataset_summary_table_tex, write_every_dataset_final_summary_table_tex, write_granular_summary_tex
label_desc: Use image node_id 24 for calling a global function with example usage: generate_every_dataset_final_summary_table(summaries_by_dataset, summary_column, out_dir) and returns: summary_all_datasets