Adds 2 newlines to the end of text
354840
def convert_p(element, text):
    
    depth = -1
    while element:
        if (not element.name == '[document]' and
                not element.parent.get('id') == '__RESTRUCTIFY_WRAPPER__'):
            depth += 1

        element = element.parent

    if text:
        text = '    ' * depth + text
    return text
13320
public String wrap(String text) {
        StringBuilder sb = new StringBuilder();
        int continuationLength = continuation.length();
        int currentPosition = 0;

        for (String word : text.split(" ")) {
            String lastWord;
            int wordLength = word.length();

            if (currentPosition + wordLength <= width) {
                if (currentPosition != 0) {
                    sb.append(" ");
                    currentPosition += 1;
                }

                sb.append(lastWord = word);
                currentPosition += wordLength;
            } else {
                if (currentPosition > 0) {
                    sb.append(LINE_SEPARATOR);
                    currentPosition = 0;
                }

                if (wordLength > width && strict) {
                    int i = 0;
                    while (i + width < wordLength) {
                        sb.append(word.substring(i, width - continuationLength)).append(continuation)
                                .append(LINE_SEPARATOR);
                        i += width - continuationLength;
                    }
                    String endOfWord = word.substring(i);
                    sb.append(lastWord = endOfWord);
                    currentPosition = endOfWord.length();
                } else {
                    sb.append(lastWord = word);
                    currentPosition += wordLength;
                }
            }

            int lastNewLine = lastWord.lastIndexOf("\n");
            if (lastNewLine != -1) {
                currentPosition = lastWord.length() - lastNewLine;
            }
        }

        return sb.toString();
    }
90310
def newLine(self) :
		""""""
		l = CSVEntry(self)
		if self.keepInMemory :
			self.lines.append(l)
		return l
89086
def add_greeting(nc, line):
    """"""

    assert type(nc) == dict

    nc["greeting"] = nc.get("greeting") or ""

    # Markdown hard line break is two new lines
    if not nc["greeting"].endswith("\n"):
        nc["greeting"] += "\n"
    nc["greeting"] += line + "\n"
119996
def _newline_end_of_file(relative_path, contents, linter_options):
    """
    del relative_path
    del linter_options
    last_line = len(contents) - 1
    if not len(contents) or not contents[last_line].endswith("\n"):
        if len(contents):
            last_line_replacement = contents[last_line] + "\n"
        else:
            last_line_replacement = "\n"
        return LinterFailure(r"No \n at end of file",
                             last_line + 1,
                             last_line_replacement)
588110
function wrap(input, wrap, ends) {

  if(!isString(input) || isUndefined(wrap)) {
    return input;
  }

  return [wrap, input, ends || wrap].join('');

}
585468
def join_lines(line1, line2):
    
    if line1 == u"":
        pass
    elif line1[-1] == u'-':
        # hyphenated word at the end of the
        # line - don't add in a space and remove hyphen
        line1 = line1[:-1]
    elif line1[-1] != u' ':
        # no space at the end of this
        # line, add in a space
        line1 = line1 + u' '
    return line1 + line2
628506
def end_of_paragraph(self, count=1, after=False):
        
        def match_func(text):
            return not text or text.isspace()

        line_index = self.find_next_matching_line(match_func=match_func, count=count)

        if line_index:
            add = 0 if after else 1
            return max(0, self.get_cursor_down_position(count=line_index) - add)
        else:
            return len(self.text_after_cursor)
952049
def truncate_ellipsis(line, length=30):
    """"""

    l = len(line)
    return line if l < length else line[:length - 3] + "..."
109948
private void appendLinebreak(int count, boolean force) {

        if (m_appendBr) {
            if (m_storedBrCount > count) {
                count = m_storedBrCount;
            }
            m_storedBrCount = 0;
            if (force) {
                m_brCount = 0;
            }
            while (m_brCount < count) {
                m_result.append("\r\n");
                m_brCount++;
            }
            m_lineLength = m_indent;
        } else {
            while (m_storedBrCount < count) {
                m_storedBrCount++;
            }
        }
    }
931255
private void skipToEndOfLine()
  {
    while (pos < limit) {
      char c = in.charAt(pos++);
      if (c == '\n') {
        lineNumber++;
        lineStart = pos;
        break;
      } else if (c == '\r') {
        break;
      }
    }
  }
690695
def remove_last_line(self):
        """"""
        editor = self._editor
        text_cursor = editor.textCursor()
        text_cursor.movePosition(text_cursor.End, text_cursor.MoveAnchor)
        text_cursor.select(text_cursor.LineUnderCursor)
        text_cursor.removeSelectedText()
        text_cursor.deletePreviousChar()
        editor.setTextCursor(text_cursor)
1191981
function appendLine(num, content, prefix) {
    sb.append(prefix + lineNumbers[num] + ' | ' + content + '\n');
  }
270797
function(text) {
        // Each newline cell data is wrapping double quotes in the text and
        // newline characters should be replaced with substitution characters temporarily
        // before spliting the text by newline characters.
        text = clipboardUtil.replaceNewlineToSubchar(text);

        return _.map(text.split(/\r?\n/), function(row) {
            return _.map(row.split('\t'), function(column) {
                column = clipboardUtil.removeDoubleQuotes(column);

                return column.replace(CUSTOM_LF_REGEXP, LF)
                    .replace(CUSTOM_CR_REGEXP, CR);
            });
        });
    }
154082
def shorten(text):
    
    if len(text) >= MAX_DISPLAY_LEN:
        text = text[:MAX_DISPLAY_LEN//2]+"..."+text[-MAX_DISPLAY_LEN//2:]
    return text
492351
def wrap (text, width, **kwargs):
    """"""
    if width <= 0 or not text:
        return text
    ret = []
    for para in get_paragraphs(text):
        text = " ".join(para.strip().split())
        ret.extend(textwrap.wrap(text, width, **kwargs))
    return os.linesep.join(ret)
806505
private void newlineAndIndent(){
        if (isWriting()){
            if (isClosed){
                write(Indentation.tabs(depth)); // \n\t\t\t\...
            } else {
                depth++;
                write(Indentation.closedTabs(depth)); // >\n\t\t\t\...
                isClosed = true;
            }
        }
    }