capybara/helpers.py
def normalize_whitespace(text):
    """
    Returns the given text with outer whitespace removed and inner whitespace collapsed.

    Args:
        text (str): The text to normalize.

    Returns:
        str: The normalized text.
    """

    return re.sub(r"\s+", " ", text, flags=re.UNICODE).strip()
def normalize_whitespace(text):
    return re.sub(r"\s+", " ", text, flags=re.UNICODE).strip()
def normalize_whitespace ( text ) : return re . sub ( r"\s+" , " " , text , flags = re . UNICODE ) . strip ( )
Returns the given text with outer whitespace removed and inner whitespace collapsed.

    Args:
        text (str): The text to normalize.

    Returns:
        str: The normalized text.
Returns the given text with outer whitespace removed and inner whitespace collapsed .