@classmethod
def parse(cls, params):
    """
        Parses a WebSocket extension offer for `permessage-snappy` provided by a client to a server.

        :param params: Output from :func:`autobahn.websocket.WebSocketProtocol._parseExtensionsHeader`.
        :type params: list

        :returns: A new instance of :class:`autobahn.compress.PerMessageSnappyOffer`.
        :rtype: obj
        """
    accept_no_context_takeover = False
    request_no_context_takeover = False
    for p in params:
        if len(params[p]) > 1:
            raise Exception(
                "multiple occurrence of extension parameter '%s' for extension '%s'"
                 % (p, cls.EXTENSION_NAME))
        val = params[p][0]
        if p == 'client_no_context_takeover':
            if val is not True:
                raise Exception(
                    "illegal extension parameter value '%s' for parameter '%s' of extension '%s'"
                     % (val, p, cls.EXTENSION_NAME))
            else:
                accept_no_context_takeover = True
        elif p == 'server_no_context_takeover':
            if val is not True:
                raise Exception(
                    "illegal extension parameter value '%s' for parameter '%s' of extension '%s'"
                     % (val, p, cls.EXTENSION_NAME))
            else:
                request_no_context_takeover = True
        else:
            raise Exception(
                "illegal extension parameter '%s' for extension '%s'" % (p,
                cls.EXTENSION_NAME))
    offer = cls(accept_no_context_takeover, request_no_context_takeover)
    return offer
