def _timed_out(self):
        """Internal use only.
        """
        if self._read_coro:
            buf = None
            if isinstance(self._read_result, bytearray):
                view = self._read_task.args[1]
                n = len(view) - len(self._read_result)
                if n > 0:
                    buf = bytes(self._read_result[:n])
            if buf:
                self._read_coro._proceed_(buf)
            else:
                self._read_coro.throw(socket.timeout('timed out'))
            self._notifier.clear(self, _AsyncPoller._Read)
            self._read_task = self._read_result = self._read_coro = None
        if self._write_coro:
            sent = 0
            if isinstance(self._write_result, buffer):
                sent = self._write_task.args[1] - len(self._write_result)
            if sent:
                self._write_coro._proceed_(sent)
            else:
                self._write_coro.throw(socket.timeout('timed out'))
            self._notifier.clear(self, _AsyncPoller._Write)
            self._write_task = self._write_result = self._write_coro = None
dataset/ETHPy150Open pgiri/asyncoro/py2/asyncoro/__init__.py/_AsyncSocket._timed_out/swapped operands of `-`