def enable_vt_processing():
results = []<EOL>for stream in (STD_OUTPUT_HANDLE, STD_ERROR_HANDLE):<EOL><INDENT>handle = kernel32.GetStdHandle(stream)<EOL>mode = DWORD()<EOL>if not kernel32.GetConsoleMode(handle, byref(mode)):<EOL><INDENT>break<EOL><DEDENT>if (mode.value & ENABLE_VIRTUAL_TERMINAL_PROCESSING) == <NUM_LIT:0>:<EOL><INDENT>results.append(<EOL>kernel32.SetConsoleMode(handle,<EOL>mode.value | ENABLE_VIRTUAL_TERMINAL_PROCESSING)<EOL>)<EOL><DEDENT>else:<EOL><INDENT>results.append('<STR_LIT>')<EOL><DEDENT><DEDENT>results = tuple(results)<EOL>log.debug('<STR_LIT:%s>', results)<EOL>return results<EOL>
What it says on the tin.

        - https://docs.microsoft.com/en-us/windows/console/setconsolemode
          #ENABLE_VIRTUAL_TERMINAL_PROCESSING

        - https://stackoverflow.com/q/36760127/450917

        Returns:
            Tuple of status codes from SetConsoleMode for (stdout, stderr).