code: 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))
  
imports: from __future__ import absolute_import
  import functools
  import itertools
  import operator
  import sys
  import types
label_desc: Use image node_id 13 for calling a global function with example usage: ensure_text(s, encoding, errors) and returns: s, s