import copy


def merge_dict(bot, top):
    """Helper function for merging dict fields over another dict.
    Merge top dict onto bot dict, so that the returned new dict has the updated top vals."""
    new = copy.deepcopy(bot)
    for k, v in top.items():
        new[k] = v
    return new