def setResponseCode(self, code, message=None):
        """
        Set the HTTP response code.

        @type code: L{int}
        @type message: L{bytes}
        """
        if not isinstance(code, _intTypes):
            raise TypeError("HTTP response code must be int or long")
        self.code = code
        if message:
            if not isinstance(message, bytes):
                raise TypeError("HTTP response status message must be bytes")
            self.code_message = message
        else:
            self.code_message = RESPONSES.get(code, b"Unknown Status")

        Set the HTTP response code.

        @type code: L{int}
        @type message: L{bytes}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/http.py