code: def get_per_module_results(log_file_name):
      per_module_results = {}
      with open(log_file_name) as f:
          for line in f:
              try:
                  line = json.loads(line)
              except Exception:
                  line = {}
              if "outcome" in line:
                  outcome = line["outcome"]
                  # outcome can be "passed", "failed", or "skipped".
                  # Depending on other fields, it can indicate
                  # an errored, xpassed, or xfailed test.
                  if line.get("when", None) != "call":
                      # when != call indicates test setup or teardown
                      if outcome == "failed":
                          # if the test failed during setup or teardown,
                          # it counts as an "errored" test:
                          outcome = "errored"
                      else:
                          # we don't care about other outcomes during
                          # setup or teardown
                          continue
                  else:
                      if (
                          line.get("wasxfail", False)
                          and outcome == "passed"
                      ):
                          # it's an xpassed test
                          outcome = "failed"
                  module_name = (
                      line["nodeid"]
                      .split("::")[0]
                      .removeprefix(PANDAS_TEST_PREFIX)
                  )
                  per_module_results.setdefault(module_name, {})
                  per_module_results[module_name].setdefault("total", 0)
                  per_module_results[module_name].setdefault(outcome, 0)
                  per_module_results[module_name]["total"] += 1
                  per_module_results[module_name][outcome] += 1
      return per_module_results
  
imports: import argparse
  import json
  from rich.console import Console
  from rich.table import Table
label_desc: Use image node_id 1 for calling a global function with example usage: get_per_module_results(log_file_name) and returns: per_module_results