()
Check if we are running in a TTY. If so, make sure the terminal supports ANSI escape sequences. If not, disable
    colorized output. Sets global `ansi_color_enabled` to True if colorized output should be enabled by default.
Check if we are running in a TTY. If so, make sure the terminal supports ANSI escape sequences. If not, disable
    colorized output. Sets global `ansi_color_enabled` to True if colorized output should be enabled by default.
Check if we are running in a TTY . If so make sure the terminal supports ANSI escape sequences . If not disable colorized output . Sets global ansi_color_enabled to True if colorized output should be enabled by default .
def setup_terminal():
    """
    Check if we are running in a TTY. If so, make sure the terminal supports ANSI escape sequences. If not, disable
    colorized output. Sets global `ansi_color_enabled` to True if colorized output should be enabled by default.
    """
    isatty = (hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
               and hasattr(sys.stderr, 'isatty') and sys.stderr.isatty())
    if sys.platform == 'win32' and isatty:
        if not isinstance(sys.stdout, colorama.ansitowin32.StreamWrapper):
            colorama.init()

    global ansi_color_enabled  # pylint:disable=global-statement
    ansi_color_enabled = isatty
def setup_terminal ( ) : isatty = ( hasattr ( sys . stdout , 'isatty' ) and sys . stdout . isatty ( ) and hasattr ( sys . stderr , 'isatty' ) and sys . stderr . isatty ( ) ) if sys . platform == 'win32' and isatty : if not isinstance ( sys . stdout , colorama . ansitowin32 . StreamWrapper ) : colorama . init ( ) global ansi_color_enabled # pylint:disable=global-statement ansi_color_enabled = isatty