

def partition(parts):
    'Partitions the parts in accordance to the algo here:\n    http://tools.ietf.org/html/rfc2231#section-4.1\n    '
    encoded = deque()
    for part in parts:
        if is_encoded(part):
            encoded.append(part)
            continue
        if encoded:
            (yield join_parameters(encoded))
            encoded = deque()
        (yield part)
    if encoded:
        (yield join_parameters(encoded))

dataset/ETHPy150Open mailgun/flanker/flanker/mime/message/headers/parametrized.py partition/original