def to_unicode(text):
if isinstance(text, unicode):<EOL><INDENT>return text<EOL><DEDENT>if isinstance(text, six.string_types):<EOL><INDENT>return decode_to_unicode(text)<EOL><DEDENT>return unicode(text)<EOL>
Convert to unicode.