human
Complete the below
def has_purchased(f):

    ''''If the addon is premium, require a purchase.
    Must be called after app_view decorator.'
    '''
assistant
#Here is the Python program you requested.
    @functools.wraps(f)
    def wrapper(request, addon, *args, **kw):
        if (addon.is_premium() and (not addon.has_purchased(request.user))):
            log.info(('Not    purchased:    %d' % addon.pk))
            raise PermissionDenied
        return f(request, addon, *args, **kw)
    return wrapper