code: def parse_request(cls, jsonrpc_message):
          
          try:
              data = cls.json_loads(jsonrpc_message)
          except ValueError, err:
              raise errors.RPCParseError("No valid JSON. (%s)" % str(err))
  
          if not isinstance(data, dict):
              raise errors.RPCInvalidRPC("No valid RPC-package.")
          if "method" not in data:
              raise errors.RPCInvalidRPC("""Invalid Request, "method" is missing.""")
          if not isinstance(data["method"], (str, unicode)):
              raise errors.RPCInvalidRPC("""Invalid Request, "method" must be a string.""")
          if "id" not in data:
              data["id"] = None #be liberal
          if "params" not in data:
              data["params"] = ()     #be liberal
          if not isinstance(data["params"], (list, tuple)):
              raise errors.RPCInvalidRPC("""Invalid Request, "params" must be an array.""")
          if len(data) != 3:
              raise errors.RPCInvalidRPC("""Invalid Request, additional fields found.""")
  
          # notification / request
          if data["id"] is None:
              return data["method"], data["params"] #notification
          else:
              return data["method"], data["params"], data["id"]
docs: We take apart JSON-RPC-formatted message as a string and decompose it
          into a dictionary object, emitting errors if parsing detects issues with
          the format of the message.
  
          :Returns:   | [method_name, params, id] or [method_name, params]
                      | params is a tuple/list
                      | if id is missing, this is a Notification
          :Raises:    RPCParseError, RPCInvalidRPC, RPCInvalidMethodParams