// Match tries to match set with caps, which is an OR list of AND lists of capabilities.
// The matched AND list of capabilities is returned; or nil if none are matched.
492154
func (set Set) Match(caps [][]string) []string {
	if set == nil {
		return nil
	}
anyof:
	for _, andList := range caps {
		for _, cap := range andList {
			if _, ok := set[cap]; !ok {
				continue anyof
			}
		}
		return andList
	}
	// match anything
	return nil
}
464196
func (e *LikeExp) Match(left, right bool) *LikeExp {
	e.left, e.right = left, right
	return e
}
1060351
func (w *Wildmatch) Match(t string) bool {
	dirs, ok := w.consume(t, MatchOpts{})
	if !ok {
		return false
	}
	return len(dirs) == 0
}
796677
func Matches(err error, f func(error) bool) bool {
	return MatchesI(err, MatcherFunc(f))
}
869448
func Match(pattern string, b []byte) (matched bool, err error) {
	re, err := Compile(pattern)
	if err != nil {
		return false, err
	}
	return re.Match(b), nil
}
1013770
func (resourceSet ResourceSet) Match(resource string, conditionValues map[string][]string) bool {
	for r := range resourceSet {
		if r.Match(resource, conditionValues) {
			return true
		}
	}

	return false
}
526745
func (r Revision) Matches(v Version) bool {
	switch tv := v.(type) {
	case versionTypeUnion:
		return tv.Matches(r)
	case Revision:
		return r == tv
	case versionPair:
		return r == tv.r
	}

	return false
}
693300
func (p *pvcEvaluator) Matches(resourceQuota *corev1.ResourceQuota, item runtime.Object) (bool, error) {
	return generic.Matches(resourceQuota, item, p.MatchingResources, generic.MatchesNoScopeFunc)
}
671726
func (p *podEvaluator) Matches(resourceQuota *corev1.ResourceQuota, item runtime.Object) (bool, error) {
	return generic.Matches(resourceQuota, item, p.MatchingResources, podMatchesScopeFunc)
}
718986
func (c command) match(cmdstr string) bool {
	for _, v := range c.aliases {
		if v == cmdstr {
			return true
		}
	}
	return false
}
1228822
func (c Command) Matches(req string) bool {
	return c.Expression().MatchString(req)
}
1168142
func (c *ResTableConfig) Match(settings *ResTableConfig) bool {
	// nil ResTableConfig always matches.
	if settings == nil {
		return true
	} else if c == nil {
		return *settings == ResTableConfig{}
	}

	// match imsi
	if settings.Mcc == 0 {
		if c.Mcc != 0 {
			return false
		}
	} else {
		if c.Mcc != 0 && c.Mcc != settings.Mcc {
			return false
		}
	}
	if settings.Mnc == 0 {
		if c.Mnc != 0 {
			return false
		}
	} else {
		if c.Mnc != 0 && c.Mnc != settings.Mnc {
			return false
		}
	}

	// match locale
	if c.Language != [2]uint8{0, 0} {
		// Don't consider country and variants when deciding matches.
		// If two configs differ only in their country and variant,
		// they can be weeded out in the isMoreSpecificThan test.
		if c.Language != settings.Language {
			return false
		}

		if c.Country != [2]uint8{0, 0} {
			if c.Country != settings.Country {
				return false
			}
		}
	}

	// screen layout
	layoutDir := c.ScreenLayout & MaskLayoutDir
	setLayoutDir := settings.ScreenLayout & MaskLayoutDir
	if layoutDir != 0 && layoutDir != setLayoutDir {
		return false
	}

	screenSize := c.ScreenLayout & MaskScreenSize
	setScreenSize := settings.ScreenLayout & MaskScreenSize
	if screenSize != 0 && screenSize > setScreenSize {
		return false
	}

	screenLong := c.ScreenLayout & MaskScreenLong
	setScreenLong := settings.ScreenLayout & MaskScreenLong
	if screenLong != 0 && screenLong != setScreenLong {
		return false
	}

	// ui mode
	uiModeType := c.UIMode & MaskUIModeType
	setUIModeType := settings.UIMode & MaskUIModeType
	if uiModeType != 0 && uiModeType != setUIModeType {
		return false
	}

	uiModeNight := c.UIMode & MaskUIModeNight
	setUIModeNight := settings.UIMode & MaskUIModeNight
	if uiModeNight != 0 && uiModeNight != setUIModeNight {
		return false
	}

	// smallest screen width dp
	if c.SmallestScreenWidthDp != 0 &&
		c.SmallestScreenWidthDp > settings.SmallestScreenWidthDp {
		return false
	}

	// screen size dp
	if c.ScreenWidthDp != 0 &&
		c.ScreenWidthDp > settings.ScreenWidthDp {
		return false
	}
	if c.ScreenHeightDp != 0 &&
		c.ScreenHeightDp > settings.ScreenHeightDp {
		return false
	}

	// screen type
	if c.Orientation != 0 && c.Orientation != settings.Orientation {
		return false
	}
	if c.Touchscreen != 0 && c.Touchscreen != settings.Touchscreen {
		return false
	}

	// input
	if c.InputFlags != 0 {
		myKeysHidden := c.InputFlags & MaskKeysHidden
		oKeysHidden := settings.InputFlags & MaskKeysHidden
		if myKeysHidden != 0 && myKeysHidden != oKeysHidden {
			if myKeysHidden != KeysHiddenNo || oKeysHidden != KeysHiddenSoft {
				return false
			}
		}
		myNavHidden := c.InputFlags & MaskNavHidden
		oNavHidden := settings.InputFlags & MaskNavHidden
		if myNavHidden != 0 && myNavHidden != oNavHidden {
			return false
		}
	}
	if c.Keyboard != 0 && c.Keyboard != settings.Keyboard {
		return false
	}
	if c.Navigation != 0 && c.Navigation != settings.Navigation {
		return false
	}

	// screen size
	if c.ScreenWidth != 0 &&
		c.ScreenWidth > settings.ScreenWidth {
		return false
	}
	if c.ScreenHeight != 0 &&
		c.ScreenHeight > settings.ScreenHeight {
		return false
	}

	// version
	if settings.SDKVersion != 0 && c.SDKVersion != 0 &&
		c.SDKVersion > settings.SDKVersion {
		return false
	}
	if settings.MinorVersion != 0 && c.MinorVersion != 0 &&
		c.MinorVersion != settings.MinorVersion {
		return false
	}

	return true
}
1248108
func (bf *Filter) Matches(data []byte) bool {
	bf.mtx.Lock()
	match := bf.matches(data)
	bf.mtx.Unlock()
	return match
}
565999
func (l *Lexer) match(matchTo string, skip int) bool {

	//u.Debugf("match(%q)  peek:%q ", matchTo, l.PeekWord())
	for _, matchRune := range matchTo {
		//u.Debugf("match rune? %v", string(matchRune))
		if skip > 0 {
			skip--
			continue
		}

		nr := l.Next()
		//u.Debugf("rune=%s n=%s   %v  %v", string(matchRune), string(nr), matchRune != nr, unicode.ToLower(nr) != matchRune)
		if matchRune != nr && unicode.ToLower(nr) != matchRune {
			//u.Debugf("setting done = false?, ie did not match")
			return false
		}
	}
	if l.IsEnd() {
		return true
	}
	// If we finished looking for the match word, and the next item is not
	// whitespace, it means we failed
	if !isWhiteSpace(l.Peek()) {
		return false
	}
	//u.Debugf("Found match():  %v", matchTo)
	return true
}
1263420
func (image Image) match(itype InstanceType) imageMatch {
	if !image.matchArch(itype.Arches) {
		return nonMatch
	}
	if itype.VirtType == nil || image.VirtType == *itype.VirtType {
		return exactMatch
	}
	if image.VirtType == "" {
		// Image doesn't specify virtualisation type. We allow it
		// to match, but prefer exact matches.
		return partialMatch
	}
	return nonMatch
}
726807
func (r *Matcher) Matches() bool {
	return r.scope() &&
		r.operation() &&
		r.group() &&
		r.version() &&
		r.resource()
}
1054549
func (s Selector) Matches(labels Labels) bool {
	for _, m := range s {
		if v := labels.Get(m.Name()); !m.Matches(v) {
			return false
		}
	}
	return true
}