import re


def strip_query(query):
    """
    Strips a query of whitespaces, this form is more useful for comparision.

    :param query: Initial query
    :return: Stripped query
    """
    return re.sub(r'[\s]+', ' ', query).strip()