<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def depth_first_iter(self, self_first=True):
 """ Iterate over nodes below this node, optionally yielding children before self. """

        if self_first:
            yield self
        for child in list(self.children):
            for i in child.depth_first_iter(self_first):
                yield i
        if not self_first:
            yield self