<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_unicode(string):
 """ Ensure a passed string is unicode """

    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)