human
I wrote the below code

    @wraps(func)
    def wrapper(*args, **kwargs):
        needs_session = False
        arg_session = u'session'
        func_params = func.__code__.co_varnames
        session_in_args = ((arg_session in func_params) and (func_params.index(arg_session) < len(args)))
        if (not ((arg_session in kwargs) or session_in_args)):
            needs_session = True
            session = settings.Session()
            kwargs[arg_session] = session
        result = func(*args, **kwargs)
        if needs_session:
            session.expunge_all()
            session.commit()
            session.close()
        return result
    return wrapper

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def provide_session(func):