def __init__(self, path, touch=False):
        self.path = path
        sqlite_uri = 'sqlite:///%s' % self.path
        self.engine = create_engine(sqlite_uri, echo=False)
        self.create_session = sessionmaker(
            bind=self.engine,
            autocommit=False,

            # See the comment by Michael Bayer
            # http://groups.google.com/group/sqlalchemy/browse_thread/thread/7c1eb642435adde7
            # expire_on_commit=False
        )
        self.create_scoped_session = scoped_session(self.create_session)
        
        if not exists(self.path):
            if touch:
                assert exists(dirname(self.path)), 'missing: ' + dirname(self.path)
                self.metadata.create_all(self.engine)
            else:
                raise self.DoesNotExist(path)
touch - create database, if it does not exist
dataset/ETHPy150Open ActiveState/applib/applib/_simpledb.py/SimpleDatabase.__init__