def cast_unicode(s, encoding='utf8', errors='replace'):
        if isinstance(s, unicode):
            return s
        return str(s).decode(encoding)
cast bytes or unicode to unicode.
dataset/ETHPy150Open circus-tent/circus/circus/py3compat.py/cast_unicode