def is_a_tty(stream=sys.stdout):
result = stream.isatty() if hasattr(stream, '<STR_LIT>') else None<EOL>log.debug(result)<EOL>return result<EOL>
Detect terminal or something else, such as output redirection.

        Returns:
            Boolean, None: is tty or None if not found.