(self, formula, threshold=None)
return
Generic walk method, will apply the function defined by the map
        self.functions.

        If threshold parameter is specified, the walk_threshold
        function will be called for all nodes with depth >= threshold.
Generic walk method, will apply the function defined by the map
        self.functions.
Generic walk method will apply the function defined by the map self . functions .
def walk(self, formula, threshold=None):
        """Generic walk method, will apply the function defined by the map
        self.functions.

        If threshold parameter is specified, the walk_threshold
        function will be called for all nodes with depth >= threshold.
        """

        try:
            f = self.functions[formula.node_type()]
        except KeyError:
            f = self.walk_error

        iterator = f(formula)
        if iterator is None:
            return

        stack = [iterator]
        while stack:
            f = stack[-1]
            try:
                child = next(f)
                if threshold and len(stack) >= threshold:
                    iterator = self.walk_threshold(child)
                    if iterator is not None:
                        stack.append(iterator)
                else:
                    try:
                        cf = self.functions[child.node_type()]
                    except KeyError:
                        cf = self.walk_error
                    iterator = cf(child)
                    if iterator is not None:
                        stack.append(iterator)
            except StopIteration:
                stack.pop()
        return
def walk ( self , formula , threshold = None ) : try : f = self . functions [ formula . node_type ( ) ] except KeyError : f = self . walk_error iterator = f ( formula ) if iterator is None : return stack = [ iterator ] while stack : f = stack [ - 1 ] try : child = next ( f ) if threshold and len ( stack ) >= threshold : iterator = self . walk_threshold ( child ) if iterator is not None : stack . append ( iterator ) else : try : cf = self . functions [ child . node_type ( ) ] except KeyError : cf = self . walk_error iterator = cf ( child ) if iterator is not None : stack . append ( iterator ) except StopIteration : stack . pop ( ) return