Helper function to fetch value from a dictionary
    
    * `d` - Dictionary to fetch value from
    * `key` - Key to lookup in dictionary
    * `def_val` - Default value to return if dict does not have a member with key
497156
def safe_get(d, key, def_val=None):
    
    if d.has_key(key):
        return d[key]
    else:
        return def_val
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))
93336
def key_assoc_val(d, func, exclude=None):
    
    vs = list(d.values())
    ks = list(d.keys())
    key = ks[vs.index(func(vs))]
    return key
1329231
def from_dict(cls, d):
        
        return cls(xc=d.get("xc"), x=d.get("x"), c=d.get("c"))
1148027
def get_member(row, key):
    '''  '''
    (target, tkey, tvalue) = dict_crawl(row, key)
    if target:
        return tvalue
    return None
1069852
def get_value(self, key):
        # type: (str) -> Any
        
        try:
            return self._dictionary[key]
        except KeyError:
            raise ConfigurationError("No such key - {}".format(key))
1113490
def get(self, key):
        
        try:
            return self[self.id_lookup.get(key)]

        except TypeError:
            raise KeyError
160486
def from_dict(cls, d):
        
        assert isinstance(d, dict)
        init_args = dict()
        for key, is_required in cls.dictionary_attributes.iteritems():
            try:
                init_args[key] = d[key]
            except KeyError:
                if is_required:
                    raise DictConvertible.Error('missing key in dictionary', cls, missing_key=key)
        return cls(**init_args)
1009413
def get_value(self):
        
        try:
            self.raw_value
        except (AttributeError, KeyError) as err:
            self._reraise_if_required(err)
            default_value = self.default_value
            if self.transform_default:
                return self.transform(default_value)
            return default_value
        else:
            # If setting is defined, load values of all subsettings.
            value = {}
            for key, subsetting in self.settings.items():
                value[key] = subsetting.get_value()
            return value
503573
def key_of(d):
    
    if len(d) > 1 and not type(d) == dict():
        raise ValueError('key_of(d) may only except single element dict')
    else:
        return keys_of(d)[0]
510246
def get(self, key, default=None):
        
        try:
            return self.items[key]
        except IndexError:
            return value(default)
388229
def getpath(d, json_path, default=None, sep='.'):
    '''
    '''
    for key in json_path.split(sep):
        try:
            d = d[key]
        except (KeyError, TypeError):
            return default
    return d
1142014
def _all_default(d, default, seen=None):
    
    if default is None:
        return
    if _get(default, CLASS) is Data:
        default = object.__getattribute__(default, SLOT)  # REACH IN AND GET THE dict
        # Log = _late_import()
        # Log.error("strictly dict (or object) allowed: got {{type}}", type=_get(default, CLASS).__name__)

    for k, default_value in default.items():
        default_value = unwrap(default_value)  # TWO DIFFERENT Dicts CAN SHARE id() BECAUSE THEY ARE SHORT LIVED
        existing_value = _get_attr(d, [k])

        if existing_value == None:
            if default_value != None:
                if _get(default_value, CLASS) in data_types:
                    df = seen.get(id(default_value))
                    if df is not None:
                        _set_attr(d, [k], df)
                    else:
                        copy_dict = {}
                        seen[id(default_value)] = copy_dict
                        _set_attr(d, [k], copy_dict)
                        _all_default(copy_dict, default_value, seen)
                else:
                    # ASSUME PRIMITIVE (OR LIST, WHICH WE DO NOT COPY)
                    try:
                        _set_attr(d, [k], default_value)
                    except Exception as e:
                        if PATH_NOT_FOUND not in e:
                            get_logger().error("Can not set attribute {{name}}", name=k, cause=e)
        elif is_list(existing_value) or is_list(default_value):
            _set_attr(d, [k], None)
            _set_attr(d, [k], listwrap(existing_value) + listwrap(default_value))
        elif (hasattr(existing_value, "__setattr__") or _get(existing_value, CLASS) in data_types) and _get(default_value, CLASS) in data_types:
            df = seen.get(id(default_value))
            if df is not None:
                _set_attr(d, [k], df)
            else:
                seen[id(default_value)] = existing_value
                _all_default(existing_value, default_value, seen)
729377
function Dict_get(key1, key2, key3) {
      var value;
      var xref = this.xref;
      if (typeof (value = this.map[key1]) !== 'undefined' || key1 in this.map ||
          typeof key2 === 'undefined') {
        return xref ? xref.fetchIfRef(value) : value;
      }
      if (typeof (value = this.map[key2]) !== 'undefined' || key2 in this.map ||
          typeof key3 === 'undefined') {
        return xref ? xref.fetchIfRef(value) : value;
      }
      value = this.map[key3] || null;
      return xref ? xref.fetchIfRef(value) : value;
    }
1323832
def _get(self, key, section=None, default=_onion_dict_guard):
        
        if section is not None:
            section_dict = self.__sections.get(section, {})
            if key in section_dict:
                return section_dict[key]
        for d in self.__dictionaries:
            if key in d:
                return d[key]
        if default is _onion_dict_guard:
            raise KeyError(key)
        else:
            return default
409985
def todict(self, dict_type=dict, index_key=0, index_value=-1):
        ''''''
        if len(self):
            return dict_type(self.items([index_key, index_value]))
        else:  # empty
            return dict_type()
744685
def get(self, key):
        

        match = self._get_match(key=key)

        if not match:
            return None

        return self._get_value_from_match(key=key, match=match)