(node: html.HtmlElement, max_depth: int, current_depth: int=0)
| 298 | def get_keep_elements(self, tree: html.HtmlElement, keep: list[str], max_depth: int, max_children: int, |
| 299 | max_sibling: int, dfs_count: int=1, keep_parent: bool=False) -> list[str]: |
| 300 | def get_anscendants(node: html.HtmlElement, max_depth: int, current_depth: int=0) -> list[str]: |
| 301 | if current_depth > max_depth: |
| 302 | return [] |
| 303 | |
| 304 | anscendants = [] |
| 305 | parent = node.getparent() |
| 306 | if parent is not None: |
| 307 | anscendants.append(parent) |
| 308 | anscendants.extend(get_anscendants(parent, max_depth, current_depth + 1)) |
| 309 | |
| 310 | return anscendants |
| 311 | |
| 312 | def get_descendants(node: html.HtmlElement, max_depth: int, current_depth: int=0) -> list[str]: |
| 313 | if current_depth > max_depth: |
nothing calls this directly
no outgoing calls
no test coverage detected