A helper function which joins click.option functions of each parameter from config.json
765393
def _config_options(func):
    
    for param in SHConfig().get_params()[-1::-1]:
        func = click.option('--{}'.format(param), param,
                            help='Set new values to configuration parameter "{}"'.format(param))(func)
    return func
1140421
function ScriptHelper(opt) {

	// default configuration
	this.config = {
		'root': 		(module.parent) ? path.dirname(module.parent.filename) : __dirname,
		'macro':		'#include',
		'extension':	'lua',
		'encoding':		null
	};

	// if options are provided, set those options
	if (typeof opt === 'string') opt = {'root': opt};
	if (typeof opt === 'object') {
		for (var key in opt) {
			if (opt.hasOwnProperty(key) && typeof this.config[key] !== 'undefined') 
				this.config[key] = opt[key];
		}
	}

	// prepend a . before extension config value
	if (this.config.extension) {
		if (this.config.extension.substr(0, 1) !== '.') 
			this.config.extension = '.' + this.config.extension;
	} else { this.config.extension = ''; }

	// set internal vars
	this.clearCache();

}
724705
function mergeOptions(config, pass) {
      var _this = this;

      var result = loadConfig(config);

      var plugins = result.plugins.map(function (descriptor) {
        return loadPluginDescriptor(descriptor);
      });
      var presets = result.presets.map(function (descriptor) {
        return loadPresetDescriptor(descriptor);
      });

      if (config.options.passPerPreset != null && typeof config.options.passPerPreset !== "boolean") {
        throw new Error(".passPerPreset must be a boolean or undefined");
      }
      var passPerPreset = config.options.passPerPreset;
      pass = pass || this.passes[0];

      // resolve presets
      if (presets.length > 0) {
        var presetPasses = null;
        if (passPerPreset) {
          var _passes;

          presetPasses = presets.map(function () {
            return [];
          });
          // The passes are created in the same order as the preset list, but are inserted before any
          // existing additional passes.
          (_passes = this.passes).splice.apply(_passes, [1, 0].concat((0, _toConsumableArray3.default)(presetPasses)));
        }

        presets.forEach(function (presetConfig, i) {
          _this.mergeOptions(presetConfig, presetPasses ? presetPasses[i] : pass);
        });
      }

      // resolve plugins
      if (plugins.length > 0) {
        var _pass;

        (_pass = pass).unshift.apply(_pass, (0, _toConsumableArray3.default)(plugins));
      }

      (0, _merge2.default)(this.options, result.options);
    }
304391
function _createOptions(config) {
  return {
    filename:config.filename,
    displayErrors:true,
    timeout: config.timeout || 20*1000
  };
}
520197
def cmd_config_show(option, show_keys):
    

    habucfg = loadcfg()

    if not show_keys:
        for key in habucfg.keys():
            if 'KEY' in key:
                habucfg[key] = '*************'

    print(json.dumps(habucfg, indent=4, sort_keys=True, default=str))
7809
function mergeOptions(...opt){
        // extract default (last argument)
        const result = opt.pop();

        // try to find first match
        while (opt.length > 0){
            // extract first argument (priority)
            const o = opt.shift();

            // value set ?
            if (typeof o !== 'undefined' && o !== null){
                return o;
            }
        }

        return result;
    }
391356
function(configArg) {

      config = _.extend({}, defaults);
      events = {};

      _(configArg).forEach(function(val, key) {
        if (key === 'room' ||
            key === 'lobby') {
          events[key] = val;
        }
        else {
          config[key] = val;
        }
      });
    }
496892
def process_bind_param(self, value, dialect):
        """"""
        if value is not None:
            value = simplejson.dumps(value)
        return value
558872
function getOptions () {
  return {
    compress: ('compress' in program) ? program.compress : false,
    debug: ('debug' in program) ? program.debug : false,
    deploy: false,
    grep: ('grep' in program) ? program.grep : false,
    invert: ('invert' in program) ? program.invert : false,
    maps: ('maps' in program) ? program.maps : false,
    reload: ('reload' in program) ? program.reload : false,
    script: ('script' in program) ? program.script : false,
    serve: ('serve' in program) ? program.serve : false,
    watch: false
  };
}
1108289
function( json, params, callback ){
    var where = sql.parse( 'select * from foo where '+ params.where).where;

    var features = [];
    _.each(json.features, function(f){
      var props = f.attributes || f.properties;
      var param = where.conditions.left.value;
      var val = where.conditions.right.value;
      if ( ( this.whereOps[ where.conditions.operation ] && props[ param ] && this.whereOps[ where.conditions.operation ]( props[ param ], val ) ) || param == val ) {
        features.push( f );
      }
    }, this);
    json.features = features;

    delete params.where;
    // recycle the data + params through the filter fn
    this.filter( json, params, callback );
  }
941425
def configs_in(src_dir):
    """"""
    for filename in files_in_dir(src_dir, 'json'):
        with open(os.path.join(src_dir, filename), 'rb') as in_f:
            yield json.load(in_f)
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)
416109
def options(f):
    

    f = click.option('--config', envvar='VODKA_HOME', default=click.get_app_dir('vodka'), help="location of config file")(f)
    return f
505165
function mergeConf(env, conf, key, ENV, fn) {
  fetch(conf, key, function(err, layout) {
    if (err) return fn(err);

    fetch(layout, 'default', function(err, defaults) {
      if (err) return fn(err);

      debug('  default', defaults);
      merge(ENV, defaults);
      debug('    ', ENV);

      fetch(layout, env, function(err, envs) {
        if (err) return fn(err);

        debug('  ' + env, envs);
        merge(ENV, envs);
        debug('    ', ENV);

        fn();
      });
    });
  });
}
560232
function enrichConfigWithGitParams( config ) {
    const
        ORIGIN = "origin",
        ORIGIN_LENGTH = ORIGIN.length,
        FETCH = " (fetch)",
        FETCH_LENGTH = FETCH.length;

    if ( !config.repository || !config.repository.url ) {
        const remotes = ChildProcess.execSync( "git remote -v" ).toString();
        let origin = '';
        remotes.split( "\n" ).forEach( function forEachRemote( remote ) {
            if ( remote.substr( 0, ORIGIN_LENGTH ) === ORIGIN ) {
                const restOfLine = remote.substr( ORIGIN_LENGTH );
                if ( restOfLine.substr( -FETCH_LENGTH ) === FETCH ) {
                    origin = restOfLine.substr( 0, restOfLine.length - FETCH_LENGTH ).trim();
                }
            }
        } );
        config.repository = {
            type: "git",
            url: origin
        };
    }
}
543582
function params (options) {
  if (this.params) {
    var list = this.params.map(function (param) {
      var nameSplit = param.name.split('.')
      var name = nameSplit[nameSplit.length - 1]
      if (nameSplit.length > 1) name = '.' + name
      if (param.variable) name = '...' + name
      if (param.optional) name = '[' + name + ']'
      return {
        indent: '    '.repeat(nameSplit.length - 1),
        name: name,
        type: param.type,
        defaultvalue: param.defaultvalue,
        description: param.description
      }
    })
    return options.fn(list)
  }
}
996658
def config(config, skip_defaults):
    

    configurator = ClickConfigurator(
        vodka.plugin,
        skip_defaults=skip_defaults
    )

    configurator.configure(vodka.config.instance, vodka.config.InstanceHandler)

    try:
        dst = munge_config.parse_url(config)
    except ValueError:
        config = os.path.join(config, "config.yaml")
        dst = munge_config.parse_url(config)

    config_dir = os.path.dirname(config)
    if not os.path.exists(config_dir) and config_dir:
        os.makedirs(config_dir)

    dst.cls().dumpu(vodka.config.instance, dst.url.path)

    if configurator.action_required:
        click.echo("")
        click.echo("not all required values could be set by this script, please manually edit the config and set the following values")
        click.echo("")
        for item in configurator.action_required:
            click.echo("- %s" % item)
        click.echo("")

    click.echo("Config written to %s" % dst.url.path)