boolean (@NotNull final PsiElement elementToMove, boolean down) { final PyStatementList statementList = getStatementList(elementToMove); if (statementList != null) { if (down) { final PsiElement child = statementList.getLastChild(); if (elementToMove == child && PsiTreeUtil.getNextSiblingOfType(statementList.getParent(), PyStatementPart.class) != null || child != elementToMove) { return true; } } else { return true; } } return statementList == null; }