code: def to_unicode(string):
      
      if isinstance(string, six.binary_type):
          return string.decode('utf8')
      if isinstance(string, six.text_type):
          return string
      if six.PY2:
          return unicode(string)
      return str(string)
docs: Ensure a passed string is unicode