code: def load_tom_results_from_dir(
      log_dir: Union[str, Path]
  ) -> pd.DataFrame:
      rows = []
      final_results_dict = log_utils.get_final_results_from_dir(log_dir)
  
      for path, final_results in final_results_dict.items():
          spec = log_utils.extract_spec(path)
          dataset, prompt_type, model = parse_spec(spec)
          rows.append(
              {
                  "model": model,
                  "dataset": dataset,
                  "prompt_type": prompt_type,
                  "accuracy": final_results["accuracy"],
                  "bootstrap_std": final_results["bootstrap_std"],
              }
          )
      return pd.DataFrame(rows)
  
file_path: evals/evals/elsuite/theory_of_mind/scripts/make_plots.py
imports: import argparse
  from pathlib import Path
  from typing import Union
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from evals.utils import log_utils
label_desc: Use image node_id 2 for calling a global function with example usage: load_tom_results_from_dir(log_dir) and returns: pd