def filter(self, node, condition):
if not isinstance(node, Node):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>for child in node:<EOL><INDENT>if condition(child):<EOL><INDENT>yield child<EOL><DEDENT>for subchild in self.filter(child, condition):<EOL><INDENT>yield subchild<EOL><DEDENT><DEDENT>
This method accepts a node and the condition function; a
generator will be returned to yield the nodes that got matched
by the condition.