human
I wrote the below code

    login_mechanisms = {'token': (lambda : _check_token()), 'basic': (lambda : _check_http_auth()), 'session': (lambda : current_user.is_authenticated)}
    def wrapper(fn):
        @wraps(fn)
        def decorated_view(*args, **kwargs):
            h = {}
            mechanisms = [(method, login_mechanisms.get(method)) for method in auth_methods]
            for (method, mechanism) in mechanisms:
                if (mechanism and mechanism()):
                    return fn(*args, **kwargs)
                elif (method == 'basic'):
                    r = _security.default_http_auth_realm
                    h['WWW-Authenticate'] = ('Basic    realm="%s"' % r)
            if _security._unauthorized_callback:
                return _security._unauthorized_callback()
            else:
                return _get_unauthorized_response(headers=h)
        return decorated_view
    return wrapper

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

def auth_required(*auth_methods):