Create a Module instance, init fields, generate the method that returns initial record properties
@param {Lava.system.App} lava_app Application instance
@param {_cModule} config
@param {string} name Module's name
553210
function(lava_app, config, name) {

		this._app = lava_app;
		this._config = config;
		this._name = name;

		this._createFields(config);

		this._record_constructor = Lava.ClassManager.getConstructor(
			config.record_class || Lava.schema.data.DEFAULT_RECORD_CLASS,
			'Lava.data'
		);

		if ('id' in this._fields) {

			this._has_id = true;
			this._fields['id'].on('changed', this._onRecordIdChanged, this);

		}

	}
851596
@Override
    public void init(ApplicationConfig config) 
    	throws ServletException {

        // The ApplicationConfig is used by the Application to configure itself.
        mConfig = config;

        // A log for keeping track of events specific to this application
        mLog = config.getLog();

    }
728724
function Config(module) {
  if (!(this instanceof Config))
    return new Config(module);

  assert(typeof module === 'string');
  assert(module.length > 0);

  this.module = module;
  this.network = 'mainnet';
  this.prefix = Path.join(HOME, `.${module}`);

  this.options = Object.create(null);
  this.data = Object.create(null);
  this.env = Object.create(null);
  this.args = Object.create(null);
  this.argv = [];
  this.pass = [];
  this.query = Object.create(null);
  this.hash = Object.create(null);
}
541588
def init_app(module, BASE_DIR, **kwargs):
    
    global app

    def init_config():
        """
        Load settings module and attach values to the application
        config dictionary
        """
        if 'FLASK_PHILO_SETTINGS_MODULE' not in os.environ:
            raise ConfigurationError('No settings has been defined')

        app.config['BASE_DIR'] = BASE_DIR

        # default settings
        for v in dir(default_settings):
            if not v.startswith('_'):
                app.config[v] = getattr(default_settings, v)

        app.debug = app.config['DEBUG']

        # app settings
        settings = importlib.import_module(
            os.environ['FLASK_PHILO_SETTINGS_MODULE'])
        for v in dir(settings):
            if not v.startswith('_'):
                app.config[v] = getattr(settings, v)

        def init_urls():
            # Reads urls definition from URLs file and bind routes and views
            urls_module = importlib.import_module(app.config['URLS'])
            for route in urls_module.URLS:
                app.add_url_rule(
                    route[0], view_func=route[1].as_view(route[2]))

        def init_logging():
            """
            initialize logger for the app
            """

            hndlr = logging.StreamHandler()
            formatter = logging.Formatter(
                '%(asctime)s - %(name)s - %(levelname)s - %(message)s')
            hndlr.setFormatter(formatter)
            app.logger.addHandler(hndlr)
            log_level = app.config['LOG_LEVEL']
            app.logger.setLevel(getattr(logging, log_level))

        def init_flask_oauthlib():
            """
            http://flask-oauthlib.readthedocs.io/en/latest/oauth2.html
            """
            oauth.init_app(app)

        def init_cors(app):
            """
            Initializes cors protection if config
            """

            if 'CORS' in app.config:
                CORS(
                    app,
                    resources=app.config['CORS'],
                    supports_credentials=app.config.get(
                        "CORS_SUPPORT_CREDENTIALS",
                        False
                    ),
                    allow_headers=app.config.get(
                        "CORS_ALLOW_HEADERS",
                        "Content-Type,Authorization,accept-language,accept"
                    )
                )

        init_db(g, app)
        init_logging()
        init_urls()
        init_flask_oauthlib()
        init_jinja2(g, app)
        init_cors(app)
    app = Flask(module)
    init_config()
    return app
1097440
function Application(ctx, config) {
	// validate params
	if (!ctx && !config) {
		// both empty
		ctx = document;
		config = {};
	}
	else if (Utils.isNode(config)) {
		// reverse order of arguments
		var tmpConfig = config;
		config = ctx;
		ctx = tmpConfig;
	}
	else if (!Utils.isNode(ctx) && !config) {
		// only config is given
		config = ctx;
		ctx = document;
	}
	else if (Utils.isNode(ctx) && !config) {
		// only ctx is given
		config = {};
	}

	var defaults = {
		namespace: Module
	};

	config = Utils.extend(defaults, config);

	/**
	 * The context node.
	 *
	 * @property _ctx
	 * @type Node
	 */
	this._ctx = Utils.getElement(ctx);

	/**
	 * The configuration.
	 *
	 * @property config
	 * @type Object
	 */
	this._config = config;

	/**
	 * The sandbox to get the resources from.
	 * The singleton is shared between all modules.
	 *
	 * @property _sandbox
	 * @type Sandbox
	 */
	this._sandbox = new Sandbox(this);

	/**
	 * Contains references to all modules on the page.
	 *
	 * @property _modules
	 * @type Object
	 */
	this._modules = {};

	/**
	 * The next unique module id to use.
	 *
	 * @property id
	 * @type Number
	 */
	this._id = 1;
}
242425
function(config) {

		var locale = Lava.schema.LOCALE,
			resource_owner,
			component_resource,
			resources;

		if ('resources_cache' in config) {

			resources = config.resources_cache[locale];

		}

		if ('resource_id' in config) {

			resource_owner = this['locateViewBy' + config.resource_id.locator_type](config.resource_id.locator);
			if (Lava.schema.DEBUG && (!resource_owner || !resource_owner.isWidget))
				Lava.t("Resource root not found: " + config.resource_id.locator_type + '=' + config.resource_id.locator);
			component_resource = resource_owner.getResource(config.resource_id.name, Lava.schema.LOCALE);

			if (component_resource) {

				if (Lava.schema.DEBUG && component_resource.type != 'component') Lava.t("resource value is not a component");

				resources = resources
					? Lava.resources.mergeResources(component_resource.value, resources)
					: component_resource.value;

			}

		}

		if (resources) {
			this._resources[locale] = resources;
			Lava.resources.mergeRootContainerStacks(resources);
		}

	}
30590
def create_config(name)

      name = ConfigurationList.symbol_config_name_to_config_name[name] if ConfigurationList.symbol_config_name_to_config_name[name]

      # @todo a configuration has additional fields that are ususally set with
      #   some target information for the title.

      new_config = @registry.add_object(Configuration.default_properties(name))
      @properties['buildConfigurations'] << new_config.identifier

      yield new_config if block_given?

      new_config.save!
    end
1081890
function initialize(app, options) {
  var log = logger.get(options);
  app._mukoan = app._mukoan || {};
  if (!app._mukoan.initialized) {
    var config = defaults({}, options, DEFAULT_CONFIGURATION);
    log.info('Starting and configuring Koa server');

    // Setup global error handler and logger
    app.use(middlewares.error(config.error));
    app.on('error', (error) => log.error('Unexpected exception ', error));
    app._mukoan.initialized = true;
  } else {
    log.warn('Trying to initialize the same Koa instance twice (ignoring action)');
  }
}
186083
function getModuleConfig(nameOrPath,modules) {
    for (var i = 0; i < modules.length; i++) {
        var config = modules[i];
        if (config.options && (config.options.directory === nameOrPath || config.name === nameOrPath)) {
            return config;
        }
    }
    return null;
}
277213
function(name, config) {
        if (typeof name !== 'string') {
          throw new TypeError('expected the first argument to be a string');
        }
        if (utils.isObject(config)) {
          config.name = name;
        }
        this.emit('scaffold.set', name, config);
        this.scaffolds[name] = config;
        return this;
      }
1334268
protected void initModule() {

        Object o;

        if (CmsStringUtil.isEmpty(getParamAction()) || CmsDialog.DIALOG_INITIAL.equals(getParamAction())) {
            // this is the initial dialog call
            if (CmsStringUtil.isNotEmpty(m_paramModule)) {
                // edit an existing module, get it from manager
                o = OpenCms.getModuleManager().getModule(m_paramModule);
            } else {
                // create a new module
                o = null;
            }
        } else {
            // this is not the initial call, get module from session
            o = getDialogObject();
        }

        if (!(o instanceof CmsModule)) {
            // create a new module
            m_module = new CmsModule();

        } else {
            // reuse module stored in session
            m_module = (CmsModule)((CmsModule)o).clone();
        }
    }
1277942
function(config) {

		if ('id' in config.fields) Lava.t("Id field in MetaStorage is not permitted");

		this._config = config;
		this._createFields(config);
		this.initFields(); // MetaStorage is constructed directly, not via App class

		var field;

		if (Lava.schema.DEBUG) {
			for (field in this._fields) {
				if (this._fields[field].isCollectionField || this._fields[field].isRecordField)
					Lava.t("Standard Collection and Record fields will not work inside the MetaStorage");
			}
		}

		this._record_constructor = Lava.ClassManager.getConstructor('MetaRecord', 'Lava.data');

	}
903067
@Override
    public void init(ServletConfig config) throws ServletException {
        super.init(config);
        m_management = (Management)
                m_server.getModule("org.fcrepo.server.management.Management");
        if (m_management == null) {
            throw new ServletException("Unable to get Management module from server.");
        }
    }
267004
function() {

		var default_properties = {},
			field_name;

		for (field_name in this._fields) {

			this._fields[field_name].onModuleFieldsCreated(default_properties);

		}

		this._createRecordProperties = new Function(
			"return " + Lava.serializer.serialize(default_properties)
		);

	}
694836
function Cms(module, with_app) {
  if (!module)
    throw new Error('Requires a module');
  if (!module.config)
    throw new Error('Module requires config');
  if (!module.config.name)
    logger.info('No name specified in config. Calling it null.')
  if (!module.config.mongoConnectString)
    throw new Error('Config requires mongoConnectString');
  if (!module.models)
    throw new Error('Module requires models');
  // module info and shortcut to configuration
  this.module = module;
  this.config = module.config;
  // connection to mongo
  this.connection = null;
  // the storage client
  this.client = null;
  // gridfs storage (untested)
  this.gfs = null;
  // the express app
  this.app = null;
  // login, logout
  this.auth = null;
  // meta info for models
  this.meta = null;
  // guard manages view permissions
  this.guard = null;
  // workflow provides state transition info to view
  this.workflow = null;

  logger.info('cms init');
  //process.nextTick(this._init.bind(this));
  this._init(with_app === undefined ? true : with_app);
}
977775
function (config) {
        config = config || {};

        if (config.onStart !== undefined) {
            if (!isFunction(config.onStart)) {
                throw new core.TypeError({
                    code: 'application-configure',
                    message: "config.onStart must be a function"
                });
            }

            this.onStart = config.onStart;
        }

        if (config.onStop !== undefined) {
            if (!isFunction(config.onStop)) {
                throw new core.TypeError({
                    code: 'application-configure',
                    message: "config.onStop must be a function"
                });
            }
            this.onStop = config.onStop;
        }

        return this;
    }
576656
function getModuleConfig(moduleName) {
                    if (!angular.isString(moduleName)) {
                        throw new Error('You need to give the name of the module to get');
                    }
                    if (!modules[moduleName]) {
                        return null;
                    }
                    return angular.copy(modules[moduleName]);
                }