setup defaults and callbacks
777468
function() {
								jQuery.each(req.apps, function(idx, item) {
									item.name = item.name || item.appId;
									F2.log('Removed failed ' + item.name + ' app', item);
									F2.AppHandlers.__trigger(
										_sAppHandlerToken,
										F2.Constants.AppHandlers.APP_MANIFEST_REQUEST_FAIL,
										item // the app config
									);
									F2.removeApp(item.instanceId);
								});
							}
558487
function () {
  'use strict';

  // default options for pattern-importer
  var options = {

    environment: {
      config: {
        server: {
          baseDir: './app'
        },
        host: 'localhost',
        port: 8001,
        debugInfo: false,
        open: true
      }
    },
    showConsoleLog: true,
    dependencies: [] // gulp tasks which should be run before this task

  };

  return options;
}
1194622
function(callback) {
            var toInit = ['config', 'logger'];
            loader.loadServices(path.resolve(serverRoot, 'services'));
            injectDependencies(loader);

            loader.init(toInit, function(err) {
                callback(err);
            });
        }
811399
function setDefaults(scope, defaults) {
        if (!defaults) { return; }

        // store defaults for use in generateRemodel
        scope.defaults = defaults;

        for (var name in defaults) {
            if (defaults.hasOwnProperty(name) && scope[name] === undefined) {
                scope[name] = defaults[name];
            }
        }
    }
961250
function setOptions(cfg = {}) {
    console.log('setting handler options...', cfg);
    // override the default options
    _.defaultsDeep(handlers, cfg.handlers);
}
1290907
function () {
      var done = this.async();
      var questions = [];
      var choices = [
        {
          name: 'Standard Preset',
          value: 'standard'
        },
        {
          name: 'Minimum Preset',
          value: 'minimum'
        },
        {
          name: 'Custom Configuration (Advanced)',
          value: 'custom'
        }
      ];
      var defaultType = 'standard';

      if (!this.skipWelcomeMessage) {
        this.log(yosay('Welcome to ' + this.pkg.name + ' v' + this.pkg.version));
      }

      if (!this.configType) {
        if (this.config.existed) {
          choices.splice(2, 0, {
            name: 'User Preset',
            value: 'user'
          });
          defaultType = 'user';
        }
        questions.push({
          type: 'list',
          name: 'configType',
          message: 'Setup Type',
          choices: choices,
          default: defaultType
        });
      }

      this.prompt(questions, function (answers) {
        if (typeof answers.configType !== 'undefined') {
          this.configType = answers.configType;
        }

        // Preset for skipping prompt
        switch (this.configType) {
          case 'standard':
            this.preset = standardPreset;
            break;
          case 'minimum':
            this.preset = minimumPreset;
            break;
          case 'user':
            this.preset = this.config.getAll();
            break;
          case 'custom':
            this.preset = {};
            break;
        }

        // Initial settings
        this.settings = _.assign({}, defaultConfig, this.config.getAll());

        done();
      }.bind(this));
    }
813003
public function setDefaultFunctions()
    {
        $this->setLink() //set link() function
             ->setTwigBaseUrl(); //set baseUrl() function

        foreach ($this->functions as $key => $func) {
            $this->twigEnvironment->addFunction($func);
        }
    }
1363529
def init_defaults(self):
        
        super(ModelTable, self).init_defaults()
        self.model = self.table
        self.name = self.model._meta.db_table
1065617
def init_defaults(self):
        
        super(SimpleTable, self).init_defaults()
        self.name = self.table
1293900
def _build_callback(self, config):
        '''  '''
        wrapped = config['callback']
        plugins = self.plugins + config['apply']
        skip    = config['skip']
        try:
            for plugin in reversed(plugins):
                if True in skip: break
                if plugin in skip or type(plugin) in skip: continue
                if getattr(plugin, 'name', True) in skip: continue
                if hasattr(plugin, 'apply'):
                    wrapped = plugin.apply(wrapped, config)
                else:
                    wrapped = plugin(wrapped)
                if not wrapped: break
                functools.update_wrapper(wrapped, config['callback'])
            return wrapped
        except RouteReset: # A plugin may have changed the config dict inplace.
            return self._build_callback(config)
1332133
function NachosConfig() {
  var defaults = {
    packages: nachosHome('packages'),
    server: 'http://nachosjs.herokuapp.com',
    defaults: {
      shell: 'shell',
      exts: {}
    },
    startup: []
  };

  debug('creating new settings file with these defaults: %j', defaults);

  SettingsFile.call(this, 'nachos', {
    globalDefaults: defaults
  });
}
697197
public function setup() {
		if ( ! empty( $this->struct['sanitize_callback'] ) ) {
			add_filter( 'uix_' . $this->slug . '_sanitize_' . $this->type, $this->struct['sanitize_callback'] );
		}

		parent::setup();
	}
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)
}
573027
def _insert_defaults(self):
        
        merged = merge_defaults(self.structure, self)
        self.update(merged)
114041
function(settings, callback) {
    "use strict";

    if (typeof settings === 'function') {
      callback = settings;
      settings = {};
    }

    if (typeof settings === 'undefined') {
      settings = {};
    }

    if (typeof callback !== 'function') {
      callback = function () {};
    }

    getLogFiles(function () {
      parseOptions(settings, function () {
        setupLogger();

        require('./Logger').verbose('Starting worker manager');

        // Start the Master
        master = require('./master');

        registerListeners(master);

        master.start();

        callback();
      });
    });
  }
346251
function setDefaultSettings(settings) {
  if (!settings)
    throw new Error('Settings must be an object.')

  // Default settings for each project type.
  switch (settings.projectType) {
    case 'cli':
    case 'node-app':
    case 'node-lib':
      settings.platforms ??= ['node']
      break

    case 'lib':
      settings.platforms ??= ['browser', 'node']
      break

    case 'react-spa':
      settings.platforms ??= ['browser']
      settings.jsx ??= true
      settings.react ??= true
      break

    case 'web-lib':
      settings.platforms ??= ['browser']
      break
  }

  // Default supported browsers inferred by the platform.
  if (settings.platforms.includes('browsers')) {
    settings.browsers ??= [
      '>= 0.5%',
      'not ie 11',
      'not op_mini all',
    ]
  }

  // Default supported NodeJS inferred by the platform.
  if (settings.platforms.includes('node'))
    settings.node ??= '8.9'
}
15229
function overrideConfig() {
    _.merge(Elixir.config, require(path.join(process.cwd(), 'elixirConfig.js')));
}