boolean (@NotNull PyStringLiteralExpression expr) { PyAssignmentStatement assignment = PsiTreeUtil.getParentOfType(expr, PyAssignmentStatement.class); if (assignment == null || !PsiTreeUtil.isAncestor(assignment.getAssignedValue(), expr, false)) { return false; } return isExplicitTypeAlias(assignment, TypeEvalContext.codeAnalysis(expr.getProject(), expr.getContainingFile())); }