def fix_eols(s):
 s = re.sub('(?<!\\r)\\n', CRLF, s)
 s = re.sub('\\r(?!\\n)', CRLF, s)
 return s

def fix_eols ( s ) : s = re . sub ( '(?<!\\r)\\n' , CRLF , s ) s = re . sub ( '\\r(?!\\n)' , CRLF , s ) return s
replace all line-ending characters with .