class_docstr: :param get_size: A callable which returns the `Size` of the output terminal.
  :param stdout: Any object with has a `write` and `flush` method + an 'encoding' property.
  :param true_color: Use 24bit color instead of 256 colors. (Can be a :class:`SimpleFilter`.)
      When `ansi_colors_only` is set, only 16 colors are used.
  :param ansi_colors_only: Restrict to 16 ANSI colors only.
  :param term: The terminal environment variable. (xterm, xterm-256color, linux, ...)
  :param write_binary: Encode the output before writing it. If `True` (the
      default), the `stdout` object is supposed to expose an `encoding` attribute.
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:
          return
  
      data = "".join(self._buffer)
  
      try:
          # (We try to encode ourself, because that way we can replace
          # characters that don't exist in the character set, avoiding
          # UnicodeEncodeError crashes. E.g. u'\xb7' does not appear in 'ascii'.)
          # My Arch Linux installation of july 2015 reported 'ANSI_X3.4-1968'
          # for sys.stdout.encoding in xterm.
          if self.write_binary:
              if hasattr(self.stdout, "buffer"):
                  out = self.stdout.buffer  # Py3.
              else:
                  out = self.stdout
              out.write(
                  data.encode(
                      self.stdout.encoding or "utf-8", "replace"
                  )
              )
          else:
              self.stdout.write(data)
  
          self.stdout.flush()
      except IOError as e:
          if e.args and e.args[0] == errno.EINTR:
              # Interrupted system call. Can happpen in case of a window
              # resize signal. (Just ignore. The resize handler will render
              # again anyway.)
              pass
          elif e.args and e.args[0] == 0:
              # This can happen when there is a lot of output and the user
              # sends a KeyboardInterrupt by pressing Control-C. E.g. in
              # a Python REPL when we execute "while True: print('test')".
              # (The `ptpython` REPL uses this `Output` class instead of
              # `stdout` directly -- in order to be network transparent.)
              # So, just ignore.
              pass
          else:
              raise
  
      self._buffer = []
  
imports: from __future__ import unicode_literals
  from prompt_toolkit.filters import to_simple_filter, Condition
  from prompt_toolkit.layout.screen import Size
  from prompt_toolkit.renderer import Output
  from prompt_toolkit.styles import ANSI_COLOR_NAMES
  from six.moves import range
  import array
  import errno
  import os
  import six
label_desc: Use image node_id 29 for calling the Vt100_Output obj's underlying member method code with example usage: obj.flush() without return types