def literalize_string(content, is_unicode=False):
quote_mark = "<STR_LIT:'>"<EOL>if "<STR_LIT:'>" in content:<EOL><INDENT>quote_mark = '<STR_LIT:">'<EOL>if '<STR_LIT:">' in content:<EOL><INDENT>quote_mark = "<STR_LIT:'>"<EOL>content = content.replace(r"<STR_LIT:'>", r"<STR_LIT>")<EOL><DEDENT><DEDENT>if '<STR_LIT:\n>' in content:<EOL><INDENT>quote_mark *= <NUM_LIT:3><EOL><DEDENT>return '<STR_LIT:u>'[not is_unicode:]+quote_mark+content+quote_mark<EOL>
r'''Literalize a string content.

    Examples:

    >>> print literalize_string('str')
    'str'
    >>> print literalize_string('\'str\'')
    "'str'"
    >>> print literalize_string('\"\'str\'\"')
    '"\'str\'"'