code: def main():
      parser = argparse.ArgumentParser(
          description="convert a Pytest JUnit XML file to a checkstyle one, for reviewdog"
      )
      parser.add_argument(
          "file", type=argparse.FileType("r"), default="-", nargs="?"
      )
      args = parser.parse_args()
  
      tree = ET.parse(args.file)
      root = tree.getroot()
  
      invalid = []
      for testcase in root.findall(".//testcase"):
          for child in testcase:
              if child.tag in ("error", "failure"):
                  classname = testcase.get("classname")
                  name = testcase.get("name")
  
                  match = FILE_LINE.search(child.text)
                  if match is None:
                      invalid.append(
                          f"output of test '{name}' in '{classname}' does not contain match for filename & line regex /{FILE_LINE.pattern}/"
                      )
                      continue
  
                  filename = match[1]
                  line = int(match[2])
  
                  base_message = child.get("message").replace(
                      "\\n", "\n"
                  )
                  indented = textwrap.indent(base_message, "    ")
  
                  message = f"""\
  Test '{name}' failed:
  
  {indented}
  """
                  # multiline output is possible by escaping (only) the \n
                  # https://github.com/actions/toolkit/issues/193#issuecomment-605394935
                  encoded = message.replace("\n", "%0A")
                  print(
                      f"::error file={filename},line={line}::{encoded}"
                  )
  
      if invalid:
          print(
              "failed to understand some failed test(s) (fixing the test(s) will stop this error too):",
              file=sys.stderr,
          )
          for exc in invalid:
              print(f"- {exc}", file=sys.stderr)
  
          sys.exit(1)
  
file_path: stellargraph/scripts/ci/junit_to_github_checks.py
imports: import argparse
  from collections import defaultdict
  import os
  import re
  import sys
  import textwrap
  import xml.etree.ElementTree
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types