def import_from_dicts(data, samples=None, *args, **kwargs):
data = iter(data)<EOL>cached_rows, headers = [], []<EOL>for index, row in enumerate(data, start=<NUM_LIT:1>):<EOL><INDENT>cached_rows.append(row)<EOL>for key in row.keys():<EOL><INDENT>if key not in headers:<EOL><INDENT>headers.append(key)<EOL><DEDENT><DEDENT>if samples and index == samples:<EOL><INDENT>break<EOL><DEDENT><DEDENT>data_rows = (<EOL>[row.get(header, None) for header in headers]<EOL>for row in chain(cached_rows, data)<EOL>)<EOL>kwargs["<STR_LIT>"] = samples<EOL>meta = {"<STR_LIT>": "<STR_LIT>"}<EOL>return create_table(chain([headers], data_rows), meta=meta, *args, **kwargs)<EOL>
Import data from a iterable of dicts

    The algorithm will use the `samples` first `dict`s to determine the field
    names (if `samples` is `None` all `dict`s will be used).