def trim_trailing_lines(lines):
 lines = list(lines)
 while (lines and (not lines[(-1)])):
  lines.pop((-1))
 return lines

def trim_trailing_lines ( lines ) : lines = list ( lines ) while ( lines and ( not lines [ ( - 1 ) ] ) ) : lines . pop ( ( - 1 ) ) return lines
trim trailing blank lines .