def format_as_diagnostics(lines):
    """Format the lines as diagnostics output by prepending the diagnostic #.

    This function makes no assumptions about the line endings.
    """
    return ''.join(['# ' + line for line in lines])