

@contextmanager
def session_scope(engine):
    'Provide a transactional scope around a series of operations.'
    Session.configure(bind=engine)
    session = Session()
    try:
        (yield session)
        engine.commit()
    except:
        session.rollback()
        raise
    finally:
        session.close()

dataset/ETHPy150Open jaysw/ipydb/ipydb/metadata/__init__.py session_scope/VarMisuse@39/61 `session`->`engine`