code: def to_str(obj):
      
      if not isinstance(obj, str) and PY3 and isinstance(obj, bytes):
          obj = obj.decode('utf-8')
      return obj if isinstance(obj, string_types) else str(obj)
docs: Attempts to convert given object to a string object