Initialize the loader with web3 and config
329297
function init(loader) {
  var loaderConfig = loaderUtils.getLoaderConfig(loader, 'web3Loader');
  web3 = require('./lib/web3')(loaderConfig.provider);
  config = mergeConfig(loaderConfig);
  isDebug = loader.debug;
}
633140
function INIT(config) {
  if (__init) return;

  CONF = _.extend(CONF, config)

  LOG = LOG.use(require('./lib/sentry')(CONF.sentry))

  JOBS = Q.init(CONF, LOG)

  if (CONF.auth)
    WWW.use('/'+CONF.admin_url_prefix,
            express.basicAuth(CONF.auth.user, CONF.auth.pass));

  WWW.use(express.bodyParser())
  WWW.use('/'+CONF.admin_url_prefix, Q.kue.app)

  __init = true
}
290717
def include_raw_constructor(self, loader, node):
        

        path = convert_path(node.value)

        with open(path, 'r') as f:
            config = f.read()

            config = self.inject_include_info(path, config, include_type='include-raw')

            self.add_file(path, config)

            return config
932020
public function _initialize() {
		$this->wd_host = sprintf( 'http://%s:%s@hub.browserstack.com/wd/hub', $this->config['username'], $this->config['access_key'] );

		$this->capabilities = $this->config['capabilities'];
		$this->capabilities[ \WebDriverCapabilityType::BROWSER_NAME ] = $this->config['browser'];
		if ( ! empty( $this->config['version'] ) ) {
			$this->capabilities[ \WebDriverCapabilityType::VERSION ] = $this->config['version'];
		}

		$this->webDriver = \RemoteWebDriver::create( $this->wd_host, $this->capabilities );
		$this->webDriver->manage()->timeouts()->implicitlyWait( $this->config['wait'] );

		$this->initialWindowSize();
	}
580570
protected function init()
    {
        // WebDocBook booting
        $this->boot();

        // the logger
        $this->logger = new Logger(array(
            'directory'         => Kernel::getPath('log'),
            'logfile'           => Kernel::getConfig('app:logfile', 'history'),
            'error_logfile'     => Kernel::getConfig('app:error_logfile', 'errors'),
            'duplicate_errors'  => false,
        ));

        // user configuration
        $internal_config    = Kernel::getConfig('userconf', array());
        $user_config_file   = Kernel::getPath('user_config_filepath');
        if (true===file_exists($user_config_file)) {
            $user_config = FilesystemHelper::parseIni($user_config_file);
            if (!empty($user_config)) {
                Kernel::setConfig($user_config, 'user_config');
            } else {
                throw new Exception(
                    sprintf('Can not read you configuration file "%s"!', Kernel::getPath('user_config_filepath', true))
                );
            }
        } else {
            Kernel::setConfig($internal_config, 'user_config');
        }

        // creating the application default headers
        $charset        = Kernel::getConfig('html:charset', 'utf-8');
        $content_type   = Kernel::getConfig('html:content-type', 'text/html');
        $app_name       = Kernel::getConfig('title', null, 'manifest');
        $app_version    = Kernel::getConfig('version', null, 'manifest');
        $app_website    = Kernel::getConfig('homepage', null, 'manifest');
        $this->response->addHeader('Content-type', $content_type.'; charset: '.$charset);

        // expose app ?
        $expose_wdb = Kernel::getConfig('app:expose_webdocbook', true);
        if (true===$expose_wdb || 'true'===$expose_wdb || '1'===$expose_wdb) {
            $this->response->addHeader('Composed-by', $app_name.' '.$app_version.' ('.$app_website.')');
        }

        // the template builder
        $this->setTemplateBuilder(new TemplateBuilder);

        // some PHP configs
        @date_default_timezone_set( Kernel::getConfig('user_config:timezone', 'Europe/London') );
        
        // the internationalization
        $langs = Kernel::getConfig('languages:langs', array('en'=>'English'));
        $i18n_loader_opts = array(
            'language_directory'            => Kernel::getPath('i18n'),
            'language_strings_db_directory' => Kernel::getPath('user_config'),
            'language_strings_db_filename'  => basename(Kernel::get('app_i18n_filepath')),
            'force_rebuild'                 => true,
            'available_languages'           => array_combine(array_keys($langs), array_keys($langs)),
        );

        if (Kernel::isDevMode()) {
            $i18n_loader_opts['show_untranslated'] = true;
        }
        $translator = I18n::getInstance(new I18n_Loader($i18n_loader_opts));

        // language
        $def_ln = Kernel::getConfig('languages:default', 'auto');
        if (!empty($def_ln) && $def_ln==='auto') {
            $translator->setDefaultFromHttp();
            $def_ln = Kernel::getConfig('languages:fallback_language', 'en');
        }
        $trans_ln = $translator->getLanguage();
        if (empty($trans_ln)) {
            $translator->setLanguage($def_ln);
        }

        $this->getTemplateBuilder()
            ->getTwigEngine()
            ->addExtension(new I18n_Twig_Extension($translator));
    }
41974
function loader(source) {

  // dust files don't have side effects, so loader results are cacheable
  if (this.cacheable) this.cacheable();

  // Set up default options & override them with other options
  const default_options = {
    root: '',
    dustAlias: 'dustjs-linkedin',
    namingFn: defaultNamingFunction,
    preserveWhitespace: false,
    wrapOutput: false,
    verbose: false,
    ignoreImages: false,
    excludeImageRegex: undefined
  };

  // webpack 4 'this.options' was deprecated in webpack 3 and removed in webpack 4
  // if you want to use global loader options, use dust-loader-complete < v4.0.0
  // var query = this.options || this.query || {};
  // var global_options = query['dust-loader-complete'] || {};

  // get user supplied loader options from `this.query`
  const loader_options = getOptions(this) || {};

  // merge user options with default options
  const options = Object.assign({}, default_options, loader_options);

  // Fix slashes & resolve root
  options.root = path.resolve(options.root.replace('/', path.sep));

  // Get the path
  const template_path = path.relative(options.root, this.resourcePath);

  // Create the template name
  const name = options.namingFn(template_path, options);

  // Log
  log(options, 'Loading DustJS module from "' + template_path + '": naming template "' + name + '"');

  // Find different styles of dependencies
  const deps = [];

  // Find regular dust partials, updating the source as needed for relatively-pathed partials
  source = findPartials(source, template_path + '/../', options, deps);

  // Find image dependencies
  if (!options.ignoreImages) {
    source = findImages(name, source, deps, options);
  }

  // Find require comments
  findRequireComments(source, template_path + '/../', options, deps);

  // Do not trim whitespace in case preserveWhitespace option is enabled
  dust.config.whitespace = options.preserveWhitespace;

  // Compile the template
  const template = dust.compile(source, name);

  // Build the returned string
  let returnedString;
  if (options.wrapOutput) {
    returnedString = "var dust = require('" + options.dustAlias + "/lib/dust'); "
      + deps.join(' ') + template
      + "var fn = " + defaultWrapperGenerator(name)
      + '; fn.templateName = "' + name + '"; '
      + "module.exports = fn;";
  } else {
    returnedString = "var dust = require('" + options.dustAlias + "'); "
      + deps.join(' ')
      + 'var template = ' + template + ';'
      + 'template.templateName = "' + name + '";'
      + "module.exports = template;";
  }

  // Return the string to be used
  return returnedString
}
627423
function () {
            config = scope.getConfig();

            // Setup container
            $el = config.$el;

            $(document).on('mouseup', handleMouseUp);

            validateConfig();
            prepareDOM();
            createPages();

            lazyLoader = scope.createComponent('lazy-loader');
            lazyLoader.init(config.pages);
        }
1000535
function tweakWebpackConfig(module) {
  const { default: webpackConfig = module } = module;

  const config = handleWebpackConfig(webpackConfig);

  if (!config) {
    throw new Error(
      'Not found webpack configuration. For multiple configurations in single file you must provide config with target "node".'
    );
  }

  const hmrClientEntry = require.resolve('./HmrClient');

  const addHmrClientEntry = (entry, entryOwner) => {
    const owner = entryOwner;
    if (Array.isArray(owner[entry])) {
      owner[entry].splice(-1, 0, hmrClientEntry);
    } else if (typeof owner[entry] === 'string') {
      owner[entry] = [hmrClientEntry, owner[entry]];
    } else if (typeof owner[entry] === 'function') {
      // Call function and try again with function result.
      owner[entry] = owner[entry]();
      addHmrClientEntry(entry, owner);
    } else if (typeof owner[entry] === 'object') {
      Object.getOwnPropertyNames(owner[entry]).forEach(name =>
        addHmrClientEntry(name, owner[entry])
      );
    }
  };

  // Add HmrClient to every entries.
  addHmrClientEntry('entry', config);

  if (!config.plugins) {
    config.plugins = [];
  }

  // Add source-map support if configured.
  if (config.devtool && config.devtool.indexOf('source-map') >= 0) {
    config.plugins.push(
      new webpack.BannerPlugin({
        banner: `;require('${require
          .resolve('source-map-support')
          .replace(/\\/g, '/')}').install();`,
        raw: true,
        entryOnly: false,
      })
    );
  }

  // Enable HMR globally if not.
  if (!config.plugins.find(p => p instanceof webpack.HotModuleReplacementPlugin)) {
    config.plugins.push(new webpack.HotModuleReplacementPlugin());
  }

  return config;
}
955459
def config_loader(app, **kwargs):
    """"""
    app.config.from_object(Config)
    app.config.update(**kwargs)
1081615
function Loader(options) {
  options = options || {};
  this._nodeenv = options.nodeenv || process.env.NODE_ENV || 'development';
  this._path = options.path || '';
  this._name = options.name || Loader.DOT_BASE;
}
576228
@Deprecated
    protected void initialize() {
        // Cancel any running tasks
        Timer oldTimer = timer;
        timer = new Timer();
        if (oldTimer!=null) {
            oldTimer.cancel();
        }
        // (re)initialize
        LoaderConfigurator configurator = new LoaderConfigurator(this);
        defaultLoaderServiceFacade = new DefaultLoaderServiceFacade(timer, listener, resources);
        configurator.load();
    }
198197
function inits() {
  log( "init", "step="+step+" ajaxOngoing="+ajaxOngoing );
  if ( getParam( 'nc' ) == 'true' ) {
    noCache = "?nc="+ Math.random();
  }

  if ( ajaxOngoing == 0 ) { 
    if ( step == "load-lang" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadLang();
      step = "loadmodulemap";
    } else if ( step == "loadmodulemap" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load module list...');
      loadModuleList();
      step = "loaddecor";
    } else if ( step == "loaddecor" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load decor config...');
      loadDecorList();
      step = "loadstructure";
    } else  if ( step == "loadstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      loadStructure();
      step = "loadincludes";
    } else if ( step == "loadincludes" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load include JS modules ...');
      checkModules( );
      loadIncludes();
      step = "loadmodules";
    } else if ( step == "loadmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load JS modules ...');
      loadModules();
      if ( layout.theme != null ) {
        loadCSSrelPath( 'css-custom/'+layout.theme+'.css' );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/'+layout.theme+'.css" type="text/css" />');        
      }
      loadCSSrelPath( "css-custom/custom.css" );
      if ( pageInfo["layoutMode"] == 'tablet' ) {
        loadCSSrelPath( "css-custom/custom-t.css" );
        //jQuery('head').append('<link rel="stylesheet" rel="nofollow" href="css-custom/custom-t.css" type="text/css" />');        
      } else if ( pageInfo["layoutMode"] == 'mobile' ) {
        loadCSSrelPath( "css-custom/custom-m.css" );
        //jQuery('head').append('<link rel="st<ylesheet" rel="nofollow" href="css-custom/custom-m.css" type="text/css" />');
      } 
      step = "initmodules";
    } else  if ( step == "initmodules" ) {
      ajaxOngoing++;
      log( 'init', 'Load Structure File ...');
      initModules( layout );
      step = "buildstructure";
    } else  if ( step == "buildstructure" ) {
      ajaxOngoing++;
      log( 'init', 'Start to build HTML ...');
      buildStructure( layout );
      step = "loadres-ht";
    } else  if ( step == "loadres-ht" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources HTML ...');
      loadResourcesHT();
      step = "call-hooks";
    } else  if ( step == "call-hooks" ) {
      log( 'init', 'Call module hooks ...');
      callHooks();
      step = "loadres-js";
    } else  if ( step == "loadres-js" ) {
      ajaxOngoing++;
      log( 'init', 'Start to load resources JS ...');
      loadResourcesJS();
      step = "callbacks";
    } else  if ( step == "callbacks" ) {
      log( 'init', 'Start callback methods for resources...');
      resourceCallbacks();
      step = "dialogs";
    } else  if ( step == "dialogs" ) {
      log( 'init', 'Start load dialogs for resources...');
      resourceDialogs();
      step = "afterInit";
    } else  if ( step == "afterInit" ) {
      log( 'init', 'Start load dialogs for resources...');
      startModulesAfterPageLoad( layout );
      clearInterval( initTimerId );
      step = "done";
    }
  }  
}
1031536
function _load() {
  if (!existsSync(exports.configFile)) {
    _initFile();
  }

  try {
    return JSON.parse(fs.readFileSync(exports.configFile, 'utf8'));
  }
  catch (e) {
    console.error('JSON parse error');
    console.error('See and edit', exports.configFile);
    console.error('or exec `confy clean`');
    process.exit();
  }
}
246767
function init(msg, done) {
  var config = {
    context: opts.context,
    adapter: opts.adapter,
    routes: opts.routes,
    auth: opts.auth,
    options: opts.options
  }

  setServer.call(this, config, done)
}
537800
function init(){
    self.type = config.type || 'redis';
    if(config.redisMock){
      self.db = config.redisMock;
    }
    else{
      if(config.redisUrl){
        self.redisData = config.redisUrl || null;
      }
      else if(config.redisEnv){
        self.redisData = process.env[config.redisEnv] || null;
      }
      else if(config.redisData){
        self.redisData = config.redisData;
      }
      self.readOnly = (typeof config.readOnly === 'boolean') ? config.readOnly : false;
      try {
        if (self.redisData) {
          if(typeof self.redisData === 'string'){
            self.db = redis.createClient(self.redisData,
              {'no_ready_check': true,
              retry_strategy: retryStrategy});
          } else {
            self.db = redis.createClient(self.redisData.port,
              self.redisData.hostname, {'no_ready_check': true,
              retry_strategy: retryStrategy});

            // don't call redis auth method if no auth info passed
            if (self.redisData.auth) {
              self.db.auth(self.redisData.auth);
            }
          }
          self.db.on('error', function(err) {
            console.log('Error ' + err);
          });
          process.on('SIGTERM', function() {
            self.db.quit();
          });
          log(false, 'Redis client created with the following defaults:', {expiration: self.defaultExpiration, verbose: self.verbose, readOnly: self.readOnly});
        } else {
          self.db = false;
          log(false, 'Redis client not created: no redis config provided');
        }
      } catch (err) {
        self.db = false;
        log(true, 'Redis client not created:', err);
      }
    }
  }
985943
function initialize() {
    var getRenderer = require( config.getRenderer ?
      path.join( './../../../', config.getRenderer ) :
      markedRenderer
    );
    var renderer = getRenderer( marked );
    filingCabinet = new FilingCabinet( config );

    readControls(
      config.controls,
      filingCabinet
    );
    readReferences(
      config.components,
      config.referenceFile,
      filingCabinet
    );
    readComponents(
      config.components,
      config.referenceFile,
      config.localeFile,
      config.layoutSegment,
      config.contentSegment,
      filingCabinet,
      renderer
    );
    readContents(
      config.contents,
      config.submenuFile,
      filingCabinet,
      renderer
    );

    logger.showInfo( '*** Validating elements...' );
    filingCabinet.finalize();
    logger.showInfo( '*** Content manager is initialized.' );

    contextFactory = new ContextFactory( config, filingCabinet );
  }
216880
def Init():
  """"""
  global INIT_RAN
  if INIT_RAN:
    return

  # Set up a temporary syslog handler so we have somewhere to log problems
  # with ConfigInit() which needs to happen before we can start our create our
  # proper logging setup.
  syslog_logger = logging.getLogger("TempLogger")
  if os.path.exists("/dev/log"):
    handler = logging.handlers.SysLogHandler(address="/dev/log")
  else:
    handler = logging.handlers.SysLogHandler()
  syslog_logger.addHandler(handler)

  try:
    config_lib.SetPlatformArchContext()
    config_lib.ParseConfigCommandLine()
  except config_lib.Error:
    syslog_logger.exception("Died during config initialization")
    raise

  metric_metadata = server_metrics.GetMetadata()
  metric_metadata.extend(communicator.GetMetricMetadata())

  stats_collector = prometheus_stats_collector.PrometheusStatsCollector(
      metric_metadata, registry=prometheus_client.REGISTRY)
  stats_collector_instance.Set(stats_collector)

  server_logging.ServerLoggingStartupInit()

  bs_registry_init.RegisterBlobStores()
  all_decoders.Register()
  all_parsers.Register()
  registry.Init()

  # Exempt config updater from this check because it is the one responsible for
  # setting the variable.
  if not config.CONFIG.ContextApplied("ConfigUpdater Context"):
    if not config.CONFIG.Get("Server.initialized"):
      raise RuntimeError("Config not initialized, run \"grr_config_updater"
                         " initialize\". If the server is already configured,"
                         " add \"Server.initialized: True\" to your config.")

  INIT_RAN = True