def cancel(self, block):
event = libaio.io_event()<EOL>try:<EOL><INDENT>libaio.io_cancel(self._ctx, byref(block._iocb), byref(event))<EOL><DEDENT>except OSError as exc:<EOL><INDENT>if exc.errno == errno.EINPROGRESS:<EOL><INDENT>return None<EOL><DEDENT>raise<EOL><DEDENT>return self._eventToPython(event)<EOL>
Cancel an IO block.

block (AIOBlock)
    The IO block to cancel.

Returns cancelled block's event data (see getEvents), or None if the
kernel returned EINPROGRESS. In the latter case, event completion will
happen on a later getEvents call.