def dataReceived(self, data):
        if not self.known_proto:
            self.known_proto = self.transport.getNextProtocol()
            assert self.known_proto == b'h2'

        events = self.conn.receive_data(data)

        for event in events:
            if isinstance(event, ResponseReceived):
                self.handleResponse(event.headers, event.stream_id)
            elif isinstance(event, DataReceived):
                self.handleData(event.data, event.stream_id)
            elif isinstance(event, StreamEnded):
                self.endStream(event.stream_id)
            elif isinstance(event, SettingsAcknowledged):
                self.settingsAcked(event)
            elif isinstance(event, StreamReset):
                reactor.stop()
                raise RuntimeError(event.error_code % "Stream reset: %d")
            else:
                print(event)

        data = self.conn.data_to_send()
        if data:
            self.transport.write(data)
dataset/ETHPy150Open python-hyper/hyper-h2/examples/twisted/head_request.py/H2Protocol.dataReceived/swapped operands of `%`