<commit_before>import copy


def deep_dict_merge(old_dict, new_dict, deep=True):
	old_dict = copy.deepcopy(old_dict)
	for key, value in new_dict.items():
		if key in old_dict and isinstance(old_dict[key], dict) and isinstance(value, dict):
			old_dict[key] = deep_dict_merge(old_dict[key], value, deep=False)<commit_msg>forgot to add deep copy logic<commit_after>import copy


def deep_dict_merge(old_dict, new_dict, deep=True):
	if deep:
		old_dict = copy.deepcopy(old_dict)
	else:
		old_dict = old_dict.copy()
	for key, value in new_dict.items():
		if key in old_dict and isinstance(old_dict[key], dict) and isinstance(value, dict):
			old_dict[key] = deep_dict_merge(old_dict[key], value, deep=False)
{'fraction_non_alphanumeric': 0.11379800853485064, 'fraction_numerical': 0.0, 'mean_word_length': 6.333333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1298292', 'n_tokens_mistral': 262, 'n_tokens_neox': 250, 'n_words': 63}