code: def print_table(
      table,
      header_text,
      row_labels,
      col_labels,
      colwidth=10,
      latex=True,
  ):
      """Pretty-print a 2D array of data, optionally with row/col labels"""
      print("")
  
      if latex:
          num_cols = len(table[0])
          print("\\begin{center}")
          print("\\adjustbox{max width=\\textwidth}{%")
          print("\\begin{tabular}{l" + "c" * num_cols + "}")
          print("\\toprule")
      else:
          print("--------", header_text)
  
      for row, label in zip(table, row_labels):
          row.insert(0, label)
  
      if latex:
          col_labels = [
              "\\textbf{" + str(col_label).replace("%", "\\%") + "}"
              for col_label in col_labels
          ]
      table.insert(0, col_labels)
  
      for r, row in enumerate(table):
          misc.print_row(row, colwidth=colwidth, latex=latex)
          if latex and r == 0:
              print("\\midrule")
      if latex:
          print("\\bottomrule")
          print("\\end{tabular}}")
          print("\\end{center}")
  
file_path: generalized-moe/domainbed/scripts/collect_results.py
imports: import argparse
  import os
  import sys
  import numpy
  from domainbed import algorithms
  from domainbed import datasets
  from domainbed import model_selection
  from domainbed.lib import misc, reporting
  from domainbed.lib.query import Q
label_desc: Use image node_id 2 for calling a global function with example usage: print_table(table, header_text, row_labels, col_labels, colwidth, latex) without return types