def text_remove_empty_lines(text):
 lines = [line.rstrip() for line in text.splitlines() if line.strip()]
 return '\n'.join(lines)

def text_remove_empty_lines ( text ) : lines = [ line . rstrip ( ) for line in text . splitlines ( ) if line . strip ( ) ] return '\n' . join ( lines )
whitespace normalization: - strip empty lines - strip trailing whitespace .