def _merge(x, y):
merged = {**x, **y}<EOL>xkeys = x.keys()<EOL>for key in xkeys:<EOL><INDENT>if isinstance(x[key], dict) and key in y:<EOL><INDENT>merged[key] = _merge(x[key], y[key])<EOL><DEDENT><DEDENT>return merged<EOL>
Merge two nested dictionaries. Overwrite values in x with values in y.