@staticmethod
def __has_colors(stream):
    """
        Is tty output check
        :param object stream: input stream
        :return: bool
        """
    if not hasattr(stream, 'isatty'):
        return False
    if not stream.isatty():
        return False
    try:
        import curses
        curses.setupterm()
        return curses.tigetnum('colors') > 2
    except Exception:
        return False
