'Default decoder.
Recursively deserialize into immutable types (
:class:`acme.jose.util.frozendict` instead of
:func:`dict`, :func:`tuple` instead of :func:`list`).'

@classmethod
def default_decoder(cls, value):

    if isinstance(value, list):
        return tuple((cls.default_decoder(subvalue) for subvalue in value))
    elif isinstance(value, dict):
        return util.frozendict(dict(((cls.default_decoder(key), cls.default_decoder(value)) for (key, value) in six.iteritems(value))))
    else:
        return value
