code: def make_table(result_dict):
      """Generate table of results."""
      md_writer = MarkdownTableWriter()
      latex_writer = LatexTableWriter()
      md_writer.headers = [
          "Model",
          "Precision",
          "Task",
          "Metric",
          "Value",
      ]
      latex_writer.headers = [
          "Model",
          "Precision",
          "Task",
          "Metric",
          "Value",
      ]
  
      values = []
      for model, model_results in result_dict.items():
          for precision, prec_results in model_results.items():
              for task, task_results in prec_results.items():
                  results = task_results["results"]
                  m = task_to_metric[task]
                  if len(results) > 1:
                      result = results[task]
                  else:
                      result = list(results.values())[0]
  
                  values.append(
                      [
                          model,
                          precision,
                          task,
                          m,
                          "%.2f" % (result[m] * 100),
                      ]
                  )
  
                  model = ""
                  precision = ""
  
      md_writer.value_matrix = values
      latex_writer.value_matrix = values
  
      # todo: make latex table look good
      # print(latex_writer.dumps())
  
      return md_writer.dumps()
  
imports: import logging
  from pytablewriter import MarkdownTableWriter, LatexTableWriter
  import os
  import json
  import sys
  from harness_to_leaderboard import task_to_metric
label_desc: Use image node_id 1 for calling a global function with example usage: make_table(result_dict) and returns: md_writer