List<ClarifiedResolveResult> (@NotNull QualifiedRatedResolveResult resolveResult, @NotNull PyResolveContext resolveContext) { final PsiElement resolved = resolveResult.getElement(); if (resolved instanceof PyCallExpression resolvedCall) { // foo = classmethod(foo) final Pair<String, PyFunction> wrapperInfo = interpretAsModifierWrappingCall(resolvedCall); if (wrapperInfo != null) { final String wrapperName = wrapperInfo.getFirst(); final PyFunction.Modifier wrappedModifier = PyNames.CLASSMETHOD.equals(wrapperName) ? PyFunction.Modifier.CLASSMETHOD : PyNames.STATICMETHOD.equals(wrapperName) ? PyFunction.Modifier.STATICMETHOD : null; final ClarifiedResolveResult result = new ClarifiedResolveResult(resolveResult, wrapperInfo.getSecond(), wrappedModifier, false); return Collections.singletonList(result); } } else if (resolved instanceof PyFunction function) { final TypeEvalContext context = resolveContext.getTypeEvalContext(); if (function.getProperty() != null && isQualifiedByInstance(function, resolveResult.getQualifiers(), context)) { final PyType type = context.getReturnType(function); return type instanceof PyFunctionType ? Collections.singletonList(new ClarifiedResolveResult(resolveResult, ((PyFunctionType)type).getCallable(), null, false)) : Collections.emptyList(); } } return resolved != null ? Collections.singletonList(new ClarifiedResolveResult(resolveResult, resolved, null, resolved instanceof PyClass)) : Collections.emptyList(); }