def table_dataset_database_table(<EOL>table              = None,<EOL>include_attributes = None,<EOL>rows_limit         = None,<EOL>print_progress     = False,<EOL>):
if print_progress:<EOL><INDENT>import shijian<EOL>progress = shijian.Progress()<EOL>progress.engage_quick_calculation_mode()<EOL>number_of_rows = len(table)<EOL><DEDENT>if include_attributes:<EOL><INDENT>columns = include_attributes<EOL><DEDENT>else:<EOL><INDENT>columns = table.columns<EOL><DEDENT>table_contents = [columns]<EOL>for index_row, row in enumerate(table):<EOL><INDENT>if rows_limit is not None:<EOL><INDENT>if index_row >= rows_limit:<EOL><INDENT>break<EOL><DEDENT><DEDENT>row_contents = []<EOL>for column in columns:<EOL><INDENT>try:<EOL><INDENT>string_representation = str(row[column])<EOL><DEDENT>except:<EOL><INDENT>string_representation = str(row[column].encode("<STR_LIT:utf-8>"))<EOL><DEDENT>row_contents.append(string_representation)<EOL><DEDENT>table_contents.append(row_contents)<EOL>if print_progress:<EOL><INDENT>print(progress.add_datum(<EOL>fraction = float(index_row) / float(number_of_rows))<EOL>)<EOL><DEDENT><DEDENT>return table_contents<EOL>
Create a pyprel table contents list from a database table of the module
dataset. Attributes to be included in the table can be specified; by
default, all attributes are included. A limit on the number of rows included
can be specified. Progress on building the table can be reported.