deep_copy_dict(d) that returns a deep copy of a (possibly nested) dict d, such that mutating a nested dict or list inside the copy never affects the original. Use copy.deepcopy.orig = {'a': {'b': 1}}; c = deep_copy_dict(orig); c['a']['b'] = 99; orig['a']['b']1
Mutating the deep copy leaves the original untouched.
`import copy` then `return copy.deepcopy(d)`.
Contrast with `dict(d)` or `d.copy()`, which only copy one level (shallow copy).