Given a key, find the value
        Vyper will check in the following order:
        override, arg, env, config file, key/value store, default
        Vyper will check to see if an alias exists first.
968587
def _find(self, key):
        
        key = self._real_key(key)

        # OVERRIDES
        val = self._override.get(key)
        if val is not None:
            log.debug("{0} found in override: {1}".format(key, val))
            return val

        # ARGS
        val = self._args.get(key)
        if val is not None:
            log.debug("{0} found in args: {1}".format(key, val))
            return val

        # ENVIRONMENT VARIABLES
        if self._automatic_env_applied:
            # even if it hasn't been registered, if `automatic_env` is used,
            # check any `get` request
            val = self._get_env(self._merge_with_env_prefix(key))
            if val is not None:
                log.debug("{0} found in environment: {1}".format(key, val))
                return val

        env_key = self._find_insensitive(key, self._env)
        log.debug("Looking for {0} in env".format(key))
        if isinstance(env_key, list):
            parent = self._find_insensitive(key, self._config)
            found_in_env = False
            log.debug("Found env key parent {0}: {1}".format(key, parent))

            for item in env_key:
                log.debug("{0} registered as env var parent {1}:".format(
                    key, item["env_key"]))
                val = self._get_env(item["env_key"])

                if val is not None:
                    log.debug("{0} found in environment: {1}".format(
                        item["env_key"], val))
                    temp = parent
                    for path in item["path"]:
                        real_key = self._find_real_key(path, temp)
                        temp = temp[real_key]

                    self._set_insensitive(item["final_key"], val, temp)
                    found_in_env = True
                else:
                    log.debug("{0} env value unset".format(item["env_key"]))

            if found_in_env:
                return parent

        elif env_key is not None:
            log.debug("{0} registered as env var: {1}".format(key, env_key))
            val = self._get_env(env_key)
            if val is not None:
                log.debug("{0} found in environment: {1}".format(env_key, val))
                return val
            else:
                log.debug("{0} env value unset".format(env_key))

        # CONFIG FILE
        val = self._find_insensitive(key, self._config)
        if val is not None:
            log.debug("{0} found in config: {1}".format(key, val))
            return val

        # Test for nested config parameter
        if self._key_delimiter in key:
            path = key.split(self._key_delimiter)

            source = self._find(path[0])
            if source is not None and isinstance(source, dict):
                val = self._search_dict(source, path[1::])
                if val is not None:
                    log.debug("{0} found in nested config: {1}".format(
                        key, val))
                    return val

        # KEY/VALUE STORE
        val = self._kvstore.get(key)
        if val is not None:
            log.debug("{0} found in key/value store: {1}".format(key, val))
            return val

        # DEFAULTS
        val = self._defaults.get(key)
        if val is not None:
            log.debug("{0} found in defaults: {1}".format(key, val))
            return val

        return None
1140619
public java.lang.String getEnvVariablesOrDefault(
      java.lang.String key,
      java.lang.String defaultValue) {
    if (key == null) { throw new java.lang.NullPointerException(); }
    java.util.Map<java.lang.String, java.lang.String> map =
        internalGetEnvVariables().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
353270
def _pv_default(opts, key, default_value)
        value = _pv_opts_lookup(opts, key)
        if value == nil
          opts[key] = default_value
        end
      end
882054
def _lookup_vultrid(which_key, availkey, keyname):
    '''
    
    '''
    if DETAILS == {}:
        _cache_provider_details()

    which_key = six.text_type(which_key)
    try:
        return DETAILS[availkey][which_key][keyname]
    except KeyError:
        return False
1104718
def find_value(self, key):
        """"""
        values = self.values
        if key not in values:
            raise AttributeError("Config has no value for {}".format(key))

        val = values[key]
        if isinstance(val, Default):
            return val.val
        else:
            return val
359109
function checkKeyExists(key) {
    var scope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'fallback';
    // get the current language from the store
    var locale = store.state[moduleName].locale;
    var fallback = store.state[moduleName].fallback;
    var translations = store.state[moduleName].translations; // check the current translation

    if (translations.hasOwnProperty(locale) && translations[locale].hasOwnProperty(key)) {
      return true;
    }

    if (scope == 'strict') {
      return false;
    } // check any localized translations


    var localeRegional = locale.split('-');

    if (localeRegional.length > 1 && translations.hasOwnProperty(localeRegional[0]) && translations[localeRegional[0]].hasOwnProperty(key)) {
      return true;
    }

    if (scope == 'locale') {
      return false;
    } // check if a fallback locale exists


    if (translations.hasOwnProperty(fallback) && translations[fallback].hasOwnProperty(key)) {
      return true;
    } // key does not exist in the store


    return false;
  }
408412
function checkValue(typeVarMap, index, k, x) {
        var propPath = [k];
        var t = expType.types[k];
        return (
          t.type === VARIABLE ?
            Z.chain (
              function(typeVarMap) {
                return isEmpty (typeVarMap[t.name].types) ?
                  Left (function() {
                    return typeVarConstraintViolation (
                      env,
                      typeInfo,
                      index,
                      propPath,
                      typeVarMap[t.name].valuesByPath
                    );
                  }) :
                  Right (typeVarMap);
              },
              Right (updateTypeVarMap (env,
                                       typeVarMap,
                                       t,
                                       index,
                                       propPath,
                                       [x]))
            ) :
          // else
            Z.map (
              function(r) { return r.typeVarMap; },
              satisfactoryTypes (env,
                                 typeInfo,
                                 typeVarMap,
                                 t,
                                 index,
                                 propPath,
                                 [x])
            )
        );
      }
80746
def config_value_keys(self, sortkey = False):
        
        ret = set()
        cls = type(self)
        while True:
            root = cls.getConfigRoot()
            if root:
                ret = ret.union(set(root.config_value_keys()))
            parent = None
            for c in cls.__bases__:
                if issubclass(c, Configurable):
                    parent = c
            if parent is None:
                break
            cls = parent
        if sortkey:
            return sorted(list(ret))
        else:
            return list(ret)
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)
        )
580380
def set_value(repo_directory, key, value, strict=True):
    """"""
    if value is None:
        raise ValueError('Argument "value" must not be None.')

    # Read values and do nothing if not making any changes
    config = read_config(repo_directory)
    old = config.get(key)
    if old == value:
        return old

    # Check schema
    if strict and old is not None and not isinstance(old, type(value)):
        raise ConfigSchemaError('Expected config variable %s to be type %s, got %s'
            % (repr(key), repr(type(value)), repr(type(old))))

    # Set new value and save results
    config[key] = value
    write_config(repo_directory, config)
    return old
1138052
function hasKey(key) {
		var reads = stacheKey.reads(key);
		var readValue;

		if (reads[0].key === "scope") {
			// read properties like `scope.vm.foo` directly from the scope
			readValue = stacheKey.read(this, reads.slice(1), key);
		} else {
			// read normal properties from the scope's context
			readValue = stacheKey.read(this._context, reads, key);
		}

		return readValue.foundLastParent && readValue.parentHasKey;
	}
450098
function(config, keyToFind) {

  // Recursive function.
  var rec = function(o, prefix) {

    // Loop through each of the objects properties to find value.
    return _.find(o, function(val, key) {

      // Build namespaced name.
      var name = _.filter([prefix, key]).join('.');

      if (typeof val === 'string') {

        // If name of string value matches, return it.
        return (':' + name + ':') === keyToFind;

      } else if (typeof val === 'object') {

        // Recursively check object.
        return rec(val, name);

      } else {

        // Not a string or an object so just return false.
        return false;

      }

    });

  };

  // Init recursive function and return.
  return rec(config);

}
871796
def sub(self, key):
        
        subv = Vyper()
        data = self.get(key)
        if isinstance(data, dict):
            subv._config = data
            return subv
        else:
            return None
1153849
def getvar(key, default=None, template='OPENSHIFT_{key}'):
    
    return os.environ.get(template.format(key=key), default)
1069852
def get_value(self, key):
        # type: (str) -> Any
        
        try:
            return self._dictionary[key]
        except KeyError:
            raise ConfigurationError("No such key - {}".format(key))
399565
def get(self, key, env=None):
        
        if env is None:
            env = self.environment
        try:
            ret = self._settings[env][key]
        except KeyError:
            ret = None
        if ret is None:
            # See if it's set in the environment
            if key == "identity_class":
                # This is defined via the identity_type
                env_var = self.env_dct.get("identity_type")
                ityp = os.environ.get(env_var)
                if ityp:
                    return _import_identity(ityp)
            else:
                env_var = self.env_dct.get(key)
            if env_var is not None:
                ret = os.environ.get(env_var)
        return ret
319902
def find_or_build(cls, **kwargs):
        
        keys = kwargs.pop('keys') if 'keys' in kwargs else []
        return cls.first(**subdict(kwargs, keys)) or cls.build(**kwargs)