def merge_dicts(d1, d2):
    result = copy.deepcopy(d1)

    for key, value in six.iteritems(d2):
        if isinstance(value, dict):
            result[key] = merge_dicts(result[key], value)
        elif key not in result or value is not None:
            result[key] = value

    return result
List elements are displayed on separate lines using C{str()}.
dataset/ETHPy150Open StackStorm/st2/st2client/st2client/utils/misc.py/merge_dicts--crossover with--dataset/ETHPy150Open nlloyd/SubliminalCollaborator/libs/twisted/test/test_text.py/StringyStringTest.test_list