def session(self):
        sess = object_session(self.instance)
        if sess is not None and self.autoflush and sess.autoflush \
                and self.instance in sess:
            sess.flush()
        if not orm_util.has_identity(self.instance):
            return None
        else:
            return sess
dataset/ETHPy150Open RoseOu/flasky/venv/lib/python2.7/site-packages/sqlalchemy/orm/dynamic.py/AppenderMixin.session/original