build the config by expanding all the variables
961569
public static Config loadConfig(
      String cluster,
      String role,
      String environ,
      String topologyBinaryFile,
      String topologyDefnFile,
      Boolean verbose,
      TopologyAPI.Topology topology) {

    return Config.toClusterMode(
        Config.newBuilder()
            .putAll(ConfigLoader.loadClusterConfig())
            .putAll(commandLineConfigs(cluster, role, environ, verbose))
            .putAll(topologyConfigs(topologyBinaryFile, topologyDefnFile, topology))
            .build());
  }
845268
function config (args) {
    // make sure extension has .
    if (args && typeof args.ext === 'string' && args.ext.charAt(0) !== '.') {
        args.ext = '.'+args.ext
    }
    // merge config to global config
    mergeArgs(GLOBAL, args)
    // create regular expression for matching extension
    GLOBAL.extRegExp = new RegExp('\\'+GLOBAL.ext+'$')
    // return config
    return GLOBAL
}
653281
def list_config_variables(self, offset):
        """"""

        names = sorted(self._config_variables)
        names = names[offset:offset + 9]
        count = len(names)

        if len(names) < 9:
            names += [0]*(9 - count)

        return [count] + names
123670
def add(config = {})
      config.each do |key, value|
        define_setting key.to_sym, value
      end
    end
1277145
def edit
    @config_var = ConfigVar.where(name: params[:name]).first
    unless @config_var
      @config_var = ConfigVar.new name: params[:name]
      if descriptor = ConfigvarsRails.variable_descriptor(params[:name])
        @config_var.value = descriptor.default_value
      end
    end
  end
560637
def expand_system_vars(data):
    """"""
    def _expanded(value):
        if isinstance(value, basestring):
            value = expandvars(value)
            value = expanduser(value)
            return scoped_format(value, system=system)
        elif isinstance(value, (list, tuple, set)):
            return [_expanded(x) for x in value]
        elif isinstance(value, dict):
            return dict((k, _expanded(v)) for k, v in value.iteritems())
        else:
            return value
    return _expanded(data)
578941
def expand(directory: str) -> str:
    """"""
    temp1 = os.path.expanduser(directory)
    return os.path.expandvars(temp1)
342438
def expand_variables(self, variables):
        
        # format string values returns a copy
        updated = utils.format_string_values(self.data, **variables)

        # Several keys should only be expanded at runtime, perserve them.
        if 'member-role' in updated.get('mode', {}):
            updated['mode']['member-role'] = self.data['mode']['member-role']

        # Update ourselves in place
        self.data = updated
        # Reload filters/actions using updated data, we keep a reference
        # for some compatiblity preservation work.
        m = self.resource_manager
        self.resource_manager = self.load_resource_manager()

        # XXX: Compatiblity hack
        # Preserve notify action subject lines which support
        # embedded jinja2 as a passthrough to the mailer.
        for old_a, new_a in zip(m.actions, self.resource_manager.actions):
            if old_a.type == 'notify' and 'subject' in old_a.data:
                new_a.data['subject'] = old_a.data['subject']
1327970
def set_config_variables(repo, variables):
    
    with repo.config_writer() as writer:
        for k, value in variables.items():
            section, option = k.split('.')
            writer.set_value(section, option, value)
        writer.release()
1045988
def build_config(ctx, target, config_path, c, extra_path, ignore, verbose, silent, debug):
    
    config_builder = LintConfigBuilder()
    try:
        # Config precedence:
        # First, load default config or config from configfile
        if config_path:
            config_builder.set_from_config_file(config_path)
        elif os.path.exists(DEFAULT_CONFIG_FILE):
            config_builder.set_from_config_file(DEFAULT_CONFIG_FILE)

        # Then process any commandline configuration flags
        config_builder.set_config_from_string_list(c)

        # Finally, overwrite with any convenience commandline flags
        if ignore:
            config_builder.set_option('general', 'ignore', ignore)
        if silent:
            config_builder.set_option('general', 'verbosity', 0)
        elif verbose > 0:
            config_builder.set_option('general', 'verbosity', verbose)

        if extra_path:
            config_builder.set_option('general', 'extra-path', extra_path)

        if target:
            config_builder.set_option('general', 'target', target)

        if debug:
            config_builder.set_option('general', 'debug', debug)

        config = config_builder.build()

        return config, config_builder
    except LintConfigError as e:
        click.echo(u"Config Error: {0}".format(ustr(e)))
    ctx.exit(CONFIG_ERROR_CODE)
525630
private function buildVariableDefinitions() {
        foreach($this->getFields() as $field) {
            $variable = new Object\Variable();
            $variable->setName($field->getShortName());
            $variable->setAccess('protected');
            $variable->setAutoIncrementing($field->isAutoIncrementing());
            $variable->setDescription($field->getDescription());
            $variable->setLength($field->getLength());
            $variable->setNullable($field->isNullable());
            $variable->setPrimary($field->isPrimary());
            $variable->setType($field->getType());
            $this->getAbstractClass()->addVariable($variable);
        }
    }
759582
function buildOnce(config) {
  // verify config
  if (!lintConfig(config)) throw new Error('invalid config')

  // set default holder
  if (!config.holder) {
    config.holder = { name: 'app', stub: 'epii' }
  }

  // prepare static dir
  shell.mkdir('-p', config.$path.target.client)
  shell.mkdir('-p', config.$path.target.vendor)

  // process source
  pureRecipe(config, CONTEXT)
  viewRecipe(config, CONTEXT)
  sassRecipe(config, CONTEXT)
  fileRecipe(config, CONTEXT)
}
373824
def expandvars(path):
    

    path = path2fsn(path)

    def repl_func(match):
        return environ.get(match.group(1), match.group(0))

    path = re.compile(r"\$(\w+)", flags=re.UNICODE).sub(repl_func, path)
    if os.name == "nt":
        path = re.sub(r"%([^%]+)%", repl_func, path)
    return re.sub(r"\$\{([^\}]+)\}", repl_func, path)
1338239
def expand_defaults(self, client=False, getenv=True, getshell=True):
        
        if not isinstance(self._default, six.string_types):
            self.expanded_default = self._default
        else:
            self.expanded_default = coerce(self.type, expand_defaults(
                self._default, client, getenv, getshell))
185714
def _expand_var(self, in_string, available_variables):
        
        instances = self._get_instances(in_string)
        for instance in instances:
            for name, value in available_variables.items():
                variable_string = self._get_variable_string(name)
                if instance == variable_string:
                    in_string = in_string.replace(variable_string, value)
        return in_string
973974
function Config() {
  this.options = {
    global: global,
    stackLimit: Infinity,
    plugins: [],
    aliases: {},
    globals: {},
    tests: []
  };
}
1023463
def add(self, variables: Dict[str, str], overwrite: bool=False):
        
        preset_variables = self._project.variables.list()
        preset_variable_keys = [variable.key for variable in preset_variables]

        for key, value in variables.items():
            if key in preset_variable_keys:
                if overwrite:
                    variable = preset_variables[preset_variable_keys.index(key)]
                    variable.value = value
                    variable.save()
            else:
                variable = self._project.variables.create({
                    _VARIABLE_KEY_PROPERTY: key, _VARIABLE_VALUE_PROPERTY: value})
                variable.save()