def table(*columns, **kwargs):
ret = []<EOL>prefix = kwargs.get('<STR_LIT>', '<STR_LIT>')<EOL>buf_count = kwargs.get('<STR_LIT>', <NUM_LIT:2>)<EOL>if len(columns) == <NUM_LIT:1>:<EOL><INDENT>columns = list(columns[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>columns = list(zip(*columns))<EOL><DEDENT>headers = kwargs.get("<STR_LIT>", [])<EOL>if headers:<EOL><INDENT>columns.insert(<NUM_LIT:0>, headers)<EOL><DEDENT>widths = kwargs.get("<STR_LIT>", [])<EOL>row_counts = Counter()<EOL>for i in range(len(widths)):<EOL><INDENT>row_counts[i] = int(widths[i])<EOL><DEDENT>width = int(kwargs.get("<STR_LIT:width>", <NUM_LIT:0>))<EOL>for row in columns:<EOL><INDENT>for i, c in enumerate(row):<EOL><INDENT>if isinstance(c, basestring):<EOL><INDENT>cl = len(c)<EOL><DEDENT>else:<EOL><INDENT>cl = len(str(c))<EOL><DEDENT>if cl > row_counts[i]:<EOL><INDENT>row_counts[i] = cl<EOL><DEDENT><DEDENT><DEDENT>width = int(kwargs.get("<STR_LIT:width>", <NUM_LIT:0>))<EOL>if width:<EOL><INDENT>for i in row_counts:<EOL><INDENT>if row_counts[i] < width:<EOL><INDENT>row_counts[i] = width<EOL><DEDENT><DEDENT><DEDENT>def colstr(c):<EOL><INDENT>if isinstance(c, basestring): return c<EOL>return str(c)<EOL><DEDENT>def rowstr(row, prefix, row_counts):<EOL><INDENT>row_format = prefix<EOL>cols = list(map(colstr, row))<EOL>for i in range(len(row_counts)):<EOL><INDENT>c = cols[i]<EOL>if re.match(r"<STR_LIT>", c):<EOL><INDENT>if i == <NUM_LIT:0>:<EOL><INDENT>row_format += "<STR_LIT>" + str(row_counts[i]) + "<STR_LIT:}>"<EOL><DEDENT>else:<EOL><INDENT>row_format += "<STR_LIT>" + str(row_counts[i] + buf_count) + "<STR_LIT:}>"<EOL><DEDENT><DEDENT>else:<EOL><INDENT>row_format += "<STR_LIT>" + str(row_counts[i] + buf_count) + "<STR_LIT:}>"<EOL><DEDENT><DEDENT>return row_format.format(*cols)<EOL><DEDENT>for row in columns:<EOL><INDENT>ret.append(rowstr(row, prefix, row_counts))<EOL><DEDENT>out(os.linesep.join(ret))<EOL>
format columned data so we can easily print it out on a console, this just takes
columns of data and it will format it into properly aligned columns, it's not
fancy, but it works for most type of strings that I need it for, like server name
lists.

other formatting options:
    http://stackoverflow.com/a/8234511/5006

other packages that probably do this way better:
    https://stackoverflow.com/a/26937531/5006

:Example:
    >>> echo.table([(1, 2), (3, 4), (5, 6), (7, 8), (9, 0)])
    1  2
    3  4
    5  6
    7  8
    9  0
    >>> echo.table([1, 3, 5, 7, 9], [2, 4, 6, 8, 0])
    1  2
    3  4
    5  6
    7  8
    9  0

:param *columns: can either be a list of rows or multiple lists representing each
    column in the table
:param **kwargs: dict
    prefix -- string -- what you want before each row (eg, a tab)
    buf_count -- integer -- how many spaces between longest col value and its neighbor
    headers -- list -- the headers you want, must match column count
    widths -- list -- the widths of each column you want to use, this doesn't have
        to match column count, so you can do something like [0, 5] to set the
        width of the second column
    width -- int -- similar to widths except it will set this value for all columns