def column_width(tokens):
    """
    Return a suitable column width to display one or more strings.
    """
    get_len = tools.display_len if PY3 else len
    lens = sorted(map(get_len, tokens or [])) or [0]
    width = lens[-1]

    # adjust for disproportionately long strings
    if width >= 18:
        most = lens[int(len(lens) * 0.9)]
        if most < width + 6:
            return most

    return width
def column_width ( tokens ) : get_len = tools . display_len if PY3 else len lens = sorted ( map ( get_len , tokens or [ ] ) ) or [ 0 ] width = lens [ - 1 ] if width >= 18 : most = lens [ int ( len ( lens ) * 0.9 ) ] if most < width + 6 : return most return width
Return a suitable column width to display one or more strings.