human
Give me a Python function to merge keys and two dicts.
assistant
Here is a Python function to merge keys two dicts

import collections

def merge_dicts(d1, d2):
    """Merge two dicts."""
    for k, v in list(d2.items()):
        if k in d1:
            d1[k] = d1[k] + v
        else:
            d1[k] = v
    return d1

# Enter the dictionary
d1 = collections.OrderedDict()
d2 = collections.OrderedDict()

# Add some items to the dictionary
d1['a'] = 1
d1['b'] = 2
d2['c'] = 3
d2['d'] = 4

# Calling the function
print((merge_dicts(d1, d2)))

#Example Output
# OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 4)])

#Remember to inspect code for bugs.