def dict_update(orig, updates):
    """Recursively merges two objects"""
    for key, val in updates.items():
        if isinstance(val, dict):
            orig[key] = dict_update(orig.get(key, {}), val)
        else:
            orig[key] = updates[key]
    return orig