ResolveResultList (@NotNull List<Instruction> instructions, @NotNull PsiElement element, @NotNull String name, @NotNull TypeEvalContext context) { final ResolveResultList ret = new ResolveResultList(); for (Instruction instruction : instructions) { final PsiElement definition = instruction.getElement(); // TODO: This check may slow down resolving, but it is the current solution to the comprehension scopes problem if (isInnerComprehension(element, definition)) continue; if (definition instanceof PyImportedNameDefiner definer && !(definition instanceof PsiNamedElement)) { final List<RatedResolveResult> resolvedResults = definer.multiResolveName(name); for (RatedResolveResult result : resolvedResults) { ret.add(new ImportedResolveResult(result.getElement(), result.getRate(), definer)); } if (resolvedResults.isEmpty()) { ret.add(new ImportedResolveResult(null, RatedResolveResult.RATE_NORMAL, definer)); } else { // TODO this kind of resolve contract is quite stupid ret.poke(definer, RatedResolveResult.RATE_LOW); } } else { ret.poke(definition, getRate(definition, context)); } } final ResolveResultList results = new ResolveResultList(); for (RatedResolveResult r : ret) { final PsiElement e = r.getElement(); if (e == element || element instanceof PyTargetExpression && e != null && PyUtil.inSameFile(element, e) && PyPsiUtils.isBefore(element, e)) { continue; } results.add(changePropertyMethodToSameNameGetter(r, name)); } return results; }