Set a local config array up according to
		defaults and main shutit configuration

		cfg_section - see __init__
177183
def __set_config(self, cfg_section):
		
		defaults = [
			'shutit.core.alerting.emailer.mailto', None,
			'shutit.core.alerting.emailer.mailfrom', 'angry@shutit.tk',
			'shutit.core.alerting.emailer.smtp_server', 'localhost',
			'shutit.core.alerting.emailer.smtp_port', 25,
			'shutit.core.alerting.emailer.use_tls', True,
			'shutit.core.alerting.emailer.send_mail', True,
			'shutit.core.alerting.emailer.subject', 'Shutit Report',
			'shutit.core.alerting.emailer.signature', '--Angry Shutit',
			'shutit.core.alerting.emailer.compress', True,
			'shutit.core.alerting.emailer.username', '',
			'shutit.core.alerting.emailer.password', '',
			'shutit.core.alerting.emailer.safe_mode', True,
			'shutit.core.alerting.emailer.maintainer','',
			'shutit.core.alerting.emailer.mailto_maintainer', True
		]

		for cfg_name, cfg_default in zip(defaults[0::2], defaults[1::2]):
			try:
				self.config[cfg_name] = self.shutit.cfg[cfg_section][cfg_name]
			except KeyError:
				if cfg_default is None:
					raise Exception(cfg_section + ' ' + cfg_name + ' must be set')
				else:
					self.config[cfg_name] = cfg_default

		# only send a mail to the module's maintainer if configured correctly
		if self.config['shutit.core.alerting.emailer.mailto_maintainer'] and \
			(self.config['shutit.core.alerting.emailer.maintainer'] == "" or \
			self.config['shutit.core.alerting.emailer.maintainer'] == self.config['shutit.core.alerting.emailer.mailto']):
			self.config['shutit.core.alerting.emailer.mailto_maintainer'] = False
			self.config['shutit.core.alerting.emailer.maintainer'] = ""
703165
def config(key, value, local=True):
    
    option = local and '--local' or ''
    run('config %s "%s" "%s"' % (option, key, value))
670631
def set_config_section(section_name, values, message = '')
      current_values = get_config_section(section_name)
      changes = generate_config_changes("$config[#{section_name.to_s.inspect}]", current_values, values)
      if changes&.any?
        if message.to_s.strip == ''
          message = "Updating #{section_name} section."
        end
        changes << "write_config(#{message.inspect});"

        exec(*changes)

        (changes.size - 1)
      else
        0
      end
    end
1212802
def reset_config_files():
    """"""
    print("*** Reset Spyder settings to defaults ***", file=STDERR)
    for fname in SAVED_CONFIG_FILES:
        cfg_fname = get_conf_path(fname)
        if osp.isfile(cfg_fname) or osp.islink(cfg_fname):
            os.remove(cfg_fname)
        elif osp.isdir(cfg_fname):
            shutil.rmtree(cfg_fname)
        else:
            continue
        print("removing:", cfg_fname, file=STDERR)
246064
def copy_globals(self, cfg):
        
        for name, setting in cfg.settings.items():
            csetting = self.settings.get(name)
            if (setting.is_global and csetting is not None and
                    not csetting.modified):
                csetting.set(setting.get())
522312
def init_config(app):
        """"""
        for k in dir(config):
            if k.startswith('CLASSIFIER_'):
                app.config.setdefault(k, getattr(config, k))
1170859
def run_configurations(callback, sections_reader):
    """"""
    base = dict(OPTIONS)
    sections = sections_reader()
    if sections is None:
        logger.info("Configuration not found in .ini files. "
                    "Running with default settings")
        recompile()
    elif sections == []:
        logger.info("Configuration does not match current runtime. "
                    "Exiting")
    results = []
    for section, options in sections:
        OPTIONS.clear()
        OPTIONS.update(base)
        OPTIONS.update(options)
        logger.debug("Running configuration from section \"%s\". OPTIONS: %r",
                     section, OPTIONS)
        results.append(callback())
    return results
704258
def set(config, section, opt, value):
        
        if section not in config.keys():
            config[section] = {}

        config[section][opt] = value
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,
                )
674585
def set_config(self, config, and_restart=False):
        
        assert isinstance(config, dict)
        self.post('config', data=config)
        if and_restart:
            self.restart()
748686
def init():
    """"""
    default_config_path = path.join(
        (os.environ.get('TLDR_CONFIG_DIR') or path.expanduser('~')),
        '.tldrrc')
    if path.exists(default_config_path):
        click.echo("There is already a config file exists, "
                   "skip initializing it.")
    else:
        repo_path = click.prompt("Input the tldr repo path(absolute path)")
        if not path.exists(repo_path):
            sys.exit("Repo path not exist, clone it first.")

        platform = click.prompt("Input your platform(linux, osx or sunos)")
        if platform not in ['linux', 'osx', 'sunos']:
            sys.exit("Platform should be in linux, osx or sunos.")

        colors = {
            "description": "blue",
            "usage": "green",
            "command": "cyan"
        }

        config = {
            "repo_directory": repo_path,
            "colors": colors,
            "platform": platform
        }
        with open(default_config_path, 'w') as f:
            f.write(yaml.safe_dump(config, default_flow_style=False))

        click.echo("Initializing the config file at {0}".format(
            default_config_path))
797801
def init_config(cls):
        
        try:
            # first load current conf and only overwrite needed params
            # we don't want to reset everything
            config_file = os.path.expanduser(cls.home_config)
            config = cls.load(config_file, 'global')
            cls._del('global', 'api.env')

            hidden_apikey = '%s...' % cls.get('api.key', '')[:6]
            apikey = click.prompt('Api key (xmlrpc)',
                                  default=hidden_apikey)
            if apikey == hidden_apikey:
                # if default value then use actual value not hidden one
                apikey = cls.get('api.key')
            env_choice = click.Choice(list(cls.apienvs.keys()))
            apienv = click.prompt('Environnment [production]/ote',
                                  default=cls.default_apienv,
                                  type=env_choice,
                                  show_default=False)
            sshkey = click.prompt('SSH keyfile',
                                  default='~/.ssh/id_rsa.pub')
            hidden_apikeyrest = '%s...' % cls.get('apirest.key', '')[:6]
            apikeyrest = click.prompt('Api key (REST)',
                                      default=hidden_apikeyrest)
            if apikeyrest == hidden_apikeyrest:
                # if default value then use actual value not hidden one
                apikeyrest = cls.get('apirest.key')

            config.update({
                'api': {'key': apikey,
                        'host': cls.apienvs[apienv]},
            })
            if apikeyrest:
                config.update({
                    'apirest': {'key': apikeyrest},
                })

            if sshkey is not None:
                sshkey_file = os.path.expanduser(sshkey)
                if os.path.exists(sshkey_file):
                    config['sshkey'] = [sshkey_file]

            directory = os.path.expanduser(os.path.dirname(config_file))
            if not os.path.exists(directory):
                mkpath(directory, 0o700)

            # save to disk
            cls.save(config_file, config)
            # load in memory
            cls.load(config_file, 'global')
        except (KeyboardInterrupt, click.exceptions.Abort):
            cls.echo('Aborted.')
            sys.exit(1)
66338
def init_config(self):
        """"""

        input_fpath = os.path.join(self.work_path, 'input.nml')

        input_nml = f90nml.read(input_fpath)

        if self.expt.counter == 0 or self.expt.repeat_run:
            input_type = 'n'
        else:
            input_type = 'r'
        input_nml['MOM_input_nml']['input_filename'] = input_type

        f90nml.write(input_nml, input_fpath, force=True)
243625
function initUserConfig ( config ) {

    var parsedConfig = {};

    if ( !config ) {
        return;
    }

    config = config.split( ";" );

    $.each( config, function ( index, item ) {

        item = item.split( ":" );
        parsedConfig[ item[ 0 ] ] = item[ 1 ];

    } );

    setUserConfig( parsedConfig );

}
1204543
def init(path = Dir.pwd, _options = {})
      # FIXME: for travis test: ensure the global git configurations
      # 'user.email' and 'user.name' are set
      [ 'user.name', 'user.email' ].each do |userconf|
        next unless MiniGit[userconf].nil?
        warn "The Git global configuration '#{userconf}' is not set so"
        warn "you should *seriously* consider setting them by running\n\t git config --global #{userconf} 'your_#{userconf.sub(/\./, '_')}'"
        default_val = ENV['USER']
        default_val += '@domain.org' if userconf =~ /email/
        warn "Now putting a default value '#{default_val}' you could change later on"
        run %(
                       git config --global #{userconf} "#{default_val}"
                  )
        #MiniGit[userconf] = default_val
      end
      exit_status = 1
      Dir.mkdir( path ) unless Dir.exist?( path )
      Dir.chdir( path ) do
        execute "git init" unless FalkorLib.config.debug
        exit_status = $?.to_i
      end
      # #puts "#init #{path}"
      # Dir.chdir( "#{path}" ) do
      #     %x[ pwd && git init ] unless FalkorLib.config.debug
      # end
      exit_status
    end
395739
public function load_config() {
        $cfg = [];
        require __DIR__ . '/defaults.php';
        if (file_exists($this->config_path)) {
            require $this->config_path;
        }
        $this->data = $cfg;
    }
328486
def global_config(cls, key, *args):
        '''  '''
        if args:
            cls.settings[key] = args[0]
        else:
            return cls.settings[key]