def to_unicode(text, encoding=None, errors='strict'):
    if isinstance(text, six.text_type):
        return text
    if not isinstance(text, (bytes, six.text_type)):
        raise TypeError('to_unicode must receive a bytes, str or unicode '
                        'object, got %s' % type(text).__name__)
    if encoding is None:
        encoding = 'utf-8'
    return text.decode(encoding, errors)
Return the unicode representation of a bytes object `text`. If `text`
dataset/ETHPy150Open scrapinghub/splash/splash/utils.py/to_unicode