import textwrap


def whitespace_cleanup(value: str) -> str:
    """Return the string value with (per line) leading and any trailing whitespace removed."""
    return textwrap.dedent(value).strip("\n")