def to_unicode(value):
if isinstance(value, _TO_UNICODE_TYPES):<EOL><INDENT>return value<EOL><DEDENT>if not isinstance(value, bytes):<EOL><INDENT>raise TypeError(<EOL>"<STR_LIT>" % type(value))<EOL><DEDENT>return value.decode("<STR_LIT:utf-8>")<EOL>
Converts a string argument to a unicode string.
If the argument is already a unicode string or None, it is returned
unchanged.  Otherwise it must be a byte string and is decoded as utf8.