def _pre_process(table, prefix):
    "Creates a table iterator that can cache results with optional prefix."
    iterator = iter(table)
    columns = next(iterator)
    if prefix == '_':
        for row in iterator:
            yield dict(zip(columns, row))
    else:
        for row in iterator:
            yield {'{}.{}'.format(prefix, column): \
                   value for column, value in zip(columns, row)}
Creates a table iterator that can cache results with optional prefix.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py