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)
| 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 | """ |
no test coverage detected