

def get_nodes_by_type(self, nodetype):
    nodes = []
    if isinstance(self, nodetype):
        nodes.append(self)
    nodes.extend(self.nodelist_true.get_nodes_by_type(nodetype))
    if self.nodelist_false:
        nodes.extend(self.nodelist_false.get_nodes_by_type(nodetype))
    return nodes

dataset/ETHPy150Open aehlke/manabi/apps/utils/templatetags/smartif.py SmartIfNode.get_nodes_by_type/original