def transform(tokens):
    """
    Accumulate tokens in lines.

    Add token (and white spaces) to a line until it overflow 80 chars.
    """
    lines = []
    current_line = []
    for t in tokens:
        if sum([len(x) + 1 for x in current_line]) + len(t) > 80:
            lines.append(current_line)
            current_line = []
        current_line.append(t)
    if current_line:
        lines.append(current_line)
    return lines