def color(text, color, BOLD=False):
    """ANSI Sequence wrapper for text, colorizes output"""
    ANSI_PREFIX = '\x1b['
    ANSI_ENDS = '\x1b[0m'
    ANSI_COLORS_FOREGROUND = {'black': ANSI_PREFIX + '90m', 'red': 
        ANSI_PREFIX + '91m', 'green': ANSI_PREFIX + '92m', 'yellow': 
        ANSI_PREFIX + '93m', 'blue': ANSI_PREFIX + '94m', 'magenta': 
        ANSI_PREFIX + '95m', 'cyan': ANSI_PREFIX + '96m', 'white': 
        ANSI_PREFIX + '97m'}
    if color.lower() in ANSI_COLORS_FOREGROUND.keys():
        colored = ANSI_COLORS_FOREGROUND[color] + text + ANSI_ENDS
        if BOLD:
            colored = '\x1b[1m' + colored
        return colored
    else:
        return text
