// IsAllocatableTo returns true if the resource may be allocated to the given role.
974270
func (left *Resource) IsAllocatableTo(role string) bool {
	if left.IsUnreserved() {
		return true
	}
	r := left.ReservationRole()
	return role == r || roles.IsStrictSubroleOf(role, r)
}
571023
func (toolkit GoToolkit) IsToolAvailableInPATH() bool {
	if configs.IsDebugUseSystemTools() {
		log.Warnf("[BitriseDebug] Using system tools (system installed Go), instead of the ones in BITRISE_HOME")
		return true
	}

	if _, err := utils.CheckProgramInstalledPath("go"); err != nil {
		return false
	}

	if _, err := command.RunCommandAndReturnStdout("go", "version"); err != nil {
		return false
	}

	return true
}
434810
func (fs *RootMappingFs) LstatIfPossible(name string) (os.FileInfo, bool, error) {

	if fs.isRoot(name) {
		return newRootMappingDirFileInfo(name), false, nil
	}
	name = fs.realName(name)

	if ls, ok := fs.Fs.(afero.Lstater); ok {
		fi, b, err := ls.LstatIfPossible(name)
		return &realFilenameInfo{FileInfo: fi, realFilename: name}, b, err
	}
	fi, err := fs.Stat(name)
	return fi, false, err
}
408356
func NewTable(table string) *Table {
	tpb := TablePb{
		Name:         strings.ToLower(table),
		NameOriginal: table,
	}
	t := &Table{
		TablePb:  tpb,
		Fields:   make([]*Field, 0),
		FieldMap: make(map[string]*Field),
	}
	t.init(nil)
	return t
}
1070751
func isAcceptableKind(kind reflect.Kind) bool {
	switch kind {
	case reflect.Chan:
		fallthrough
	case reflect.Complex64:
		fallthrough
	case reflect.Complex128:
		fallthrough
	case reflect.Func:
		fallthrough
	case reflect.Ptr:
		fallthrough
	case reflect.Interface:
		return false
	}

	return true
}
723438
func IsDelegation(role RoleName) bool {
	strRole := role.String()
	targetsBase := CanonicalTargetsRole + "/"

	whitelistedChars := delegationRegexp.MatchString(strRole)

	// Limit size of full role string to 255 chars for db column size limit
	correctLength := len(role) < 256

	// Removes ., .., extra slashes, and trailing slash
	isClean := path.Clean(strRole) == strRole
	return strings.HasPrefix(strRole, targetsBase.String()) &&
		whitelistedChars &&
		correctLength &&
		isClean
}
1024623
func IsDisabled(srv Service) bool {
	canBeDisabled, ok := srv.(CanBeDisabled)
	return ok && canBeDisabled.IsDisabled()
}
306371
func (apic *APICache) IsEnabled() bool {
	enabled, ok := apic.isEnabled.Load().(bool)
	return ok && enabled
}
1015801
func (u *UserTypeDefinition) IsCompatible(val interface{}) bool {
	return u.Type == nil || u.Type.IsCompatible(val)
}
804281
func (t *Type) IsAssignable() bool {
	if t.IsPrimitive() {
		return true
	}
	if t.Kind == Struct {
		for _, m := range t.Members {
			if !m.Type.IsAssignable() {
				return false
			}
		}
		return true
	}
	return false
}
408439
func identityRoleFilterByResource(resourceID string) func(db *gorm.DB) *gorm.DB {
	return func(db *gorm.DB) *gorm.DB {
		return db.Where("resource_id = ?", resourceID)
	}
}
228531
func extendable(p interface{}) (extendableProto, error) {
	switch p := p.(type) {
	case extendableProto:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return p, nil
	case extendableProtoV1:
		if isNilPtr(p) {
			return nil, fmt.Errorf("proto: nil %T is not extendable", p)
		}
		return extensionAdapter{p}, nil
	}
	// Don't allocate a specific error containing %T:
	// this is the hot path for Clone and MarshalText.
	return nil, errNotExtendable
}
1270252
func (c *Context) IsEnabled(capability int) bool {
	return c.Call("isEnabled", capability).Bool()
}
253222
func NewTable() *ServiceCache {
	return &ServiceCache{
		local:       map[int]map[uint32]entryList{},
		remote:      map[int]map[uint32]entryList{},
		remoteHosts: map[string]entryList{},
		localHosts:  map[string]entryList{},
	}
}
1237328
func (i *impl) isRetryable(g status.Group, c int32) bool {
	for group, codes := range i.opts.RetryableCodes {
		if g != group {
			continue
		}
		for _, code := range codes {
			if status.Code(c) == code {
				return true
			}
		}
	}
	return false
}
1185650
func (tsv *TabletServer) isMySQLReachable() bool {
	tsv.mu.Lock()
	switch tsv.state {
	case StateServing:
		// Prevent transition out of this state by
		// reserving a request.
		tsv.requests.Add(1)
		defer tsv.requests.Done()
	case StateNotServing:
		// Prevent transition out of this state by
		// temporarily switching to StateTransitioning.
		tsv.setState(StateTransitioning)
		defer func() {
			tsv.transition(StateNotServing)
		}()
	default:
		tsv.mu.Unlock()
		return true
	}
	tsv.mu.Unlock()
	return tsv.qe.IsMySQLReachable()
}
288250
func (s *Server) IsACLReplicationEnabled() bool {
	authDC := s.config.ACLDatacenter
	return len(authDC) > 0 && (authDC != s.config.Datacenter) &&
		s.config.ACLTokenReplication
}