nodes: 0, module; 1, function_definition; 2, function_name:sort_request; 3, parameters; 4, type; 5, block; 6, typed_parameter; 7, identifier:OrderedDict; 8, expression_statement; 9, expression_statement; 10, return_statement; 11, identifier:request; 12, type; 13, comment:"""
      Sort a JSON-RPC request dict.
  
      This has no effect other than making the request nicer to read.
  
          >>> json.dumps(sort_request(
          ...     {'id': 2, 'params': [2, 3], 'method': 'add', 'jsonrpc': '2.0'}))
          '{"jsonrpc": "2.0", "method": "add", "params": [2, 3], "id": 2}'
  
      Args:
          request: JSON-RPC request in dict format.
      """; 14, assignment; 15, call; 16, generic_type; 17, identifier:sort_order; 18, list; 19, identifier:OrderedDict; 20, argument_list; 21, identifier:Dict; 22, type_parameter; 23, string:"jsonrpc"; 24, string:"method"; 25, string:"params"; 26, string:"id"; 27, call; 28, type; 29, type; 30, identifier:sorted; 31, argument_list; 32, identifier:str; 33, identifier:Any; 34, call; 35, keyword_argument; 36, attribute; 37, argument_list; 38, identifier:key; 39, lambda; 40, identifier:request; 41, identifier:items; 42, lambda_parameters; 43, call; 44, identifier:k; 45, attribute; 46, argument_list; 47, identifier:sort_order; 48, identifier:index; 49, subscript; 50, identifier:k; 51, integer:0
code: def sort_request(request: Dict[str, Any]) -> OrderedDict:
      """
      Sort a JSON-RPC request dict.
  
      This has no effect other than making the request nicer to read.
  
          >>> json.dumps(sort_request(
          ...     {'id': 2, 'params': [2, 3], 'method': 'add', 'jsonrpc': '2.0'}))
          '{"jsonrpc": "2.0", "method": "add", "params": [2, 3], "id": 2}'
  
      Args:
          request: JSON-RPC request in dict format.
      """
      sort_order = ["jsonrpc", "method", "params", "id"]
      return OrderedDict(sorted(request.items(), key=lambda k: sort_order.index(k[0])))