code: def transform(stdout: str, is_maintainer: bool) -> str:
      if not stdout:
          return stdout
      transformed = []
      for line in stdout.splitlines():
          if m := MESSAGE_REGEX.match(line):
              path = m.group(1)
              command = (
                  "`black .` or comment `@mlflow-automation autoformat`"
                  if is_maintainer
                  else "`black .`"
              )
              line = (
                  f"{path}: Unformatted file. Run {command} to format."
              )
  
          transformed.append(line)
      return "\n".join(transformed) + "\n"
  
imports: import os
  import re
  import subprocess
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: transform(stdout, is_maintainer) and returns: unknown, stdout