Returns the value for the configuration attribute matching the key provided. If the value does not exist or is empty, the
provided default value will be returned.
549658
public boolean getBooleanConfigAttribute(Map<String, Object> props, String key, boolean defaultValue) {
        if (props.containsKey(key)) {
            return (Boolean) props.get(key);
        }
        return defaultValue;
    }
287816
def value(self, key, default=None):
        
        if self._customFormat:
            return self._customFormat.value(key, default)
        else:
            return unwrapVariant(super(XSettings, self).value(key))
367927
def __get_attribute(node, name, default_value=''):
    
    if node.hasAttribute(name):
        return node.attributes[name].value.strip()
    else:
        return default_value
1148965
def get_config_value(self, name, defaultValue):
    
    self.send_get_config_value(name, defaultValue)
    return self.recv_get_config_value()
497035
def get_config_value_from_file(key, config_path=None, default=None):
    
    config = _get_config_dict_from_file(config_path)
    if key not in config:
        return default
    return config[key]
1088164
def get_setting(key, **kwargs):
    
    has_default = 'default' in kwargs
    default_val = kwargs.get('default')

    try:
        if has_default:
            return getattr(settings, key, default_val)
        else:
            return getattr(settings, key)
    except Exception as e:
        raise ImproperlyConfigured(
            _('"{0}" setting has not been properly set. {1}').format(key, e)
        )
1095771
def get_value(self, attributes,key = None):
        

        value = attributes
        if key is None:
            key = self._splitted_key

        # A splitted key like 'a.b.c' goes into nested properties
        # and the value is retrieved recursively
        for i,elem in enumerate(key):
            if isinstance(value, (list,tuple)):
                #if this is a list, we return all matching values for the given list items
                return [self.get_value(v,key[i:]) for v in value]
            else:
                value = value[elem]

        return value
978892
def get(self, key, default=None):
        """"""
        return self._settings.get(key, Config.get(self, key, default))
51464
def get(self, key, default=None):
        
        try:
            result = self._loads(self._client.hget(self.key_prefix, key))
            assert result is not None
            return result
        except (AssertionError, KeyError):
            return default or self._default
52023
def get(self, key, default=None):
        '''
        
        '''
        valu = self.data.get(key, default)
        if key in self.data:
            self.data.move_to_end(key)
        return valu
460412
def get_config_item(self, key):
        
        value = _lxc.Container.get_config_item(self, key)

        if value is False:
            return False
        elif value.endswith("\n"):
            return value.rstrip("\n").split("\n")
        else:
            return value
721635
def value(self, key, default=None):
        
        parts = nativestring(key).split('/')
        curr = self._xstack[-1]
        for part in parts[:-1]:
            next = curr.find(part)
            if next is None:
                next = ElementTree.SubElement(curr, part)
            curr = next
        
        xval = curr.find(parts[-1])
        if xval is None:
            return default
        
        return self.restoreValue(xval)
612263
public int get(int key, int defaultValue) {
    int index = getKeyIndex(key);
    if (index >= 0) {
      return values[index];
    } else {
      return defaultValue;
    }
  }
1121696
public static int getConfigInt(String key, int defaultValue) {
		return NumberUtils.toInt(getConfigParam(key, Integer.toString(defaultValue)));
	}
55457
public Object getAttribute(String key, Object defaultValue)
    {
        Object attributeValue = getUserAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        attributeValue = getSessionAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        return defaultValue;
    }
486043
def get(cls, key, section=None, **kwargs):
        
        section = section or cls._default_sect
        if section not in cls._conf:
            cls._load(section=section)

        value = cls._conf[section].get(key)

        # if not found in context read default
        if not value and section != cls._default_sect:
            value = cls._conf[cls._default_sect].get(key) if cls._default_sect in cls._conf else None

        if value is None:
            if 'default' in kwargs:  # behave as {}.get(x, default='fallback')
                _def_value = kwargs['default']
                logger.warn("Static configuration [{}] was not found. Using the default value [{}].".format(key, _def_value))
                return _def_value
            else:
                raise InvalidConfigException(u'Not found entry: {}'.format(key))

        try:
            value = from_json(value)  # parse value
        except (TypeError, ValueError):
            pass  # if not json parseable, then keep the string value

        return value
1069852
def get_value(self, key):
        # type: (str) -> Any
        
        try:
            return self._dictionary[key]
        except KeyError:
            raise ConfigurationError("No such key - {}".format(key))