def unify_linebreaks(text):
  """Helper to return a string with all line breaks converted to LF.

  Args:
    text: a string.

  Returns:
    A string with all line breaks converted to LF.
  """
  return text.replace('\r\n', '\n').replace('\r', '\n')