def METHOD_NAME(self, predicate = None):
    if self.children is not None:
        for child in self.children:
            if predicate is not None and not predicate(child):
                continue
            yield child