boolean (@NotNull final PsiScopeProcessor processor, @NotNull final ResolveState state, final PsiElement lastParent, @NotNull final PsiElement place) { // import is per-file if (place.getContainingFile() != getContainingFile()) { return true; } if (isStarImport()) { final List<PsiElement> targets = ResolveImportUtil.resolveFromImportStatementSource(this, getImportSourceQName()); for (PsiElement target : targets) { final PsiElement importedFile = PyUtil.turnDirIntoInit(target); if (importedFile != null) { PsiScopeProcessor starImportableNamesProcessor = new DelegatingScopeProcessor(processor) { @Override public boolean execute(@NotNull PsiElement element, @NotNull ResolveState state) { if (element instanceof PyElement && importedFile instanceof PyFile && !PyUtil.isStarImportableFrom(StringUtil.notNullize(((PyElement)element).getName()), (PyFile)importedFile)) { return true; } return super.execute(element, state); } }; if (!importedFile.processDeclarations(starImportableNamesProcessor, state, null, place)) { return false; } } } } else { PyImportElement[] importElements = getImportElements(); for (PyImportElement element : importElements) { if (!processor.execute(element, state)) { return false; } } } return true; }