MCPcopy Index your code
hub / github.com/OmkarPathak/pygorithm / _iter_helper

Method _iter_helper

pygorithm/data_structures/quadtree.py:335–354  ·  view source on GitHub ↗

Calls pred on each child and childs child, iteratively. pred takes one positional argument (the child). :param pred: function to call :type pred: `types.FunctionType`

(self, pred)

Source from the content-addressed store, hash-verified

333 return result
334
335 def _iter_helper(self, pred):
336 """
337 Calls pred on each child and childs child, iteratively.
338
339 pred takes one positional argument (the child).
340
341 :param pred: function to call
342 :type pred: `types.FunctionType`
343 """
344
345 _stack = deque()
346 _stack.append(self)
347
348 while _stack:
349 curr = _stack.pop()
350 if curr.children:
351 for child in curr.children:
352 _stack.append(child)
353
354 pred(curr)
355
356 def find_entities_per_depth(self):
357 """

Callers 4

find_nodes_per_depthMethod · 0.95
sum_entitiesMethod · 0.95

Calls 1

popMethod · 0.45

Tested by

no test coverage detected