Initialize the feature flags middleware
350018
function initFeatureFlags(enabled) {
  return function features(req, res, next) {
    if (req.get('x-env') !== 'production') return next();
    if (enabled && enabled !== req.cookies.features) res.cookie('features', enabled);
    next();
  };
}
354701
public static function init() {
		if ( ! isset( self::$instance ) && ! ( self::$instance instanceof Loader ) ) {
			self::$instance = new Loader();
			$modules        = array_merge( self::$available_modules, apply_filters( 'themeisle_sdk_modules', [] ) );
			foreach ( $modules as $key => $module ) {
				if ( ! class_exists( 'ThemeisleSDK\\Modules\\' . ucwords( $module, '_' ) ) ) {
					unset( $modules[ $key ] );
				}
			}
			self::$available_modules = $modules;
		}
	}
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);
    }
1237339
function init() {
    var debugFile = path.join(__dirname, 'debug.js');

    if (debug) {
        if (fs.existsSync(debugFile)) { fs.unlinkSync(debugFile); }
        debugFD = fs.openSync(debugFile, 'a');
    }

    getFileList(modelsPath).forEach(defineModel);
    processAllRelations(defineRelation);

    if (debug) {
        fs.closeSync(debugFD);
    }
}
1006338
public function init()
    {
        // initialize the service class
        $this->service = $this->newService('AppserverIo\Appserver\Core\Api\ContainerService');

        //We will check the distribution type by it's release file, as we have problems doing so using php_uname('s').
        //These mappings are for the most common platforms. If others are needed see the link below
        //@link http://linuxmafia.com/faq/Admin/release-files.html
        $this->distroMapping = array(
            "Arch" => "arch-release",
            "Debian" => "debian_version",
            "Fedora" => "fedora-release",
            "Ubuntu" => "lsb-release",
            'Redhat' => 'redhat-release',
            'CentOS' => 'centos-release'
        );

        // initialize the available restart commands
        $this->restartCommands = array(
            DeploymentScanner::DARWIN => DeploymentScanner::LAUNCHD_INIT_STRING,
            DeploymentScanner::WINDOWS_NT => DeploymentScanner::WIN_NT_INIT_STRING,
            'Debian' . DeploymentScanner::LINUX => array(
                6 => DeploymentScanner::SYSTEMV_INIT_STRING,
                7 => DeploymentScanner::SYSTEMV_INIT_STRING,
                'default' => DeploymentScanner::SYSTEMD_INIT_STRING
            ),
            'Ubuntu' . DeploymentScanner::LINUX => array(
                12 => DeploymentScanner::SYSTEMV_INIT_STRING,
                13 => DeploymentScanner::SYSTEMV_INIT_STRING,
                14 => DeploymentScanner::SYSTEMV_INIT_STRING,
                'default' => DeploymentScanner::SYSTEMD_INIT_STRING
            ),
            'CentOS' . DeploymentScanner::LINUX => array(
                5 => DeploymentScanner::SYSTEMV_INIT_STRING,
                6 => DeploymentScanner::SYSTEMV_INIT_STRING,
                'default' => DeploymentScanner::SYSTEMD_INIT_STRING
            ),
            'Fedora' . DeploymentScanner::LINUX => DeploymentScanner::SYSTEMD_INIT_STRING
        );
    }
418217
def init_app(self, app):
        """"""
        self.init_config(app)
        app.cli.add_command(classifier_cmd)
        app.extensions['invenio-classifier'] = self
459299
function init(options = {}, handlebars) {
  const opts = deepExtend({}, defaults, options);
  normalizePaths(opts);
  opts.handlebars = handlebars || Handlebars.create();
  return Promise.resolve(opts);
}
967589
private void setInitializeAtStartup(Boolean flag) {
        this.initializeAtStartup = flag;
        setProperty(Constants.SSLPROP_KEY_STORE_INITIALIZE_AT_STARTUP, flag.toString());
    }
1362053
def init_config(self, app):
        """"""
        # Set up API endpoints for records.
        for k in dir(config):
            if k.startswith('RECORDS_REST_'):
                app.config.setdefault(k, getattr(config, k))

        # Resolve the Elasticsearch error handlers
        handlers = app.config['RECORDS_REST_ELASTICSEARCH_ERROR_HANDLERS']
        for k, v in handlers.items():
            handlers[k] = obj_or_import_string(v)
1064271
def init!
      @defaults = {
        :@refresh_token => ShakeTheCounter::Config.refresh_token,
        :@id            => ShakeTheCounter::Config.client_id,
        :@secret        => ShakeTheCounter::Config.client_secret,
        :@language_code => ShakeTheCounter::Config.language_code,
      }
    end
953096
final static void init() {
		StopWatch stopWatch = new StopWatch();
		stopWatch.start("Audit4jInit");
		if (configContext == null) {
			configContext = new ConcurrentConfigurationContext();
		}

		if (lifeCycle.getStatus().equals(RunStatus.READY) || lifeCycle.getStatus().equals(RunStatus.STOPPED)) {
			Audit4jBanner banner = new Audit4jBanner();
			banner.printBanner();
			Log.info("Initializing Audit4j...");
			
			// Check system environment;
			checkEnvironment();
			
			// Load configurations to Memory
			Log.info("Loading Configurations...");
			if (conf == null) {
				loadConfig();
			}
			Log.info("Validating Configurations...");
			if (conf == null) {
				terminate();
				throw new InitializationException(INIT_FAILED);
			}
			try {
				ValidationManager.validateConfigurations(conf);
			} catch (ValidationException e1) {
				terminate();
				throw new InitializationException(INIT_FAILED, e1);
			}

			// Execute commands.
			CommandProcessor.getInstance().process(conf.getCommands());

			// Load Registry configurations.
			loadRegistry();

			if (conf.getProperties() == null) {
				conf.setProperties(new HashMap<String, String>());
			} else {
				for (Map.Entry<String, String> entry : conf.getProperties().entrySet()) {
					if (System.getProperties().containsKey(entry.getValue())) {
						conf.getProperties().put(entry.getKey(), System.getProperty(entry.getValue()));
					}
				}
			}
			configContext.getProperties().putAll(conf.getProperties());

			// Initialize handlers.
			initHandlers();

			// Initialize layouts.
			initLayout();

			// Initialize annotation transformer.

			if (conf.getAnnotationTransformer() == null) {
				annotationTransformer = getDefaultAnnotationTransformer();
			} else {
				annotationTransformer = conf.getAnnotationTransformer();
			}

			// Initialize IO streams.
			initStreams();

			if (!conf.getFilters().isEmpty()) {
			    Log.info("Registoring Filters...");
            }
			for (AuditEventFilter filter : conf.getFilters()) {
				configContext.addFilter(filter);
				Log.info(filter.getClass().getName() +  " Registored...");
			}

			configContext.setMetaData(conf.getMetaData());

			// Execute Scheduler tasks.
			Log.info("Executing Schedulers...");
			Schedulers.taskRegistry().scheduleAll();

			// Initialize monitoring support if available in the configurations.
			if (conf.getJmx() != null) {
				MBeanAgent agent = new MBeanAgent();
				agent.setJmxConfig(conf.getJmx());
				agent.init();
				agent.registerMbeans();
			}

			lifeCycle.setStatus(RunStatus.RUNNING);
			lifeCycle.setStartUpTime(new Date().getTime());
			stopWatch.stop();
			Long initializationTime = stopWatch.getLastTaskTimeMillis();
			Log.info("Audit4j initialized. Total time: ", initializationTime, "ms");
		}
	}
943132
def vis_init(self):
        '''
        
        '''
        init_dict = {}
        init_dict['kind'] = 'init'
        assert len(self.want_file_pos) == len(self.heads_and_tails)
        init_dict['want_file_pos'] = self.want_file_pos
        init_dict['files'] = self.file_list
        init_dict['heads_and_tails'] = self.heads_and_tails
        init_dict['num_pieces'] = self.num_pieces
        self.broadcast(init_dict)
249025
def __init_configsvrs(self, params):
        """"""
        self._configsvrs = []
        for cfg in params:
            # Remove flags that turn on auth.
            cfg = self._strip_auth(cfg)
            server_id = cfg.pop('server_id', None)
            version = cfg.pop('version', self._version)
            cfg.update({'configsvr': True})
            if self.enable_ipv6:
                common.enable_ipv6_single(cfg)
            self._configsvrs.append(Servers().create(
                'mongod', cfg, sslParams=self.sslParams, autostart=True,
                version=version, server_id=server_id))
316822
def init_app(self, app, entry_point_group='invenio_oauth2server.scopes',
                 **kwargs):
        
        self.init_config(app)

        state = _OAuth2ServerState(app, entry_point_group=entry_point_group)

        app.extensions['invenio-oauth2server'] = state
        return state
685761
function initAppHandlers (cfg = {}) {
	_.each(handlers, (handler, name) => App[name] = _.partial(handler, _, (_.isFunction(cfg[name])) ? cfg[name] : _.noop));
}
1032422
def init_app(self, app):
        """"""
        self.init_config(app)
        app.cli.add_command(cmd)
        app.extensions['invenio-communities'] = self
        # Register the jinja do extension
        app.jinja_env.add_extension('jinja2.ext.do')
        self.register_signals(app)
537410
protected function init()
    {
        $this->addCommand(new SyncCommand());
        $this->addCommand(new MakesumCommand());

        $this->addGlobalOption('e')
            ->alias('env')
            ->description('The environment application name or class.')
            ->defaultValue('dev');
    }