'Prepare the Response for multiple ranges.'

def _prepare_for_ranges(self, ranges):

    content_size = self.content_length
    content_type = self.headers.get('content-type')
    self.content_type = ''.join(['multipart/byteranges;', 'boundary=', self.boundary])
    section_header_fixed_len = (((((((len(self.boundary) + 4) + len('Content-Type:    ')) + len(content_type)) + 2) + len('Content-Range:    ')) + 2) + 2)
    body_size = 0
    for (start, end) in ranges:
        body_size += section_header_fixed_len
        cr = content_range_header_value(start, end, content_size)
        body_size += len(cr)
        body_size += (end - start)
        body_size += 2
    body_size += (len(self.boundary) + 4)
    self.content_length = body_size
    self.content_range = None
    return (content_size, content_type)
