class_docstr: I/O abstraction for rendering to Windows consoles.
  (cmd.exe and similar.)
class_docstr_tok: ["I\/O","abstraction","for","rendering","to","Windows","consoles",".","(","cmd.exe","and","similar",".",")"]
docstr: Write to output stream and flush.
docstr_tok: ["Write","to","output","stream","and","flush","."]
code: def flush(self):
      """
      Write to output stream and flush.
      """
      if not self._buffer:
          # Only flush stdout buffer. (It could be that Python still has
          # something in its buffer. -- We want to be sure to print that in
          # the correct color.)
          self.stdout.flush()
          return
  
      data = "".join(self._buffer)
  
      if _DEBUG_RENDER_OUTPUT:
          self.LOG.write(("%r" % data).encode("utf-8") + b"\n")
          self.LOG.flush()
  
      # Print characters one by one. This appears to be the best soluton
      # in oder to avoid traces of vertical lines when the completion
      # menu disappears.
      for b in data:
          written = DWORD()
  
          retval = windll.kernel32.WriteConsoleW(
              self.hconsole, b, 1, byref(written), None
          )
          assert retval != 0
  
      self._buffer = []
  
imports: from __future__ import unicode_literals
  from ctypes import windll, byref, ArgumentError, c_char, c_long, c_ulong, c_uint, pointer
  from ctypes.wintypes import DWORD, HANDLE
  from prompt_toolkit.renderer import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES
  from prompt_toolkit.win32_types import CONSOLE_SCREEN_BUFFER_INFO, STD_OUTPUT_HANDLE, STD_INPUT_HANDLE, COORD, SMALL_RECT
  import os
  import six
label_desc: Use image node_id 24 for calling the Win32Output obj's underlying member method code with example usage: obj.flush() without return types