String (@NotNull PsiElement element) { final PyStringLiteralExpression stringLiteralExpression = PsiTreeUtil.getParentOfType(element, PyStringLiteralExpression.class); if (stringLiteralExpression != null) { final String text = stringLiteralExpression.getText(); final Pair<String,String> quotes = PyStringLiteralCoreUtil.getQuotes(text); final PyDocStringOwner docStringOwner = PsiTreeUtil.getParentOfType(stringLiteralExpression, PyDocStringOwner.class); if (docStringOwner != null && stringLiteralExpression.equals(docStringOwner.getDocStringExpression())) { String indent = getIndent(stringLiteralExpression); if (quotes != null) { final List<String> strings = StringUtil.split(text, "\n"); if (strings.get(strings.size()-1).trim().equals(quotes.getSecond())) { return indent + quotes.getSecond(); } else { return quotes.getSecond(); } } return indent + "\""; } else return quotes != null? quotes.getSecond() : "\""; } return ""; }