def mapdict_keys(function, dic):
    """
    Apply a function to a dictionary keys,
    creating a new dictionary with the same values
    and new values created by applying the function
    to the old ones.

    :param function: A function that takes the dictionary key as argument
                      and returns a new dictionary key
    :param dic:      A dictionary
    :return:         A new dicitonary with same keys and values changed

    Example:

    >>> dic1 = { 'a' : 10, 'b' : 20, 'c' : 30 }
    >>>
    >>> mapdict_keys(lambda x: str(x) + "_hello", dic1)
    {'a_hello': 10, 'b_hello': 20, 'c_hello': 30}
    >>>
    >>> dic1
    {'a': 10, 'b': 20, 'c': 30}
    """
    return dict(map(lambda x: (function(x[0]), x[1]), dic.items()))