def disable_if_no_tty(cls):
        """Disable all colors only if there is no TTY available.

        :return: True if colors are disabled, False if stderr or stdout is a TTY.
        :rtype: bool
        """
        if sys.stdout.isatty() or sys.stderr.isatty():
            return False
        cls.disable_all_colors()
        return True
def disable_if_no_tty ( cls ) : if sys . stdout . isatty ( ) or sys . stderr . isatty ( ) : return False cls . disable_all_colors ( ) return True
Disable all colors only if there is no TTY available.

        :return: True if colors are disabled, False if stderr or stdout is a TTY.
        :rtype: bool