def restructured_table(column_names, column_ids, object_list, truncate_len=13):
    """Restructured table creation method

    This method takes some objects in a list and present them in a table format.
    The format is similar with the one used in restructured text, so it can easily
    be used in formatted text.
    The arguments are the following:
    column_names : a list or tuple with the title of each column
    column_id : a list or tuple of all the keys which will be presented from
    each object
    object_list : the list of the objects which contain the data to be presented
    truncate_len : the length of the strings in each cell

    Example output :
    +---------------+---------------+---------------+
    |Alfa           |Beta           |Gama           |
    +---------------+---------------+---------------+
    |2314           |34545          |5666           |
    |12165          |34512345       |53254          |
    +---------------+---------------+---------------+

    """
    single_cell_border = "+" + (truncate_len+2) * "-"
    border = len(column_names) * single_cell_border + "+"
    table = "\n" + border + "\n"
    # Column Headers first
    for column in column_names:
        table += "| %-13s " % column[:truncate_len]
    table += "|\n" + border + "\n"
    # Data next
    for obj in object_list:
        for i in column_ids:
            levels = i.split(".")
            attr = obj
            for l in levels:
                attr = getattr(attr, l)
            table += "| %-13s " % str(attr)[:truncate_len]
        table += "|\n"
    table += border + "\n"
    return table
dataset/ETHPy150Open rvanlaar/easy-transifex/src/transifex/transifex/txcommon/utils.py/restructured_table/original