(self, dfs_count: int=1, max_depth: int=3, max_children: int=30,
max_sibling: int=3, keep_parent: bool=False)
| 396 | return tree |
| 397 | |
| 398 | def prune_tree(self, dfs_count: int=1, max_depth: int=3, max_children: int=30, |
| 399 | max_sibling: int=3, keep_parent: bool=False) -> None: |
| 400 | # clone the tree |
| 401 | new_tree = copy.deepcopy(self.dom_tree) |
| 402 | nodes_to_keep = self.get_keep_elements(new_tree, self.keep, max_depth, max_children, max_sibling, dfs_count, keep_parent) |
| 403 | new_tree = self.prune(new_tree, nodes_to_keep) |
| 404 | |
| 405 | self.dom_tree = new_tree |
| 406 | |
| 407 | def get_segment(self, bid: str) -> str: |
| 408 | # clone the tree |
nothing calls this directly
no test coverage detected