def dict_key_apply(iterable, str_fkt):
    """
    Applys a string modifiying function to all keys of a nested dict.
    """
    if type(iterable) is dict:
        for key in list(iterable.keys()):
            new_key = str_fkt(key)
            iterable[new_key] = iterable.pop(key)
            if type(iterable[new_key]) is dict or type(iterable[new_key]) is list:
                iterable[new_key] = dict_key_apply(iterable[new_key], str_fkt)
    elif type(iterable) is list:
        for item in iterable:
            item = dict_key_apply(item, str_fkt)
    return iterable