'I transform query parameters into an L{OpenIDRequest}.
If the query does not seem to be an OpenID request at all, I return
C{None}.
@param query: The query parameters as a dictionary with each
key mapping to one value.
@type query: dict
@raises ProtocolError: When the query does not seem to be a valid
OpenID request.
@returntype: L{OpenIDRequest}'

def decode(self, query):

    if (not query):
        return None
    try:
        message = Message.fromPostArgs(query)
    except InvalidOpenIDNamespace as err:
        query = query.copy()
        query['openid.ns'] = OPENID2_NS
        message = Message.fromPostArgs(query)
        raise ProtocolError(message, str(err))
    mode = message.getArg(OPENID_NS, 'mode')
    if (not mode):
        fmt = 'No    mode    value    in    message    %s'
        raise ProtocolError(message, text=(fmt % (message,)))
    handler = self._handlers.get(mode, self.defaultDecoder)
    return handler(message, self.server.op_endpoint)
