code: def ensure_unicode_string(value):
      
      if not isinstance(value, six.string_types):
          raise TypeError(u'Expected string value, got: {}'.format(value))
      return six.text_type(value)
docs: Ensure the value is a string, and return it as unicode.