def dataReceived(self, data):
        body = data.split('\r\n')
        try:
            method, url, http_vsn = body[0].split(' ')
        except Exception:
            # we got weird data, just fail
            logger.info(_log_t(self.transport, data))
            self.transport.loseConnection()

        o = urlparse.urlparse(url)
        query = urlparse.parse_qs(o.query)
        if 'failrate' in query:
            failrate = query['failrate'].pop()
        else:
            failrate = 0.05
        if random.random() >= float(failrate):
            logger.info(_log_t(self.transport, data, status=200))
            self.transport.write(
                success_response('application/json', '{"success": true}'))
        else:
            logger.info(_log_t(self.transport, data))
        self.transport.loseConnection()
dataset/ETHPy150Open kevinburke/hamms/hamms/__init__.py/DropRandomRequestsServer.dataReceived/original