Object (@NotNull PyReferenceExpression expression) { if (!expression.isQualified()) { if (myNamespace != null) { return myNamespace.get(expression.getReferencedName()); } if (!myEnableResolve) { return null; } final var context = TypeEvalContext.codeInsightFallback(expression.getProject()); final ResolveResult[] results = expression.getReference(PyResolveContext.defaultContext(context)).multiResolve(false); if (results.length != 1) { return null; } PsiElement result = results[0].getElement(); if (result instanceof PyTargetExpression) { result = ((PyTargetExpression)result).findAssignedValue(); } if (result instanceof PyExpression) { return evaluate((PyExpression)result); } } return null; }