'Given a `Fernet`_ token with JSON in the ciphertext, return a Python object.'

def unpack(self, token):

    obj = token
    if (not (type(obj) is bytes)):
        raise TypeError(u'need    bytes,    got    {}'.format(type(obj)))
    obj = self.fernet.decrypt(obj)
    obj = obj.decode(u'utf8')
    obj = json.loads(obj)
    return obj
