def setResponseCode(self, code, message=None):
        """
        Set the HTTP status response code, but takes care that this is called
        before any data is written.
        """
        assert not self.written, "Response code cannot be set after data has been written: %s." % "@@@@".join(self.written)
        self.responseCode = code
        self.responseMessage = message
dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/web/test/test_web.py/DummyRequest.setResponseCode/original