code: def generate_single_dataset_final_summary_table_max(
      granular_sections: Dict[
          str, Union[pandas.DataFrame, Dict[str, pandas.DataFrame]]
      ],
      pvals_by_section: Dict[
          str, Union[pandas.DataFrame, Dict[str, pandas.DataFrame]]
      ],
  ):
      columns = list(STEP_COLUMN_RENAMES.keys())
  
      emb_section_summaries = {}
      for emb_section in ("ROSCOE-SA", "ROSCOE-SS"):
          section_data = []
          section_row_titles = []
          for model, model_df in granular_sections[emb_section].items():
              if "roscoe-512-roberta-base" in model:
                  model_num = "(1)"
              elif "all-mpnet-base-v2" in model:
                  model_num = "(2)"
              elif "sup-simcse-roberta-base" in model:
                  model_num = "(3)"
              else:
                  raise NotImplementedError()
  
              section_data.append(
                  model_df[columns].max(axis=1)[emb_section]
              )
              section_row_titles.append(f"{emb_section} {model_num}")
  
          emb_section_summaries[emb_section] = pandas.DataFrame(
              data=section_data,
              index=section_row_titles,
              columns=["MAX"],
          )
  
      def _max_df(df):
          return pandas.DataFrame({"MAX": df[columns].max(axis=1)})
  
      sig_baselines = granular_sections["baselines"].loc[
          REPORTED_BASELINES
      ][pvals_by_section["baselines"] < 0.05]
  
      summary_df = pandas.concat(
          [
              _max_df(sig_baselines),
              emb_section_summaries["ROSCOE-SA"],
              emb_section_summaries["ROSCOE-SS"],
              _max_df(
                  granular_sections["ROSCOE-LI"].loc[["ROSCOE-LI"]]
              ),
              _max_df(
                  granular_sections["ROSCOE-LC"].loc[["ROSCOE-LC"]]
              ),
          ]
      )
      return summary_df
  
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 30 for calling a global function with example usage: generate_single_dataset_final_summary_table_max(granular_sections, pvals_by_section) and returns: summary_df, pandas