import re


def linearize(multiline: str) -> str:
    """
    :param multiline:  A multiline string as found in indented source code.
    :return:  A stripped, one-line string. All newlines and multiple
            consecutive whitespace characters are replaced by a single space.
    """
    oneline = re.sub(r"\s+", " ", multiline)
    return oneline.strip()