

def _removed(time, prev, curr, collected):
    prev_ids = set((res['id'] for res in prev))
    curr_ids = set((res['id'] for res in curr))
    collected_ids = set((res['id'] for res in collected))
    removed_ids = (prev_ids - curr_ids)
    for res in prev:
        id_val = res['id']
        if (id_val in removed_ids):
            if (id_val in collected_ids):
                collected.append({
                    'id': id_val,
                    'time': time.isoformat(),
                })
            else:
                res_data = dict(res, **{
                    'time': time.isoformat(),
                })
                collected.append(res_data)
    return collected

dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/statistics/oswl/saver.py _removed/original