Sets shared job configuration properties.

@access private
@param string $projectId The project's ID.
@param array $config A set of configuration options for a job.
@param string|null $location The geographic location in which the job is
executed.
192419
public function jobConfigurationProperties(
        $projectId,
        array $config,
        $location
    ) {
        $this->config = array_replace_recursive([
            'projectId' => $projectId,
            'jobReference' => ['projectId' => $projectId]
        ], $config);

        if ($location && !isset($this->config['jobReference']['location'])) {
            $this->config['jobReference']['location'] = $location;
        }

        if (!isset($this->config['jobReference']['jobId'])) {
            $this->config['jobReference']['jobId'] = $this->generateJobId();
        }
    }
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
1365177
public void configure(JobConf job) {
    iconf = new IndexUpdateConfiguration(job);
    analyzer =
        (Analyzer) ReflectionUtils.newInstance(
            iconf.getDocumentAnalyzerClass(), job);

    localAnalysis =
        (ILocalAnalysis) ReflectionUtils.newInstance(
            iconf.getLocalAnalysisClass(), job);
    localAnalysis.configure(job);

    shards = Shard.getIndexShards(iconf);

    distributionPolicy =
        (IDistributionPolicy) ReflectionUtils.newInstance(
            iconf.getDistributionPolicyClass(), job);
    distributionPolicy.init(shards);

    LOG.info("sea.document.analyzer = " + analyzer.getClass().getName());
    LOG.info("sea.local.analysis = " + localAnalysis.getClass().getName());
    LOG.info(shards.length + " shards = " + iconf.getIndexShards());
    LOG.info("sea.distribution.policy = "
        + distributionPolicy.getClass().getName());
  }
120675
public function setLocationProvider($providerId)
    {
        Piwik::checkUserHasSuperUserAccess();

        if (!UserCountry::isGeoLocationAdminEnabled()) {
            throw new \Exception('Setting geo location has been disabled in config.');
        }

        $provider = LocationProvider::setCurrentProvider($providerId);
        if ($provider === false) {
            throw new Exception("Invalid provider ID: '$providerId'.");
        }
    }
1199329
private function setConfig($config)
	{
		foreach ($config as $key => $value) {
			$this->setConfigParam($key, $value);
		}

	}
1246491
def _configure_project(config):
    
    project_id = config["provider"].get("project_id")
    assert config["provider"]["project_id"] is not None, (
        "'project_id' must be set in the 'provider' section of the autoscaler"
        " config. Notice that the project id must be globally unique.")
    project = _get_project(project_id)

    if project is None:
        #  Project not found, try creating it
        _create_project(project_id)
        project = _get_project(project_id)

    assert project is not None, "Failed to create project"
    assert project["lifecycleState"] == "ACTIVE", (
        "Project status needs to be ACTIVE, got {}".format(
            project["lifecycleState"]))

    config["provider"]["project_id"] = project["projectId"]

    return config
417767
protected void setConfigProperty(String propName, String propValue) {
        if (System.getProperty(propName) == null) {
            System.setProperty(propName, propValue);
        }
    }
951933
private function configure(array $config = []): void
    {
        foreach ($config as $param => $value) {
            $property = $this->toCamelCase($param);
            if (property_exists(self::class, $property)) {
                $this->$property = $value;
            }
        }
    }
392200
public function updateProject($projectId = null, $data)
    {
        $projectId = $projectId ?: $this->defaultProjectId;

        return $this->curl->put("projects/{$projectId}", ['data' => $data]);
    }
1192974
public function setConfig($config)
	{
		if (is_object($config)) {
			$config = get_object_vars($config);
		}
		foreach ($config as $index => $value) {
			$this->$index = $value;
		}
	}
326517
public final function set_config($config) {
        global $DB;
        foreach ($config as $key => $value) {
            // try set it in $this first
            try {
                $this->set($key, $value);
                continue;
            } catch (portfolio_exception $e) { }
            if (!in_array($key, $this->get_allowed_config())) {
                $a = (object)array('property' => $key, 'class' => get_class($this));
                throw new portfolio_export_exception($this->get('exporter'), 'invalidconfigproperty', 'portfolio', null, $a);
            }
            if (!isset($this->config->{$key})) {
                $DB->insert_record('portfolio_instance_config', (object)array(
                    'instance' => $this->id,
                    'name' => $key,
                    'value' => $value,
                ));
            } else if ($this->config->{$key} != $value) {
                $DB->set_field('portfolio_instance_config', 'value', $value, array('name' => $key, 'instance' => $this->id));
            }
            $this->config->{$key} = $value;
        }
    }
572954
public static void deploy(Config config) {
	if (!contextIsValid(config)) return;

	synchronized (config) {
	    Resource dir = config.getDeployDirectory();
	    if (!dir.exists()) dir.mkdirs();

	    Resource[] children = dir.listResources(ALL_EXT);
	    Resource child;
	    String ext;
	    for (int i = 0; i < children.length; i++) {
		child = children[i];
		try {
		    // Lucee archives
		    ext = ResourceUtil.getExtension(child, null);
		    if ("lar".equalsIgnoreCase(ext)) {
			// deployArchive(config,child,true);
			XMLConfigAdmin.updateArchive((ConfigImpl) config, child, true);
		    }

		    // Lucee Extensions
		    else if ("lex".equalsIgnoreCase(ext)) XMLConfigAdmin._updateRHExtension((ConfigImpl) config, child, true);

		    // Lucee core
		    else if (config instanceof ConfigServer && "lco".equalsIgnoreCase(ext)) XMLConfigAdmin.updateCore((ConfigServerImpl) config, child, true);
		}
		catch (Throwable t) {
		    ExceptionUtil.rethrowIfNecessary(t);
		    Log log = config.getLog("deploy");
		    log.error("Extension", t);
		}
	    }
	}
    }
298743
public function set($websiteId, ConfigInterface $config)
    {
        $foundDifference = false;

        foreach ($config->getData() as $key => $value) {
            if ($config->setConfigValue($key, $value, $websiteId)) {
                $foundDifference = true;
            }
        }

        if ($foundDifference) {
            $config->cleanScope();
        }

        return $this->statusResponseFactory->create()
            ->setStatus('ok');
    }
810022
function Job(job, provider, plugins, config) {
  var jobId = job._id.toString();

  debug(`Creating new job "${jobId}" for project "${job.project.display_name}" using provider "${provider.id}".`);

  this.config = _.extend({
    spawn: spawnNormal,
    pty: false,
    env: {}
  }, config);

  // Setup default ENVs to be used in plugin contexts
  this.config.env = _.extend(this.config.env, {
    STRIDER: true,
    STRIDER_TRIGGER: job.trigger.type || 'manual',
    STRIDER_COMMIT: '',
    STRIDER_PR: '',
    STRIDER_BRANCH: job.ref.branch,
    STRIDER_SLUG: job.project.name,
    STRIDER_BUILD: jobId,
    STRIDER_BUILD_URL: `${job.project.display_url}/job/${jobId}`
  });

  if (this.config.pty) {
    debug('PTY has been disabled due to a bug in node core');
    this.config.pty = false;
  }

  this.io = config.io;
  this.job = job;
  this.id = job._id;
  this.provider = provider;
  this.plugins = plugins;
  this.logPrefix = colorize.job(this.id);
  this.phase = null;
  this.testcode = null;
  this.cancelled = false;
  this.commands = [];
  this.listen();
}
813408
function setConfig(configs) {
    configProperties = platformConfigs;
    provider.platform[platformName] = {};

    addConfig(configProperties, configProperties.platform[platformName]);

    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');
  }
1036628
public function setProjectId($projectId = '')
    {
        $this->projectId = $projectId;
        $this->_debug->info(__FUNCTION__, 'setProjectId: ', $this->projectId);
    }
1182935
private static void setJobConf(Object theObject, Configuration conf) {
        //If JobConf and JobConfigurable are in classpath, AND
        //theObject is of type JobConfigurable AND
        //conf is of type JobConf then
        //invoke configure on theObject
        try {
            Class<?> jobConfClass = conf.getClassByName("org.apache.hadoop.mapred.JobConf");
            Class<?> jobConfigurableClass = conf.getClassByName("org.apache.hadoop.mapred.JobConfigurable");
            if (jobConfClass.isAssignableFrom(conf.getClass())
                    && jobConfigurableClass.isAssignableFrom(theObject.getClass())) {
                Method configureMethod = jobConfigurableClass.getMethod("configure", jobConfClass);
                configureMethod.invoke(theObject, conf);
            }
        } catch (ClassNotFoundException e) {
            //JobConf/JobConfigurable not in classpath. no need to configure
        } catch (Exception e) {
            throw new RuntimeException("Error in configuring object", e);
        }
    }