Private method that registers an entry_point with a provided
        module.
169662
def _register_entry_point_module(self, entry_point, module):
        

        records_map = self._map_entry_point_module(entry_point, module)
        self.store_records_for_package(entry_point, list(records_map.keys()))

        for module_name, records in records_map.items():
            if module_name in self.records:
                logger.info(
                    "module '%s' was already declared in registry '%s'; "
                    "applying new records on top.",
                    module_name, self.registry_name,
                )
                logger.debug("overwriting keys: %s", sorted(
                    set(self.records[module_name].keys()) &
                    set(records.keys())
                ))
                self.records[module_name].update(records)
            else:
                logger.debug(
                    "adding records for module '%s' to registry '%s'",
                    module_name, self.registry_name,
                )
                self.records[module_name] = records
723695
def _loader(app, init_func, entry_points=None, modules=None):
    
    if entry_points:
        for entry_point in entry_points:
            for ep in pkg_resources.iter_entry_points(entry_point):
                try:
                    init_func(ep.load())
                except Exception:
                    app.logger.error(
                        'Failed to initialize entry point: {0}'.format(ep))
                    raise
    if modules:
        for m in modules:
            try:
                init_func(m)
            except Exception:
                app.logger.error('Failed to initialize module: {0}'.format(m))
                raise
1227859
def from_module(self, path):
        """"""
        bundles = PythonLoader(path).load_bundles()
        for name in bundles:
            self.register(name, bundles[name])
442262
function register( name, exports, options ) {
    var f       = 'register()'
      , _global = options.global
    ;
    
    de&&ug( f, name, exports, options );
    
    modules[ name ] && fatal( f + ' allready loaded: ' + name );
    
    modules[ name ] = exports || {};
    
    if ( exports && _global ) {
      name = typeof _global == 'string' ? _global : name;
      
      if ( options.no_conflict ) {
        var previous = global[ name ];
        
        exports.no_conflict = function() {
          global[ name ] = previous;
          
          return exports;
        };
      }
      
      global[ name ] = exports;
    }
  }
648524
function(module) {
		var name = module.$modname;
		if (!this.$hasModule(name)) {
			this._modules.push(module);
			if (gui.Type.isFunction(module.oncontextinitialize)) {
				module.oncontextinitialize(window);
			}
			if (gui.Type.isFunction(module.onrun)) {
				module.onrun();
			}
		} else {
			throw new Error(name + ' loaded twice?');
		}
		return module;
	}
665398
function register(module, value) {
        if (module in CORE_MODULES && DEBUG) {
          print(`\u26A0\uFE0F ${module} already registered`);
        }
        CORE_MODULES[module] = value;
      }
1353563
protected function registerAspectModule()
    {
        if (isset($this->configure['modules'])) {
            foreach ($this->configure['modules'] as $module) {
                $this->register($module);
            }
        }
    }
422771
def app_loader(app, entry_points=None, modules=None):
    
    _loader(app, lambda ext: ext(app), entry_points=entry_points,
            modules=modules)
1312018
function Module (rawModule, runtime) {
  this.runtime = runtime;
  // Store some children item
  this._children = Object.create(null);
  // Store the origin module object which passed by programmer
  this._rawModule = rawModule;
  var rawState = rawModule.state;

  // Store the origin module's state
  this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};
}
228640
def mapper(module, entry_point,
           modpath='pkg_resources', globber='root', modname='es6',
           fext=JS_EXT, registry=_utils):
    

    modname_f = modname if callable(modname) else _utils['modname'][modname]

    return {
        modname_f(modname_fragments): join(base, subpath)
        for modname_fragments, base, subpath in modgen(
            module, entry_point=entry_point,
            modpath=modpath, globber=globber,
            fext=fext, registry=_utils)
    }
1315375
def register(self, entry_point):
        
        if entry_point in self.registered_extensions:
            raise ValueError('Extension already registered')

        ep = EntryPoint.parse(entry_point)
        if ep.name in self.names():
            raise ValueError('An extension with the same name already exist')

        ext = self._load_one_plugin(ep, False, (), {}, False)
        self.extensions.append(ext)
        if self._extensions_by_name is not None:
            self._extensions_by_name[ext.name] = ext
        self.registered_extensions.insert(0, entry_point)
875562
def entry_point(self, entry_point):
        
        if len(entry_point.split(',')) == 1:
            self._params.update(
                href=self._resource.get(entry_point))
            return self
        else:
            self._params.update(
                filter_context=entry_point)
            return self
638168
def RegisterBuiltin(cls, arg):
        '''
        '''
        if arg in cls.types_dict:
            raise RuntimeError, '%s already registered' %arg
        class _Wrapper(arg):
            'Wrapper for builtin %s\n%s' %(arg, cls.__doc__)
        _Wrapper.__name__ = '_%sWrapper' %arg.__name__
        cls.types_dict[arg] = _Wrapper
1198702
function(options){
    // Prevent re-starting a module that is already started
    if (this._isInitialized){ return; }

    // start the sub-modules (depth-first hierarchy)
    _.each(this.submodules, function(mod){
      // check to see if we should start the sub-module with this parent
      if (mod.startWithParent){
        mod.start(options);
      }
    });

    // run the callbacks to "start" the current module
    this.triggerMethod("before:start", options);

    this._initializerCallbacks.run(options, this);
    this._isInitialized = true;

    this.triggerMethod("start", options);
  }
815605
def init_app(self, app):
        """"""
        if self.entry_point_group:
            eps = sorted(pkg_resources.iter_entry_points(
                self.entry_point_group), key=attrgetter('name'))
            for ep in eps:
                app.logger.debug("Loading config for entry point {}".format(
                    ep))
                app.config.from_object(ep.load())
505613
def entry_point(__func: Callable) -> Callable:
    
    if __func.__module__ == '__main__':
        import sys
        sys.exit(__func())
    else:
        return __func
1057794
def create_module(self, spec):
        """"""
        mod = super(NamespaceLoader2, self).create_module(spec)
        # Set a few properties required by PEP 302
        # mod.__file__ = [p for p in self.path]
        # this will set mod.__repr__ to not builtin... shouldnt break anything in py2...
        # CAREFUL : get_filename present implies the module has ONE location, which is not true with namespaces
        return mod