parameters: (s, encoding="utf-8", errors="strict")
docstring: Coerce *s* to six.text_type.
  
      For Python 2:
        - `unicode` -> `unicode`
        - `str` -> `unicode`
  
      For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
docstring_summary: Coerce *s* to six.text_type.
docstring_tokens: Coerce * s * to six . text_type .
function: def ensure_text(s, encoding="utf-8", errors="strict"):
      """Coerce *s* to six.text_type.
  
      For Python 2:
        - `unicode` -> `unicode`
        - `str` -> `unicode`
  
      For Python 3:
        - `str` -> `str`
        - `bytes` -> decoded to `str`
      """
      if isinstance(s, binary_type):
          return s.decode(encoding, errors)
      elif isinstance(s, text_type):
          return s
      else:
          raise TypeError("not expecting type '%s'" % type(s))
function_tokens: def ensure_text ( s , encoding = "utf-8" , errors = "strict" ) : if isinstance ( s , binary_type ) : return s . decode ( encoding , errors ) elif isinstance ( s , text_type ) : return s else : raise TypeError ( "not expecting type '%s'" % type ( s ) )