Run every startup to get config and instantiate the feature

@returns {undefined}
354991
async function onEveryExtensionLoad() {
  new StudyLifeCycleHandler();

  const studySetup = await getStudySetup();
  await browser.study.logger.log(["Study setup: ", studySetup]);
  await browser.study.setup(studySetup);
}
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
}
627166
function() {
  var app = this;
  if (typeof app.config.logger == 'function') {
    app.config.logger(app);
  } else {
    var defaults = {
      name: app.settings.shortname || app.settings.name || app.settings.title || 'base',
      level: 'info'
    };
    var opts = app.config.logger && app.config.logger.options
                ? _.defaults({}, app.config.logger.options, defaults): defaults;
    if (app.config.logger && app.config.logger.type === 'bunyan') {
      var bunyan = require('bunyan');
      app.log.logger = bunyan.createLogger(opts);
    } else {
      app.log.logger = new log.SimpleLogger(opts);
    }
  }
}
654970
function () {
      var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];

      options.base = this;
      return _emberApplicationSystemEngineInstance.default.create(options);
    }
688945
function init(configuration){
    var self = {
        config : configuration,
        adapters : [],
        getWhenCurrentWritesDone : getWhenCurrentWritesDone
    };

    _.each(self.config.adapters, function(adapter){
        var adapterInstance;

        try {
            adapterInstance = require('./adapters/' + adapter.type).init(adapter);
        } catch (e) {
            console.log(chalk.red('Initialization Error: '), e);
            throw e;
        }

        adapterInstance.writeQueue = BB.resolve();

        self.adapters.push(adapterInstance);
    });

    [
        'error',
        'info',
        'debug',
        'warn',
        'trace',
        'critical'
    ].forEach(function (type) {
        /**
         * Create a TYPE log entry
         * @param category Categorize your error with a user defined label
         * @param args Include your customized messages. This should be a comma separated list just like `console.log`
         */
        self[type] = function () {
            // If we are still logging and there are messages to write
            if(arguments.length > 0){
                var category = (arguments.length > 1 && _.isString(arguments[0])) ? arguments[0] : '',
                    startIdx = (arguments.length > 1) ? 1 : 0;

                _write.call(self, type, category, Array.prototype.slice.call(arguments, startIdx));
            }
        };
    });

    return self;
}
201609
function main() {
    const options = queryOptions();
    switch (options.porting) {
        case 'build':
            runBuild(options)
            .catch((reason) => {
                console.error(reason);
                process.exit(1);
            });
            break;
        case 'arrange':
            runArrange(options);
            break;
        case 'rebase':
            runRebase(options);
            break;
        case 'clean':
            runClean(options);
            break;
    }
}
789576
async function initializeRealtime({ getApp, onCreate, onDelete, url, token }) {
  const realtimeConfig = { token, url }

  try {
    realtime
      .subscribe(realtimeConfig, APPS_DOCTYPE)
      .onCreate(async app => {
        // Fetch directly the app to get attributes `related` as well.
        let fullApp
        try {
          fullApp = await getApp(app.slug)
        } catch (error) {
          throw new Error(`Cannot fetch app ${app.slug}: ${error.message}`)
        }

        if (typeof onCreate === 'function') {
          onCreate(fullApp)
        }
      })
      .onDelete(app => {
        if (typeof onDelete === 'function') {
          onDelete(app)
        }
      })
  } catch (error) {
    console.warn(`Cannot initialize realtime in Cozy-bar: ${error.message}`)
  }
}
111772
function run(options, callback) {
  var settings = {}
  var stdin = new PassThrough()
  var tree
  var detectConfig
  var hasConfig
  var detectIgnore
  var hasIgnore

  try {
    stdin = process.stdin
  } catch (error) {
    /* Obscure bug in Node (seen on windows):
     * - https://github.com/nodejs/node/blob/f856234/lib/internal/
     *   process/stdio.js#L82;
     * - https://github.com/AtomLinter/linter-markdown/pull/85.
     */
  }

  if (!callback) {
    throw new Error('Missing `callback`')
  }

  if (!options || !options.processor) {
    return next(new Error('Missing `processor`'))
  }

  /* Processor. */
  settings.processor = options.processor

  /* Path to run as. */
  settings.cwd = options.cwd || process.cwd()

  /* Input. */
  settings.files = options.files || []
  settings.extensions = (options.extensions || []).map(extension)

  settings.filePath = options.filePath || null
  settings.streamIn = options.streamIn || stdin

  /* Output. */
  settings.streamOut = options.streamOut || process.stdout
  settings.streamError = options.streamError || process.stderr
  settings.alwaysStringify = options.alwaysStringify
  settings.output = options.output
  settings.out = options.out

  /* Null overwrites config settings, `undefined` doesn’t. */
  if (settings.output === null || settings.output === undefined) {
    settings.output = undefined
  }

  if (settings.output && settings.out) {
    return next(new Error('Cannot accept both `output` and `out`'))
  }

  /* Process phase management. */
  tree = options.tree || false

  settings.treeIn = options.treeIn
  settings.treeOut = options.treeOut
  settings.inspect = options.inspect

  if (settings.treeIn === null || settings.treeIn === undefined) {
    settings.treeIn = tree
  }

  if (settings.treeOut === null || settings.treeOut === undefined) {
    settings.treeOut = tree
  }

  /* Configuration. */
  detectConfig = options.detectConfig
  hasConfig = Boolean(options.rcName || options.packageField)

  if (detectConfig && !hasConfig) {
    return next(
      new Error('Missing `rcName` or `packageField` with `detectConfig`')
    )
  }

  settings.detectConfig =
    detectConfig === null || detectConfig === undefined
      ? hasConfig
      : detectConfig
  settings.rcName = options.rcName || null
  settings.rcPath = options.rcPath || null
  settings.packageField = options.packageField || null
  settings.settings = options.settings || {}
  settings.configTransform = options.configTransform
  settings.defaultConfig = options.defaultConfig

  /* Ignore. */
  detectIgnore = options.detectIgnore
  hasIgnore = Boolean(options.ignoreName)

  settings.detectIgnore =
    detectIgnore === null || detectIgnore === undefined
      ? hasIgnore
      : detectIgnore
  settings.ignoreName = options.ignoreName || null
  settings.ignorePath = options.ignorePath || null
  settings.silentlyIgnore = Boolean(options.silentlyIgnore)

  if (detectIgnore && !hasIgnore) {
    return next(new Error('Missing `ignoreName` with `detectIgnore`'))
  }

  /* Plug-ins. */
  settings.pluginPrefix = options.pluginPrefix || null
  settings.plugins = options.plugins || {}

  /* Reporting. */
  settings.reporter = options.reporter || null
  settings.reporterOptions = options.reporterOptions || null
  settings.color = options.color || false
  settings.silent = options.silent || false
  settings.quiet = options.quiet || false
  settings.frail = options.frail || false

  /* Process. */
  fileSetPipeline.run({files: options.files || []}, settings, next)

  function next(error, context) {
    var stats = statistics((context || {}).files)
    var failed = Boolean(
      settings.frail ? stats.fatal || stats.warn : stats.fatal
    )

    if (error) {
      callback(error)
    } else {
      callback(null, failed ? 1 : 0, context)
    }
  }
}
790596
function init(config) {
    var promises = [];

    if (config.redis) {
        _.each(config.redis.dbs, function (idx, name) {
            promises.push(
                connectToRedis(idx, config.redis)
                    .then(function (remoteCache) {
                        caches[name] = wrapRemoteCache(remoteCache);
                        return true;
                    })
            );
        });
    }

    // initialization done once all connections established
    return Q.all(promises)
        .then(function () {
            return config;
        });
}
387580
function config() {
  // only run this if it's not running inside Now.sh
  if (Boolean(process.env.NOW_REGION || process.env.NOW)) return

  const secrets = loadSecrets()
  const required = loadRequired()

  // load environment variables from now.json
  loadNowJSON(secrets, required)
}
632186
function setup() {
    return browser.getProcessedConfig()
        .then((configuration) => {
            let cucumberFormat = configuration.cucumberOpts.format;

            IS_JSON_FORMAT = cucumberFormat && cucumberFormat.includes('json');

            if (Array.isArray(cucumberFormat)) {
                IS_JSON_FORMAT = cucumberFormat.find((format) => {
                    cucumberFormat = format;
                    return format.includes('json')
                });
            }

            if (IS_JSON_FORMAT) {
                /**
                 * If options are provided override the values to the PLUGIN_CONFIG object
                 */
                if (this.config.options) {
                    Object.assign(PLUGIN_CONFIG, this.config.options);
                }

                /**
                 * Get the JSON folder path and file name if they are still empty
                 */
                const formatPathMatch = cucumberFormat.match(/(.+):(.+)/);
                const filePathMatch = formatPathMatch[2].match(/(.*)\/(.*)\.json/);

                // Get the cucumber results path
                PLUGIN_CONFIG.cucumberResultsPath = filePathMatch[1];

                // Get the cucumber report name
                PLUGIN_CONFIG.cucumberReportName = filePathMatch[2];

                /**
                 * If the json output folder is still default, then create a new one
                 */
                if (PLUGIN_CONFIG.jsonOutputPath === JSON_OUTPUT_FOLDER) {
                    PLUGIN_CONFIG.jsonOutputPath = path.join(PLUGIN_CONFIG.cucumberResultsPath, JSON_OUTPUT_FOLDER);
                }

                /**
                 * Check whether the file name need to be unique
                 */
                PLUGIN_CONFIG.uniqueReportFileName = (Array.isArray(configuration.multiCapabilities)
                    && configuration.multiCapabilities.length > 0)
                    || typeof configuration.getMultiCapabilities === 'function'
                    || configuration.capabilities.shardTestFiles;

                /**
                 * Prepare the PID_INSTANCE_DATA
                 */
                const metadata = {
                    browser: {
                        name: '',
                        version: ''
                    },
                    device: '',
                    platform: {
                        name: '',
                        version: ''
                    }
                };

                PID_INSTANCE_DATA = {
                    pid: process.pid,
                    metadata: Object.assign(metadata, configuration.capabilities[PLUGIN_CONFIG.metadataKey] || {})
                };

                /**
                 * Create the needed folders if they are not present
                 */
                fs.ensureDirSync(PLUGIN_CONFIG.cucumberResultsPath);
                fs.ensureDirSync(PLUGIN_CONFIG.jsonOutputPath);
            } else {
                console.warn('\n### NO `JSON` FORMAT IS SPECIFIED IN THE PROTRACTOR CONF FILE UNDER `cucumberOpts.format ###`\n');
            }
        });
}
998770
function(params) {
			$.extend(globalConfig, params || {});

			this.startAll(document.documentElement);

			this.fire('init');
			initialized = true;
		}
764298
function createApplication() {
  var app = connect();
  utils.merge(app, proto);
  app.request = { __proto__: req };
  app.response = { __proto__: res };
  app.init();
  return app;
}
328543
function start(config) {
		if (!isConfigurationParametersDefinedCorrectly(config)) {
			throw new Error('license-check - Configuration error');
		}

		var folders = [];
		if (config.src) {
			folders = getFoldersToCheck(config.src);
		}

		if (folders.length === 0) {
			gutil.log('license-check', gutil.colors.red('{src} not defined or empty, the plugin will run with the default configuration: **/*'));
			folders = getDefaultFolders();
		}

		var src = vfs.src(folders);
		src.pipe(license(config));
		return src;
	}
171519
function start() {
  const node = process.execPath
  const daemonFile = path.join(__dirname, '../daemon')
  const startupFile = startup.getFile('hotel')

  startup.create('hotel', node, [daemonFile], common.logFile)

  // Save startup file path in ~/.hotel
  // Will be used later by uninstall script
  mkdirp.sync(common.hotelDir)
  fs.writeFileSync(common.startupFile, startupFile)

  console.log(`Started http://localhost:${conf.port}`)
}
1275363
def start config={}, &block
      @config.update(config).update(load_config)
      #@config = (config.empty?) ? load_config : config
      log "Starting #{name} in the background.."
      logfile = get_logfile(config)
      daemonize(logfile, get_pidfile(config)) do
        yield(self) if block_given?
        trap('TERM') { handle_exit }
        trap('INT')  { handle_exit }
        (respond_to?(:__start!)) ? __start! : perform(@config)
        # If this process doesn't loop or otherwise breaks out of 
        # the loop we still want to clean up after ourselves
        handle_exit
      end
    end
624596
function create() {
  var app = junction();
  utils.merge(app, application);
  app.init();
  return app;
}