def terminal_supports_colors(stream=None):
    return (sys.platform != 'Pocket PC' and
            (sys.platform != 'win32' or 'ANSICON' in os.environ) and
            connected_to_terminal(stream))
Check if a stream is connected to a terminal that supports ANSI escape sequences.
dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/terminal.py/terminal_supports_colors