def MapLines(f, s):
    'Apply a function across each line in a flat string.\n\n  Args:\n    f: A string transform function for a line.\n    s: A string consisting of potentially multiple lines.\n\n  Returns:\n    A flat string with f applied to each line.\n  '
    return '\n'.join((f(line) for line in s.split('\n')))
Apply a function across each line in a flat string.

Args:
  f: A string transform function for a line.
  s: A string consisting of potentially multiple lines.

Returns:
  A flat string with f applied to each line.
def MapLines(f, s):
    'Apply a function across each line in a flat string.\n\n  Args:\n    f: A string transform function for a line.\n    s: A string consisting of potentially multiple lines.\n\n  Returns:\n    A flat string with f applied to each line.\n  '
    return '\n'.join((f(line) for line in s.split('\n')))