import re


def clean(text):
    """
    Cleans text, removes excess tabs, CRs, spaces

    :param text: raw text string
    :return: clean text string
    """
    text = re.sub('\s*\n\s*', '\n', text)
    text = re.sub('[ \t]{2,}', ' ', text)
    return text.strip()