def collapse_body(self):
        if isinstance(self.body, basestring):
            return self.body

        newbody = []
        for chunk in self.body:
            if py3k and not isinstance(chunk, bytes):
                raise TypeError("Chunk %s is not of type 'bytes'." % repr(chunk))
            newbody.append(chunk)
        newbody = ntob('').join(newbody)

        self.body = newbody
        return newbody
Collapse self.body to a single string; replace it and return it.
dataset/ETHPy150Open clips/pattern/pattern/server/cherrypy/cherrypy/_cprequest.py/Response.collapse_body