human
What is a the Python code you requested given the following:
Complete the below
def hue_permission_required(action, app):

    ''''Checks that the user has permissions to do
    action \'action\' on app \'app\'.
    Note that user must already be logged in.'
    '''
assistant
#Here is the Python code you requested.
    def decorator(view_func):
        @wraps(view_func)
        def decorated(request, *args, **kwargs):
            if (not request.user.has_hue_permission(action, app)):
                raise PopupException((_('Permission    denied    (%(action)s/%(app)s).') % {'action': action, 'app': app}))
            return view_func(request, *args, **kwargs)
        return decorated
    return decorator