Access to module through app.
166556
public function only(...$layouts){
		if( !in_array(app::$response->layout->_name, $layouts) ){
			(new Report('Runtime/CantBeUsedInThisLayout'))->stop();
		}
	}
1147054
def module_for(args)
      registry = self
      mod = Module.new

      args.each do |visibility, exports|
        exports.each do |dependency_name, method_name|
          # equivalent to (e.g.):
          #
          #   def foo
          #     registry.fetch(:foo)
          #   end
          mod.send(:define_method, method_name) do
            registry.fetch(dependency_name)
          end

          # equivalent to (e.g.):
          #
          #   private :foo
          mod.send(visibility, method_name)
        end
      end

      mod
    end
321444
def get_app(self, reference_app=None):
        """"""

        if reference_app is not None:
            return reference_app

        if current_app:
            return current_app._get_current_object()

        if self.app is not None:
            return self.app

        raise RuntimeError(
            'No application found. Either work inside a view function or push'
            ' an application context. See'
            ' http://flask-sqlalchemy.pocoo.org/contexts/.'
        )
215459
function (name) {
    // initialize module instance with default module configuration
    _.merge(this, defaultModuleConfig)
    // set app name
    this.name = name
    // set absolute path of base directory for module
    this.base = getBase()
    // store reference to global app
    this.immutableApp = immutableApp
}
521174
function loadAndDescribeModuleInCwd() {
// Hack: Trick node into changing process.mainScript to moduleToDebug
  moduleToDebug = Module._load(location, module, true);

  var sample = getSampleCommand();
  sampleLine = util.format('You can access your module as `m`%s.', sample);

  prompt = getModuleName() + '> ';
}
1142326
def get_app_submodules(submodule_name):
    
    for name, module in get_app_modules():
        if module_has_submodule(module, submodule_name):
            yield name, import_module('%s.%s' % (name, submodule_name))
667590
def aboutModule( module, parent = None, logo = '' ):
        
        
        dlg = XAboutDialog( parent )
        dlg.setLogo( logo )
        dlg.setInfo( XAboutDialog.moduleInfo(module) )
        
        dlg.exec_()
1011310
def get_module(app, modname, verbose=False, failfast=False):
    
    module_name = '%s.%s' % (app, modname)
    try:
        module = import_module(module_name)
    except ImportError as e:
        if failfast:
            raise e
        elif verbose:
            print("Could not load %r from %r: %s" % (modname, app, e))
        return None
    if verbose:
        print("Loaded %r from %r" % (modname, app))
    return module
954550
function (e) {
		currentProgram = undefined;
		currentModule = {
			name: null,
			resource: getResourceName(e.filename),
			module: getModuleName(getResourceName(e.filename)),
			localNames: Object.create(null)
		};
	}
189390
def access_view(name, **kwargs):
    
    ctx = Context(**kwargs)
    ctx.execute_action('access:view', **{
        'unicorn': ctx.repo.create_secure_service('unicorn'),
        'service': name,
    })
17200
def load_module(self, module):
        
        # pylint: disable=unused-variable
        for name, obj in inspect.getmembers(module,
                                            lambda member: hasattr(member, '__module__')
                                            and member.__module__ == module.__name__
                                            and inspect.isclass):
            self.load_class(obj)
998331
def setup_app_scope(name, scope):
    """"""

    # load plugins
    plugins = []
    for plugin_name, active in get('settings').get('rw.plugins', {}).items():
        plugin = __import__(plugin_name)
        plugin_path = plugin_name.split('.')[1:] + ['plugin']
        for sub in plugin_path:
            plugin = getattr(plugin, sub)
        plugins.append(scope.activate(plugin))

    yield plugins
    raise rw.gen.Return(scope['settings'])
1138691
def load_module(modulename, modulepath):
    
    if '.' in modulename:
        modulepackage, modulebase = modulename.rsplit('.', 1)
    else:
        modulepackage = ''

    imp.acquire_lock()
    try:
        # Check if module is already loaded
        if modulename not in sys.modules:
            # Find module on disk and try to load it
            path, name = os.path.split(modulepath)
            name = os.path.splitext(name)[0]
            handle, path, info = imp.find_module(name, [path])
            try:
                # Load the module and put into sys.modules
                module = imp.load_module(modulename, handle, path, info)
                if modulepackage:
                    setattr(sys.modules[modulepackage], modulebase, module)
            finally:
                # Make sure handle is closed properly
                if handle:
                    handle.close()
    finally:
        imp.release_lock()

    return sys.modules[modulename]
58139
function(moduleId) {
		var visitedModules = {};
		var recurse = function(moduleId) {
			if (visitedModules[moduleId] == true) { return true; }
			visitedModules[moduleId] = true;
			var module = getModule(moduleId);
			if (!module || !module.defined) { return false; }
			else {
				var deps = module.deps || [];
				for (var i = deps.length; i--;) {
					if (!recurse(deps[i])) {
						return false;
					}
				}
				return true;
			}
		};
		return recurse(moduleId);
	}
1329584
def load_module(self, module):
        
        if isinstance(module, basestring) and module.find('.') > -1:
            a = module.split('.')
            module = ('.%s' % a[-1], '.'.join(a[:-1]))
        try:
            module = import_module(*module)
        except Exception, e:
            return e
        
        for name in dir(module):
            if name.startswith('_'): continue
            obj = getattr(module, name)
            if callable(obj):
                for tag in settings.TAG_TYPES:
                    if hasattr(obj, tag) and getattr(obj, tag) in (1, True):
                        name = getattr(obj, 'name', obj.__name__)
                        if name in self[tag]:
                            continue
                        if hasattr(obj, 'name'):
                            self.register(tag, getattr(obj, 'name'), obj)
                        else:
                            self.register(tag, obj)
211172
def _load_from_module(module):
    
    settings = OrderedDict()

    for key in dir(module):
        if key.isupper():
            settings[key] = getattr(module, key)
    return settings
77536
function getModule (name) {
    // create new module if it does not already exist
    if (!defined(immutableApp.modules[name])) {
        // create module
        immutableApp.modules[name] = new ImmutableAppModule(name)
        // add to list
        immutableApp.moduleNames.push(name)
    }
    // return module
    return immutableApp.modules[name]
}