boolean (@NotNull PsiElement e1, @NotNull PsiElement e2) { PyIfStatement ifStatement = ObjectUtils.tryCast(PsiTreeUtil.findCommonParent(e1, e2), PyIfStatement.class); if (ifStatement == null) return false; List<PyStatementPart> parts = getIfStatementParts(ifStatement); PyStatementPart p1 = findIfStatementPartByElement(e1, parts); PyStatementPart p2 = findIfStatementPartByElement(e2, parts); return p1 != p2; }