<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def restore_ids(cls, obj, ids):
 """ Given an list of ids as captured with capture_ids, restore the ids. Note the structure of an object must not change between the calls to capture_ids and restore_ids. """

        ids = iter(ids)
        obj.traverse(lambda o: setattr(o, 'id', next(ids)))