<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend(self, iter, parent=None):
 """Add a sequence of items to the end of the list :param iter: The iterable of items to add. :param parent: The node to add the items as a child of, or None for top-level nodes. """

        for item in iter:
            self.append(item, parent)