MCPcopy Index your code
hub / github.com/python/cpython / enum_all_nodes

Method enum_all_nodes

Tools/unicode/dawg.py:180–190  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

178 return skipped
179
180 def enum_all_nodes(self):
181 stack = [self.root]
182 done = set()
183 while stack:
184 node = stack.pop()
185 if node.id in done:
186 continue
187 yield node
188 done.add(node.id)
189 for label, child in sorted(node.edges.items()):
190 stack.append(child)
191
192 def prettyprint(self):
193 for node in sorted(self.enum_all_nodes(), key=lambda e: e.id):

Callers 2

prettyprintMethod · 0.95
_linearize_edgesMethod · 0.95

Calls 5

setFunction · 0.85
popMethod · 0.45
addMethod · 0.45
itemsMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected