Code Refactoring Assistant — illustrative example INPUT Refactor this Python function without changing its result or empty-name error: def label(name, loud): if loud: if not name: raise ValueError("name required") return name.upper() if not name: raise ValueError("name required") return name.lower() RESULT def label(name, loud): if not name: raise ValueError("name required") return name.upper() if loud else name.lower() Checks: label("Ada", True) → "ADA"; label("Ada", False) → "ada". An empty string raises ValueError("name required") in both modes. REVIEW Refactoring should preserve observable behavior unless a change is explicitly requested. Identify tests or examples that can detect an unintended difference. This is a teaching example, not a live execution record.