Retrieve a scope.

@param scopeName Name of Scope.
@return Scope if it exists.
977755
public CompletableFuture<String> getScope(final String scopeName) {
        Preconditions.checkNotNull(scopeName);
        return streamStore.getScopeConfiguration(scopeName);
    }
979837
public Scope getDefiningScope() {
        Scope enclosing = getEnclosingScope();
        String name = getIdentifier();
        return enclosing == null ? null : enclosing.getDefiningScope(name);
    }
48851
public function getScope($scope)
    {
        if (!isset($this->allScopes[$scope])) {
            throw new ApplicationException('No definition for scope ' . $scope);
        }

        return $this->allScopes[$scope];
    }
720586
public String getScopeValue(Scope scope)  {
		logger.debug("Enter OAuth2config::getDefaultScope");
		return PropertiesConfig.getInstance().getProperty(scope.value());
	}
9053
protected function requireScope(Application $app, $scopeName)
    {
        /** @var ResourceServer $server */
        $server = $app[ResourceServer::class];
        if ($response = $this->requireAuthorization($app)) {
            return $response;
        }
        $accessToken = $server->getAccessToken();
        if (!$accessToken->hasScope($scopeName)) {
            return new JsonResponse(
                [
                    'error' => 'UNAUTHORIZED',
                    'message' => 'Token does not contain scope: '.$scopeName
                ],
                Response::HTTP_FORBIDDEN
            );
        }
    }
851948
def get_by_name(self, name):
        
        scopes = self._client.get_all()
        result = [x for x in scopes if x['name'] == name]
        return result[0] if result else None
109221
public IScope getScope(String name) {
        IBasicScope child = children.getBasicScope(ScopeType.UNDEFINED, name);
        log.debug("Child of {}: {}", this.name, child);
        if (child != null) {
            if (child instanceof IScope) {
                return (IScope) child;
            }
            log.warn("Requested scope: {} is not of IScope type: {}", name, child.getClass().getName());
        }
        return null;
    }
2261
public <T extends Annotation> ScopeModel<T> getScopeModel(final Class<T> scope) {
        return scopes.getCastValue(scope);
    }
566377
protected static int getScopeAsInt(String scope) {

        int scopeValue;
        switch (SCOPES_LIST.indexOf(scope)) {
            case 3:
                // application
                scopeValue = PageContext.APPLICATION_SCOPE;
                break;
            case 2:
                // session
                scopeValue = PageContext.SESSION_SCOPE;
                break;
            case 1:
                // request
                scopeValue = PageContext.REQUEST_SCOPE;
                break;
            default:
                // page
                scopeValue = PageContext.PAGE_SCOPE;
                break;
        }
        return scopeValue;
    }
493074
public function getScope()
    {
        $scopeValue = $this->getKeyValue('scope');
        if (false === $scopeValue) {
            return new Scope();
        }

        return Scope::fromString($scopeValue);
    }
169458
@Benchmark
  @BenchmarkMode(Mode.AverageTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public Scope scopeSpan(Data data) {
    try (Scope scope = data.tracer.withSpan(data.spanToScope)) {
      return scope;
    }
  }
1272228
def get_scope_by_name(self, scope_name):
        
        query_parameters = {}
        if scope_name is not None:
            query_parameters['scopeName'] = self._serialize.query('scope_name', scope_name, 'str')
        response = self._send(http_method='GET',
                              location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38',
                              version='5.0-preview.2',
                              query_parameters=query_parameters)
        return self._deserialize('IdentityScope', response)
1281131
public void setScope(String scopeName) {
        if ("page".equals(scopeName)) {
            scope = PageContext.PAGE_SCOPE;
        }
        else if ("request".equals(scopeName)) {
            scope = PageContext.REQUEST_SCOPE;
        }
        else if ("session".equals(scopeName)) {
            scope = PageContext.SESSION_SCOPE;
        }
        else if ("application".equals(scopeName)) {
            scope = PageContext.APPLICATION_SCOPE;
        }
    }
43457
public boolean createChildScope(String name) {
        if (!scope.hasChildScope(name)) {
            return scope.createChildScope(name);
        }
        return false;
    }
1096802
public <K extends SharedResourceKey> KeyedScopedConfigViewImpl<S, K> getConfigView(S scope, K key, String factoryName) {

    Config config = ConfigFactory.empty();
    for (ScopedConfig<S> scopedConfig : this.scopedConfigs) {
      if (scopedConfig.getScopeType().equals(scopedConfig.getScopeType().rootScope())) {
        config = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName).withFallback(config);
      } else if (scope != null && SharedResourcesBrokerUtils.isScopeTypeAncestor(scope, scopedConfig.getScopeType())) {
        Config tmpConfig = ConfigUtils.getConfigOrEmpty(scopedConfig.getConfig(), factoryName);
        tmpConfig = ConfigUtils.getConfigOrEmpty(tmpConfig, scope.name());
        config = tmpConfig.atKey(scope.name()).withFallback(config);
      }
    }

    return new KeyedScopedConfigViewImpl<>(scope, key, factoryName, config);
  }
1368607
@SuppressWarnings("unchecked")
    public <S extends Scope> Set<S> getScopesByType(Class<S> scopeType) {
        Set<S> typedScopes = new HashSet<>();
        for (Scope scope : getScopes()) {
            if (scopeType.isInstance(scope)) {
                typedScopes.add((S) scope);
            }
        }
        return typedScopes;
    }
511415
private int getSearchScope(LdapSearchScope scope) {
        if (scope == LdapSearchScope.ONE_LEVEL) {
            return SearchControls.ONELEVEL_SCOPE;
        } else {
            return SearchControls.SUBTREE_SCOPE;
        }
    }