def _from_bytes(value):
    result = (value.decode('utf-8')
              if isinstance(value, six.binary_type) else value)
    if isinstance(result, six.text_type):
        return result
    else:
        raise ValueError('%r could not be converted to unicode' % (value,))
Converts bytes to a string value, if necessary.
dataset/ETHPy150Open google/oauth2client/oauth2client/_helpers.py/_from_bytes