boolean (@NotNull PsiFileSystemItem anchor, @NotNull PsiElement footHold, @NotNull List<PyImportElement> importElements, @NotNull Predicate<String> filter, @NotNull Processor<List<? extends RatedResolveResult>> resultProcessor) { final PyFile module = PyUtil.as(PyUtil.turnDirIntoInit(anchor), PyFile.class); final List<QualifiedName> packageQNames = QualifiedNameFinder.findImportableQNames(footHold, anchor.getVirtualFile()); for (PyImportElement importElement : importElements) { for (QualifiedName packageQName : packageQNames) { for (QualifiedName importedQName : getImportedQNames(importElement)) { final String directChild = findFirstComponentAfterPrefix(importedQName, packageQName); if (directChild != null && filter.test(directChild)) { final List<RatedResolveResult> results = ResolveImportUtil.resolveChildren(anchor, directChild, module, true, true, false, false); if (!resultProcessor.process(ResolveResultList.asImportedResults(results, importElement))) { return false; } } } } } return true; }