Create the CONAN_USER_HOME for this task fingerprint and initialize the Conan remotes.

    See https://docs.conan.io/en/latest/reference/commands/consumer/config.html#conan-config-install
    for docs on configuring remotes.
325860
def _conan_user_home(self, conan, in_workdir=False):
    
    # This argument is exposed so tests don't leak out of the workdir.
    if in_workdir:
      base_cache_dir = self.workdir
    else:
      base_cache_dir = get_pants_cachedir()
    user_home_base = os.path.join(base_cache_dir, 'conan-support', 'conan-user-home')
    # Locate the subdirectory of the pants shared cachedir specific to this task's option values.
    user_home = os.path.join(user_home_base, self.fingerprint)
    conan_install_base = os.path.join(user_home, '.conan')
    # Conan doesn't copy remotes.txt into the .conan subdir after the "config install" command, it
    # simply edits registry.json. However, it is valid to have this file there, and Conan won't
    # touch it, so we use its presence to detect whether we have appropriately initialized the
    # Conan installation.
    remotes_txt_sentinel = os.path.join(conan_install_base, 'remotes.txt')
    if not os.path.isfile(remotes_txt_sentinel):
      safe_mkdir(conan_install_base)
      # Conan doesn't consume the remotes.txt file just by being in the conan directory -- we need
      # to create another directory containing any selection of files detailed in
      # https://docs.conan.io/en/latest/reference/commands/consumer/config.html#conan-config-install
      # and "install" from there to our desired conan directory.
      with temporary_dir() as remotes_install_dir:
        # Create an artificial conan configuration dir containing just remotes.txt.
        remotes_txt_for_install = os.path.join(remotes_install_dir, 'remotes.txt')
        safe_file_dump(remotes_txt_for_install, self._remotes_txt_content)
        # Configure the desired user home from this artificial config dir.
        argv = ['config', 'install', remotes_install_dir]
        workunit_factory = functools.partial(
          self.context.new_workunit,
          name='initial-conan-config',
          labels=[WorkUnitLabel.TOOL])
        env = {
          'CONAN_USER_HOME': user_home,
        }
        cmdline, exit_code = conan.run(workunit_factory, argv, env=env)
        if exit_code != 0:
          raise self.ConanConfigError(
            'Error configuring conan with argv {} and environment {}: exited non-zero ({}).'
            .format(cmdline, env, exit_code),
            exit_code=exit_code)
      # Generate the sentinel file so that we know the remotes have been successfully configured for
      # this particular task fingerprint in successive pants runs.
      safe_file_dump(remotes_txt_sentinel, self._remotes_txt_content)

    return user_home
240329
protected void setupInitialRegistryPaths() throws IOException {
        if (registryOperations instanceof RMRegistryOperationsService) {
            RMRegistryOperationsService rmRegOperations =
                    (RMRegistryOperationsService) registryOperations;
            rmRegOperations.initUserRegistryAsync(jstormMasterContext.service_user_name);
        }
    }
270199
def create(self):
        
        if not self.exists():
            # create new empyt config file based on template
            self.config.add_section("lametric")
            self.config.set("lametric", "client_id", "")
            self.config.set("lametric", "client_secret", "")

            # save new config
            self.save()

            # stop here, so user can set his config
            sys.exit(
                "An empty config file '{}' has been created. Please set "
                "the corresponding LaMetric API credentials.".format(
                    self._filename
                )
            )
1328478
public RemoteTask createRemoteTask(Map<String, Object> properties) throws RemoteException
    {
        try   {
            Application app = this.getApplication();
            RemoteTask remoteServer = new TaskSession(app);
            ((TaskSession)remoteServer).setProperties(properties);
            return remoteServer;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }
230707
function(_config) {
        var self = this;

        if(!_config) {
            throw new Error("You must give bitcoinaddress config object");
        }
        this.config = _config;
        $ = this.config.jQuery || jQuery;
        this.scan();
        this.initUX();
    }
746867
def _create_github_remote_repo(basedir):
    '''
    '''
    github_user = _lazy('github_user')
    github_repo = _lazy('github_repo', default=os.path.basename(basedir))

    _insert_repo_infos_into_readme(basedir, github_user, github_repo)
    run(flo('cd {basedir} && git add README.md'))
    run(flo('cd {basedir} && git commit -am "Add github repo and user '
            'into README.md"'))

    print_msg('create github repo')
    run(flo("cd {basedir}  &&  "
            "curl -u '{github_user}' https://api.github.com/user/repos "
            "-d '") + '{"name":"' + flo('{github_repo}"') + "}'")
    run(flo('cd {basedir}  &&  '
            'git remote add origin '
            'git@github.com:{github_user}/{github_repo}.git'))
    run(flo('cd {basedir}  &&  git push origin master'))
887656
private void initRemoteCommands(final RepositoryEntry config)
   {
      this.id = UUID.randomUUID().toString();
      registerNamespace = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-registerNamespace-"
               + config.getName();
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            if (!id.equals(args[0]))
            {
               try
               {
                  registerNamespace((String)args[1], (String)args[2], false);
               }
               catch (Exception e)
               {
                  LOG.warn("Could not register the namespace on other cluster nodes", e);
               }
            }
            return true;
         }
      });
      unregisterNamespace = rpcService.registerCommand(new RemoteCommand()
      {

         public String getId()
         {
            return "org.exoplatform.services.jcr.impl.core.NamespaceRegistryImpl-unregisterNamespace-"
               + config.getName();
         }

         public Serializable execute(Serializable[] args) throws Throwable
         {
            if (!id.equals(args[0]))
            {
               try
               {
                  unregisterNamespace((String)args[1], false);
               }
               catch (Exception e)
               {
                  LOG.warn("Could not unregister the namespace on other cluster nodes", e);
               }
            }
            return true;
         }
      });
   }
174013
def initialize(config):
	""
	config = init_config(config)

	_setup_logging()
	_load_library_extensions()
	if not Handler._registry:
		raise RuntimeError("No handlers registered")

	class_ = _load_bot_class()

	config.setdefault('log_channels', [])
	config.setdefault('other_channels', [])

	channels = config.log_channels + config.other_channels

	log.info('Running with config')
	log.info(pprint.pformat(config))

	host = config.get('server_host', 'localhost')
	port = config.get('server_port', 6667)

	return class_(
		host,
		port,
		config.bot_nickname,
		channels=channels,
		password=config.get('password'),
	)
300854
@Setup(Level.Trial)
    public void setupFeatureManager() {
        FeatureManager featureManager = new FeatureManagerBuilder()
                .featureEnums(SystemPropertyActivationStrategyFeatures.class)
                .stateRepository(new InMemoryStateRepository())
                .userProvider(new NoOpUserProvider())
                .build();
        // set up the toggle activation state
        StaticFeatureManagerProvider.setFeatureManager(featureManager);
        manager = featureManager;

        FeatureState propertBasedFeatureState = new FeatureState(SystemPropertyActivationStrategyFeatures.SYSTEM_BASED_FEATURE)
            .setEnabled(true)
            .setStrategyId(SystemPropertyActivationStrategy.ID)
            .setParameter(SystemPropertyActivationStrategy.PARAM_PROPERTY_NAME, "foo.bar")
            .setParameter(SystemPropertyActivationStrategy.PARAM_PROPERTY_VALUE, "true");


        manager.setFeatureState(propertBasedFeatureState);


    }
1314206
function init()
    {
        $homedir = $this->rc->config->get('enigma_smime_homedir', INSTALL_PATH . '/plugins/enigma/home');

        if (!$homedir)
            return new enigma_error(enigma_error::INTERNAL,
                "Option 'enigma_smime_homedir' not specified");

        // check if homedir exists (create it if not) and is readable
        if (!file_exists($homedir))
            return new enigma_error(enigma_error::INTERNAL,
                "Keys directory doesn't exists: $homedir");
        if (!is_writable($homedir))
            return new enigma_error(enigma_error::INTERNAL,
                "Keys directory isn't writeable: $homedir");

        $homedir = $homedir . '/' . $this->user;

        // check if user's homedir exists (create it if not) and is readable
        if (!file_exists($homedir))
            mkdir($homedir, 0700);

        if (!file_exists($homedir))
            return new enigma_error(enigma_error::INTERNAL,
                "Unable to create keys directory: $homedir");
        if (!is_writable($homedir))
            return new enigma_error(enigma_error::INTERNAL,
                "Unable to write to keys directory: $homedir");

        $this->homedir = $homedir;

    }
983715
def Initialize(config=None,
               external_hostname = None,
               admin_password = None,
               redownload_templates = False,
               repack_templates = True,
               token = None):
  """"""

  print("Checking write access on config %s" % config["Config.writeback"])
  if not os.access(config.parser.filename, os.W_OK):
    raise IOError("Config not writeable (need sudo?)")

  print("\nStep 0: Importing Configuration from previous installation.")
  options_imported = 0
  prev_config_file = config.Get("ConfigUpdater.old_config", default=None)
  if prev_config_file and os.access(prev_config_file, os.R_OK):
    print("Found config file %s." % prev_config_file)
    # pytype: disable=wrong-arg-count
    if builtins.input("Do you want to import this configuration? "
                      "[yN]: ").upper() == "Y":
      options_imported = ImportConfig(prev_config_file, config)
    # pytype: enable=wrong-arg-count
  else:
    print("No old config file found.")

  print("\nStep 1: Setting Basic Configuration Parameters")
  print("We are now going to configure the server using a bunch of questions.")
  ConfigureDatastore(config)
  ConfigureUrls(config, external_hostname=external_hostname)
  ConfigureEmails(config)

  print("\nStep 2: Key Generation")
  if config.Get("PrivateKeys.server_key", default=None):
    if options_imported > 0:
      print("Since you have imported keys from another installation in the "
            "last step,\nyou probably do not want to generate new keys now.")
    # pytype: disable=wrong-arg-count
    if (builtins.input("You already have keys in your config, do you want to"
                       " overwrite them? [yN]: ").upper() or "N") == "Y":
      config_updater_keys_util.GenerateKeys(config, overwrite_keys=True)
    # pytype: enable=wrong-arg-count
  else:
    config_updater_keys_util.GenerateKeys(config)

  FinalizeConfigInit(
      config,
      token,
      admin_password=admin_password,
      redownload_templates=redownload_templates,
      repack_templates=repack_templates,
      prompt=True)
468631
def set_conf(conf)
      begin
        conf = load_conf(conf)
        @svn_user              = conf['svn_user']
        @svn_pass              = conf['svn_pass']
        @force_checkout        = conf['force_checkout']
        @svn_repo_master       = conf['svn_repo_master']
        @svn_repo_working_copy = conf['svn_repo_working_copy']
        @svn_repo_config_path  = conf['svn_repo_config_path']
        Svn::Core::Config.ensure(@svn_repo_config_path)
      rescue Exception => e
        raise RepoAccessError, 'errors loading conf file'
      end
    end
1319365
def init(opts):
    '''
    
    '''
    opts['multiprocessing'] = False
    log.debug('Opening connection to junos')

    args = {"host": opts['proxy']['host']}
    optional_args = ['user',
                     'username',
                     'password',
                     'passwd',
                     'port',
                     'gather_facts',
                     'mode',
                     'baud',
                     'attempts',
                     'auto_probe',
                     'ssh_private_key_file',
                     'ssh_config',
                     'normalize'
                     ]

    if 'username' in opts['proxy'].keys():
        opts['proxy']['user'] = opts['proxy'].pop('username')
    proxy_keys = opts['proxy'].keys()
    for arg in optional_args:
        if arg in proxy_keys:
            args[arg] = opts['proxy'][arg]

    thisproxy['conn'] = jnpr.junos.Device(**args)
    try:
        thisproxy['conn'].open()
    except (ProbeError, ConnectAuthError, ConnectRefusedError, ConnectTimeoutError,
            ConnectError) as ex:
        log.error("{} : not able to initiate connection to the device".format(str(ex)))
        thisproxy['initialized'] = False
        return

    if 'timeout' in proxy_keys:
        timeout = int(opts['proxy']['timeout'])
        try:
            thisproxy['conn'].timeout = timeout
        except Exception as ex:
            log.error('Not able to set timeout due to: %s', str(ex))
        else:
            log.debug('RPC timeout set to %d seconds', timeout)

    try:
        thisproxy['conn'].bind(cu=jnpr.junos.utils.config.Config)
    except Exception as ex:
        log.error('Bind failed with Config class due to: {}'.format(str(ex)))

    try:
        thisproxy['conn'].bind(sw=jnpr.junos.utils.sw.SW)
    except Exception as ex:
        log.error('Bind failed with SW class due to: {}'.format(str(ex)))
    thisproxy['initialized'] = True
1206409
def setup (self):
        ''' 
        '''
        mainaccount = self.add_quotes(self.enter_config_value("mainaccount", 'ned'))
        keys = self.enter_config_value("keys", '[]')
        nodes = self.enter_config_value("nodes", 
                '["https://steemd.minnowsupportproject.org",'
                + '"https://rpc.buildteam.io",'
                + '"https://rpc.curiesteem.com",'
                + '"https://gtg.steem.house:8090",'
                + '"https://rpc.steemliberator.com",'
                + '"https://rpc.steemviz.com",'
                + '"https://steemd.privex.io"]')
        client_id = self.add_quotes(self.enter_config_value("client_id"))
        client_secret = self.add_quotes(self.enter_config_value("client_secret"))
        callback_url = self.add_quotes(self.enter_config_value("callback_url"))
        permissions = self.add_quotes(self.enter_config_value("permissions", "login,offline,vote"))
        logpath = self.add_quotes(self.enter_config_value("logpath", ""))
        screenmode = self.add_quotes(self.enter_config_value("screenmode", "quiet"))
        self.make(mainaccount=mainaccount, keys=keys, nodes=nodes, client_id=client_id, 
            client_secret=client_secret, callback_url=callback_url, permissions=permissions,
            logpath=logpath, screenmode=screenmode)
1214930
def create_travis_config(self):
        
        test_runner = self.config["options_test_runner"]

        role_url = "{0}".format(os.path.join(self.config["scm_host"],
                                             self.config["scm_user"],
                                             self.config["scm_repo_prefix"] +
                                             self.normalized_role))

        travisyml_template = default_travisyml_template.replace(
            "%test_runner", test_runner)
        travisyml_template = travisyml_template.replace(
            "%basename", test_runner.split("/")[-1])
        travisyml_template = travisyml_template.replace(
            "%role_url", role_url)

        utils.string_to_file(os.path.join(self.output_path, ".travis.yml"),
                             travisyml_template)
522824
def setup(cls, client_id, client_secret):
        
        cls.client_id = client_id
        cls.client_secret = client_secret
277384
def init(cnf):
    '''
    
    '''
    CONFIG['host'] = cnf.get('proxy', {}).get('host')
    if not CONFIG['host']:
        raise MinionError(message="Cannot find 'host' parameter in the proxy configuration")

    CONFIG['user'] = cnf.get('proxy', {}).get('user')
    if not CONFIG['user']:
        raise MinionError(message="Cannot find 'user' parameter in the proxy configuration")

    CONFIG['uri'] = "/api/{0}".format(CONFIG['user'])