Checks whether a depended-on module is available.
431824
def check_dependee_exists(self, depender, dependee, dependee_id):
		
		shutit_global.shutit_global_object.yield_to_draw()
		# If the module id isn't there, there's a problem.
		if dependee is None:
			return 'module: \n\n' + dependee_id + '\n\nnot found in paths: ' + str(self.host['shutit_module_path']) + ' but needed for ' + depender.module_id + '\nCheck your --shutit_module_path setting and ensure that all modules configured to be built are in that path setting, eg "--shutit_module_path /path/to/other/module/:."\n\nAlso check that the module is configured to be built with the correct module id in that module\'s configs/build.cnf file.\n\nSee also help.'
		return ''
457044
private void findModulesFromInput(
      CompilerInput input,
      boolean wasImportedByModule,
      Set<CompilerInput> inputs,
      Map<String, CompilerInput> inputsByIdentifier,
      Map<String, CompilerInput> inputsByProvide,
      boolean supportEs6Modules,
      boolean supportCommonJSModules) {
    if (!inputs.remove(input)) {
      // It's possible for a module to be included as both a script
      // and a module in the same compilation. In these cases, it should
      // be forced to be a module.
      if (wasImportedByModule && input.getJsModuleType() == CompilerInput.ModuleType.NONE) {
        input.setJsModuleType(CompilerInput.ModuleType.IMPORTED_SCRIPT);
      }
      return;
    }

    FindModuleDependencies findDeps =
        new FindModuleDependencies(
            this, supportEs6Modules, supportCommonJSModules, inputPathByWebpackId);
    findDeps.process(checkNotNull(input.getAstRoot(this)));

    // If this input was imported by another module, it is itself a module
    // so we force it to be detected as such.
    if (wasImportedByModule && input.getJsModuleType() == CompilerInput.ModuleType.NONE) {
      input.setJsModuleType(CompilerInput.ModuleType.IMPORTED_SCRIPT);
    }
    this.moduleTypesByName.put(input.getPath().toModuleName(), input.getJsModuleType());

    Iterable<String> allDeps =
        Iterables.concat(
            input.getRequiredSymbols(), input.getDynamicRequires(), input.getTypeRequires());
    for (String requiredNamespace : allDeps) {
      CompilerInput requiredInput = null;
      boolean requiredByModuleImport = false;
      if (inputsByProvide.containsKey(requiredNamespace)) {
        requiredInput = inputsByProvide.get(requiredNamespace);
      } else if (inputsByIdentifier.containsKey(requiredNamespace)) {
        requiredByModuleImport = true;
        requiredInput = inputsByIdentifier.get(requiredNamespace);
      }

      if (requiredInput != null) {
        findModulesFromInput(
            requiredInput,
            requiredByModuleImport,
            inputs,
            inputsByIdentifier,
            inputsByProvide,
            supportEs6Modules,
            supportCommonJSModules);
      }
    }
  }
603232
def is_skipped_module(self, module_name):
        
        if module_name is None:
            return False
        return super(Pdb, self).is_skipped_module(module_name)
1113597
public boolean dependsOn(DependencyNode dependency) {
        boolean dependsDirectly = dependenciesVia.contains(dependency);
        if (dependsDirectly)
            return true;
        for (DependencyNode reqDependency : dependency.dependantsVia) {
            if (dependsOn(reqDependency))
                return true;
        }
        return false;
    }
648763
function(module) {
			if (!module) {
				return;
			}

			var file = fileByModules(module);
			Array.prototype.push.apply(seen, file.modules);
			file.requires.forEach(function(module) {
				// Ignore resoled modules and dependencies in own file
				if((_.indexOf(resolved, module) < 0) &&
				   (_.indexOf(file.modules, module) < 0)) {
					// Catch circular dependencies
					if(_.indexOf(seen, module) < 0) {
						resolve(module);
					}
					else {
						grunt.fail.fatal('Circular dependency detected:\n\t' +
						                 file.modules.join(', ') + ' depend on ' +
						                 module, 1);
					}
				}
			});
			Array.prototype.push.apply(resolved, file.modules);
		}
1044659
def check_deps(deps):
        """"""
        if not isinstance(deps, list):
            deps = [deps]
        checks = list(Environment.has_apps(deps))
        if not all(checks):
            for name, available in list(dict(zip(deps, checks)).items()):
                if not available:
                    error_msg = "The required application/dependency '{0}'" \
                                " isn't available.".format(name)
                    raise SystemError(error_msg)
682694
def depends_on(self, dependency):
        
        packages = self.package_info()
        return [package for package in packages if dependency in package.get("requires", "")]
1123306
def has_module (name, without_error=True):
    
    try:
        importlib.import_module(name)
        return True
    except ImportError:
        return False
    except Exception:
        # some modules raise errors when intitializing
        return not without_error
729374
def check_available!(name, endpoint)
      check_name_available!(name) unless name.nil?
      check_endpoint_available!(endpoint) unless endpoint.nil?
    end
1041341
def _check_feature_dependences(self):
        """"""
        for mid in self.modules:
            for fst in self.modules[mid].statement.find_all("feature"):
                fn, fid = self.resolve_pname(fst.argument, mid)
                if fn not in self.modules[fid].features:
                    continue
                if not self.if_features(fst, mid):
                    raise FeaturePrerequisiteError(*fn)
1034235
function hasModule (name) {
    // throw error on invalid name
    requireValidName(name)
    // check if module exists
    return defined(immutable.modules[name]) ? true : false
}
308316
def check_deps(self):
		
		shutit_global.shutit_global_object.yield_to_draw()
		cfg = self.cfg
		self.log('PHASE: dependencies', level=logging.DEBUG)
		self.pause_point('\nNow checking for dependencies between modules', print_input=False, level=3)
		# Get modules we're going to build
		to_build = [
			self.shutit_map[module_id] for module_id in self.shutit_map
			if module_id in cfg and cfg[module_id]['shutit.core.module.build']
		]
		# Add any deps we may need by extending to_build and altering cfg
		for module in to_build:
			self.resolve_dependencies(to_build, module)

		# Dep checking
		def err_checker(errs, triples):
			"""Collate error information.
			"""
			new_triples = []
			for err, triple in zip(errs, triples):
				if not err:
					new_triples.append(triple)
					continue
				found_errs.append(err)
			return new_triples

		found_errs = []
		triples    = []
		for depender in to_build:
			for dependee_id in depender.depends_on:
				triples.append((depender, self.shutit_map.get(dependee_id), dependee_id))

		triples = err_checker([ self.check_dependee_exists(depender, dependee, dependee_id) for depender, dependee, dependee_id in triples ], triples)
		triples = err_checker([ self.check_dependee_build(depender, dependee, dependee_id) for depender, dependee, dependee_id in triples ], triples)
		triples = err_checker([ check_dependee_order(depender, dependee, dependee_id) for depender, dependee, dependee_id in triples ], triples)

		if found_errs:
			return [(err,) for err in found_errs]

		self.log('Modules configured to be built (in order) are: ', level=logging.DEBUG)
		for module_id in self.module_ids():
			module = self.shutit_map[module_id]
			if cfg[module_id]['shutit.core.module.build']:
				self.log(module_id + '    ' + str(module.run_order), level=logging.DEBUG)
		self.log('\n', level=logging.DEBUG)

		return []
1291825
def find_known_dependencies(self, requirement):
        
        logger.info("Checking for known dependencies of %s ..", requirement.name)
        known_dependencies = sorted(self.dependencies.get(requirement.name.lower(), []))
        if known_dependencies:
            logger.info("Found %s: %s", pluralize(len(known_dependencies), "known dependency", "known dependencies"),
                        concatenate(known_dependencies))
        else:
            logger.info("No known dependencies... Maybe you have a suggestion?")
        return known_dependencies
979064
public function hasAllRequiredModules()
    {
        $required = $this->getRequiredModules();
        $available = array_keys($this->module->getList());
        $difference = array_diff($required, array_intersect($required, $available));

        return empty($difference);
    }
1360948
def checkAvailable(from_module):
        
        if txrequests is None and treq is None:
            config.error("neither txrequests nor treq is installed, but {} is requiring it\n\n{}".format(
                from_module, HTTPClientService.TREQ_PROS_AND_CONS))
513408
def _find_dependent_modules(self, module):
        
        dms = set()
        for um in inspect.getmembers(module, inspect.ismodule):
            dms.add(um[1])

        for uc in inspect.getmembers(module, inspect.isclass):
            self._add_obj_module(dms, uc[1])
        for ur in inspect.getmembers(module, inspect.isroutine):
            self._add_obj_module(dms, ur[1])

        return dms
1172428
def has_attribute(module_name, attribute_name):
    """"""
    init_file = '%s/__init__.py' % module_name
    return any(
        [attribute_name in init_line for init_line in open(init_file).readlines()]
    )