boolean (PsiElement element) { if (element instanceof PyTargetExpression && element.getParent() instanceof PyAssignmentStatement stmt && PsiTreeUtil.getParentOfType(element, PyFunction.class) != null) { if (stmt.getTargets().length == 1) { return true; } } return false; }