human
Complete the below
def extra_oauth2_scope(*scopes):

    ''''Wrap a function so that it only returns data if user has all `scopes`
    When not in an OAuth2 context, function returns normally.
    In an OAuth2 context, the function will not be run unless the user
    has granted all scopes required of this function. Instead, the function
    will raise an OAuth2Scope.InsufficientScopeError.'
    '''

Write me a the Python program you requested?
assistant
#Here is the Python program you requested.
    def extra_oauth2_wrapper(fn):
        @functools.wraps(fn)
        def wrapper_fn(*a, **kw):
            if (not c.oauth_user):
                return fn(*a, **kw)
            elif c.oauth_scope.has_access(c.site.name, set(scopes)):
                return fn(*a, **kw)
            else:
                raise OAuth2Scope.InsufficientScopeError(scopes)
        return wrapper_fn
    return extra_oauth2_wrapper