nodes: 0, module; 1, function_definition; 2, function_name:merge_dict; 3, parameters; 4, block; 5, identifier:a; 6, identifier:b; 7, expression_statement; 8, if_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""
      Recursively merges and returns dict a with dict b.
      Any list values will be combined and returned sorted.
  
      :param a: dictionary object
      :param b: dictionary object
      :return: merged dictionary object
      """; 13, not_operator; 14, block; 15, assignment; 16, pattern_list; 17, call; 18, block; 19, identifier:result; 20, call; 21, return_statement; 22, identifier:result; 23, call; 24, identifier:key; 25, identifier:val; 26, attribute; 27, argument_list; 28, if_statement; 29, identifier:isinstance; 30, argument_list; 31, identifier:b; 32, identifier:deepcopy; 33, argument_list; 34, identifier:six; 35, identifier:iteritems; 36, identifier:b; 37, boolean_operator; 38, block; 39, elif_clause; 40, else_clause; 41, identifier:b; 42, identifier:dict; 43, identifier:a; 44, comparison_operator:key in result; 45, call; 46, expression_statement; 47, boolean_operator; 48, block; 49, block; 50, identifier:key; 51, identifier:result; 52, identifier:isinstance; 53, argument_list; 54, assignment; 55, comparison_operator:key in result; 56, call; 57, expression_statement; 58, expression_statement; 59, subscript; 60, identifier:dict; 61, subscript; 62, call; 63, identifier:key; 64, identifier:result; 65, identifier:isinstance; 66, argument_list; 67, assignment; 68, assignment; 69, identifier:result; 70, identifier:key; 71, identifier:result; 72, identifier:key; 73, identifier:merge_dict; 74, argument_list; 75, subscript; 76, identifier:list; 77, subscript; 78, call; 79, subscript; 80, call; 81, subscript; 82, identifier:val; 83, identifier:result; 84, identifier:key; 85, identifier:result; 86, identifier:key; 87, identifier:sorted; 88, argument_list; 89, identifier:result; 90, identifier:key; 91, identifier:deepcopy; 92, argument_list; 93, identifier:result; 94, identifier:key; 95, call; 96, identifier:val; 97, identifier:list; 98, argument_list; 99, binary_operator:set(val) | set(result[key]); 100, call; 101, call; 102, identifier:set; 103, argument_list; 104, identifier:set; 105, argument_list; 106, identifier:val; 107, subscript; 108, identifier:result; 109, identifier:key
code: def merge_dict(a, b):
      """
      Recursively merges and returns dict a with dict b.
      Any list values will be combined and returned sorted.
  
      :param a: dictionary object
      :param b: dictionary object
      :return: merged dictionary object
      """
  
      if not isinstance(b, dict):
          return b
  
      result = deepcopy(a)
      for key, val in six.iteritems(b):
          if key in result and isinstance(result[key], dict):
              result[key] = merge_dict(result[key], val)
          elif key in result and isinstance(result[key], list):
              result[key] = sorted(list(set(val) | set(result[key])))
          else:
              result[key] = deepcopy(val)
  
      return result