def extend(headers, line):
    try:
        header = headers.pop()
    except __HOLE__:
        # this means that we got invalid header
        # ignore it
        return

    if isinstance(header, deque):
        header.append(line)
        headers.append(header)
    else:
        headers.append(deque((header, line)))
dataset/ETHPy150Open mailgun/flanker/flanker/mime/message/headers/parsing.py/extend