def traverse(self, condition=None,
                 include_self=1, descend=1, siblings=0, ascend=0):
        if ascend:
            siblings=1
        # Check for special argument combinations that allow using an
        # optimized version of traverse()
        if include_self and descend and not siblings:
            if condition is None:
                return self._all_traverse()
            elif isinstance(condition, (types.ClassType, type)):
                return self._fast_traverse(condition)
        # Check if `condition` is a class (check for TypeType for Python
        # implementations that use only new-style classes, like PyPy).
        if isinstance(condition, (types.ClassType, type)):
            node_class = condition
            def condition(node, node_class=node_class):
                return isinstance(node, node_class)
        r = []
        if include_self and (condition is None or condition(self)):
            r.append(self)
        if descend and len(self.children):
            for child in self:
                r.extend(child.traverse(
                    include_self=1, descend=1, siblings=0, ascend=0,
                    condition=condition))
        if siblings or ascend:
            node = self
            while node.parent:
                index = node.parent.index(node)
                for sibling in node.parent[index+1:]:
                    r.extend(sibling.traverse(include_self=1, descend=descend,
                                              siblings=0, ascend=0,
                                              condition=condition))
                if not ascend:
                    break
                else:
                    node = node.parent
        return r
Test that parsing is successful for an IPv6 PROXY header.
dataset/ETHPy150Open adieu/allbuttonspressed/docutils/nodes.py/Node.traverse--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/protocols/haproxy/test/test_v1parser.py/V1ParserTests.test_fullParsingSuccess_IPv6