Set config from main context to worker context.
@param  {Object} config   The openpgp configuration
429897
function configure(config) {
  Object.keys(config).forEach(function(key) {
    openpgp.config[key] = config[key];
  });
}
1294198
public function setupWorker(Config $config)
    {

        $credentials = $config->getParams()['credentials'];

        $this->_worker = new \GuzzleHttp\Client(array(
            'defaults' => array(
                'auth' => array($credentials['username'], $credentials['password']),
            ),
        ));
    }
311863
async def set_config(self, config):
        
        config_facade = client.ModelConfigFacade.from_connection(
            self.connection()
        )
        for key, value in config.items():
            if isinstance(value, ConfigValue):
                config[key] = value.value
        await config_facade.ModelSet(config)
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 );

}
268783
def set_config(self, config):
    
    if self.config is None:
      self.config = { }
    self.config.update(config_to_api_list(config))
11105
function(config) {
    var app = express();

    app.config = config;

    app.use(function(req, res, next) {
      // express.js seems to store the app in req.app already but it isn't
      // documented anywhere. Just to make sure we do it also.
      req.app = app;
      next();
    });

    if (app.config.protocol === 'spdy') {
      createSpdyServer(app);
    } else if ( app.config.protocol === 'https' ) {
      createHttpsServer(app);
    } else {
      createHttpServer(app);
    }

    log.trace("Initializing features");
    app = plugins.initFeatures(app);
    log.trace("Triggering appReady event");
    app.emit('appReady', app);

    return app;
  }
237295
public function configure($config)
    {
        foreach ((array)$config as $key => $value) {
            $this->setConfig($key, $value);
        }
    }
874656
function configure(context, file, fileSet, next) {
  var config = context.configuration
  var processor = context.processor

  if (stats(file).fatal) {
    return next()
  }

  config.load(file.path, handleConfiguration)

  function handleConfiguration(error, configuration) {
    var plugins
    var options
    var plugin
    var length
    var index
    var name

    if (error) {
      return next(error)
    }

    /* Store configuration on the context object. */
    debug('Using settings `%j`', configuration.settings)
    processor.data('settings', configuration.settings)

    plugins = configuration.plugins
    length = plugins.length
    index = -1

    debug('Using `%d` plugins', length)

    while (++index < length) {
      plugin = plugins[index][0]
      options = plugins[index][1]

      if (options === false) {
        continue
      }

      /* Allow for default arguments in es2020. */
      if (options === null || (object(options) && empty(options))) {
        options = undefined
      }

      name = fnName(plugin) || 'function'
      debug('Using plug-in `%s`, with options `%j`', name, options)

      try {
        processor.use(plugin, options, fileSet)
      } catch (error2) {
        /* istanbul ignore next - Shouldn’t happen anymore! */
        return next(error2)
      }
    }

    next()
  }
}
698123
function(worker)
{
    var self = this;

    this.context     = worker.context;
    this.worker      = worker;
    this.controllers = {};
    this.contexts    = greppy.config.get('app').get('infrastructure');
}
152404
def configure(configFile=None, baseConfig="ProductionConfig",
              port=8000, extraConfig={}):
    
    file_handler = StreamHandler()
    file_handler.setLevel(logging.WARNING)
    app.logger.addHandler(file_handler)
    configStr = 'ga4gh.server.serverconfig:{0}'.format(baseConfig)
    app.config.from_object(configStr)
    if os.environ.get('GA4GH_CONFIGURATION') is not None:
        app.config.from_envvar('GA4GH_CONFIGURATION')
    if configFile is not None:
        app.config.from_pyfile(configFile)
    app.config.update(extraConfig.items())
    # Setup file handle cache max size
    datamodel.fileHandleCache.setMaxCacheSize(
        app.config["FILE_HANDLE_CACHE_MAX_SIZE"])
    # Setup CORS
    try:
        cors.CORS(app, allow_headers='Content-Type')
    except AssertionError:
        pass
    app.serverStatus = ServerStatus()

    app.backend = _configure_backend(app)
    if app.config.get('SECRET_KEY'):
        app.secret_key = app.config['SECRET_KEY']
    elif app.config.get('OIDC_PROVIDER'):
        raise exceptions.ConfigurationException(
            'OIDC configuration requires a secret key')
    if app.config.get('CACHE_DIRECTORY'):
        app.cache_dir = app.config['CACHE_DIRECTORY']
    else:
        app.cache_dir = '/tmp/ga4gh'
    app.cache = FileSystemCache(
        app.cache_dir, threshold=5000, default_timeout=600, mode=384)
    # Peer service initialization
    network.initialize(
        app.config.get('INITIAL_PEERS'),
        app.backend.getDataRepository(),
        app.logger)
    app.oidcClient = None
    app.myPort = port
    if app.config.get('AUTH0_ENABLED'):
        emails = app.config.get('AUTH0_AUTHORIZED_EMAILS', '').split(',')
        [auth.authorize_email(e, app.cache) for e in emails]
    if "OIDC_PROVIDER" in app.config:
        # The oic client. If we're testing, we don't want to verify
        # SSL certificates
        app.oidcClient = oic.oic.Client(
            verify_ssl=('TESTING' not in app.config))
        try:
            app.oidcClient.provider_config(app.config['OIDC_PROVIDER'])
        except requests.exceptions.ConnectionError:
            configResponse = message.ProviderConfigurationResponse(
                issuer=app.config['OIDC_PROVIDER'],
                authorization_endpoint=app.config['OIDC_AUTHZ_ENDPOINT'],
                token_endpoint=app.config['OIDC_TOKEN_ENDPOINT'],
                revocation_endpoint=app.config['OIDC_TOKEN_REV_ENDPOINT'])
            app.oidcClient.handle_provider_config(configResponse,
                                                  app.config['OIDC_PROVIDER'])

        # The redirect URI comes from the configuration.
        # If we are testing, then we allow the automatic creation of a
        # redirect uri if none is configured
        redirectUri = app.config.get('OIDC_REDIRECT_URI')
        if redirectUri is None and app.config.get('TESTING'):
            redirectUri = 'https://{0}:{1}/oauth2callback'.format(
                socket.gethostname(), app.myPort)
        app.oidcClient.redirect_uris = [redirectUri]
        if redirectUri is []:
            raise exceptions.ConfigurationException(
                'OIDC configuration requires a redirect uri')

        # We only support dynamic registration while testing.
        if ('registration_endpoint' in app.oidcClient.provider_info and
           app.config.get('TESTING')):
            app.oidcClient.register(
                app.oidcClient.provider_info["registration_endpoint"],
                redirect_uris=[redirectUri])
        else:
            response = message.RegistrationResponse(
                client_id=app.config['OIDC_CLIENT_ID'],
                client_secret=app.config['OIDC_CLIENT_SECRET'],
                redirect_uris=[redirectUri],
                verify_ssl=False)
            app.oidcClient.store_registration_info(response)
888088
public function setConfig($config)
    {
        $this->config = $config;
        $this->factory = new Factory($config);
        $this->AssetBuild->setConfig($config);
    }
302735
public static void addConfig(Config config) {
		if (config == null) {
			throw new IllegalArgumentException("Config can not be null");
		}
		if (configNameToConfig.containsKey(config.getName())) {
			throw new IllegalArgumentException("Config already exists: " + config.getName());
		}
		
		configNameToConfig.put(config.getName(), config);
		
		/** 
		 * Replace the main config if current config name is MAIN_CONFIG_NAME
		 */
		if (MAIN_CONFIG_NAME.equals(config.getName())) {
			DbKit.config = config;
			Db.init(DbKit.config.getName());
		}
		
		/**
		 * The configName may not be MAIN_CONFIG_NAME,
		 * the main config have to set the first comming Config if it is null
		 */
		if (DbKit.config == null) {
			DbKit.config = config;
			Db.init(DbKit.config.getName());
		}
	}
526906
function setXHRConfig (req, config) {
  try {
    req.withCredentials = config.http.withCredentials;
  }
  catch (err) {
    // Some browsers don't allow `withCredentials` to be set for synchronous requests
  }

  try {
    req.timeout = config.http.timeout;
  }
  catch (err) {
    // Some browsers don't allow `timeout` to be set for synchronous requests
  }

  // Set request headers
  Object.keys(config.http.headers).forEach(function (key) {
    var value = config.http.headers[key];
    if (value !== undefined) {
      req.setRequestHeader(key, value);
    }
  });
}
1260422
function configure(config) {
    tapLimit = config.tapLimit;
    testNumber = config.priorTestNumber;
    testFileRegex = new RegExp(config.testFileRegexStr);
    failedTests = config.failedTests;
    maxFailedTests = config.maxFailedTests;
    catchExceptions = config.catchExceptions;
    if (config.selectedTests !== '')
        selectTests(config.selectedTests);
    debugBreak = config.debugBreak;
    
    installTapWithPatches(config.tapPath);
    
    runUserCode(function() {
        require(config.filePath);
    }, false);
    
    // installing a tearDown handler induces tap autoend,
    // which sometimes causes tearDown before tests install,
    // so have to install handler *after* registering tests.
    // the handler installs because tap has to wait for all
    // tests by waiting at least until the next tick.
    
    tap.tearDown(function() {
        process.send({
            event: 'done',
            lastTestNumber: testNumber,
            failedTests: failedTests
        });
        // disconnect IPC so can exit when stdout, stderr,
        // child processes, and other resources complete.
        process.disconnect();
    });
    tap.end();
}
192450
function buildConfig (_config) {
  _config.datastore = Object.assign({}, defaultDatastore, _get(_config, 'datastore', {}))

  return _config
}
683773
function setPlatformConfig(platformName, platformConfigs) {
    configProperties.platform[platformName] = platformConfigs;
    provider.platform[platformName] = {};

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

    createConfig(configProperties.platform[platformName], provider.platform[platformName], '');
  }
506463
function init(config) {
        exports.config = config;
        MainViewManager
            .on("currentFileChange", _onFileChange);
        DocumentManager
            .on("documentSaved", _onDocumentSaved)
            .on("dirtyFlagChange", _onDirtyFlagChange);
        ProjectManager
            .on("beforeProjectClose beforeAppClose", close);

        // Default transport for live connection messages - can be changed
        setTransport(NodeSocketTransport);

        // Default launcher for preview browser - can be changed
        setLauncher(DefaultLauncher);

        // Initialize exports.status
        _setStatus(STATUS_INACTIVE);
    }