Returns a list of parent todos that (in)directly depend on the
        given todo.
542391
def parents(self, p_todo, p_only_direct=False):
        
        parents = self._depgraph.incoming_neighbors(
            hash(p_todo), not p_only_direct)
        return [self._tododict[parent] for parent in parents]
883578
function (id) {
    var todos = [];
    for (var i in _todos) {
      if (_todos[i].todo_list_id === id) {
        todos.push(_todos[i]);
      }
    }
    return todos;
  }
1264213
def _needs_dependencies(p_function):
    
    def build_dependency_information(p_todolist):
        for todo in p_todolist._todos:
            p_todolist._register_todo(todo)

    def inner(self, *args, **kwargs):
        if not self._initialized:
            self._initialized = True

            from topydo.lib.Graph import DirectedGraph
            self._depgraph = DirectedGraph()

            build_dependency_information(self)

        return p_function(self, *args, **kwargs)

    return inner
1352587
protected void getDependencies(JSONObject jsonObject, String rootDirectory, Collection<DependencyInfo> dependencies) {
        try {
            CommandLineProcess npmLs = new CommandLineProcess(rootDirectory, getLsCommandParams());
            npmLs.setTimeoutReadLineSeconds(this.npmTimeoutDependenciesCollector);
            List<String> linesOfNpmLs = npmLs.executeProcess();
            getDependencies(jsonObject, linesOfNpmLs, 1, dependencies);
        } catch (IOException e) {
            logger.warn("Error getting dependencies after running 'npm ls --json' on {}, error : {}", rootDirectory, e.getMessage());
            logger.debug("Error: {}", e.getStackTrace());
        }
    }
946533
def group(self, p_todos):
        
        # preorder todos for the group sort
        p_todos = _apply_sort_functions(p_todos, self.pregroupfunctions)

        # initialize result with a single group
        result = OrderedDict([((), p_todos)])

        for (function, label), _ in self.groupfunctions:
            oldresult = result
            result = OrderedDict()
            for oldkey, oldgroup in oldresult.items():
                for key, _group in groupby(oldgroup, function):
                    newgroup = list(_group)

                    if not isinstance(key, list):
                        key = [key]

                    for subkey in key:
                        subkey = "{}: {}".format(label, subkey)
                        newkey = oldkey + (subkey,)

                        if newkey in result:
                            result[newkey] = result[newkey] + newgroup
                        else:
                            result[newkey] = newgroup

        # sort all groups
        for key, _group in result.items():
            result[key] = self.sort(_group)

        return result
1202180
private Collection<DependencyInfo> collectPackageJsonDependencies(Collection<BomFile> packageJsons) {
        Collection<DependencyInfo> dependencies = new LinkedList<>();
        ConcurrentHashMap<DependencyInfo, BomFile> dependencyPackageJsonMap = new ConcurrentHashMap<>();
        ExecutorService executorService = Executors.newWorkStealingPool(NUM_THREADS);
        Collection<EnrichDependency> threadsCollection = new LinkedList<>();
        for (BomFile packageJson : packageJsons) {
            if (packageJson != null && packageJson.isValid()) {
                // do not add new dependencies if 'npm ls' already returned all
                DependencyInfo dependency = new DependencyInfo();
                dependencies.add(dependency);
                threadsCollection.add(new EnrichDependency(packageJson, dependency, dependencyPackageJsonMap, npmAccessToken));
                logger.debug("Collect package.json of the dependency in the file: {}", dependency.getFilename());
            }
        }
        runThreadCollection(executorService, threadsCollection);
        logger.debug("set hierarchy of the dependencies");
        // remove duplicates dependencies
        Map<String, DependencyInfo> existDependencies = new HashMap<>();
        Map<DependencyInfo, BomFile> dependencyPackageJsonMapWithoutDuplicates = new HashMap<>();
        for (Map.Entry<DependencyInfo, BomFile> entry : dependencyPackageJsonMap.entrySet()) {
            DependencyInfo keyDep = entry.getKey();
            String key = keyDep.getSha1() + keyDep.getVersion() + keyDep.getArtifactId();
            if (!existDependencies.containsKey(key)) {
                existDependencies.put(key, keyDep);
                dependencyPackageJsonMapWithoutDuplicates.put(keyDep, entry.getValue());
            }
        }
        setHierarchy(dependencyPackageJsonMapWithoutDuplicates, existDependencies);
        return existDependencies.values();
    }
943216
def check_dependencies(self):
        """"""
        deadlocks = []

        for task in self.iflat_tasks():
            for dep in task.deps:
                if dep.node.depends_on(task):
                    deadlocks.append((task, dep.node))

        if deadlocks:
            lines = ["Detect wrong list of dependecies that will lead to a deadlock:"]
            lines.extend(["%s <--> %s" % nodes for nodes in deadlocks])
            raise RuntimeError("\n".join(lines))
163112
public List<HealthDependencyPresenter> getDependencies() {
    List<HealthDependencyPresenter> dependencies = Lists.newArrayList();
    if (dto.getDependencies().isPresent()) {
      for (HealthDependencyDto dependencyDto : dto.getDependencies().get()) {
        dependencies.add(new HealthDependencyPresenter(dependencyDto));
      }
    }
    return dependencies;
  }
97966
def find_tasks(source_code):
    """"""
    results = []
    for line, text in enumerate(source_code.splitlines()):
        for todo in re.findall(TASKS_PATTERN, text):
            todo_text = (todo[-1].strip(' :').capitalize() if todo[-1]
                         else todo[-2])
            results.append((todo_text, line + 1))
    return results
418171
public function toWords($todo = null) {
		$this->toWords = true;

		if ($todo !== null)
			$this->todo = $todo;

		if ($this->todo !== null)
			return $this->doQuadrillion();
	}
545585
private void collectChildren(DependencyInfo dependencyInfo, HashMap<String, DependencyInfo> packageDependencyMap,
                                 HashMap<DependencyInfo, Collection<String>> requireDependenciesMap) {
        Collection<String> requires = requireDependenciesMap.get(dependencyInfo);
        // check if dependencyInfo object already have children's
        if (dependencyInfo.getChildren().isEmpty()) {
            for (String require : requires) {
                DependencyInfo dependencyChild = packageDependencyMap.get(require);
                if (dependencyChild != null) {
                    dependencyInfo.getChildren().add(dependencyChild);
                    collectChildren(dependencyChild, packageDependencyMap, requireDependenciesMap);
                }
            }
        }
    }
668673
function calculateDependencyTree(initList) {
        if (initList) {
            return _.map(initList, function (initItem) {
                return [initItem];
            });
        } else {

            var id;
            for (id in dependencyMap) {
                var mod = moduleMap[id];
                if (mod && mod.getDependencies) {

                    //dynamically look up deps with mod's getDependency function --used by express
                    var deps = normalizeServiceNames(mod.getDependencies.call(null, injectedMap['service-loader']));
                    debug('Found additional dependencies for %s', id, deps);
                    deps = _.uniq(deps.concat(dependencyMap[id]));
                    depCalc.addNode(id, deps);
                } else {
                    depCalc.addNode(id, dependencyMap[id]);
                }
            }

            //injected modules have no dependencies by default
            for (id in injectedMap) {
                if (!dependencyMap[id]) { //when you do an inject, you can specify a dependency
                    depCalc.addNode(id, []);
                }
            }

            return depCalc.calcGroups(); //could throw an error
        }
    }
550061
public List<Entry> getDirectChildren(Dn parent) throws NoSuchNodeException, MissingParentException {
        return extractEntriesFromCursor(searchOneLevel(parent));
    }
409844
def parents(self):
        
        return [self.repository.get_changeset(parent)
                for parent in self._commit.parents]
1330109
function getAllDependencies() {
    var folder = './' + getBowerFolder();
    var bowerDependencies = fs.readdirSync(folder, {encoding: 'utf8'});

    var dependencyInfos = [];
    bowerDependencies.forEach(function(dirname) {
        var filepath = nodePath.resolve(cwd, folder, dirname, '.bower.json');
        if (fs.existsSync(filepath)) {
            var dependencyInfo = getDependency(filepath);
            dependencyInfo.dirName = dirname;
            dependencyInfos.push(dependencyInfo);
        }
    });

    return dependencyInfos;
}
382978
def projects(self):
        
        result = set()
        for todo in self._todos:
            projects = todo.projects()
            result = result.union(projects)

        return result
351968
def toDict(self):
		

		# Init the dictionary we will return
		dRet = {
			"__name__": self._name
		}

		# Get the parents dict and add it to the return
		dRet.update(super(Tree,self).toDict())

		# Return
		return dRet