def split_line_endings(data):
 lines = NEWLINE_RE.split(data)
 if (not lines[(-1)]):
  lines = lines[:(-1)]
 return lines

def split_line_endings ( data ) : lines = NEWLINE_RE . split ( data ) if ( not lines [ ( - 1 ) ] ) : lines = lines [ : ( - 1 ) ] return lines
splits a string into lines while preserving all non-crlf characters .