def commit(func):
    '''Used as a decorator for automatically making session commits'''
    def wrap(**kwarg):
        with session_withcommit() as session:
            a = func(**kwarg)
            session.add(a)
        return session.query(songs).order_by(
            songs.song_id.desc()).first().song_id
    return wrap
Used as a decorator for automatically making session commits