<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def walk_map(d, func):
 """Apply a function recursively to values of dictionary. Parameters d : dict Input dictionary, possibly nested. func : function Function to apply to dictionary values. Returns ------- dict Dictionary whose values are the output of the given function. """

    out = {}
    for k, v in d.items():
        if isinstance(v, (dict, defaultdict)):
            out[k] = walk_map(v, func)
        else:
            out[k] = func(v)
    return out