Check for dependency cycles.
13978
def cleanup(self):
        
        if not self.pending_children:
            return

        nclist = [(n, find_cycle([n], set())) for n in self.pending_children]

        genuine_cycles = [
            node for node,cycle in nclist
                     if cycle or node.get_state() != NODE_EXECUTED
        ]
        if not genuine_cycles:
            # All of the "cycles" found were single nodes in EXECUTED state,
            # which is to say, they really weren't cycles.  Just return.
            return

        desc = 'Found dependency cycle(s):\n'
        for node, cycle in nclist:
            if cycle:
                desc = desc + "  " + " -> ".join(map(str, cycle)) + "\n"
            else:
                desc = desc + \
                    "  Internal Error: no cycle found for node %s (%s) in state %s\n" %  \
                    (node, repr(node), StateString[node.get_state()])

        raise SCons.Errors.UserError(desc)
1282560
def check(self, diff):
        """"""
        path = diff.b_path
        contrib_path = self.project.contrib_module_path
        assert pathlib.Path(contrib_path) in pathlib.Path(path).parents
241924
protected function checkDependency($dependencies = null)
    {
        $errors = array();

        if (is_null($dependencies)) $dependencies = array();

        $i = 0;
        $clean = true;
        foreach ($dependencies as $module => $version)
        {
            if ($module == $this->systemName)
            {
                if (!$this->sysVersionDependency($version))
                    $clean = false;

                continue;
            }

            $depModule = ModuleModel::where('module_name', $module)->first();
            if (!$depModule)
            {
                $this->errors->add("module_dependency_$i", "Module $module with version $version not installed");
                $clean = false;
            }
            else
            {
                $depVersion = $depModule->module_version;
                $needVersion = $version;

                $depVersion = new Version($depVersion);
                $needVersion = new Version($needVersion);

                if (!$depVersion->isPartOf($needVersion))
                {
                    $this->errors->add("module_dependency_$i", 'Module '.$module.' v'.$needVersion->getVersion().' must install, but '.$depVersion->getVersion().' installed.');
                    $clean = false;
                }
            }
            $i++;
        }

        if(!$clean)
            return false;

        return true;
    }
905511
function checkDependencies(req, res) {
                    var modelName = req.params.modelName,
                        id = req.params.documentId,
                        models = _.pluck(registry.models, 'model');

                    dependencies.check(models, modelName, id, function (err, depPair) {
                        if (err) throw err;
                        if (_.isEmpty(depPair)) return res.json(200, []);
                        var deps = depPair[1];
                        var lines = dependencies.depsToLines(deps);
                        return res.json(200, lines);
                    });
                }
1111022
def dependency_ran(self, test):
        """"""
        for d in (self.test_name(i) for i in dependencies[test]):
            if d not in self.ok_results:
                return "Required test '{}' did not run (does it exist?)".format(d)
        return None
654006
def CheckDependencies(self, verbose_output=True):
    
    print('Checking availability and versions of dependencies.')
    check_result = True

    for module_name, dependency in sorted(self.dependencies.items()):
      if module_name == 'sqlite3':
        result, status_message = self._CheckSQLite3()
      else:
        result, status_message = self._CheckPythonModule(dependency)

      if not result and module_name == 'lzma':
        dependency.name = 'backports.lzma'
        result, status_message = self._CheckPythonModule(dependency)

      if not result and not dependency.is_optional:
        check_result = False

      self._PrintCheckDependencyStatus(
          dependency, result, status_message, verbose_output=verbose_output)

    if check_result and not verbose_output:
      print('[OK]')

    print('')
    return check_result
522351
def check_dependencies():
    
    available = []
    try:
        shell('ebook-convert')
        available.append('calibre')
    except OSError:
        pass
    try:
        shell('pandoc --help')
        available.append('pandoc')
    except OSError:
        pass
    if not available:
        sys.exit(error('No generator found, you cannot use md2ebook.'))
    check_dependency_epubcheck()
    return available
601540
def we_depend_on_them(decls):
        """"""
        to_be_included = set()
        for decl in decls:
            to_be_included.update(dependency_info_t.i_depend_on_them(decl))
        return to_be_included
388844
def extract_dependencies(pipe_def=None, pipe_generator=None):
    """"""
    if pipe_def:
        pydeps = gen_dependencies(pipe_def)
    elif pipe_generator:
        pydeps = pipe_generator(Context(describe_dependencies=True))
    else:
        raise Exception('Must supply at least one kwarg!')

    return sorted(set(pydeps))
1041495
def missing_dependencies():
    """"""
    missing_deps = []
    for dependency in DEPENDENCIES:
        if not dependency.check() and not dependency.optional:
            missing_deps.append(dependency)
    if missing_deps:
        return status(deps=missing_deps, linesep='<br>')
    else:
        return ""
134953
def get_dependencies(self):
    """"""
    producer_infos = set()
    for product_type in self._dependencies:
      producer_infos.update(self._get_producer_infos_by_product_type(product_type))
    return producer_infos
690306
function fetchUnmetDependencies() {
        var runAgain = false;
        for (var id in dependencyMap) {
            _.forEach(dependencyMap[id], function (depId) {
                if (!dependencyMap[depId] && !injectedMap[depId]) {
                    try {
                        loadExternalModule(id, depId);
                    } catch (err) {
                        throw new Error('Error loading dependency ' + depId + ' for ' + id + ': ' + err.message);
                    }

                    runAgain = true;
                }
            });
        }

        if (runAgain) { //continue until all we don't have any more unmet dependencies
            fetchUnmetDependencies();
        }
    }
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)
1182451
def show_dependencies(self):
        """"""
        from spyder.widgets.dependencies import DependenciesDialog
        dlg = DependenciesDialog(self)
        dlg.set_data(dependencies.DEPENDENCIES)
        dlg.exec_()
742299
def subsystem_dependencies_iter(cls):
    """"""
    for dep in cls.subsystem_dependencies():
      if isinstance(dep, SubsystemDependency):
        yield dep
      else:
        yield SubsystemDependency(dep, GLOBAL_SCOPE, removal_version=None, removal_hint=None)
637922
def pull_dependencies(collector, image, **kwargs):
    """"""
    for dep in image.commands.dependent_images:
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)
743612
private void checkDependencies() {
    if (basedOnResult != null) {
      if (!input.isComplete() || !algs.isComplete() || basedOnResult.get() != algs.getAlgorithmStep().getResult()) {
        // We've become invalidated, notify.
        basedOnResult = null;
        firePanelUpdated();
      }
    }
  }