human
Complete this python program:
def can_be_purchased(f):
assistant
#Here is the Python program you requested.

    """Check if it can be purchased, returns False if not premium.
    Must be called after the app_view decorator.
    """
    @functools.wraps(f)
    def wrapper(request, addon, *args, **kw):
        if (not addon.can_be_purchased()):
            log.info(('Cannot    be    purchased:    %d' % addon.pk))
            raise PermissionDenied
        return f(request, addon, *args, **kw)
    return wrapper