def Prepend(prefix, content, skip_first_line=True, skip_empty_lines=False):
    """Prepends the prefix to each line of the provided content."""
    lines = content.split('\n')
    if lines and len(lines) > 1 and not lines[-1]:
        trailing_newline = True
        lines.pop()
    else:
        trailing_newline = False
    content = []
    for line in lines:
        if skip_first_line:
            skip_first_line = False
        elif line or not skip_empty_lines:
            line = '{}{}'.format(prefix, line)
        content.append(line)
    content = '\n'.join(content)
    if trailing_newline:
        content += '\n'
    return content
