def merge_dicts(dict_a, dict_b):
def _merge_dicts_(a, b):<EOL><INDENT>for key in set(a.keys()).union(b.keys()):<EOL><INDENT>if key in a and key in b:<EOL><INDENT>if isinstance(a[key], dict) and isinstance(b[key], dict):<EOL><INDENT>yield (key, dict(_merge_dicts_(a[key], b[key])))<EOL><DEDENT>elif b[key] is not None:<EOL><INDENT>yield (key, b[key])<EOL><DEDENT>else:<EOL><INDENT>yield (key, a[key])<EOL><DEDENT><DEDENT>elif key in a:<EOL><INDENT>yield (key, a[key])<EOL><DEDENT>elif b[key] is not None:<EOL><INDENT>yield (key, b[key])<EOL><DEDENT><DEDENT><DEDENT>return dict(_merge_dicts_(dict_a, dict_b))<EOL>
Recursively merge dictionary b into dictionary a.

    If override_nones is True, then