@NotNull
  private static String calculateEscapedText(@NotNull String prevText,
                                             @NotNull TextRange range,
                                             String newContent) {
    final String newText = range.replace(prevText, newContent);

    if (PyStringLiteralCoreUtil.isQuoted(newText)) {
      return newText;
    }

    final Pair<String, String> quotes = calculateQuotes(prevText);
    return quotes.first + newText + quotes.second;
  }
@NotNull
  private static String calculateEscapedText(@NotNull String prevText,
                                             @NotNull TextRange range,
                                             String newContent)