nodes: 0, module; 1, function_definition; 2, function_name:map_dict; 3, parameters; 4, block; 5, identifier:key_map; 6, list_splat_pattern; 7, default_parameter; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, comment:# Combine dicts.; 12, expression_statement; 13, comment:# Namespace shortcut.; 14, comment:# Return mapped dict.; 15, return_statement; 16, identifier:dicts; 17, identifier:copy; 18, False; 19, identifier:base; 20, None; 21, comment:"""
      Returns a dict with new key values.
  
      :param key_map:
          A dictionary that maps the dict keys ({old key: new key}
      :type key_map: dict
  
      :param dicts:
          A sequence of dicts.
      :type dicts: dict
  
      :param copy:
          If True, it returns a deepcopy of input values.
      :type copy: bool, optional
  
      :param base:
          Base dict where combine multiple dicts in one.
      :type base: dict, optional
  
      :return:
          A unique dict with new key values.
      :rtype: dict
  
      Example::
  
          >>> d = map_dict({'a': 'c', 'b': 'd'}, {'a': 1, 'b': 1}, {'b': 2})
          >>> sorted(d.items())
          [('c', 1), ('d', 2)]
      """; 22, assignment; 23, assignment; 24, call; 25, identifier:it; 26, call; 27, identifier:get; 28, attribute; 29, identifier:combine_dicts; 30, argument_list; 31, attribute; 32, argument_list; 33, identifier:key_map; 34, identifier:get; 35, dictionary_comprehension; 36, keyword_argument; 37, keyword_argument; 38, call; 39, identifier:items; 40, pair; 41, for_in_clause; 42, identifier:copy; 43, identifier:copy; 44, identifier:base; 45, identifier:base; 46, identifier:combine_dicts; 47, argument_list; 48, call; 49, identifier:v; 50, pattern_list; 51, identifier:it; 52, list_splat; 53, identifier:get; 54, argument_list; 55, identifier:k; 56, identifier:v; 57, identifier:dicts; 58, identifier:k; 59, identifier:k
code: def map_dict(key_map, *dicts, copy=False, base=None):
      """
      Returns a dict with new key values.
  
      :param key_map:
          A dictionary that maps the dict keys ({old key: new key}
      :type key_map: dict
  
      :param dicts:
          A sequence of dicts.
      :type dicts: dict
  
      :param copy:
          If True, it returns a deepcopy of input values.
      :type copy: bool, optional
  
      :param base:
          Base dict where combine multiple dicts in one.
      :type base: dict, optional
  
      :return:
          A unique dict with new key values.
      :rtype: dict
  
      Example::
  
          >>> d = map_dict({'a': 'c', 'b': 'd'}, {'a': 1, 'b': 1}, {'b': 2})
          >>> sorted(d.items())
          [('c', 1), ('d', 2)]
      """
  
      it = combine_dicts(*dicts).items()  # Combine dicts.
  
      get = key_map.get  # Namespace shortcut.
  
      # Return mapped dict.
      return combine_dicts({get(k, k): v for k, v in it}, copy=copy, base=base)