def map_keys(function, dictionary):
    """
    Transform each key using the given function. Return a new dict with transformed keys.

    :param function: values map function
    :param dictionary: dictionary to mapping
    :return: dict with changed (mapped) keys
    """

    return {function(key): value for key, value in dictionary.items()}