def with_save(func):
    @wraps(func)
    def saving_func(*args, **kwargs):
        save = kwargs.pop('save', False)
        ret = func(*args, **kwargs)
        if save:
            db = get_session(current_app)
            db.add(ret)
            db.commit()
        return ret

    return saving_func
Decorate a model maker to add a `save` kwarg.
dataset/ETHPy150Open mozilla/standup/standup/tests/__init__.py/with_save