// GetMatch checks for a match on the specified key, and returns the value that
// the key must match, and true. If a match cannot be found, returns nil, false.
510610
func (n EndpointSelector) GetMatch(key string) ([]string, bool) {
	if value, ok := n.MatchLabels[key]; ok {
		return []string{value}, true
	}
	for _, v := range n.MatchExpressions {
		if v.Key == key && v.Operator == metav1.LabelSelectorOpIn {
			return v.Values, true
		}
	}
	return nil, false
}
1361224
func (r *Regexp) IsMatch(s int) bool {
	if s < len(r.dfa.states) {
		return r.dfa.states[s].match
	}
	return false
}
558926
func (v *Object) GetValue(keys ...string) (*Value, error) {
	return v.getPath(keys)
}
512038
func RegexMatch(key1 string, key2 string) bool {
	res, err := regexp.MatchString(key2, key1)
	if err != nil {
		panic(err)
	}
	return res
}
1266257
func (c *Config) Get(key string) (Value, error) {
	val, ok := (*c)[key]
	if !ok {
		return val, ErrNoSuchKey
	}
	return val, nil
}
1368880
func (c *SyncCollector) HasMatch(k string, v interface{}) bool {
	// c.rw.RLock()
	// defer c.rw.RUnlock()
	if c.Has(k) {
		return c.Get(k) == v
	}
	return false
}
391813
func (cs callSet) FindMatch(receiver interface{}, method string, args []interface{}) (*Call, error) {
	key := callSetKey{receiver, method}

	// Search through the expected calls.
	expected := cs.expected[key]
	var callsErrors bytes.Buffer
	for _, call := range expected {
		err := call.matches(args)
		if err != nil {
			fmt.Fprintf(&callsErrors, "\n%v", err)
		} else {
			return call, nil
		}
	}

	// If we haven't found a match then search through the exhausted calls so we
	// get useful error messages.
	exhausted := cs.exhausted[key]
	for _, call := range exhausted {
		if err := call.matches(args); err != nil {
			fmt.Fprintf(&callsErrors, "\n%v", err)
		}
	}

	if len(expected)+len(exhausted) == 0 {
		fmt.Fprintf(&callsErrors, "there are no expected calls of the method %q for that receiver", method)
	}

	return nil, fmt.Errorf(callsErrors.String())
}
563119
func (k *ArrayKeyring) Get(key string) (Item, error) {
	if i, ok := k.items[key]; ok {
		return i, nil
	}
	return Item{}, ErrKeyNotFound
}
1312674
func (j *Js) Get(key string) *Js {
	m := j.Getdata()
	if v, ok := m[key]; ok {
		j.data = v
		return j
	}
	j.data = nil
	return j
}
1113838
func (c *Config) GetKey(key Key) (v interface{}) {
	return c.values.Get(key)
}
1293693
func (m *ArrayMap) Get(key int) (value T, ok bool) {
	if m.isValidKey(key) {
		return m.data[key], true
	}
	return nil, false
}
753300
func (c *Context) GetString(key string) (s string) {
	if val, ok := c.Get(key); ok && val != nil {
		s, _ = val.(string)
	}
	return
}
751153
func (f *Values) Get(key string) []string {
	var results []string
	for i, v := range f.values {
		if v.Key == key {
			results = append(results, f.values[i].Value)
		}
	}
	return results
}
1328556
func (deque *keyedDeque) Get(key interface{}) (*list.Element, bool) {
	deque.RLock()
	defer deque.RUnlock()

	v, ok := deque.index[key]
	return v, ok
}
925912
func (meta Metadata) GetValue(key string) []byte {
	if value, isSet := meta[key]; isSet {
		return value
	}

	return []byte{}
}
567467
func (args Args) ExactMatch(key, source string) bool {
	fieldValues, ok := args.fields[key]
	//do not filter if there is no filter set or cannot determine filter
	if !ok || len(fieldValues) == 0 {
		return true
	}

	// try to match full name value to avoid O(N) regular expression matching
	return fieldValues[source]
}
1127792
func (m *lockingMap) Get(key string) (interface{}, bool) {
	m.keyLocker.RLock(key)
	defer m.keyLocker.RUnlock(key)

	m.lock.RLock()
	defer m.lock.RUnlock()

	val, ok := m.data[key]
	if ok && (m.checkFunc == nil || m.checkFunc(key, val)) {
		return val, true
	} else {
		// No value or it failed to check
		return nil, false
	}
}