create constants for simple access to certain configuration settings
423465
public function createConst() {

		$properties = get_object_vars($this);

		if(isset($properties['db'])) {
			foreach($properties['db'] as $k => $v) {
				if(is_scalar($v)) {
					$k = strtoupper($k);
					if(!defined("DB$k")) { define("DB$k", $v); }
				}
			}
		}

		if(isset($properties['site'])) {
			foreach($properties['site'] as $k => $v) {
				if(is_scalar($v)) {
					$k = strtoupper($k);
					if(!defined($k)) { define($k, $v); }
				}
			}
		}

		if(isset($properties['paths'])) {
			foreach($properties['paths'] as $k => $v) {
				$k = strtoupper($k);
				if(!defined($k)) { define($k, $v['subdir']); }
			}
		}

		$locale = localeconv();

		foreach($locale as $k => $v) {
			$k = strtoupper($k);
			if(!defined($k) && !is_array($v)) { define($k, $v); }
		}
	}
525202
function createEasyAccess() {
  var userConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  var conf = Object.assign({}, defaultConfig, userConfig);
  return function (store) {
    generateSetterModules(store, conf);

    store[conf.setter] = function (path, payload) {
      return defaultSetter(path, payload, store, conf);
    };

    store[conf.getter] = function (path) {
      return defaultGetter(path, store);
    };

    store[conf.deletor] = function (path, payload) {
      return defaultDeletor(path, payload, store, conf);
    };
  };
}
386779
def DEFINE_constant_string(self, name, default, help):
    """"""
    self.AddOption(
        type_info.String(name=name, default=default or "", description=help),
        constant=True)
398410
def _prepare_settings(pspath, settings):
    '''
    
    '''
    prepared_settings = []
    for setting in settings:
        match = re.search(r'Collection\[(\{.*\})\]', setting['name'])
        if match:
            name = setting['name'][:match.start(1)-1]
            match_dict = yaml.load(match.group(1))
            index = _collection_match_to_index(pspath, setting['filter'], name, match_dict)
            if index != -1:
                setting['name'] = setting['name'].replace(match.group(1), str(index))
                prepared_settings.append(setting)
        else:
            prepared_settings.append(setting)
    return prepared_settings
96236
def getConstant(name):
    '''
    
    '''

    # We instantiate a manager for our global preferences
    if 'dynamic_preferences_globalpreferencemodel' in connection.introspection.table_names() and not isPreliminaryRun():
        params = global_preferences_registry.manager()
        try:
            return params.get(name)
        except NotFoundInRegistry as e:
            logger.error('Error in getting constant: %s' % e)
            return None
31856
def custom_conf(self, conf):
        ''''''
        if conf:
            for (key, val) in conf.items():
                self.__conf[key] = val
        return self
1230150
def get_all_constants():
    
    return filter(
        lambda key: key.upper() == key and type(globals()[key]) in _ALLOWED,

        filter(                               # filter _PRIVATE variables
            lambda x: not x.startswith("_"),
            globals()
        )
    )
960690
def get_settings(all,key):
    """"""
    with Database("settings") as s:
        if all:
            for k, v in zip(list(s.keys()), list(s.values())):
                print("{} = {}".format(k, v))
        elif key:
            print("{} = {}".format(key, s[key]))
        else:
            print("Don't know what you want? Try --all")
1102638
def constants_from_value(data=@value)
      data.scan(escape_pattern).flatten.collect { |value| value.strip }
    end
1251298
function initConfig(conf) {
  const result = Object.assign({}, conf);
  if (conf.filename) {
    result.filepath = path.dirname(conf.filename);
  }
  return result;
}
162157
def cli(env):
    """"""

    settings = config.get_settings_from_client(env.client)
    env.fout(config.config_table(settings))
183656
def _encode_config(conf_dict):
    """"""
    out = []

    # get variables in order defined in settings._ALLOWED_MERGES
    for var in settings._ALLOWED_MERGES:
        out.append(conf_dict[var])

    # convert bools to chars
    out = map(
        lambda x: "t" if x else "f",
        out
    )

    return "".join(out)
819727
function variables(root, config, done) {
  var expression = /\$v\[(.+?)\]/g;
  each(Object.keys(root), function(key, next) {
    var value = root[key];
    if (typeof value === 'object') return variables(value, config, next);
    if (typeof value !== 'string') return next();
    root[key] = value.replace(expression, function(match, matchKey) {
      return config[matchKey] || match;
    });
    next();
  }, done);
}
1119519
def init_config(self, app):
        """"""
        app.config.setdefault(
            'LOGGING_FS_LEVEL',
            'DEBUG' if app.debug else 'WARNING'
        )
        for k in dir(config):
            if k.startswith('LOGGING_FS'):
                app.config.setdefault(k, getattr(config, k))

        # Support injecting instance path and/or sys.prefix
        if app.config['LOGGING_FS_LOGFILE'] is not None:
            app.config['LOGGING_FS_LOGFILE'] = \
                app.config['LOGGING_FS_LOGFILE'].format(
                    instance_path=app.instance_path,
                    sys_prefix=sys.prefix,
                )
39718
def setup_config(command, filename, section, vars):
    """"""
    confuri = "config:" + filename
    if ":" in section:
        confuri += "#" + section.rsplit(":", 1)[-1]
    conf = appconfig(confuri)

    load_environment(conf.global_conf, conf.local_conf)
991543
def _build_config_tree(name, configuration):
    '''
    
    '''
    type_, id_, options = _get_type_id_options(name, configuration)
    global _INDENT, _current_statement
    _INDENT = ''
    if type_ == 'config':
        _current_statement = GivenStatement(options)
    elif type_ == 'log':
        _current_statement = UnnamedStatement(type='log')
        _parse_log_statement(options)
    else:
        if _is_statement_unnamed(type_):
            _current_statement = UnnamedStatement(type=type_)
        else:
            _current_statement = NamedStatement(type=type_, id=id_)
        _parse_statement(options)
1061192
def config():
    ''''''
    if hasattr(current_app, 'settings_file'):
        log.info('Loaded configuration from %s', current_app.settings_file)

    log.info(white('Current configuration'))
    for key in sorted(current_app.config):
        if key.startswith('__') or not key.isupper():
            continue
        echo('{0}: {1}'.format(white(key), current_app.config[key]))