Find the sought key in the given dictionary regardless of case

    >>> things = {'Fred' : 9}
    >>> print(get_caselessly(things, 'fred'))
    9
173631
def get_caselessly(dictionary, sought):
    
    try:
        return dictionary[sought]
    except KeyError:
        caseless_keys = {k.lower(): k for k in dictionary.keys()}
        real_key = caseless_keys[sought.lower()]  # allow any KeyError here
        return dictionary[real_key]
490094
def _key(self, ch):
        """"""

        if ch in self.D:
            return ch

        if isinstance(ch, int):
            raise KeyError(ch)  # dont accept integers as custom names

        if self.chnames:
            for item in self.chnames.items():
                if item[1] == ch:
                    return item[0]
        for item in self.chnames_0.items():
            if item[1] == ch:
                return item[0]

        # If we got here, ch can be an int represented by a string if it comes
        # from a condition string:
        try:
            chint = int(ch)
            if chint in self.D:
                return chint
        except ValueError:
            pass

        raise KeyError(ch)
1319277
def get(self, key, default=None):
        """"""
        for k, v in self:
            if k == key:
                return v
        return default
94828
def reverse_lookup(self, name, case_sensitive=False):
        
        if case_sensitive:
            filtr = lambda x, l: any(x == z for z in l)
        else:
            name = name.lower()
            filtr = lambda x, l: any(x == z.lower() for z in l)
        return {k: v for k, v in six.iteritems(self.__dict__)
                if filtr(name, v)}
218473
def _get_by_key(self, key, handle_not_found=True):
        
        resolution = self._get_item_or_section(key, handle_not_found=handle_not_found)
        if self.settings.key_getter:
            return self.settings.key_getter(parent=self, subject=resolution)
        else:
            return resolution
446609
def getKey(self, key):
		
		data = self.getDictionary()
		if key in data:
			return data[key]
		else:
			return None
497156
def safe_get(d, key, def_val=None):
    
    if d.has_key(key):
        return d[key]
    else:
        return def_val
1285813
def getkey(mapping, value, default=None, use_id=False):
    '''
    '''
    if use_id:
        for key, val in mapping.items():
            if val is value:
                return key
    else:
        for key, val in mapping.items():
            if val == value:
                return key
    return default
1012529
def _recursive_getitem(d, key):
    
    if key in d:
        return d
    else:
        for v in d.values():
            return _recursive_getitem(v, key)
        else:
            raise KeyError('Key not found: {}'.format(key))
1225756
function getkey (key) {
    var parsedKey = Number(key)

    return (
      isNaN(parsedKey) ||
      key.indexOf('.') !== -1 ||
      opts.object
    ) ? key
      : parsedKey
  }
182756
def get(self, key, alt=None):
        
        with self.lock:
            if key in self:
                return self.getitem(key)

            else:
                return alt
833635
def get_human_key(self, key):
        """"""
        for human_key, k in self._identifier_map.items():
            if k == key:
                return human_key
        raise KeyError(key)
366303
def getone(self, key):
        
        v = self.getall(key)
        if not v:
            raise KeyError('Key not found: %r' % key)
        if len(v) > 1:
            raise KeyError('Multiple values match %r: %r' % (key, v))
        return v[0]
229024
def get(self, key, default=None):
        
        try:
            val = self[key]
        except KeyError:
            val = default
        return val
510246
def get(self, key, default=None):
        
        try:
            return self.items[key]
        except IndexError:
            return value(default)
526163
def find_gt(self, item):
        ''
        k = self._key(item)
        i = bisect_right(self._keys, k)
        if i != len(self):
            return self._items[i]
        raise ValueError('No item found with key above: %r' % (k,))
655370
def check_key(self, key: str) -> bool:
        
        keys = self.get_keys()
        return key in keys