import re


def strip_ansi_sequences(text):
    """Return a string cleaned of ANSI sequences"""
    # This snippet of code is from Martijn Pieters
    # https://stackoverflow.com/questions/14693701/how-can-i-remove-the-ansi-escape-sequences-from-a-string-in-python
    ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
    return ansi_escape.sub('', text)