code: def soft_unicode(s):
      """Convert an object to a string if it isn't already. This preserves
      a :class:`Markup` string rather than converting it back to a basic
      string, so it will still be marked as safe and won't be escaped
      again.
  
      >>> value = escape('<User 1>')
      >>> value
      Markup('&lt;User 1&gt;')
      >>> escape(str(value))
      Markup('&amp;lt;User 1&amp;gt;')
      >>> escape(soft_unicode(value))
      Markup('&lt;User 1&gt;')
      """
      if not isinstance(s, text_type):
          s = text_type(s)
      return s
  
imports: from .None import Markup
  from ._compat import text_type
label_desc: Use image node_id 3 for calling a global function with example usage: soft_unicode(s) and returns: s