nodes: 0, module; 1, function_definition; 2, function_name:sort_recursive; 3, parameters; 4, block; 5, identifier:data; 6, expression_statement; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:"""
      Recursively sorts all elements in a dictionary
  
      Args:
          data (dict): The dictionary to sort
  
      Returns:
          sorted_dict (OrderedDict): The sorted data dict
      """; 11, assignment; 12, identifier:i; 13, call; 14, block; 15, call; 16, identifier:newdict; 17, dictionary; 18, attribute; 19, argument_list; 20, if_statement; 21, identifier:OrderedDict; 22, argument_list; 23, identifier:data; 24, identifier:items; 25, comparison_operator:type(i[1]) is dict; 26, block; 27, else_clause; 28, call; 29, call; 30, identifier:dict; 31, expression_statement; 32, block; 33, identifier:sorted; 34, argument_list; 35, identifier:type; 36, argument_list; 37, assignment; 38, expression_statement; 39, call; 40, keyword_argument; 41, subscript; 42, subscript; 43, call; 44, assignment; 45, attribute; 46, argument_list; 47, identifier:key; 48, lambda; 49, identifier:i; 50, integer:1; 51, identifier:newdict; 52, subscript; 53, identifier:sort_recursive; 54, argument_list; 55, subscript; 56, subscript; 57, identifier:newdict; 58, identifier:items; 59, lambda_parameters; 60, tuple; 61, identifier:i; 62, integer:0; 63, subscript; 64, identifier:newdict; 65, subscript; 66, identifier:i; 67, integer:1; 68, identifier:item; 69, call; 70, subscript; 71, identifier:i; 72, integer:1; 73, identifier:i; 74, integer:0; 75, identifier:compare_type; 76, argument_list; 77, identifier:item; 78, integer:0; 79, call; 80, identifier:type; 81, argument_list; 82, subscript; 83, identifier:item; 84, integer:1
code: def sort_recursive(data):
      """
      Recursively sorts all elements in a dictionary
  
      Args:
          data (dict): The dictionary to sort
  
      Returns:
          sorted_dict (OrderedDict): The sorted data dict
      """
  
      newdict = {}
  
      for i in data.items():
          if type(i[1]) is dict:
              newdict[i[0]] = sort_recursive(i[1])
          else:
              newdict[i[0]] = i[1]
  
      return OrderedDict(sorted(newdict.items(), key=lambda item: (compare_type(type(item[1])), item[0])))