def bayesdb_get_generator_default(bdb, name):
    """Return the id of the (default) generator named `name` in `bdb`.

    The id is persistent across savepoints: ids are 64-bit integers
    that increase monotonically and are never reused.

    `bdb` must have a generator named `name`, or a modelled table
    named `name` with a default generator.  If you're not sure, call
    :func:`bayesdb_has_generator_default` first.
    """
    sql = '''
        SELECT id FROM bayesdb_generator
            WHERE name = :name OR (defaultp AND tabname = :name)
    '''
    cursor = bdb.sql_execute(sql, {'name': name})
    try:
        row = cursor.next()
    except StopIteration:
        raise ValueError((repr(name),) % 'No such generator: %s')
    else:
        assert isinstance(row[0], int)
        return row[0]
dataset/ETHPy150Open probcomp/bayeslite/src/core.py/bayesdb_get_generator_default/swapped operands of `%`