Return value if key exists in file.

    Return default if key not in config.
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]
587140
def get(self, key, default=None):
        
        try:
            return self[key]
        except KeyError:
            return default or self._default
1366646
def get(self, key, default=None):
        
        if key in self.__cli:
            return self.__cli[key]
        if key in self.__config:
            return self.__config.get(key)
        if key in self.__defaults:
            return self.__defaults.get(key)
        return default
1364979
def get(self, key, default):
        """"""
        with self._lock:
            try:
                return self._dict[key].copy()
            except KeyError:
                return default
157493
def setdefault(self, key, value):
        
        with self.lock:
            if key in self:
                return self.getitem(key)

            else:
                self.setitem(key, value)
                return value
718884
def config_value_for(key, default = nil, check_live = true)
      key = key.to_s
      value = check_live ? self[key.to_s] : nil
      value || config[key] || self.class.config_value_for(key) || default
    end
212954
def get(self, key, default=UndefinedKey):
        
        return self._get(ConfigTree.parse_key(key), 0, default)
978892
def get(self, key, default=None):
        """"""
        return self._settings.get(key, Config.get(self, key, default))
1141273
def _get_opt(config, key, option, opt_type):
    """"""
    for opt_key in [option, option.replace('-', '_')]:
        if not config.has_option(key, opt_key):
            continue

        if opt_type == bool:
            return config.getbool(key, opt_key)

        if opt_type == int:
            return config.getint(key, opt_key)

        if opt_type == str:
            return config.get(key, opt_key)

        if opt_type == list:
            return _parse_list_opt(config.get(key, opt_key))

        raise ValueError("Unknown option type: %s" % opt_type)
1069852
def get_value(self, key):
        # type: (str) -> Any
        
        try:
            return self._dictionary[key]
        except KeyError:
            raise ConfigurationError("No such key - {}".format(key))
1136941
def get(file_name, key):
    
    db = XonoticDB.load_path(file_name)
    value = db.get(key)
    if value is None:
        sys.exit(1)
    else:
        click.echo(value)
655370
def check_key(self, key: str) -> bool:
        
        keys = self.get_keys()
        return key in keys
618360
def getin(m, path, default=None):
    """"""
    keynotfound = ':com.gooey-project/not-found'
    result = reduce(lambda acc, val: acc.get(val, {keynotfound: None}), path, m)
    # falsey values like 0 would incorrectly trigger the default to be returned
    # so the keynotfound val is used to signify a miss vs just a falesy val
    if isinstance(result, dict) and keynotfound in result:
        return default
    return result
900566
def get_or_save_default(self, key, default_value):
        
        val = self.get_or_none(key)
        if val is None:
            self.update(key, default_value)
            val = default_value
        return val
34366
def get(self, key: str) -> Optional[str]:
        
        return get_config(self.full_key(key))
440516
def get_default_config_file(rootdir=None):
    """"""
    if rootdir is None:
        return DEFAULT_CONFIG_FILE

    for path in CONFIG_FILES:
        path = os.path.join(rootdir, path)
        if os.path.isfile(path) and os.access(path, os.R_OK):
            return path
56097
def _get_value(obj, key, default=missing):
    
    if "." in key:
        return _get_value_for_keys(obj, key.split("."), default)
    else:
        return _get_value_for_key(obj, key, default)