def write_response(self, response, writer):
        self.state = self.STATE_WRITING_HEADER
        
        if self.version != 'HTTP/1.0':
            chunked = False
        else:
            chunked = True

        writer.clear()
        
        writer.write_bytes("%s %s\r\n" % (self.version, self.status))        
        for header_name, header_value in self.response_headers:
            if header_name in self._disallowed_application_headers: continue
            writer.write_bytes("%s: %s\r\n" % (header_name, header_value))
        writer.write_bytes("Date: %s\r\n" % rfc822.formatdate())
        writer.write_bytes("Server: %s\r\n" % SERVER_ID) 

        if chunked:
            writer.write_bytes("Transfer-Encoding: chunked\r\n")
        else:
            response = ''.join(response)
            writer.write_bytes("Content-length: %d\r\n" % len(response))
        
        writer.write_bytes("\r\n")
    
        self.state = self.STATE_WRITING_DATA
        
        if chunked:
            for chunk in response:
                writer.write_bytes("%x;\r\n" % len(chunk))
                writer.write_bytes(chunk)
                writer.write_bytes("\r\n")
                
            writer.write_bytes("0\r\n\r\n")
        else:
            writer.write_bytes(response)

        writer.flush() #TODO use special header to indicate no flush needed
        
        self.state = self.STATE_FINISHED
dataset/ETHPy150Open concurrence/concurrence/lib/concurrence/http/server.py/WSGIRequest.write_response/operator `==` -> `!=`