def _process_event(self, key, mask):
self._logger.debug('<STR_LIT>'.format(key, mask))<EOL>fileobj, (reader, writer) = key.fileobj, key.data<EOL>if mask & selectors.EVENT_READ and reader is not None:<EOL><INDENT>if reader._cancelled:<EOL><INDENT>self.remove_reader(fileobj)<EOL><DEDENT>else:<EOL><INDENT>self._logger.debug('<STR_LIT>'.format(reader))<EOL>reader._run()<EOL><DEDENT><DEDENT>if mask & selectors.EVENT_WRITE and writer is not None:<EOL><INDENT>if writer._cancelled:<EOL><INDENT>self.remove_writer(fileobj)<EOL><DEDENT>else:<EOL><INDENT>self._logger.debug('<STR_LIT>'.format(writer))<EOL>writer._run()<EOL><DEDENT><DEDENT>
Selector has delivered us an event.