MCPcopy Index your code
hub / github.com/dask/dask / walk

Method walk

dask/_expr.py:786–806  ·  view source on GitHub ↗

Iterate through all expressions in the tree Returns ------- nodes Generator of Expr instances in the graph. Ordering is a depth-first search of the expression tree

(self)

Source from the content-addressed store, hash-verified

784 return g
785
786 def walk(self) -> Generator[Expr]:
787 """Iterate through all expressions in the tree
788
789 Returns
790 -------
791 nodes
792 Generator of Expr instances in the graph.
793 Ordering is a depth-first search of the expression tree
794 """
795 stack = [self]
796 seen = set()
797 while stack:
798 node = stack.pop()
799 if node._name in seen:
800 continue
801 seen.add(node._name)
802
803 for dep in node.dependencies():
804 stack.append(dep)
805
806 yield node
807
808 def find_operations(self, operation: type | tuple[type]) -> Generator[Expr]:
809 """Search the expression graph for a specific operation type

Callers 1

find_operationsMethod · 0.95

Calls 4

setClass · 0.85
popMethod · 0.80
addMethod · 0.45
dependenciesMethod · 0.45

Tested by

no test coverage detected