def deep_update_dict(dict1, dict2, update_dict1=True):
    if not update_dict1:
        dict1 = copy.deepcopy(dict1)

    for key, dict2_value in dict2.items():
        if key not in dict1:
            dict1[key] = dict2_value
        else:
            dict1_value = dict1[key]
            if isinstance(dict1_value, list) and isinstance(dict2_value, list):
                seen_items = set()
                dict1[key] = [item for item in (dict1_value + dict2_value) if not (item in seen_items or
                                                                                   seen_items.add(item))]
            elif isinstance(dict1_value, dict) and isinstance(dict2_value, dict):
                dict1[key] = deep_update_dict(dict1_value, dict2_value, update_dict1=update_dict1)
            elif isinstance(dict1_value, set) and isinstance(dict2_value, set):
                dict1[key] = dict1_value | dict2_value
            else:
                dict1[key] = dict2_value
    return dict1
Favorites the status specified in the status parameter as the authenticating user.
dataset/ETHPy150Open sodastsai/taskr/taskr/contrib/collections.py/deep_update_dict--crossover with--dataset/ETHPy150Open livid/v2ex/twitter/twitter.py/Api.CreateFavorite