K iZ(ddlmZddlmZmZddZy)) annotations)AnyDictc |jD]N\}}t|tr,||vst||ts/t||||B||vsG||||<P|jD]\}}||vs |||<|S)aMerge two nested dictionaries. Effectively a recursive ``dict.update``. Examples -------- Merge two flat dictionaries: >>> nested_update( ... {'a': 1, 'b': 2}, ... {'b': 3, 'c': 4} ... ) {'a': 1, 'b': 3, 'c': 4} Merge two nested dictionaries: >>> nested_update( ... {'x': {'a': 1, 'b': 2}, 'y': 5, 'z': 6}, ... {'x': {'b': 3, 'c': 4}, 'z': 7, '0': 8}, ... ) {'x': {'a': 1, 'b': 3, 'c': 4}, 'y': 5, 'z': 7, '0': 8} )items isinstancedict nested_update)thisthatkeyvalues c/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/traitlets/utils/nested_update.pyr r s,jjl" U eT "d{z$s)T:d3ic3 D[S DI "jjl U d?DI KN)r Dict[Any, Any]r rreturnr) __future__rtypingrrr rrrs#!r