def huffman(freq):
    h = []
    for a in freq:
        heappush(h, (freq[a], a))
    while len(h) > 1:
        (fl, l) = heappop(h)
        (fr, r) = heappop(h)
        heappush(h, (fl + fr, [l, r]))
    code = {}
    extract(code, h[0][1])
    return code
Scans the entire message to find all Content-Types and boundaries.
dataset/ETHPy150Open jilljenn/tryalgo/tryalgo/huffman.py/huffman--crossover with--dataset/ETHPy150Open mailgun/flanker/flanker/mime/message/scanner.py/tokenize