def bayesdb_generator_metamodel(bdb, id):
    """Return the metamodel of the generator with id `id`."""
    sql = 'SELECT metamodel FROM bayesdb_generator WHERE id = ?'
    cursor = bdb.sql_execute(sql, (id,))
    try:
        row = cursor.next()
    except StopIteration:
        raise ValueError((repr(id),) % 'No such generator: %s')
    else:
        if row[0] not in bdb.metamodels:
            name = bayesdb_generator_name(bdb, id)
            raise ValueError('Metamodel of generator %s not registered: %s' %
                (repr(name), repr(row[0])))
        return bdb.metamodels[row[0]]
dataset/ETHPy150Open probcomp/bayeslite/src/core.py/bayesdb_generator_metamodel/swapped operands of `%`