code: def ruff_format_str(code: Union[str, List[str]]) -> str:
      if isinstance(code, list):
          code = "\n".join(code)
  
      r = subprocess.run(
          # Name of the file does not seem to matter but ruff requires one
          ["ruff", "format", "--stdin-filename", "placeholder.py"],
          input=code.encode(),
          check=True,
          capture_output=True,
      )
      return r.stdout.decode()
  
imports: import keyword
  import re
  import subprocess
  import textwrap
  import urllib
  from typing import Any, Dict, Final, Iterable, List, Optional, Union
  from .schemapi import _resolve_references
label_desc: Use image node_id 7 for calling a global function with example usage: ruff_format_str(code) and returns: r