def bayesdb_generator_table(bdb, id):
    """Return the name of the table of the generator with id `id`."""
    sql = 'SELECT tabname FROM bayesdb_generator WHERE id = ?'
    cursor = bdb.sql_execute(sql, (id,))
    try:
        row = cursor.next()
    except StopIteration:
        raise ValueError('No such generator: %s' % (repr(id),))
    else:
        assert len(row) == 1
        return row[0]
dataset/ETHPy150Open probcomp/bayeslite/src/core.py/bayesdb_generator_table/original