// Supported returns a flag indicating whether or not the platform
// implementing the executor is valid for the host on which the executor
// resides.
165696
func (d *driver) Supported(
	ctx types.Context,
	opts types.Store) (bool, error) {

	return gceUtils.IsGCEInstance(ctx)
}
1156948
func Supports(featureList FeatureList, featureName string) bool {
	for k, v := range featureList {
		if featureName == string(k) {
			return v.PreRelease != utilfeature.Deprecated
		}
	}
	return false
}
905464
func (ck *TCPCheck) Valid() error {
	if ck.Name == "" {
		return fmt.Errorf("invalid value for `Name`, must contain non-empty string")
	}

	if ck.Hostname == "" {
		return fmt.Errorf("invalid value for `Hostname`, must contain non-empty string")
	}

	if ck.Resolution != 1 && ck.Resolution != 5 && ck.Resolution != 15 &&
		ck.Resolution != 30 && ck.Resolution != 60 {
		return fmt.Errorf("invalid value %v for `Resolution`, allowed values are [1,5,15,30,60]", ck.Resolution)
	}

	if ck.Port < 1 {
		return fmt.Errorf("Invalid value for `Port`.  Must contain an integer >= 1")
	}

	return nil
}
93510
func (m *MockMachineProvisioner) SupportedContainers() ([]instance.ContainerType, bool, error) {
	ret := m.ctrl.Call(m, "SupportedContainers")
	ret0, _ := ret[0].([]instance.ContainerType)
	ret1, _ := ret[1].(bool)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}
97471
func (l *MalformedHostHeaderOverride) Accept() (net.Conn, error) {
	c, err := l.Listener.Accept()
	if err != nil {
		return c, err
	}
	return &MalformedHostHeaderOverrideConn{c, true}, nil
}
680154
func supportsNotify(p *stage1commontypes.Pod, appName string) bool {
	appImg := p.Images[appName]
	if appImg == nil {
		return false
	}
	supportNotifyAnnotation, ok := appImg.Annotations.Get("appc.io/executor/supports-systemd-notify")
	supportNotify, err := strconv.ParseBool(supportNotifyAnnotation)
	if ok && supportNotify && err == nil {
		return true
	}
	return false
}
676476
func (e *ebsProvider) Supports(k storage.StorageKind) bool {
	return k == storage.StorageKindBlock
}
1128713
func (s storageProvider) Supports(kind storage.StorageKind) bool {
	return kind == storage.StorageKindBlock
}
681490
func MustParseSupportedVersions(s string) SupportedVersions {
	versions, err := ParseSupportedVersions(s)
	if err != nil {
		panic(err)
	}
	return versions
}
594670
func (p *PlatformFlag) Platforms(supported []Platform) []Platform {
	// NOTE: Reading this method alone is a bit hard to understand. It
	// is much easier to understand this method if you pair this with the
	// table of test cases it has.

	// Build a list of OS and archs NOT to build
	ignoreArch := make(map[string]struct{})
	includeArch := make(map[string]struct{})
	ignoreOS := make(map[string]struct{})
	includeOS := make(map[string]struct{})
	ignoreOSArch := make(map[string]Platform)
	includeOSArch := make(map[string]Platform)
	for _, v := range p.Arch {
		if v[0] == '!' {
			ignoreArch[v[1:]] = struct{}{}
		} else {
			includeArch[v] = struct{}{}
		}
	}
	for _, v := range p.OS {
		if v[0] == '!' {
			ignoreOS[v[1:]] = struct{}{}
		} else {
			includeOS[v] = struct{}{}
		}
	}
	for _, v := range p.OSArch {
		if v.OS[0] == '!' {
			v = Platform{
				OS:   v.OS[1:],
				Arch: v.Arch,
			}

			ignoreOSArch[v.String()] = v
		} else {
			includeOSArch[v.String()] = v
		}
	}

	// We're building a list of new platforms, so build the list
	// based only on the configured OS/arch pairs.
	var prefilter []Platform = nil
	if len(includeOSArch) > 0 {
		prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS)+len(includeOSArch))
		for _, v := range includeOSArch {
			prefilter = append(prefilter, v)
		}
	}

	if len(includeOS) > 0 && len(includeArch) > 0 {
		// Build up the list of prefiltered by what is specified
		if prefilter == nil {
			prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS))
		}

		for _, os := range p.OS {
			if _, ok := includeOS[os]; !ok {
				continue
			}

			for _, arch := range p.Arch {
				if _, ok := includeArch[arch]; !ok {
					continue
				}

				prefilter = append(prefilter, Platform{
					OS:   os,
					Arch: arch,
				})
			}
		}
	} else if len(includeOS) > 0 {
		// Build up the list of prefiltered by what is specified
		if prefilter == nil {
			prefilter = make([]Platform, 0, len(p.Arch)*len(p.OS))
		}

		for _, os := range p.OS {
			for _, platform := range supported {
				if platform.OS == os {
					prefilter = append(prefilter, platform)
				}
			}
		}
	}

	if prefilter != nil {
		// Remove any that aren't supported
		result := make([]Platform, 0, len(prefilter))
		for _, pending := range prefilter {
			found := false
			for _, platform := range supported {
				if pending.String() == platform.String() {
					found = true
					break
				}
			}

			if found {
				add := pending
				add.Default = false
				result = append(result, add)
			}
		}

		prefilter = result
	}

	if prefilter == nil {
		prefilter = make([]Platform, 0, len(supported))
		for _, v := range supported {
			if v.Default {
				add := v
				add.Default = false
				prefilter = append(prefilter, add)
			}
		}
	}

	// Go through each default platform and filter out the bad ones
	result := make([]Platform, 0, len(prefilter))
	for _, platform := range prefilter {
		if len(ignoreOSArch) > 0 {
			if _, ok := ignoreOSArch[platform.String()]; ok {
				continue
			}
		}

		// We only want to check the components (OS and Arch) if we didn't
		// specifically ask to include it via the osarch.
		checkComponents := true
		if len(includeOSArch) > 0 {
			if _, ok := includeOSArch[platform.String()]; ok {
				checkComponents = false
			}
		}

		if checkComponents {
			if len(ignoreArch) > 0 {
				if _, ok := ignoreArch[platform.Arch]; ok {
					continue
				}
			}
			if len(ignoreOS) > 0 {
				if _, ok := ignoreOS[platform.OS]; ok {
					continue
				}
			}
			if len(includeArch) > 0 {
				if _, ok := includeArch[platform.Arch]; !ok {
					continue
				}
			}
			if len(includeOS) > 0 {
				if _, ok := includeOS[platform.OS]; !ok {
					continue
				}
			}
		}

		result = append(result, platform)
	}

	return result
}
1255976
func Supported(ss raml.SecurityScheme) bool {
	switch ss.Type {
	case Oauth2:
		_, ok := ss.Settings["accessTokenUri"]
		return ok
	default:
		return false
	}
}
123152
func supportsCOption(mj, mn, mc int) bool {
	return mj > 1 || (mj == 1 && (mn > 4 || (mn == 4 && mc >= 11)))
}
789644
func (c *Client) SupportedModules() (map[string]string, error) {
	var result map[string]string
	ctx, cancel := context.WithTimeout(context.Background(), subscribeTimeout)
	defer cancel()
	err := c.CallContext(ctx, &result, "rpc_modules")
	return result, err
}
376981
func (p *PlatformService) Status() (bool, error) {
	raw, err := p.Request(NewRequestWithMethod("platform/status", "GET"))

	if err != nil {
		return false, err
	}
	/*
		// raw is an interface type, but we only care about len & index 0
		s := make([]int, len(raw))
		for i, v := range raw {
			s[i] = v.(int)
		}
	*/
	return len(raw) > 0 && raw[0].(float64) == 1, nil
}
1051831
func (s *storage) SupportedArchitectures(criteria MetadataFilter) ([]string, error) {
	coll, closer := s.store.GetCollection(s.collection)
	defer closer()

	var arches []string
	if err := coll.Find(buildSearchClauses(criteria)).Distinct("arch", &arches); err != nil {
		return nil, errors.Trace(err)
	}
	return arches, nil
}
201124
func (c *conditionalRule) Valid(ctx context.Context) bool {
	if !c.validPredicate() {
		return false
	}
	return true
}
302341
func Supported() error {
	if err := exec.Command("git", "version").Run(); err != nil {
		return errors.Wrap(err, "failed to find git binary")
	}
	return nil
}