code: def _get_sleep(self, poller, timeout, block, rsock, wsock, cookie):
          
          _vv and IOLOG.debug(
              '%r._get_sleep(timeout=%r, block=%r, rfd=%d, wfd=%d)',
              self, timeout, block, rsock.fileno(), wsock.fileno()
          )
  
          e = None
          woken = None
          try:
              woken = list(poller.poll(timeout))
          except Exception:
              e = sys.exc_info()[1]
  
          self._lock.acquire()
          try:
              i = self._sleeping.index((wsock, cookie))
              del self._sleeping[i]
              if not woken:
                  raise e or TimeoutError()
  
              got_cookie = rsock.recv(self.COOKIE_SIZE)
              self._cls_idle_socketpairs.append((rsock, wsock))
  
              assert cookie == got_cookie, (
                  "Cookie incorrect; got %r, expected %r" \
                  % (binascii.hexlify(got_cookie),
                     binascii.hexlify(cookie))
              )
              assert i < self._waking, (
                  "Cookie correct, but no queue element assigned."
              )
              self._waking -= 1
              if self.closed:
                  raise LatchError()
              _vv and IOLOG.debug('%r.get() wake -> %r', self, self._queue[i])
              return self._queue.pop(i)
          finally:
              self._lock.release()
docs: When a result is not immediately available, sleep waiting for
          :meth:`put` to write a byte to our socket pair.