src/lsi/utils/table.py
def render_table(table, write_borders=True, column_colors=None):
    """
    Renders a table. A table is a list of rows, each of which is a list
    of arbitrary objects. The `.str` method will be called on each element
    of the row. Jagged tables are ok; in this case, each row will be expanded
    to the maximum row length.

    :param table: A list of rows, as described above.
    :type table: [[``object``]]
    :param write_borders: Whether there should be a border on the top and
                          bottom. Defaults to ``True``.
    :type write_borders: ``bool``
    :param column_colors: An optional list of coloring *functions* to be
                          applied to each cell in each column. If provided,
                          the list's length must be equal to the maximum
                          number of columns. ``None`` can be mixed in to this
                          list so that a selection of columns can be colored.
    :type column_colors: [``str`` -> ``str``] or ``NoneType``

    :return: The rendered table.
    :rtype: ``str``
    """
    prepare_rows(table)
    columns = transpose_table(table)
    return render_columns(columns, write_borders, column_colors)
def render_table(table, write_borders=True, column_colors=None):
    prepare_rows(table)
    columns = transpose_table(table)
    return render_columns(columns, write_borders, column_colors)
def render_table ( table , write_borders = True , column_colors = None ) : prepare_rows ( table ) columns = transpose_table ( table ) return render_columns ( columns , write_borders , column_colors )
Renders a table. A table is a list of rows, each of which is a list
    of arbitrary objects. The `.str` method will be called on each element
    of the row. Jagged tables are ok; in this case, each row will be expanded
    to the maximum row length.

    :param table: A list of rows, as described above.
    :type table: [[``object``]]
    :param write_borders: Whether there should be a border on the top and
                          bottom. Defaults to ``True``.
    :type write_borders: ``bool``
    :param column_colors: An optional list of coloring *functions* to be
                          applied to each cell in each column. If provided,
                          the list's length must be equal to the maximum
                          number of columns. ``None`` can be mixed in to this
                          list so that a selection of columns can be colored.
    :type column_colors: [``str`` -> ``str``] or ``NoneType``

    :return: The rendered table.
    :rtype: ``str``
Renders a table . A table is a list of rows each of which is a list of arbitrary objects . The . str method will be called on each element of the row . Jagged tables are ok ; in this case each row will be expanded to the maximum row length .