human
I wrote the below code

    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))

What's a good function header?

=====
Here's a good function header?
assistant
#Here's a good function header.

def map_leafs(func, mapping):