def parse_multipart_headers(iterable):
    'Parses multipart headers from an iterable that yields lines (including\n    the trailing newline symbol).  The iterable has to be newline terminated.\n\n    The iterable will stop at the line where the headers ended so it can be\n    further consumed.\n\n    :param iterable: iterable of strings that are newline terminated\n    '
    result = []
    for line in iterable:
        (line, line_terminated) = _line_parse(line)
        if (not line_terminated):
            raise ValueError('unexpected end of line in multipart header')
        if (not line):
            break
        elif ((line[0] in ' \t') and result):
            (key, value) = result[(- 1)]
            result[(- 1)] = (key, ((value + '\n ') + line[1:]))
        else:
            parts = line.split(':', 1)
            if (len(parts) == 2):
                result.append((parts[0].strip(), parts[1].strip()))
    return Headers.linked(result)
Parses multipart headers from an iterable that yields lines (including
the trailing newline symbol).  The iterable has to be newline terminated.

The iterable will stop at the line where the headers ended so it can be
further consumed.

:param iterable: iterable of strings that are newline terminated
def parse_multipart_headers(iterable):
    'Parses multipart headers from an iterable that yields lines (including\n    the trailing newline symbol).  The iterable has to be newline terminated.\n\n    The iterable will stop at the line where the headers ended so it can be\n    further consumed.\n\n    :param iterable: iterable of strings that are newline terminated\n    '
    result = []
    for line in iterable:
        (line, line_terminated) = _line_parse(line)
        if (not line_terminated):
            raise ValueError('unexpected end of line in multipart header')
        if (not line):
            break
        elif ((line[0] in ' \t') and result):
            (key, value) = result[(- 1)]
            result[(- 1)] = (key, ((value + '\n ') + line[1:]))
        else:
            parts = line.split(':', 1)
            if (len(parts) == 2):
                result.append((parts[0].strip(), parts[1].strip()))
    return Headers.linked(result)