'Set the HTTP response code.
@type code: C{int}
@type message: C{bytes}'

def setResponseCode(self, code, message=None):

    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, 'Unknown    Status')
