nodes: 0, module; 1, function_definition; 2, function_name:union; 3, parameters; 4, block; 5, identifier:dict1; 6, identifier:dict2; 7, expression_statement; 8, for_statement; 9, return_statement; 10, comment:"""
      Deep merge of dict2 into dict1.  May be dictionaries or dictobj's.
      Values in dict2 will replace values in dict1 where they vary but have
      the same key.
  
      When lists are encountered, the dict2 list will replace the dict1 list.
  
      This will alter the first dictionary.  The returned result is dict1, but
      it will have references to both dictionaries.  If you do not want this,
      use union_copy(), which is less efficient but data-safe.
  
      >>> a = dict(a=dict(b=dict(c=1)))
      >>> b = dict(a=dict(b=dict(d=2)),e=[1,2])
      >>> # sorted json so that it is predictably the same
      >>> import json
      >>> json.dumps(union(a, b), sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [1, 2]}'
      >>> json.dumps(a, sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [1, 2]}'
      >>> json.dumps(b, sort_keys=True)
      '{"a": {"b": {"d": 2}}, "e": [1, 2]}'
      >>> a['e'][0] = 3
      >>> json.dumps(a, sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [3, 2]}'
      >>> json.dumps(b, sort_keys=True)
      '{"a": {"b": {"d": 2}}, "e": [3, 2]}'
      """; 11, pattern_list; 12, call; 13, block; 14, identifier:dict1; 15, identifier:key; 16, identifier:value; 17, attribute; 18, argument_list; 19, if_statement; 20, identifier:dict2; 21, identifier:items; 22, boolean_operator; 23, block; 24, else_clause; 25, comparison_operator:key in dict1; 26, call; 27, expression_statement; 28, block; 29, identifier:key; 30, identifier:dict1; 31, identifier:isinstance; 32, argument_list; 33, assignment; 34, expression_statement; 35, identifier:value; 36, identifier:dict; 37, subscript; 38, call; 39, assignment; 40, identifier:dict1; 41, identifier:key; 42, identifier:union; 43, argument_list; 44, subscript; 45, identifier:value; 46, subscript; 47, identifier:value; 48, identifier:dict1; 49, identifier:key; 50, identifier:dict1; 51, identifier:key
code: def union(dict1, dict2):
      """
      Deep merge of dict2 into dict1.  May be dictionaries or dictobj's.
      Values in dict2 will replace values in dict1 where they vary but have
      the same key.
  
      When lists are encountered, the dict2 list will replace the dict1 list.
  
      This will alter the first dictionary.  The returned result is dict1, but
      it will have references to both dictionaries.  If you do not want this,
      use union_copy(), which is less efficient but data-safe.
  
      >>> a = dict(a=dict(b=dict(c=1)))
      >>> b = dict(a=dict(b=dict(d=2)),e=[1,2])
      >>> # sorted json so that it is predictably the same
      >>> import json
      >>> json.dumps(union(a, b), sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [1, 2]}'
      >>> json.dumps(a, sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [1, 2]}'
      >>> json.dumps(b, sort_keys=True)
      '{"a": {"b": {"d": 2}}, "e": [1, 2]}'
      >>> a['e'][0] = 3
      >>> json.dumps(a, sort_keys=True)
      '{"a": {"b": {"c": 1, "d": 2}}, "e": [3, 2]}'
      >>> json.dumps(b, sort_keys=True)
      '{"a": {"b": {"d": 2}}, "e": [3, 2]}'
      """
      for key, value in dict2.items():
          if key in dict1 and isinstance(value, dict):
              dict1[key] = union(dict1[key], value)
          else:
              dict1[key] = value
      return dict1