(node: html.HtmlElement, max_depth: int, current_depth: int=0)
| 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: |
| 314 | return [] |
| 315 | |
| 316 | descendants = [] |
| 317 | for child in node: |
| 318 | descendants.append(child) |
| 319 | descendants.extend(get_descendants(child, max_depth, current_depth + 1)) |
| 320 | |
| 321 | return descendants |
| 322 | |
| 323 | to_keep = set(copy.deepcopy(keep)) |
| 324 | nodes_to_keep = set() |
nothing calls this directly
no outgoing calls
no test coverage detected