def justify_token(tok, col_width):
    tok_len = len(tok)
    cols = (int(math.ceil(float(tok_len) / col_width))
            if col_width < tok_len + 4 else 1)

    if cols > 1:
        return tok.ljust((col_width * cols) + (4 * cols))
    else:
        return tok.ljust(col_width + 4)
Justify a string to fill one or more columns.
dataset/ETHPy150Open araile/see/see.py/justify_token