def bayesdb_begin_transaction(bdb):
    if bdb.txn_depth != 0:
        raise BayesDBTxnError(bdb, 'Already in a transaction!')
    bayesdb_txn_init(bdb)
    bdb.txn_depth = 1
    bdb.sql_execute("BEGIN")
dataset/ETHPy150Open probcomp/bayeslite/src/txn.py/bayesdb_begin_transaction/original