nodes: 0, module; 1, function_definition; 2, function_name:sum_num_dicts; 3, parameters; 4, block; 5, identifier:dicts; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, if_statement; 11, return_statement; 12, identifier:normalize; 13, False; 14, comment:"""Sums the given dicts into a single dict mapping each key to the sum
      of its mappings in all given dicts.
  
      Parameters
      ----------
      dicts : list
          A list of dict objects mapping each key to an numeric value.
      normalize : bool, default False
          Indicated whether to normalize all values by value sum.
  
      Returns
      -------
      dict
          A dict where each key is mapped to the sum of its mappings in all
          given dicts.
  
      Example
      -------
      >>> dict1 = {'a': 3, 'b': 2}
      >>> dict2 = {'a':7, 'c': 8}
      >>> result = sum_num_dicts([dict1, dict2])
      >>> print(sorted(result.items()))
      [('a', 10), ('b', 2), ('c', 8)]
      >>> result = sum_num_dicts([dict1, dict2], normalize=True)
      >>> print(sorted(result.items()))
      [('a', 0.5), ('b', 0.1), ('c', 0.4)]
      """; 15, assignment; 16, identifier:dicti; 17, identifier:dicts; 18, block; 19, identifier:normalize; 20, block; 21, identifier:sum_dict; 22, identifier:sum_dict; 23, dictionary; 24, for_statement; 25, return_statement; 26, identifier:key; 27, identifier:dicti; 28, block; 29, call; 30, expression_statement; 31, identifier:norm_int_dict; 32, argument_list; 33, assignment; 34, identifier:sum_dict; 35, subscript; 36, binary_operator:sum_dict.get(key, 0) + dicti[key]; 37, identifier:sum_dict; 38, identifier:key; 39, call; 40, subscript; 41, attribute; 42, argument_list; 43, identifier:dicti; 44, identifier:key; 45, identifier:sum_dict; 46, identifier:get; 47, identifier:key; 48, integer:0
code: def sum_num_dicts(dicts, normalize=False):
      """Sums the given dicts into a single dict mapping each key to the sum
      of its mappings in all given dicts.
  
      Parameters
      ----------
      dicts : list
          A list of dict objects mapping each key to an numeric value.
      normalize : bool, default False
          Indicated whether to normalize all values by value sum.
  
      Returns
      -------
      dict
          A dict where each key is mapped to the sum of its mappings in all
          given dicts.
  
      Example
      -------
      >>> dict1 = {'a': 3, 'b': 2}
      >>> dict2 = {'a':7, 'c': 8}
      >>> result = sum_num_dicts([dict1, dict2])
      >>> print(sorted(result.items()))
      [('a', 10), ('b', 2), ('c', 8)]
      >>> result = sum_num_dicts([dict1, dict2], normalize=True)
      >>> print(sorted(result.items()))
      [('a', 0.5), ('b', 0.1), ('c', 0.4)]
      """
      sum_dict = {}
      for dicti in dicts:
          for key in dicti:
              sum_dict[key] = sum_dict.get(key, 0) + dicti[key]
      if normalize:
          return norm_int_dict(sum_dict)
      return sum_dict