@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyParenthesizedExpression expression)
    throws IncorrectOperationException {
    final PsiElement lastChild = expression.getLastChild();
    if (lastChild != null && !")".equals(lastChild.getText())) {
      editor.getDocument().insertString(expression.getTextRange().getEndOffset(), ")");
    }
  }
@Override
  public void doApply(@NotNull Editor editor, @NotNull PySmartEnterProcessor processor, @NotNull PyParenthesizedExpression expression)