code: def format_generated_code(code: str) -> str:
      """
      Format some code with ruff. Cannot be done "on the fly" so we first save the code in a temporary file.
      """
      # Format with ruff
      with tempfile.TemporaryDirectory() as tmpdir:
          filepath = Path(tmpdir) / "__init__.py"
          filepath.write_text(code)
          ruff_bin = find_ruff_bin()
          os.spawnv(
              os.P_WAIT,
              ruff_bin,
              ["ruff", str(filepath), "--fix", "--quiet"],
          )
          return filepath.read_text()
  
file_path: hub-client/utils/_legacy_check_future_compatible_signatures.py
imports: import argparse
  import inspect
  import os
  import re
  import tempfile
  from pathlib import Path
  from typing import Callable, NoReturn
  from ruff.__main__ import find_ruff_bin
  from huggingface_hub.hf_api import HfApi
label_desc: Use image node_id 3 for calling a global function with example usage: format_generated_code(code) and returns: filepath