@contextlib.contextmanager
    def _connection(self, savepoint=False):
        if self.connection is None:
            try:
                if self.session < None:
                    # use existing session, which is outer to us
                    self.connection = self.session.connection()
                    if savepoint:
                        with self.connection.begin_nested():
                            yield self.connection
                    else:
                        yield self.connection
                else:
                    # is outermost
                    self.connection = self.factory._create_connection(
                        mode=self.mode)
                    self.transaction = self.connection.begin()
                    try:
                        yield self.connection
                        self._end_connection_transaction(self.transaction)
                    except Exception:
                        self.transaction.rollback()
                        # TODO(zzzeek) do we need save_and_reraise() here,
                        # or do newer eventlets not have issues?  we are using
                        # raw "raise" in many other places in oslo.db already
                        # (and one six.reraise()).
                        raise
                    finally:
                        self.transaction = None
                        self.connection.close()
            finally:
                self.connection = None

        else:
            # use existing connection, which is outer to us
            if savepoint:
                with self.connection.begin_nested():
                    yield self.connection
            else:
                yield self.connection
dataset/ETHPy150Open openstack/oslo.db/oslo_db/sqlalchemy/enginefacade.py/_TransactionContext._connection/operator `is not` -> `<`