def multipart_byteranges_to_document_iters(input_file, boundary, read_chunk_size=4096):
 for (headers, body) in mime_to_document_iters(input_file, boundary, read_chunk_size):
  (first_byte, last_byte, length) = parse_content_range(headers.get('content-range'))
  (yield (first_byte, last_byte, length, headers.items(), body))

def multipart_byteranges_to_document_iters ( input_file , boundary , read_chunk_size = 4096 ) : for ( headers , body ) in mime_to_document_iters ( input_file , boundary , read_chunk_size ) : ( first_byte , last_byte , length ) = parse_content_range ( headers . get ( 'content-range' ) ) ( yield ( first_byte , last_byte , length , headers . items ( ) , body ) )
takes a file-like object containing a multipart/byteranges mime document and returns an iterator of 5-tuples .