import json

ip = r"Dataset\gpt4-turbo\agg_comp_imp_fewshot\cache\1_mbpp-updated_ambiguous_0.json"
op = r"Dataset\original\mbpp-updated.json"

with open(ip,'r') as f:
    data = json.load(f)

with open(op,'r') as f:
    data_original = json.load(f)

for d in data:
    for d_ in data_original:
        if d['task_id'] == d_['task_id']:
            d['updated_test_list'] = d_['updated_test_list']

with open(ip,'w') as f:
    json.dump(data, f, indent=2)