human
Complete the below
def document_iters_to_http_response_body(ranges_iter, boundary, multipart, logger):

    ''''Takes an iterator of range iters and turns it into an appropriate
    HTTP response body, whether that\'s multipart/byteranges or not.
    This is almost, but not quite, the inverse of
    request_helpers.http_response_to_document_iters(). This function only
    yields chunks of the body, not any headers.
    :param ranges_iter: an iterator of dictionaries, one per range.
    Each dictionary must contain at least the following key:
    "part_iter": iterator yielding the bytes in the range
    Additionally, if multipart is True, then the following other keys
    are required:
    "start_byte": index of the first byte in the range
    "end_byte": index of the last byte in the range
    "content_type": value for the range\'s Content-Type header
    Finally, there is one optional key that is used in the
    multipart/byteranges case:
    "entity_length": length of the requested entity (not necessarily
    equal to the response length). If omitted, "*" will be used.
    Each part_iter will be exhausted prior to calling next(ranges_iter).
    :param boundary: MIME boundary to use, sans dashes (e.g. "boundary", not
    "--boundary").
    :param multipart: True if the response should be multipart/byteranges,
    False otherwise. This should be True if and only if you have 2 or
    more ranges.
    :param logger: a logger'
    '''
assistant
#Here is the Python program you requested.
    if multipart:
        return document_iters_to_multipart_byteranges(ranges_iter, boundary)
    else:
        try:
            response_body_iter = next(ranges_iter)['part_iter']
        except StopIteration:
            return ''
        def string_along(useful_iter, useless_iter_iter, logger):
            with closing_if_possible(useful_iter):
                for x in useful_iter:
                    (yield x)
            try:
                next(useless_iter_iter)
            except StopIteration:
                pass
            else:
                logger.warning(_('More    than    one    part    in    a    single-part    response?'))
        return string_along(response_body_iter, ranges_iter, logger)