from __future__ import annotations from typing import Optional def format_runtime_unavailable_detail( *, label: str, fallback: str, import_error: Optional[str] = None, ) -> str: normalized_error = str(import_error or "").strip() if normalized_error: return f"{label} is unavailable: {normalized_error}" return fallback