code: def literalize_string(content, is_unicode=False):
      r'''Literalize a string content.
  
      Examples:
  
      >>> print literalize_string('str')
      'str'
      >>> print literalize_string('\'str\'')
      "'str'"
      >>> print literalize_string('\"\'str\'\"')
      '"\'str\'"'
      '''
  
      quote_mark = "'"
      if "'" in content:
          quote_mark = '"'
          if '"' in content:
              quote_mark = "'"
              content = content.replace(r"'", r"\'")
  
      if '\n' in content:
          quote_mark *= 3
  
      return 'u'[not is_unicode:]+quote_mark+content+quote_marf literalize_string(content, is_unicode=False):
      r'''Literalize a string content.
  
      Examples:
  
      >>> print literalize_string('str')
      'str'
      >>> print literalize_string('\'str\'')
      "'str'"
      >>> print literalize_string('\"\'str\'\"')
      '"\'str\'"'
      '''
  
      quote_mark = "'"
      if "'" in content:
          quote_mark = '"'
          if '"' in content:
              quote_mark = "'"
              content = content.replace(r"'", r"\'")
  
      if '\n' in content:
          quote_mark *= 3
  
      return 'u'[not is_unicode:]+quote_mark+content+quote_mark
docs: r'''Literalize a string content.
  
      Examples:
  
      >>> print literalize_string('str')
      'str'
      >>> print literalize_string('\'str\'')
      "'str'"
      >>> print literalize_string('\"\'str\'\"')
      '"\'str\'"'