class_docstr: Event loop for posix systems (Linux, Mac os X).
code: def __init__(self, inputhook=None, selector=AutoSelector):
      assert inputhook is None or callable(inputhook)
      assert issubclass(selector, Selector)
  
      self.running = False
      self.closed = False
      self._running = False
      self._callbacks = None
  
      self._calls_from_executor = []
      self._read_fds = {}  # Maps fd to handler.
      self.selector = selector()
  
      # Create a pipe for inter thread communication.
      self._schedule_pipe = os.pipe()
      fcntl.fcntl(self._schedule_pipe[0], fcntl.F_SETFL, os.O_NONBLOCK)
  
      # Create inputhook context.
      self._inputhook_context = (
          InputHookContext(inputhook) if inputhook else None
      )
  
imports: from __future__ import unicode_literals
  import fcntl
  import os
  import signal
  import threading
  import time
  from prompt_toolkit.terminal.vt100_input import InputStream
  from prompt_toolkit.utils import DummyContext, in_main_thread
  from prompt_toolkit.input import Input
  from .base import EventLoop, INPUT_TIMEOUT
  from .callbacks import EventLoopCallbacks
  from .inputhook import InputHookContext
  from .posix_utils import PosixStdinReader
  from .utils import TimeIt
  from .select import AutoSelector, Selector, fd_to_int
label_desc: Use image node_id 1 to create a new PosixEventLoop object from inherited base classes: EventLoop with example: obj = PosixEventLoop(inputhook, selector)