code: def decode(self, query):
          
          if not query:
              return None
  
          try:
              message = Message.fromPostArgs(query)
          except InvalidOpenIDNamespace, err:
              # It's useful to have a Message attached to a ProtocolError, so we
              # override the bad ns value to build a Message out of it.  Kinda
              # kludgy, since it's made of lies, but the parts that aren't lies
              # are more useful than a 'None'.
              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)
docs: 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}