human
Complete the below
def map_leafs(func, mapping):

    ''''Map a function to the leafs of a mapping.'
    '''

=====
What is a the Python program you requested?
assistant
#Here is the Python program you requested.
    def _inner(mapping, path=None):
        if (path is None):
            path = []
        for (key, val) in mapping.items():
            if isinstance(val, collections.Mapping):
                _inner(val, (path + [key]))
            else:
                mapping[key] = func(val, path=(path + [key]))
        return mapping
    return _inner(copy.deepcopy(mapping))