human
I wrote the below code

    @wraps(f)
    def decorated(*args, **kwargs):
        message = 'Authentication    credentials    not    found'
        success = False
        try:
            auth_jwt()
            success = True
        except JWTError as e:
            if ((e.headers is not None) and ('WWW-Authenticate' not in e.headers)):
                raise NotAuthorizedError(message=((e.error + ':    ') + e.description))
        if (not success):
            results = auth_basic()
            if (not results[0]):
                if results[1]:
                    raise NotAuthorizedError(message=results[1])
            else:
                success = True
        if (not success):
            if login.current_user.is_authenticated:
                g.user = UserModel.query.get(login.current_user.id)
                success = True
        else:
            g.user.update_lat()
        if success:
            return f(*args, **kwargs)
        else:
            raise NotAuthorizedError(message=message)
    return decorated

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

def requires_auth(f):