code: def safe_unicode(obj, *args):
      
      try:
          return unicode(obj, *args)  # noqa for undefined-variable
      except UnicodeDecodeError:
          # obj is byte string
          ascii_text = str(obj).encode('string_escape')
          try:
              return unicode(ascii_text)  # noqa for undefined-variable
          except NameError:
              # This is Python 3, just return the obj as it's already unicode
              return obj
      except NameError:
          # This is Python 3, just return the obj as it's already unicode
          return obj
docs: return the unicode representation of obj