<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def text(string, encoding='utf8'):
 """ Make sure string is unicode type, decode with given encoding if it's not. If parameter is a object, object.__str__ will been called """

    if isinstance(string, six.text_type):
        return string
    elif isinstance(string, six.binary_type):
        return string.decode(encoding)
    else:
        return six.text_type(string)