Initialize Git user config file.

    :param kwargs: key/value pairs are stored in the git user config file.
342608
def user_config(**kwargs):
    
    for kw in kwargs:
        git('config --global user.%s "%s"' %(kw, kwargs.get(kw))).wait()
819929
def _init_kws(self):
        """"""
        # Return user-specified GO formatting, if specfied:
        if 'fmtgo' not in self.kws:
            self.kws['fmtgo'] = self.grprdflt.gosubdag.prt_attr['fmt'] + "\n"
        if 'fmtgo2' not in self.kws:
            self.kws['fmtgo2'] = self.grprdflt.gosubdag.prt_attr['fmt'] + "\n"
        if 'fmtgene' not in self.kws:
            if 'itemid2name' not in self.kws:
                self.kws['fmtgene'] = "{AART} {ID}\n"
            else:
                self.kws['fmtgene'] = "{AART} {ID} {NAME}\n"
        if 'fmtgene2' not in self.kws:
            self.kws['fmtgene2'] = self.kws['fmtgene']
1004715
def set_defaults(defaults, kwargs):
    
    for key, value in defaults.items():
        if key not in kwargs and value is not None:
            kwargs[key] = value
        elif isinstance(value, list) and isinstance(kwargs[key], list):
            kwargs[key] = list(value) + kwargs[key]
        elif isinstance(value, dict) and isinstance(kwargs[key], dict):
            set_defaults(value, kwargs[key])
        elif key in kwargs and value is None:
            kwargs[key] = None
627100
def wrap_args_kwargs_to_initdict(init_args_kwargs_fn: InitArgsKwargsFnType,
                                 typename: str,
                                 check_result: bool = True) \
        -> InstanceToInitDictFnType:
    
    def wrapper(obj: Instance) -> InitDict:
        result = init_args_kwargs_fn(obj)
        if check_result:
            if (not isinstance(result, tuple) or
                    not len(result) == 2 or
                    not isinstance(result[0], list) or
                    not isinstance(result[1], dict)):
                raise ValueError(
                    "Class {} failed to provide an (args, kwargs) tuple and "
                    "provided instead: {}".format(typename, repr(result)))
        return args_kwargs_to_initdict(*result)

    return wrapper
1293833
def init(plugin_manager, _, _2, config):
    
    submission_git_saver = SubmissionGitSaver(plugin_manager, config)
    submission_git_saver.daemon = True
    submission_git_saver.start()
792955
def init_config(self, app):
        
        config_apps = ['REST_', 'CORS_', ]
        for k in dir(config):
            if any([k.startswith(prefix) for prefix in config_apps]):
                app.config.setdefault(k, getattr(config, k))
972293
def init_config
      unless instance_variable_defined? :@hatt_configuration
        @hatt_configuration = TCFG::Base.new

        # build up some default configuration
        @hatt_configuration.tcfg_set 'hatt_services', {}
        @hatt_configuration.tcfg_set 'hatt_globs', DEFAULT_HATT_GLOBS

        @hatt_configuration.tcfg_set_env_var_prefix 'HATT_'
      end

      if hatt_config_file_path
        # if a config file was specified, we assume it exists
        @hatt_configuration.tcfg_config_file hatt_config_file_path
      else
        Log.warn 'No configuration file specified or found. Make a hatt.yml file and point hatt at it.'
      end
      @hatt_configuration.tcfg_set 'hatt_config_file', hatt_config_file_path

      normalize_services_config @hatt_configuration

      nil
    end
1215651
def init_config(args):
    
    os.environ["AUTOMLBOARD_LOGDIR"] = args.logdir
    os.environ["AUTOMLBOARD_LOGLEVEL"] = args.log_level
    os.environ["AUTOMLBOARD_RELOAD_INTERVAL"] = str(args.reload_interval)

    if args.db:
        try:
            db_address_reg = re.compile(r"(.*)://(.*):(.*)@(.*):(.*)/(.*)")
            match = re.match(db_address_reg, args.db_address)
            os.environ["AUTOMLBOARD_DB_ENGINE"] = match.group(1)
            os.environ["AUTOMLBOARD_DB_USER"] = match.group(2)
            os.environ["AUTOMLBOARD_DB_PASSWORD"] = match.group(3)
            os.environ["AUTOMLBOARD_DB_HOST"] = match.group(4)
            os.environ["AUTOMLBOARD_DB_PORT"] = match.group(5)
            os.environ["AUTOMLBOARD_DB_NAME"] = match.group(6)
            logger.info("Using %s as the database backend." % match.group(1))
        except BaseException as e:
            raise DatabaseError(e)
    else:
        logger.info("Using sqlite3 as the database backend, "
                    "information will be stored in automlboard.db")

    os.environ.setdefault("DJANGO_SETTINGS_MODULE",
                          "ray.tune.automlboard.settings")
    django.setup()
    command = [os.path.join(root_path, "manage.py"), "migrate", "--run-syncdb"]
    execute_from_command_line(command)
665934
def init_config!(config)
      set_internal_config!(config)
      config.each do |(directory, git_repos)|
        git_repos.each do |git_repo|
          git_repo         = git_repo.include?("github.com") ? git_repo : "https://github.com/#{git_repo}.git"
          repo_name        = name_from_git_repo(git_repo)
          repo_path        = File.join(repo_directory_path, directory, repo_name)
          if repos.key? repo_name
            puts "  warning duplicate repo found: #{repo_name.inspect}"
            repos[repo_name] = false
          else
            repos[repo_name] = repo_path
          end
          dirs[repo_path]  = git_repo
        end
      end
    end
376187
def init_remotes(self, remotes, per_remote_overrides=(),
                     per_remote_only=PER_REMOTE_ONLY,
                     global_only=GLOBAL_ONLY):
        '''
        
        '''
        # The global versions of the auth params (gitfs_user,
        # gitfs_password, etc.) default to empty strings. If any of them
        # are defined and the provider is not one that supports auth, then
        # error out and do not proceed.
        override_params = copy.deepcopy(per_remote_overrides)
        global_auth_params = [
            '{0}_{1}'.format(self.role, x) for x in AUTH_PARAMS
            if self.opts['{0}_{1}'.format(self.role, x)]
        ]
        if self.provider in AUTH_PROVIDERS:
            override_params += AUTH_PARAMS
        elif global_auth_params:
            msg = (
                '{0} authentication was configured, but the \'{1}\' '
                '{0}_provider does not support authentication. The '
                'providers for which authentication is supported in {0} '
                'are: {2}.'.format(
                    self.role, self.provider, ', '.join(AUTH_PROVIDERS)
                )
            )
            if self.role == 'gitfs':
                msg += (
                    ' See the GitFS Walkthrough in the Salt documentation '
                    'for further information.'
                )
            log.critical(msg)
            failhard(self.role)

        per_remote_defaults = {}
        global_values = set(override_params)
        global_values.update(set(global_only))
        for param in global_values:
            key = '{0}_{1}'.format(self.role, param)
            if key not in self.opts:
                log.critical(
                    'Key \'%s\' not present in global configuration. This is '
                    'a bug, please report it.', key
                )
                failhard(self.role)
            per_remote_defaults[param] = enforce_types(key, self.opts[key])

        self.remotes = []
        for remote in remotes:
            repo_obj = self.git_providers[self.provider](
                self.opts,
                remote,
                per_remote_defaults,
                per_remote_only,
                override_params,
                self.cache_root,
                self.role
            )
            if hasattr(repo_obj, 'repo'):
                # Sanity check and assign the credential parameter
                repo_obj.verify_auth()
                repo_obj.setup_callbacks()
                if self.opts['__role'] == 'minion' and repo_obj.new:
                    # Perform initial fetch on masterless minion
                    repo_obj.fetch()

                # Reverse map to be used when running envs() to detect the
                # available envs.
                repo_obj.saltenv_revmap = {}

                for saltenv, saltenv_conf in six.iteritems(repo_obj.saltenv):
                    if 'ref' in saltenv_conf:
                        ref = saltenv_conf['ref']
                        repo_obj.saltenv_revmap.setdefault(
                            ref, []).append(saltenv)

                        if saltenv == 'base':
                            # Remove redundant 'ref' config for base saltenv
                            repo_obj.saltenv[saltenv].pop('ref')
                            if ref != repo_obj.base:
                                log.warning(
                                    'The \'base\' environment has been '
                                    'defined in the \'saltenv\' param for %s '
                                    'remote %s and will override the '
                                    'branch/tag specified by %s_base (or a '
                                    'per-remote \'base\' parameter).',
                                    self.role, repo_obj.id, self.role
                                )
                                # Rewrite 'base' config param
                                repo_obj.base = ref

                # Build list of all envs defined by ref mappings in the
                # per-remote 'saltenv' param. We won't add any matching envs
                # from the global saltenv map to the revmap.
                all_envs = []
                for env_names in six.itervalues(repo_obj.saltenv_revmap):
                    all_envs.extend(env_names)

                # Add the global saltenv map to the reverse map, skipping envs
                # explicitly mapped in the per-remote 'saltenv' param.
                for key, conf in six.iteritems(repo_obj.global_saltenv):
                    if key not in all_envs and 'ref' in conf:
                        repo_obj.saltenv_revmap.setdefault(
                            conf['ref'], []).append(key)

                self.remotes.append(repo_obj)

        # Don't allow collisions in cachedir naming
        cachedir_map = {}
        for repo in self.remotes:
            cachedir_map.setdefault(repo.cachedir, []).append(repo.id)

        collisions = [x for x in cachedir_map if len(cachedir_map[x]) > 1]
        if collisions:
            for dirname in collisions:
                log.critical(
                    'The following %s remotes have conflicting cachedirs: '
                    '%s. Resolve this using a per-remote parameter called '
                    '\'name\'.', self.role, ', '.join(cachedir_map[dirname])
                )
                failhard(self.role)

        if any(x.new for x in self.remotes):
            self.write_remote_map()
136906
def prepare_args(self, args, kwargs):
        
        args, kwargs = super().prepare_args(args, kwargs)
        form_kwargs = self.get_form_kwargs()
        self.form = self.Form(**form_kwargs)
        return args, kwargs
356991
def init(self, args=None):
        """"""
        from .logs import exception

        self._setup_user_dir()
        self._init_settings_file()

        try:
            self.update(self._settings_from_file())
        except Exception:
            exception("Can't load settings from file", sys.exc_info())

        try:
            self.update(self._settings_from_env())
        except Exception:
            exception("Can't load settings from env", sys.exc_info())

        self.update(self._settings_from_args(args))
996000
def init_config_file_path_if_empty(self):
        

        if os.path.exists(self.cfg_directory_path):
            return

        user_choice = 'n'
        if self.no_confirm:
            user_choice = 'y'
        else:
            sys.stdout.write(
                "Config directory does not exist at '" + os.path.abspath(self.cfg_directory_path) + "'. "
                + "Should a default configuration be created at this path? [Y/n] ")
            if sys.version_info[0] < 3:
                user_choice = raw_input()
            else:
                user_choice = input()
            user_choice = user_choice.lower().replace("yes", "y").replace("no", "n")

        if not user_choice or user_choice == '':  # the default is yes
            user_choice = "y"
        if "y" not in user_choice and "n" not in user_choice:
            sys.stderr.write("Wrong input, aborting.")
            sys.exit(1)
        if "n" in user_choice:
            sys.stdout.write("Config file will not be created. Terminating.")
            sys.exit(1)

        # copy the default config file to the new path
        copy_tree(os.environ['CColon'] + os.path.sep + 'config', self.cfg_directory_path)
        return
39982
def setup(self, **kwargs):
        

        for key in kwargs:
            if key not in self.config.keys():
                raise error.GrabMisuseError('Unknown option: %s' % key)

        if 'url' in kwargs:
            if self.config.get('url'):
                kwargs['url'] = self.make_url_absolute(kwargs['url'])
        self.config.update(kwargs)
587914
def init_config(self, app):
        
        try:
            pkg_resources.get_distribution('celery')
            app.config.setdefault(
                "ACCOUNTS_USE_CELERY", not (app.debug or app.testing))
        except pkg_resources.DistributionNotFound:  # pragma: no cover
            app.config.setdefault("ACCOUNTS_USE_CELERY", False)

        # Register Invenio legacy password hashing
        register_crypt_handler(InvenioAesEncryptedEmail)

        # Change Flask defaults
        app.config.setdefault(
            'SESSION_COOKIE_SECURE',
            not app.debug
        )

        # Change Flask-Security defaults
        app.config.setdefault(
            'SECURITY_PASSWORD_SALT',
            app.config['SECRET_KEY']
        )

        # Set JWT secret key
        app.config.setdefault(
            'ACCOUNTS_JWT_SECRET_KEY',
            app.config.get(
                'ACCOUNTS_JWT_SECRET_KEY',
                app.config.get('SECRET_KEY')
            )
        )

        config_apps = ['ACCOUNTS', 'SECURITY_']
        for k in dir(config):
            if any([k.startswith(prefix) for prefix in config_apps]):
                app.config.setdefault(k, getattr(config, k))

        # Set Session KV store
        if app.config.get('ACCOUNTS_SESSION_REDIS_URL'):
            import redis
            from simplekv.memory.redisstore import RedisStore

            session_kvstore = RedisStore(redis.StrictRedis.from_url(
                app.config['ACCOUNTS_SESSION_REDIS_URL']))
        else:
            from simplekv.memory import DictStore

            session_kvstore = DictStore()

        self.kvsession_extension = KVSessionExtension(
            session_kvstore, app)
943809
def setKWARGS(self, **kwargs):
        
        for key in list(kwargs.keys()):
            #try:
            f = getattr(self,'set_' + key)
            f(kwargs[key])
577918
function _config(args) {
  var opts = {};

  if(args.removeExtraneous){
    opts.removeExtraneous = true;
  }

  if (args.bitbucketAuthUser || args.bitbucketAuthPass) {
    opts.bitbucket = {
      authUser: args.bitbucketAuthUser,
      authPass: args.bitbucketAuthPass
    };

  } else if (args.githubUser || args.githubOrg || args.githubAuthUser || args.githubAuthPass) {
    opts.github = {
      user    : args.githubUser,
      org     : args.githubOrg,
      authUser: args.githubAuthUser,
      authPass: args.githubAuthPass,
      useSsh : args.githubUseSsh
    };

  } else if (args.gitoriousUrl || args.gitoriousProject) {
    opts.gitorious = {
      url    : args.gitoriousUrl,
      project: args.gitoriousProject
    };

  } else if (args.local) {
    opts.local = {
      dir: process.cwd()
    };
  }

  new Repoman().config(opts, bag.exit);
}