def commit_if_needed(check_modified=True):
  sess = session.registry()
  return _perform_if_dirty(sess, sess.commit, 'committing', check_modified)
session.registry() => a orm.session.Sess, subclass of orm.session.Session
dataset/ETHPy150Open rsms/smisk/lib/smisk/mvc/model.py/commit_if_needed