Spaces:
Sleeping
Sleeping
File size: 338 Bytes
96da58e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
"""
Collection of miscellaneous utility tools
"""
def deep_update(d, u):
"""
Copied from https://stackoverflow.com/a/3233356
"""
import collections
for k, v in u.items():
if isinstance(v, collections.abc.Mapping):
d[k] = deep_update(d.get(k, {}), v)
else:
d[k] = v
return d |