| 7 | import tiktoken |
| 8 | |
| 9 | class StepTree: |
| 10 | def __init__(self, html, step_len = 5000, len_func = len): |
| 11 | self.soup = BeautifulSoup(html) |
| 12 | self.step_len = step_len |
| 13 | self.len_func = len_func |
| 14 | |
| 15 | def __iter__(self): |
| 16 | if self.len_func(str(self.soup)) < self.step_len: |
| 17 | yield |
| 18 | |
| 19 | def find_common_ancestor(html_content:str, xpath:str): |
| 20 | try: |
nothing calls this directly
no outgoing calls
no test coverage detected