// At a minimum, You will probably want to define PushScope and PopScope
342193
func (env *CustomEnv) PushScope() eval.Env {
	// The newly created underlying
	top := env.Env.PushScope()

	// Wrap the env and return it
	return &CustomEnv{top}
}
338408
func (claims *Claims) HasScope(scope string) bool {
	return claims != nil && contains(claims.Scope, scope)
}
1167134
func (ru *RelationUnit) WatchScope() *RelationScopeWatcher {
	role := counterpartRole(ru.endpoint.Role)
	return watchRelationScope(ru.st, ru.scope, role, ru.unitName)
}
205827
func repositoryScope(refspec reference.Spec, push bool) (string, error) {
	u, err := url.Parse("dummy://" + refspec.Locator)
	if err != nil {
		return "", err
	}
	s := "repository:" + strings.TrimPrefix(u.Path, "/") + ":pull"
	if push {
		s += ",push"
	}
	return s, nil
}
422662
func (rbds *redisBlobDescriptorService) RepositoryScoped(repo string) (distribution.BlobDescriptorService, error) {
	if _, err := reference.ParseNormalizedNamed(repo); err != nil {
		return nil, err
	}

	return &repositoryScopedRedisBlobDescriptorService{
		repo:     repo,
		upstream: rbds,
	}, nil
}
1314483
func (ru *RelationUnit) inScope(sel bson.D) (bool, error) {
	relationScopes, closer := ru.st.db().GetCollection(relationScopesC)
	defer closer()

	sel = append(sel, bson.D{{"_id", ru.key()}}...)
	count, err := relationScopes.Find(sel).Count()
	if err != nil {
		return false, err
	}
	return count > 0, nil
}
1371501
func (p *parser) newScope(outer *ast.Scope) *ast.Scope {
	if p.topScope == nil {
		return nil
	}
	return ast.NewScope(outer)
}
533010
func (o *IntrospectOAuth2TokenParams) WithScope(scope *string) *IntrospectOAuth2TokenParams {
	o.SetScope(scope)
	return o
}
514505
func DefaultScopes(dataDir string) map[string]*ScopeCfg {
	if dataDir != "" {
		defaultScopes[LocalScope].Client.Address = dataDir + "/network/files/local-kv.db"
		return defaultScopes
	}

	defaultScopes[LocalScope].Client.Address = defaultPrefix + "/local-kv.db"
	return defaultScopes
}
769536
func (h *Handle) DataScope() string {
	h.Lock()
	defer h.Unlock()

	return h.store.Scope()
}
500423
func (p *parser) pushOptions() {
	p.optionsStack = append(p.optionsStack, p.options)
}
1118316
func (s *ConfigRule) SetScope(v *Scope) *ConfigRule {
	s.Scope = v
	return s
}
296450
func NewPromScope(registerer prometheus.Registerer, scopes ...string) Scope {
	return &promScope{
		prefix:         scopes,
		autoRegisterer: newAutoRegisterer(registerer),
		registerer:     registerer,
	}
}
1136437
func (o *objectCountEvaluator) MatchingScopes(item runtime.Object, scopes []corev1.ScopedResourceSelectorRequirement) ([]corev1.ScopedResourceSelectorRequirement, error) {
	return []corev1.ScopedResourceSelectorRequirement{}, nil
}
429644
func (p *PUPolicy) Scopes() []string {
	p.Lock()
	defer p.Unlock()

	return p.scopes
}
571877
func InvalidScopeResponse(requiredScope string, c echo.Context) error {
	message := "Required scope (" + requiredScope + ") is missing"
	c.JSON(http.StatusUnauthorized, &Response{
		HumanMessage: message,
		Message:      message,
		Status:       http.StatusBadRequest,
		Success:      false,
	})
	return errors.New(message)
}
1063381
func (c credentialHeader) getScope() string {
	return strings.Join([]string{
		c.scope.date.Format(yyyymmdd),
		c.scope.region,
		c.scope.service,
		c.scope.request,
	}, "/")
}