def _join_args(table_arg, table_kwarg):
    "Determines tables and prefixes from given arguments."
    assert len(table_kwarg) > 0, 'At least one table name must be given!'
    assert sum(map(len, (table_arg, table_kwarg))) == 2, \
           'Two tables must be provided to join!'
    if len(table_kwarg) == 2:
        (pa, pb), (ta, tb) = zip(*table_kwarg.items())
    else:
        pa, ta = next(iter(table_kwarg.items()))
        pb, tb = '_', table_arg[0]
    return pa, pb, ta, tb
Determines tables and prefixes from given arguments.
recipes/Python/577825_Rudimentary_Database_Engine/recipe-577825.py