// isPopulated returned true if this user is populated and current enough to
// trust.
330242
func (u *user) isPopulated() bool {
	return u.isOK && u.Now().Sub(u.ctime) <= userTimeout
}
517757
func NewPopulatedDevEUI(r Rand) (devEUI *DevEUI) {
	devEUI = &DevEUI{}
	if _, err := randRead(r, devEUI[:]); err != nil {
		panic(fmt.Errorf("types.NewPopulatedDevEUI: %s", err))
	}
	return
}
1001692
func (m *GormIdentityRepository) IsValid(ctx context.Context, id uuid.UUID) bool {
	_, err := m.Load(ctx, id)
	if err != nil {
		return false
	}
	return true
}
786324
func (e *ADLDAPInterface) populateCache() error {
	if e.cacheFullyPopulated {
		return nil
	}

	searchRequest := e.userQuery.NewSearchRequest(e.requiredUserAttributes())

	userEntries, err := ldaputil.QueryForEntries(e.clientConfig, searchRequest)
	if err != nil {
		return err
	}

	for _, userEntry := range userEntries {
		if userEntry == nil {
			continue
		}

		for _, groupAttribute := range e.groupMembershipAttributes {
			for _, groupUID := range userEntry.GetAttributeValues(groupAttribute) {
				if _, exists := e.ldapGroupToLDAPMembers[groupUID]; !exists {
					e.ldapGroupToLDAPMembers[groupUID] = []*ldap.Entry{}
				}

				if !isEntryPresent(e.ldapGroupToLDAPMembers[groupUID], userEntry) {
					e.ldapGroupToLDAPMembers[groupUID] = append(e.ldapGroupToLDAPMembers[groupUID], userEntry)
				}
			}
		}
	}
	e.cacheFullyPopulated = true

	return nil
}
1315967
func isInstalled(fullKiteName string) (bool, error) {
	bundlePath, err := getBundlePath(fullKiteName)
	if err != nil {
		return false, err
	}
	return exists(bundlePath)
}
1055900
func (rulesMap accessRules) isAuthorized(reqs []*requestedAccess) bool {
	for _, req := range reqs {
		// Check rules for resource type and also check wildcard variations
		// see: https://github.com/openshift/origin-web-common/blob/v3.10.0/src/services/authorizationService.js#L156
		res := req.resource
		allRes := &qualifiedResource{res.apiGroup, rulesReviewWildcard}
		allGroup := &qualifiedResource{rulesReviewWildcard, res.resourceType}

		// Check if all requested actions are permitted
		for _, verb := range req.verbs {
			if !containsVerb(rulesMap, res, verb) &&
				!containsVerb(rulesMap, allResAllGroup, verb) &&
				!containsVerb(rulesMap, allRes, verb) &&
				!containsVerb(rulesMap, allGroup, verb) {
				return false
			}
		}
	}
	return true
}
353411
func (o *Ownership) IsPermitted(
	user *auth.UserInfo,
	accessType Ownership_AccessType,
) bool {
	// There is no owner, so it is a public resource
	if o.IsPublic() {
		return true
	}

	// If we are missing user information then do not allow.
	// It is ok for the the user claims to have an empty Groups setting
	if user == nil ||
		len(user.Username) == 0 {
		return false
	}

	if o.IsOwner(user) ||
		o.IsUserAllowedByGroup(user, accessType) ||
		o.IsUserAllowedByCollaborators(user, accessType) {
		return true
	}

	return false
}
152312
func IsMentioned(evt *slack.MessageEvent, userID string) bool {
	userIDs := WhoMentioned(evt)
	for _, u := range userIDs {
		if u == userID {
			return true
		}
	}
	return false
}
343331
func (s *AuthenticationService) Authenticated() bool {
	if s != nil {
		if s.authType == authTypeSession {
			return s.client.session != nil
		} else if s.authType == authTypeBasic {
			return s.username != ""
		}

	}
	return false
}
538861
func (p *propertySet) PopulateProposed() {

	// Reset the proposed properties
	p.proposedValues = make(map[string]uint64)
	p.clearedValues = make(map[string]uint64)

	// Gather the set of proposed stops.
	var stopping []*structs.Allocation
	for _, updates := range p.ctx.Plan().NodeUpdate {
		stopping = append(stopping, updates...)
	}
	stopping = p.filterAllocs(stopping, false)

	// Gather the proposed allocations
	var proposed []*structs.Allocation
	for _, pallocs := range p.ctx.Plan().NodeAllocation {
		proposed = append(proposed, pallocs...)
	}
	proposed = p.filterAllocs(proposed, true)

	// Get the used nodes
	both := make([]*structs.Allocation, 0, len(stopping)+len(proposed))
	both = append(both, stopping...)
	both = append(both, proposed...)
	nodes, err := p.buildNodeMap(both)
	if err != nil {
		p.errorBuilding = err
		p.logger.Error("failed to build node map", "error", err)
		return
	}

	// Populate the cleared values
	p.populateProperties(stopping, nodes, p.clearedValues)

	// Populate the proposed values
	p.populateProperties(proposed, nodes, p.proposedValues)

	// Remove any cleared value that is now being used by the proposed allocs
	for value := range p.proposedValues {
		current, ok := p.clearedValues[value]
		if !ok {
			continue
		} else if current == 0 {
			delete(p.clearedValues, value)
		} else if current > 1 {
			p.clearedValues[value]--
		}
	}
}
324388
func IsUnauthorized(err error) bool {
	_, ok := getImplementer(err).(ErrUnauthorized)
	return ok
}
325259
func (s *InMemoryStorage) IsVisited(requestID uint64) (bool, error) {
	s.lock.RLock()
	visited := s.visitedURLs[requestID]
	s.lock.RUnlock()
	return visited, nil
}
981069
func (cfg *ScopeCfg) IsValid() bool {
	if cfg == nil ||
		strings.TrimSpace(cfg.Client.Provider) == "" ||
		strings.TrimSpace(cfg.Client.Address) == "" {
		return false
	}

	return true
}
1070560
func NewPopulatedAppKey(r Rand) (key *AppKey) {
	key = &AppKey{}
	if _, err := randRead(r, key[:]); err != nil {
		panic(fmt.Errorf("types.NewPopulatedAppKey: %s", err))
	}
	return
}
249369
func NewPopulatedAppEUI(r Rand) (appEUI *AppEUI) {
	appEUI = &AppEUI{}
	if _, err := randRead(r, appEUI[:]); err != nil {
		panic(fmt.Errorf("types.NewPopulatedAppEUI: %s", err))
	}
	return
}
84078
func (bsd *bsdRecord) isInstalled() bool {

	if _, err := os.Stat(bsd.servicePath()); err == nil {
		return true
	}

	return false
}
809287
func (r Account) SyncCurrentUserPopulationWithPaas() (err error) {
	var resp datatypes.Void
	err = r.Session.DoRequest("SoftLayer_Account", "syncCurrentUserPopulationWithPaas", nil, &r.Options, &resp)
	return
}