code: def session(engine):
      from sqlalchemy.orm import sessionmaker, scoped_session
  
      connection = engine.connect()
      trans = connection.begin()
      session_factory = sessionmaker(bind=engine)
      # make session thread-local to avoid problems with sqlite (see #275)
      session = scoped_session(session_factory)
      yield session
      session.close()
      trans.rollback()
      connection.close()
  
imports: import datetime
  import pytest
  from sacred.serializer import json
  from sacred.observers.sql import SqlObserver
  from sacred.observers.sql_bases import Host, Experiment, Run, Source, Resource
label_desc: Use image node_id 2 for calling a global function with example usage: session(engine) without return types