Check that every key-value in superConfig is in subConfig
1565
public static boolean verifySubset(Config superConfig, Config subConfig) {
    for (Map.Entry<String, ConfigValue> entry : subConfig.entrySet()) {
      if (!superConfig.hasPath(entry.getKey()) || !superConfig.getValue(entry.getKey()).unwrapped()
          .equals(entry.getValue().unwrapped())) {
        return false;
      }
    }
    return true;
  }
730415
def validate_config(raise_=True):
    
    ELIBConfig.check()
    known_paths = set()
    duplicate_values = set()
    missing_values = set()
    for config_value in ConfigValue.config_values:
        if config_value.path not in known_paths:
            known_paths.add(config_value.path)
        else:
            duplicate_values.add(config_value.name)
        try:
            config_value()
        except MissingValueError:
            missing_values.add(config_value.name)

    if raise_ and duplicate_values:
        raise DuplicateConfigValueError(str(duplicate_values))
    if raise_ and missing_values:
        raise MissingValueError(str(missing_values), 'missing config value(s)')
    return duplicate_values, missing_values
815294
def config_value_keys(self, sortkey = False):
        
        if sortkey:
            items = sorted(self.items())
        else:
            items = self.items()
        return (k for k,v in items if not isinstance(v,ConfigTree))
734235
def _merge_config(self, config_override):
        
        if not isinstance(config_override, dict):
            raise TypeError("config override must be a dict")

        def recursion(config_value, override_value):
            for key, value in override_value.items():
                if key in config_value:
                    if isinstance(value, dict) and isinstance(config_value[key], dict):
                        recursion(config_value[key], value)
                    else:
                        config_value[key] = value
                else:
                    config_value[key] = value

        for key, value in config_override.items():
            if key in self._data:
                recursion(self._data[key], value)
            else:
                self._data[key] = value
729313
private Configuration getConfigurationInternal(final String[] keys) {

		Configuration conf = new Configuration();

		synchronized (this.confData) {

			final Iterator<String> it = this.confData.keySet().iterator();

			while (it.hasNext()) {

				final String key = it.next();
				boolean found = false;
				if (keys != null) {
					for (int i = 0; i < keys.length; i++) {
						if (key.equals(keys[i])) {
							found = true;
							break;
						}
					}

					if (found) {
						conf.setString(key, this.confData.get(key));
					}
				} else {
					conf.setString(key, this.confData.get(key));
				}
			}
		}

		return conf;
	}
529387
protected boolean isConfigTrue(IConfigKey key) {
        String value = getConfig(key);
        if (value == null) {
            return false;
        }
        value = value.toLowerCase();
        return TRUE.equals(value);
    }
1339011
def contains(self, key):
        """"""
        if self._jconf is not None:
            return self._jconf.contains(key)
        else:
            return key in self._conf
671524
def is_config_var(var):
    

    return (
        isinstance(var, (attr._make.Attribute, attr._make._CountingAttr))
        and hasattr(var, "metadata")
        and CONFIG_KEY in var.metadata
    )
160414
def is_sub_dict(sub_dict, dictionary):
    """"""
    for key in sub_dict.keys():
        if key not in dictionary:
            return False
        if (type(sub_dict[key]) is not dict) and (sub_dict[key] != dictionary[key]):
            return False
        if (type(sub_dict[key]) is dict) and (not is_sub_dict(sub_dict[key], dictionary[key])):
            return False
    return True
1200283
function _validateConfig(config) {
    for (var i = 0; i < REQUIRED_CONFIG_VARIABLES.length; i++) {
        var key = REQUIRED_CONFIG_VARIABLES[i];
        var value = config.DubBotBase[key];
        if (!value || value === "UNSET") {
            throw new Error("No value has been set in config for key: DubBotBase." + key);
        }
    }
}
672982
def _check_unique_together(cls):
        """"""
        if cls._meta.unique_together is None:
            return

        if not isinstance(cls._meta.unique_together, (tuple, list)):
            raise ConfigurationError(
                "'{}.unique_together' must be a list or tuple.".format(cls.__name__)
            )

        elif any(
            not isinstance(unique_fields, (tuple, list))
            for unique_fields in cls._meta.unique_together
        ):
            raise ConfigurationError(
                "All '{}.unique_together' elements must be lists or tuples.".format(cls.__name__)
            )

        else:
            for fields_tuple in cls._meta.unique_together:
                for field_name in fields_tuple:
                    field = cls._meta.fields_map.get(field_name)

                    if not field:
                        raise ConfigurationError(
                            "'{}.unique_together' has no '{}' "
                            "field.".format(cls.__name__, field_name)
                        )

                    if isinstance(field, ManyToManyField):
                        raise ConfigurationError(
                            "'{}.unique_together' '{}' field refers "
                            "to ManyToMany field.".format(cls.__name__, field_name)
                        )
493104
def _read_config(self):
        """"""

        try:
            self.config = self.componentmodel.find_one(
                {'name': self.uniquename})
        except ServerSelectionTimeoutError:  # pragma: no cover
            self.log("No database access! Check if mongodb is running "
                     "correctly.", lvl=critical)
        if self.config:
            self.log("Configuration read.", lvl=verbose)
        else:
            self.log("No configuration found.", lvl=warn)
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
763986
def _create_overrides_from_config(config):
    """"""
    d = {}
    for s in config.sections():
        d[s] = {}
        for opt in config.options(s):
            d[s][opt] = config.get(s, opt)
    return d
42434
function validateConfig(config, parentPath) {
    if (parentPath === void 0) { parentPath = ''; }
    // forEach doesn't iterate undefined values
    for (var /** @type {?} */ i = 0; i < config.length; i++) {
        var /** @type {?} */ route = config[i];
        var /** @type {?} */ fullPath = getFullPath(parentPath, route);
        validateNode(route, fullPath);
    }
}
425363
def validate_config(key: str, config: dict) -> None:
    

    try:
        jsonschema.validate(config, CONFIG_JSON_SCHEMA[key])
    except jsonschema.ValidationError as x_validation:
        raise JSONValidation('JSON validation error on {} configuration: {}'.format(key, x_validation.message))
    except jsonschema.SchemaError as x_schema:
        raise JSONValidation('JSON schema error on {} specification: {}'.format(key, x_schema.message))
31856
def custom_conf(self, conf):
        ''''''
        if conf:
            for (key, val) in conf.items():
                self.__conf[key] = val
        return self