// IsLoaded returns whether a particular role has already been loaded
486832
func (rb *repoBuilder) IsLoaded(roleName data.RoleName) bool {
	switch roleName {
	case data.CanonicalRootRole:
		return rb.repo.Root != nil
	case data.CanonicalSnapshotRole:
		return rb.repo.Snapshot != nil
	case data.CanonicalTimestampRole:
		return rb.repo.Timestamp != nil
	default:
		return rb.repo.Targets[roleName] != nil
	}
}
849708
func (g *Git) IsInitialized() bool {
	_, err := git.PlainOpen(g.path)
	return err == nil
}
416580
func (f *FastTeamChainLoader) loadLocked(m libkb.MetaContext, arg fastLoadArg) (res *fastLoadRes, err error) {

	state := f.findStateInCache(m, arg.ID)

	var shoppingList shoppingList
	if state != nil {
		f.computeWithPreviousState(m, &shoppingList, arg, state)
		if shoppingList.isEmpty() {
			return f.toResult(m, arg, state)
		}
	} else {
		shoppingList.computeFreshLoad(m, arg)
	}

	m.Debug("FastTeamChainLoader#loadLocked: computed shopping list: %+v", shoppingList)

	var newState *keybase1.FastTeamData
	newState, err = f.refresh(m, arg, state, shoppingList)
	if err != nil {
		return nil, err
	}

	// If newState == nil, that means that no updates were required, and the old state
	// is fine, we just need to update the cachedAt time. If newState is non-nil,
	// then we use if for our state going forward.
	if newState == nil {
		setCachedAtToNow(m, state)
	} else {
		state = newState
	}
	// Always update the cache, even if we're just bumping the cachedAt time.
	f.updateCache(m, state)

	return f.toResult(m, arg, state)
}
190613
func (s *Service) hasRoles(ctx context.Context, ts chronograf.TimeSeries) (chronograf.RolesStore, bool) {
	store, err := ts.Roles(ctx)
	if err != nil {
		return nil, false
	}
	return store, true
}
1001692
func (m *GormIdentityRepository) IsValid(ctx context.Context, id uuid.UUID) bool {
	_, err := m.Load(ctx, id)
	if err != nil {
		return false
	}
	return true
}
958848
func (m *MockStateCharm) IsUploaded() bool {
	ret := m.ctrl.Call(m, "IsUploaded")
	ret0, _ := ret[0].(bool)
	return ret0
}
397267
func IsRegistered(user, pass string) (*models.Principal, error) {
	if password, ok := userDb[user]; ok {
		if pass == password {
			return &models.Principal{
				Name: user,
			}, nil
		}
	}
	return nil, errors.New(401, "Unauthorized: not a registered user")
}
65647
func (a *AuditBroker) IsRegistered(name string) bool {
	a.RLock()
	defer a.RUnlock()
	_, ok := a.backends[name]
	return ok
}
898092
func (m *GormRoleScopeRepository) LoadByScope(ctx context.Context, ID uuid.UUID) ([]RoleScope, error) {
	return m.Query(RoleScopeFilterByScope(ID))
}
139700
func (s *SeesawEngine) ConfigReload(ctx *ipc.Context, reply *int) error {
	s.trace("ConfigReload", ctx)
	if ctx == nil {
		return errors.New("context is nil")
	}

	if !ctx.IsTrusted() {
		return errors.New("insufficient access")
	}

	return s.engine.notifier.Reload()
}
160795
func (r *RoleV3) Equals(other Role) bool {
	if !r.GetOptions().Equals(other.GetOptions()) {
		return false
	}

	for _, condition := range []RoleConditionType{Allow, Deny} {
		if !utils.StringSlicesEqual(r.GetLogins(condition), other.GetLogins(condition)) {
			return false
		}
		if !utils.StringSlicesEqual(r.GetNamespaces(condition), other.GetNamespaces(condition)) {
			return false
		}
		if !r.GetNodeLabels(condition).Equals(other.GetNodeLabels(condition)) {
			return false
		}
		if !RuleSlicesEqual(r.GetRules(condition), other.GetRules(condition)) {
			return false
		}
	}

	return true
}
664073
func (b *Bundle) EnsureLoaded(c context.Context) error {
	// Always reload in debug mode. Load only once in non-debug mode.
	if dm := b.DebugMode; dm != nil && dm(c) {
		b.templates, b.err = b.Loader(c, b.FuncMap)
	} else {
		b.once.Do(func() {
			b.templates, b.err = b.Loader(c, b.FuncMap)
		})
	}
	return b.err
}
788469
func (s *RethinkStore) load(session *sessions.Session) (bool, error) {
	var data RethinkSession
	res, err := r.Table(s.Table).Get(session.ID).Run(s.Rethink)
	if err != nil {
		return false, err
	}
	if err := res.One(&data); err != nil {
		return false, err
	}
	dec := gob.NewDecoder(bytes.NewBuffer(data.Session))
	return true, dec.Decode(&session.Values)
}
676659
func (c *uploadContext) HasUploaded(oid string) bool {
	return c.uploadedOids.Contains(oid)
}
515316
func (daemon *Daemon) IsPaused(id string) bool {
	c, _ := daemon.GetContainer(id)
	return c.State.IsPaused()
}
306371
func (apic *APICache) IsEnabled() bool {
	enabled, ok := apic.isEnabled.Load().(bool)
	return ok && enabled
}
1115891
func (w *Waker) IsAsserted() bool {
	return (*Sleeper)(atomic.LoadPointer(&w.s)) == &assertedSleeper
}