class_docstr: Wrapper around stdin which reads (nonblocking) the next available 1024
  bytes and decodes it.
  
  Note that you can't be sure that the input file is closed if the ``read``
  function returns an empty string. When ``errors=ignore`` is passed,
  ``read`` can return an empty string if all malformed input was replaced by
  an empty string. (We can't block here and wait for more input.) So, because
  of that, check the ``closed`` attribute, to be sure that the file has been
  closed.
  
  :param stdin_fd: File descriptor from which we read.
  :param errors:  Can be 'ignore', 'strict' or 'replace'.
      On Python3, this can be 'surrogateescape', which is the default.
  
      'surrogateescape' is preferred, because this allows us to transfer
      unrecognised bytes to the key bindings. Some terminals, like lxterminal
      and Guake, use the 'Mxx' notation to send mouse events, where each 'x'
      can be any possible byte.
code: def __init__(
      self,
      stdin_fd,
      errors=("ignore" if six.PY2 else "surrogateescape"),
  ):
      assert isinstance(stdin_fd, int)
      self.stdin_fd = stdin_fd
      self.errors = errors
  
      # Create incremental decoder for decoding stdin.
      # We can not just do `os.read(stdin.fileno(), 1024).decode('utf-8')`, because
      # it could be that we are in the middle of a utf-8 byte sequence.
      self._stdin_decoder_cls = getincrementaldecoder("utf-8")
      self._stdin_decoder = self._stdin_decoder_cls(errors=errors)
  
      #: True when there is nothing anymore to read.
      self.closed = False
  
imports: from __future__ import unicode_literals
  from codecs import getincrementaldecoder
  import os
  import six
label_desc: Use image node_id 1 to create a new PosixStdinReader object from inherited base classes: object with example: obj = PosixStdinReader(stdin_fd, errors)