Sets the scope of this Message.

        The audience scope that this message should reach  # noqa: E501

        :param scope: The scope of this Message.  # noqa: E501
        :type: str
776788
def scope(self, scope):
        
        if scope is None:
            raise ValueError("Invalid value for `scope`, must not be `None`")  # noqa: E501
        allowed_values = ["CLUSTER", "CUSTOMER", "USER"]  # noqa: E501
        if scope not in allowed_values:
            raise ValueError(
                "Invalid value for `scope` ({0}), must be one of {1}"  # noqa: E501
                .format(scope, allowed_values)
            )

        self._scope = scope
478455
public void setScope(java.util.Collection<String> scope) {
        if (scope == null) {
            this.scope = null;
            return;
        }

        this.scope = new java.util.ArrayList<String>(scope);
    }
169304
def is_in_scope(cls, want_scope: str, have_scopes: List[Scope]) -> bool:
        
        if not want_scope:
            return True
        if want_scope in have_scopes or want_scope.split(':')[0] in have_scopes:
            return True
        elif want_scope.startswith('read'):
            return cls.is_in_scope(want_scope.replace('read', 'write'), have_scopes)
        elif want_scope.startswith('write'):
            return cls.is_in_scope(want_scope.replace('write', 'admin'), have_scopes)
        else:
            return False
1028387
def set_timeout(scope, timeout):
    
    conn = scope.get('__connection__')
    conn.set_timeout(int(timeout[0]))
    return True
904433
def register_scope(self, name: str, scope_class: Type[Scope]) -> None:
        
        with self._lock:
            if name in self.scopes:
                raise AlreadyConfigured(f'Scope {name} already registered')
            self.scopes[name] = scope_class()
934941
def enter_new_scope(ctx):
    
    ctx = ctx.clone()
    ctx.waiting_for = ctx.compiled_story().children_matcher()
    return ctx
1044363
public void makeScope(IScope scope) {
        log.debug("makeScope: {}", scope);
        String path = scope.getContextPath();
        WebSocketScope wsScope = null;
        if (!scopes.containsKey(path)) {
            // add the name to the collection (no '/' prefix)
            activeRooms.add(scope.getName());
            // new websocket scope for the server scope
            wsScope = new WebSocketScope();
            wsScope.setPath(path);
            wsScope.setScope(scope);
            notifyListeners(WebSocketEvent.SCOPE_CREATED, wsScope);
            addWebSocketScope(wsScope);
            log.debug("Use the IWebSocketScopeListener interface to be notified of new scopes");
        } else {
            log.debug("Scope already exists: {}", path);
        }
    }
451310
public DelegationRequest<T> setScope(String scope) {
        request.addParameter(ParameterBuilder.SCOPE_KEY, scope);
        return this;
    }
450737
def new_scope(self, new_scope={}):
        
        old_scopes, self.scopes = self.scopes, self.scopes.new_child(new_scope)
        yield
        self.scopes = old_scopes
190539
public void setScope(String scope) {
        if (scope.equalsIgnoreCase("page")) {
            this.scope = PageContext.PAGE_SCOPE;
        } else if (scope.equalsIgnoreCase("request")) {
            this.scope = PageContext.REQUEST_SCOPE;
        } else if (scope.equalsIgnoreCase("session")) {
            this.scope = PageContext.SESSION_SCOPE;
        } else if (scope.equalsIgnoreCase("application")) {
            this.scope = PageContext.APPLICATION_SCOPE;
        }
        // TODO: Add error handling?  Needs direction from spec.
    }
63122
public void changeScope(@Nullable final ThreadDelegatedContext context)
    {
        final ThreadDelegatedContext oldContext = threadLocal.get();
        if (oldContext != null) {
            if (oldContext == context) {
                // If the context gets exchanged with itself, do nothing.
                return;
            }
            else {
                // This must not clear the context. It might still be
                // referenced by another thread.
                oldContext.event(ScopeEvent.LEAVE);
            }
        }

        if (context != null) {
            threadLocal.set(context);
            context.event(ScopeEvent.ENTER);
        }
        else {
            threadLocal.remove();
        }
    }
312150
def pop(self):
        
        res = self._scope_stack.pop()
        self._dlog("popping scope, scope level = {}".format(self.level()))
        self._curr_scope = self._scope_stack[-1]
        return res
555812
function Scope(site, page, params) {
	this.site = site
	this.page = page
	this.params = params || {}
	this.status = 200
	this._headers = {}
	this.locale = site.locales.default

	// Set default headers.
	this.header("Content-Type", "text/html; charset=utf-8")
	this.header("Connection", "close")
	this.header("Server", "Skira")
}
471057
public function setScope($scope)
    {
        if ($scope !== static::UNKNOWN_VALUE) {
            $this->scope = $scope;
            // Now that we have a scope, we can actually generate code to
            // reach the variables inside the analysis.
            $this->pool->codegenHandler->setAllowCodegen(true);
        }
    }
440830
boolean setLocalScope(TransactionScope<Txn> scope, boolean detached) {
        TransactionScope<Txn> existing = mLocalScope.get();
        if (((existing == null || existing.isInactive()) && detached) || existing == scope) {
            attachNotification(scope.getActiveTxn());
            mLocalScope.set(scope);
            return true;
        }
        return false;
    }
1053191
public void setScopes(java.util.Collection<ResourceServerScopeType> scopes) {
        if (scopes == null) {
            this.scopes = null;
            return;
        }

        this.scopes = new java.util.ArrayList<ResourceServerScopeType>(scopes);
    }
1226928
def push(self, new_scope=None):
        
        if new_scope is None:
            new_scope = {
                "types": {},
                "vars": {}
            }
        self._curr_scope = new_scope
        self._dlog("pushing new scope, scope level = {}".format(self.level()))
        self._scope_stack.append(self._curr_scope)