Ensure configuration has the correct properties.
179238
function loadConfig(config, props) {
  // The calling module's path. Unfortunately, because modules are cached,
  // module.parent is the FIRST calling module parent, not necessarily the
  // current one.
  var callerPath = path.dirname(stackTrace.get(loadConfig)[1].getFileName());

  // If no config defined, resolve to nearest package.json to the calling lib. If not found, throw an error.
  if (config == null) {
    config = findup('package.json', {cwd: callerPath});
    if (config == null) {
      throw new Error('No package.json found.');
    }
  }
  // If filename was specified with no path parts, make the path absolute so
  // that resolve doesn't look in node_module directories for it.
  else if (typeof config === 'string' && !/[\\\/]/.test(config)) {
    config = path.join(callerPath, config);
  }

  // If package is a string, try to require it.
  if (typeof config === 'string') {
    config = require(resolve(config, {basedir: callerPath}));
  }

  // If config is not an object yet, something is amiss.
  if (typeof config !== 'object') {
    throw new Error('Invalid configuration specified.');
  }

  // For all specified props, populate result object.
  var result = {};
  props.forEach(function(prop) {
    result[prop] = config[prop] ? Object.keys(config[prop]) : [];
  });
  return result;
}
320208
def _validate_allowed_settings(self, application_id, application_config, allowed_settings):
		""""""

		for setting_key in application_config.keys():
			if setting_key not in allowed_settings:
				raise ImproperlyConfigured(
					"Platform {}, app {} does not support the setting: {}.".format(
						application_config["PLATFORM"], application_id, setting_key
					)
				)
1088825
function checkConfig(config) {
  let requiredProps = ['algorithm', 'format'];
  const errMsg = `Configuration isn't an object with the required properties: ${requiredProps.join(', ')}`;

  if ((!config) || (typeof config !== 'object')) {
    throw new Error(errMsg);
  }

  requiredProps.forEach(p => {
    if (!config[p]) {
      throw new Error(errMsg);
    }
  });
}
443285
function checkConfiguration(conf) {
    let failedChecks = 0;

    for (const path of Object.keys(CHECKS)) {
        // @todo avoid try..catch
        try {
            checkProperty(path, get(conf, path), CHECKS[path]);
        } catch (error) {
            LusterConfigurationError.ensureError(error).log();
            ++failedChecks;
        }
    }

    return failedChecks;
}
519678
def _is_already_configured(configuration_details):
    """"""
    path = Path(configuration_details.path).expanduser()
    with path.open('r') as shell_config:
        return configuration_details.content in shell_config.read()
1194804
def _check_config():
    """"""
    config.CONFIG_DIR.mkdir(parents=True, exist_ok=True)
    verfile = config.CONFIG_DIR / '.version'
    uptodate = verfile.is_file() and verfile.read_text() == __version__
    if not uptodate:
        verfile.write_text(__version__)
    if not (uptodate and config.CONFIG_FILE.is_file()):
        conf.create_config_(update=True)
    for stfile in ('stagpy-paper.mplstyle',
                   'stagpy-slides.mplstyle'):
        stfile_conf = config.CONFIG_DIR / stfile
        if not (uptodate and stfile_conf.is_file()):
            stfile_local = pathlib.Path(__file__).parent / stfile
            shutil.copy(str(stfile_local), str(stfile_conf))
949405
def validate(self):
        """"""
        missing = []
        for k, v in self._map.items():
            attr = getattr(self, k, False)
            if not attr or attr == CONFIG_PLACEHOLDER:
                missing.append(v)
        if missing:
            return "Missing or invalid config values: {}".format(
                ", ".join(sorted(missing))
            )
377938
def check_config(data):
    

    is_right = True

    if "title" not in data:
        logging.error("No 'title' in _config.yml")
        is_right = False

    return is_right
943750
def config_sanity_check(self):
        
        if 'name' not in self.config:
            raise EventifyConfigError(
                """Required configuration parameter missing!
                Please configure "name" as a string in your
                configuration.""")

        if 'publish_topic' not in self.config:
            raise EventifyConfigError(
                """Required configuration parameter missing!
                Please configure "public_topic" as an object
                in your configuration.""")

        if 'topic' not in self.config['publish_topic']:
            raise EventifyConfigError(
                """Required configuration parameter missing!
                Please configure "topic" as a key in your
                "public_topic object.""")
1000769
def validate_config_parameters(config_json, allowed_keys, allowed_types):
    """"""
    custom_fields = config_json.get(defs.PARAMETERS, [])
    for field in custom_fields:
        validate_field(field, allowed_keys, allowed_types)
        default = field.get(defs.DEFAULT)
        field_type = field.get(defs.TYPE)
        if default:
            validate_field_matches_type(field[defs.VALUE], default, field_type)
300021
protected function ensureSettings() {
        if (!$this->fs->exists(Platform::webDir() . '/sites/default')) {
            $this->fs->mkdir(Platform::webDir() . '/sites/default', 0775);
        }
        else {
            // If building from an existing project, Drupal may have fiddled with
            // the permissions preventing us from writing.
            $this->fs->chmod(Platform::webDir() . '/sites/default', 0775);
        }
        $has_settings = $this->fs->exists(Platform::webDir() . '/sites/default/settings.php');
        if ($has_settings) {
            $this->fs->chmod(Platform::webDir() . '/sites/default/settings.php', 0664);
        }

        switch ($this->version) {
            case DrupalStackHelper::DRUPAL7:
                if (!$has_settings) {
                    $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal7/settings.php', Platform::webDir() . '/sites/default/settings.php', true);
                }
                break;
            case DrupalStackHelper::DRUPAL8:
                if (!$has_settings) {
                    $this->fs->copy(CLI_ROOT . '/resources/stacks/drupal8/settings.php', Platform::webDir() . '/sites/default/settings.php', true);
                }
                $this->fs->mkdir([
                  Platform::sharedDir() . '/config',
                  Platform::sharedDir() . '/config/active',
                  Platform::sharedDir() . '/config/staging',
                ]);
                break;
            default:
                throw new \Exception('Unsupported version of Drupal. Write a pull reuqest!');
        }
    }
712350
def validate(config):
    '''
    
    '''

    VALID_ITEMS = [
        'type', 'bytes_sent', 'bytes_recv', 'packets_sent',
        'packets_recv', 'errin', 'errout', 'dropin',
        'dropout'
    ]

    # Configuration for load beacon should be a list of dicts
    if not isinstance(config, list):
        return False, ('Configuration for network_info beacon must be a list.')
    else:

        _config = {}
        list(map(_config.update, config))

        for item in _config.get('interfaces', {}):
            if not isinstance(_config['interfaces'][item], dict):
                return False, ('Configuration for network_info beacon must '
                               'be a list of dictionaries.')
            else:
                if not any(j in VALID_ITEMS for j in _config['interfaces'][item]):
                    return False, ('Invalid configuration item in '
                                   'Beacon configuration.')
    return True, 'Valid beacon configuration'
762644
def ensure_compatible(left, right):
    """"""
    conflicts = list(conflicting_pairs(left, right))
    if conflicts:
        raise ValueError('conflicting values for object/property pairs: %r' % conflicts)
1047912
def _handle_config(self, data):
        """"""

        self.room.config.update(data)
        self.conn.enqueue_data("config", data)
1105439
function(config) {
			if (initialized) {
				error(new Error('Cannot set global configuration after application initialization'));
				return;
			}

			for (var prop in config) {
				if (config.hasOwnProperty(prop)) {
					globalConfig[prop] = config[prop];
				}
			}
		}
435203
def configure_properties(self, tc_config_prop_filenames=None, behave_properties=None):
        
        prop_filenames = DriverWrappersPool.get_configured_value('Config_prop_filenames', tc_config_prop_filenames,
                                                                 'properties.cfg;local-properties.cfg')
        prop_filenames = [os.path.join(DriverWrappersPool.config_directory, filename) for filename in
                          prop_filenames.split(';')]
        prop_filenames = ';'.join(prop_filenames)

        # Configure config only if properties filename has changed
        if self.config_properties_filenames != prop_filenames:
            # Initialize the config object
            self.config = ExtendedConfigParser.get_config_from_file(prop_filenames)
            self.config_properties_filenames = prop_filenames

        # Override properties with system properties
        self.config.update_properties(os.environ)

        # Override properties with behave userdata properties
        if behave_properties:
            self.config.update_properties(behave_properties)
222126
def _validate_config(config):
    
    required_keys = [KEY_ADDRESS, KEY_MODEL, KEY_PORT, KEY_PATHS]
    for key in required_keys:
        if key not in config:
            raise Error("Required key %s missing from config %s",
                        (key, config))