code: def _ensure_unicode_string(string):
          
          if not isinstance(string, six.text_type):
              string = string.decode('utf-8')
          return string
docs: Returns a unicode string for string.
  
          :param string:
              The input string.
          :type string:
              `basestring`
  
          :returns:
              A unicode string.
          :rtype:
              `unicode`