Create a KeyMatcher that matches Keys that equal the given key.
356497
public static <U extends Key <U>> KeyMatcher <U> keyEquals (final U compareTo)
  {
    return new KeyMatcher <> (compareTo);
  }
382927
private int compare(Object key1, Object key2) {
        if (comparator == null)
            return ((Comparable) key1).compareTo(key2);
        else
            return comparator.compare(key1, key2);
    }
1110694
def _validate_type_key(key, value, types, validated):
    """"""
    for key_schema, value_schema in types.items():
        if not isinstance(key, key_schema):
            continue
        try:
            validated[key] = value_schema(value)
        except NotValid:
            continue
        else:
            return []

    return ['%r: %r not matched' % (key, value)]
387165
public static function keyMatch($key1, $key2)
    {
        if (false === strpos($key2, '*')) {
            return $key1 == $key2;
        }

        $needle = rtrim($key2, '*');

        return substr($key1, 0, \strlen($needle)) === (string) $needle;
    }
797334
def match(self, chars):
        """"""
        start_index = self.next_index
        for char in self:
            if char not in chars:
                self.next_index -= 1
                break
        return self[start_index:self.next_index]
797543
def check_key(key, allowed):
    

    if key in allowed:
        return True

    for pattern in allowed:
        if fnmatch(key, pattern):
            return True

    return False
379869
def filter(self, key_pattern='*', is_regex=False):
        
        if is_regex:
            if isinstance(key_pattern, str):
                regex = re.compile(key_pattern)
            else:
                regex = key_pattern
        else:
            regex = None
        for k, v in self.items():
            if regex and regex.match(k) or (not regex) and fnmatch(k, key_pattern):
                yield k, v
545418
public Object searchGreaterOrEqual(
                                      Object            searchKey)
    {
        SearchComparator comp = searchComparator(SearchComparator.GE);
        Object p = find(comp, searchKey);
        return p;
    }
751727
def dict_match(self, match_dict):
        '''
        
        '''
        ret = {}
        cur_keys = self.list_keys()
        for status, keys in six.iteritems(match_dict):
            for key in salt.utils.data.sorted_ignorecase(keys):
                for keydir in (self.ACC, self.PEND, self.REJ, self.DEN):
                    if keydir and fnmatch.filter(cur_keys.get(keydir, []), key):
                        ret.setdefault(keydir, []).append(key)
        return ret
529460
def matches?(selector)
      selector.each_pair do |key, value|
        return false unless matcher(key, value).matches?(value)
      end
      true
    end
1329222
function(kb) {
			if (!kb.keys) { return false; }
			if (kb.keys.length !== this.keys.length) { return false; }
			for (var i=0; i<kb.keys.length; i++) {
				if (!kb.keys[i].equals(this.keys[i])) { return false; }
			}
			return true;
		}
1137268
def match_item(key, value, item):
    
    if isinstance(value, (list, tuple)):
        return any(match_item(key, sub_value, item) for sub_value in value)
    else:
        return key not in item or str(item.get(key)).lower() == str(value).lower()
996566
def equal_to(self, key, value):
        
        self._where[key] = utils.encode(value)
        return self
472028
def corrected_key(self, key):
        
        matching_keys = []
        for allowed_key in CMAOptions.defaults():
            if allowed_key.lower() == key.lower():
                return allowed_key
            if allowed_key.lower().startswith(key.lower()):
                matching_keys.append(allowed_key)
        return matching_keys[0] if len(matching_keys) == 1 else None
715084
def when_equal(self, key: Hashable, value: Any, **when_kwargs) -> StateWatcher:
        

        def _(snapshot):
            try:
                return snapshot[key] == value
            except KeyError:
                return False

        return self.when(_, **when_kwargs)
124252
function equals( a, b ) {
   const aKeys = Object.keys( a );
   const bKeys = Object.keys( b );
   return aKeys.length === bKeys.length && aKeys.every( key => key in b && a[ key ] === b[ key ] );
}
598615
public static <T extends Key <T>> GroupMatcher <T> groupEquals (final String compareTo)
  {
    return new GroupMatcher <> (compareTo, StringOperatorName.EQUALS);
  }