code: def print_results_as_table(results):
      table = Table()
      table.add_column("Test module")
      table.add_column("Total tests")
      table.add_column("Passed tests")
      table.add_column("Failed tests")
      table.add_column("Errored tests")
      table.add_column("Skipped tests")
      totals = {
          "total": 0,
          "passed": 0,
          "failed": 0,
          "errored": 0,
          "skipped": 0,
      }
      for module_name, row in results.items():
          values = []
          for key in (
              "total",
              "passed",
              "failed",
              "errored",
              "skipped",
          ):
              totals[key] += row.get(key, 0)
              values.append(row.get(key, 0))
          table.add_row(module_name, *map(str, values))
      table.add_section()
      table.add_row(
          "total={}, passed={}, failed={}, errored={}, skipped={}".format(
              *map(str, totals.values())
          )
      )
      console = Console()
      console.print(table)
  
imports: import argparse
  import json
  from rich.console import Console
  from rich.table import Table
label_desc: Use image node_id 4 for calling a global function with example usage: print_results_as_table(results) without return types