def METHOD_NAME(text):
  pieces = text.split('\n')
  output = []
  for index, piece in enumerate(pieces):
    if len(piece) > 0:
      output.append(piece)
    if index != len(pieces) - 1:
      output.append('\n')
  return output