code: def transform(stdout: str, is_maintainer: bool) -> str:
      transformed = []
      for line in stdout.splitlines():
          if m := MESSAGE_REGEX.match(line):
              if m.group(2) is not None:
                  command = (
                      "`ruff --fix .` or comment `@mlflow-automation autoformat`"
                      if is_maintainer
                      else "`ruff --fix .`"
                  )
                  line = f"{line}. Run {command} to fix this error."
              else:
                  name = get_rule_name(m.group(1))
                  line = f"{line}. See https://beta.ruff.rs/docs/rules/{name} for how to fix this error."
          transformed.append(line)
      return "\n".join(transformed)
  
file_path: mlflow/dev/ruff.py
imports: import functools
  import json
  import os
  import re
  import subprocess
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: transform(stdout, is_maintainer) and returns: str