def _HandleContentsEol(contents, eol_style):
if eol_style == EOL_STYLE_NONE:<EOL><INDENT>return contents<EOL><DEDENT>if eol_style == EOL_STYLE_UNIX:<EOL><INDENT>return contents.replace('<STR_LIT:\r\n>', eol_style).replace('<STR_LIT:\r>', eol_style)<EOL><DEDENT>if eol_style == EOL_STYLE_MAC:<EOL><INDENT>return contents.replace('<STR_LIT:\r\n>', eol_style).replace('<STR_LIT:\n>', eol_style)<EOL><DEDENT>if eol_style == EOL_STYLE_WINDOWS:<EOL><INDENT>return contents.replace('<STR_LIT:\r\n>', '<STR_LIT:\n>').replace('<STR_LIT:\r>', '<STR_LIT:\n>').replace('<STR_LIT:\n>', EOL_STYLE_WINDOWS)<EOL><DEDENT>raise ValueError('<STR_LIT>' % (eol_style,))<EOL>
Replaces eol on each line by the given eol_style.

:param unicode contents:
:type eol_style: EOL_STYLE_XXX constant
:param eol_style: