from typing import Any def normalize_message(value: Any) -> str: return " ".join(str(value or "").split()).strip()