check if all the modules needed to create layers are loaded
482367
function(layers) {
    var mods = Layers.modulesForLayers(layers);
    return _.every(_.map(mods, function(m) { return cartodb[m] !== undefined; }));
  }
180253
function check() {
    module.hot.check(function(err, updatedModules) {
      if (err) return handleError(err);

      if (!updatedModules) {
        logger.warn('Cannot find update any update.');
        return;
      }

      apply(updatedModules);
    });
  }
476883
function(){
		var self = this;

		// Can only start a module that hasn't been started yet
		self.requireState( munit.ASSERT_STATE_DEFAULT, self.trigger );

		// Setup and trigger module
		self.start = self.end = Date.now();

		// Parent namespaces sometimes don't have tests
		// Also close out paths that aren't part of the focus
		if ( ! self.callback || ! munit.render.focusPath( self.nsPath ) ) {
			self.state = munit.ASSERT_STATE_CLOSED;
			return self._close();
		}

		// Trigger test setup first
		self._setup(function( e, setupCallback ) {
			if ( e ) {
				self.fail( "[munit] Failed to setup '" + self.nsPath + "' module", setupCallback, e );
				return self.close();
			}

			// Run test
			self.callback( self, self.queue );

			// If module isn't finished, then prove that it's supposed to be asynchronous
			if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
				// Only tear it down if no timeout is specified
				if ( self.options.timeout < 1 ) {
					self.close();
				}
				// Delayed close
				else if ( ! self.isAsync ) {
					self.isAsync = true;
					self._timerStart = Date.now();
					self._timeid = setTimeout(function(){
						if ( self.state < munit.ASSERT_STATE_TEARDOWN ) {
							self.close();
						}
					}, self.options.timeout );
				}
			}
		});

		return self;
	}
469464
def add_to_loaded_modules(self, modules):
        
        modules = util.return_set(modules)
        for module in modules:
            if not isinstance(module, str):
                module = module.__name__
            self.loaded_modules.add(module)
1274528
function loaded() {
            if (shimConf) {
                var exports;
                if (typeof shimConf.init === 'function') {
                    exports = shimConf.init.apply(
                        global,
                        modGetModulesExports(shimDeps, BUILDIN_MODULE)
                    );
                }

                if (exports == null && shimConf.exports) {
                    exports = global;
                    each(
                        shimConf.exports.split('.'),
                        function (prop) {
                            exports = exports[prop];
                            return !!exports;
                        }
                    );
                }

                globalDefine(moduleId, shimDeps, function () { 
                    return exports || {};
                });
            }
            else {
                modCompletePreDefine(moduleId);
            }

            modAutoDefine();
        }
74885
function ensure(files, options) {
    // Update the global array of represented modules
    unused = filterRepresented(unused, files, options)

    verbose.writeln('Unrepresented modules list currently at ', unused)

    // Only print message when all targets have been run
    if (++numRuns === getNumTargets()) {
      if (unused.length) {
        if (options.report) {
          log.writeln('\nPackages left out:')
          log.writeln(unused.join('\n'))
        }
      } else if (options.report) {
        log.ok('All modules have something copied.')
      }
    }
  }
967527
protected function checkLazyLoad()
    {
        if ($this->lazyLoadInitiated === true) {
            return;
        }

        $this->lazyLoad();
        $this->generateKeys();

        $this->lazyLoadInitiated = true;
    }
1060792
function(parentModule, kbox, id, app, callback) {

  if (typeof callback === 'undefined' && typeof app === 'function') {
    callback = app;
    app = undefined;
  }

  // Try to load module from node_modules and other directories.
  var parts = id.split('@');
  var pkg = parts[0];
  //var ver = parts[1];

  // Try to load module.
  return requireFromNodeModulesAndOtherDirs(parentModule, kbox, pkg, app)
  // Return.
  .nodeify(callback);

}
990757
def load(self, modules):
        
        self.modules_assoc = []
        for module in modules:
            if not module.enabled:
                logger.info("Module %s is declared but not enabled", module.name)
                # Store in our modules list but do not try to load
                # Probably someone else will load this module later...
                self.modules[module.uuid] = module
                continue
            logger.info("Importing Python module '%s' for %s...", module.python_name, module.name)
            try:
                python_module = importlib.import_module(module.python_name)

                # Check existing module properties
                # Todo: check all mandatory properties
                if not hasattr(python_module, 'properties'):  # pragma: no cover
                    self.configuration_errors.append("Module %s is missing a 'properties' "
                                                     "dictionary" % module.python_name)
                    raise AttributeError
                logger.info("Module properties: %s", getattr(python_module, 'properties'))

                # Check existing module get_instance method
                if not hasattr(python_module, 'get_instance') or \
                        not isinstance(getattr(python_module, 'get_instance'),
                                       collections.Callable):  # pragma: no cover
                    self.configuration_errors.append("Module %s is missing a 'get_instance' "
                                                     "function" % module.python_name)
                    raise AttributeError

                self.modules_assoc.append((module, python_module))
                logger.info("Imported '%s' for %s", module.python_name, module.name)
            except ImportError as exp:  # pragma: no cover, simple protection
                self.configuration_errors.append("Module %s (%s) can't be loaded, Python "
                                                 "importation error: %s" % (module.python_name,
                                                                            module.name,
                                                                            str(exp)))
            except AttributeError:  # pragma: no cover, simple protection
                self.configuration_errors.append("Module %s (%s) can't be loaded, "
                                                 "module configuration" % (module.python_name,
                                                                           module.name))
            else:
                logger.info("Loaded Python module '%s' (%s)", module.python_name, module.name)
524704
def layers():
  """"""
  global _cached_layers
  if _cached_layers is not None:
    return _cached_layers
  layers_module = tf.layers
  try:
    from tensorflow.python import tf2  # pylint: disable=g-direct-tensorflow-import,g-import-not-at-top
    if tf2.enabled():
      tf.logging.info("Running in V2 mode, using Keras layers.")
      layers_module = tf.keras.layers
  except ImportError:
    pass
  _cached_layers = layers_module
  return layers_module
852522
def get_loaded_modules(modules):
    ''''''

    _modules = []
    for mod in modules:
        mod_cfg = get_conf_from_module(mod)

        _modules.append((mod, mod_cfg,))

    _modules = sorted(_modules, key=lambda m: m[1].get('ordering'))

    return _modules
13896
def load_modules(self, modules, config):
        """"""
        for pluginclass in get_plugin_classes(modules):
            name = pluginclass.__name__
            if name in config["enabledplugins"]:
                if issubclass(pluginclass, _ConnectionPlugin):
                    log.debug(LOG_PLUGIN, "Enable connection plugin %s", name)
                    self.connection_plugins.append(pluginclass(config[name]))
                elif issubclass(pluginclass, _ContentPlugin):
                    log.debug(LOG_PLUGIN, "Enable content plugin %s", name)
                    self.content_plugins.append(pluginclass(config[name]))
                elif issubclass(pluginclass, _ParserPlugin):
                    log.debug(LOG_PLUGIN, "Enable parser plugin %s", name)
                    self.parser_plugins.append(pluginclass(config[name]))
                else:
                    raise ValueError("Invalid plugin class %s" % pluginclass)
162520
function () {
            count++;

            // all modules have been added have been added.
            if (count === modules.length) {
                // check if solution file content needs to be updated.
                if (isDirty) {
                    writeSolutionFileContents();
                    return;
                }

                // slight delay to ensure future tasks can interact with module files.
                setTimeout(done, 500);
                return;
            }

            var moduleName = modules[count];
            
            // ignore directory when module doesn't contain .csproj file.
            if (!fs.existsSync(path.join(options.modules, moduleName, moduleName + '.csproj'))) {
                addNextModule();
                return;
            }

            helpers.getProjectGuid(path.join(options.modules, moduleName, moduleName + '.csproj'), function (moduleGuid) {
                // module already exists in the solution, move onto the next one.
                if (alreadyInSolution(moduleGuid)) {
                    addNextModule();
                    return;
                }

                var projectReference = '\r\nProject("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "' + moduleName + '", "Orchard.Web\\Modules\\' + moduleName + '\\' + moduleName + '.csproj", "' + moduleGuid + '"\r\nEndProject\r\n';
                var projectConfiguationPlatforms = '\t\t' + moduleGuid + '.Debug|Any CPU.ActiveCfg = Debug|Any CPU\r\n\t\t' + moduleGuid + '.Debug|Any CPU.Build.0 = Debug|Any CPU\r\n\t\t' + moduleGuid + '.Release|Any CPU.ActiveCfg = Release|Any CPU\r\n\t\t' + moduleGuid + '.Release|Any CPU.Build.0 = Release|Any CPU\r\n';

                solutionFileContents = _s.insert(solutionFileContents, solutionFileContents.lastIndexOf('EndProject') + 10, projectReference)
                
                var sectionStart = solutionFileContents.indexOf("GlobalSection(ProjectConfigurationPlatforms)");
                var sectionEnd = sectionStart + solutionFileContents.substring(sectionStart).indexOf('EndGlobalSection');

                solutionFileContents = _s.insert(solutionFileContents, sectionEnd, projectConfiguationPlatforms);

                sectionStart = solutionFileContents.indexOf("GlobalSection(NestedProjects)");
                sectionEnd = sectionStart + solutionFileContents.substring(sectionStart).indexOf('EndGlobalSection');
                solutionFileContents = _s.insert(solutionFileContents, sectionEnd, '\t' + moduleGuid + ' = {' + SOLUTION_DIRECTORY_MODULES + '}\r\n\t');

                isDirty = true;

                addNextModule();
            });
        }
472716
def load_all_plugins(self):
        """"""

        # Go through the existing python files in the plugin directory
        self.plugin_path = os.path.realpath(self.plugin_dir)
        sys.path.append(self.plugin_dir)
        print '<<< Plugin Manager >>>'
        for f in [os.path.join(self.plugin_dir, child) for child in os.listdir(self.plugin_dir)]:

            # Skip certain files
            if '.DS_Store' in f or '__init__.py' in f: 
                continue

            # Add the plugin
            self.add_plugin(f)
546491
function verifyModules(filePaths) {
  return Promise.all(
    _.map(filePaths, function(filePath) {
      return firstline(filePath).then(function(line) {
        var matches = line.match(/^(?:(?:port|effect)\s+)?module\s+(\S+)\s*/);

        if (matches) {
          var moduleName = matches[1];
          var testModulePaths = moduleFromTestName(moduleName);
          var modulePath = moduleFromFilePath(filePath);

          // A module path matches if it lines up completely with a known one.
          if (
            !testModulePaths.every(function(testModulePath, index) {
              return testModulePath === modulePath[index];
            })
          ) {
            return Promise.reject(
              filePath +
                ' has a module declaration of "' +
                moduleName +
                '" - which does not match its filename!'
            );
          }
        } else {
          return Promise.reject(
            filePath +
              ' has an invalid module declaration. Check the first line of the file and make sure it has a valid module declaration there!'
          );
        }
      });
    })
  );
}
140762
function checkModule(pth, cb) {
  checkStrider(pth, function(err, config){
    if (err) return cb(err);
    if (config){
      config.dir = pth;
      return cb(null, config);
    }
    checkPackageJson(pth, function(err, config){
      if (err) return cb(err);
      if (config){
        config.dir = pth;
        return cb(null, config);
      }
      return cb(null, false);
    });
  });
}
1299684
def _load_greedy(self, module_name, dependencies, recursive):
        """"""
        found = module_name in self.modules
        allmodules = list(self._pathfiles.keys())
        i = 0

        while not found and i < len(allmodules):
            current = allmodules[i]
            if not current in self._modulefiles:
                #We haven't tried to parse this file yet
                self.parse(self._pathfiles[current], dependencies and recursive)                
                found = module_name in self.modules
            i += 1