code: def parse_rows(
      rows: Iterable[str],
  ) -> list[tuple[str, str, set[str | None]]]:
      match = re.compile(
          r"(distributed/.*test.*)::([^ ]*)"
          r"( (.*)(PASSED|FAILED|ERROR|SKIPPED|XFAIL|RERUN|LEAKED).*| )$"
      )
  
      out: defaultdict[tuple[str, str], set[str | None]] = defaultdict(
          set
      )
  
      for row in rows:
          m = match.match(row)
          if not m:
              continue
  
          fname = m.group(1)
          clsname = (
              fname.replace("/", ".")
              .replace(".py", "")
              .replace("::", ".")
          )
  
          tname = m.group(2).strip()
          if m.group(4) and "]" in m.group(4):
              tname += " " + m.group(4).split("]")[0] + "]"
  
          outcome = m.group(5)
          assert outcome in OUTCOMES
          if outcome not in {"RERUN", "LEAKED"}:
              out[clsname, tname].add(outcome)
  
      return [
          (clsname, tname, outcomes)
          for (clsname, tname), outcomes in out.items()
      ]
  
file_path: distributed/continuous_integration/scripts/parse_stdout.py
imports: from __future__ import annotations
  import html
  import re
  import sys
  from collections import Counter, defaultdict
  from collections.abc import Iterable
  from datetime import datetime
label_desc: Use image node_id 1 for calling a global function with example usage: parse_rows(rows) and returns: unknown