Human: What's the most pythonic way of normalizing lineends in a string? Assistant: 
Here is some code to normalize line ends in a string 'mixed'

mixed.replace('\r\n', '\n').replace('\r', '\n')

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.