(html, indent='\t')
| 91 | return html |
| 92 | |
| 93 | def parse_accessibility_tree(html, indent='\t'): |
| 94 | soup = BeautifulSoup(html, 'html.parser') |
| 95 | for element in soup(text=lambda text: isinstance(text, bs4.Comment)): |
| 96 | element.extract() |
| 97 | [s.extract() for s in soup('script')] |
| 98 | [s.extract() for s in soup('style')] |
| 99 | |
| 100 | accessibility_tree = '' |
| 101 | for node in soup.children: |
| 102 | if isinstance(node, bs4.NavigableString): |
| 103 | pass |
| 104 | else: |
| 105 | parse_accessibility_tree() |
| 106 | |
| 107 | def num_tokens_from_string(string: str, encoding_name: str) -> int: |
| 108 | encoding = tiktoken.get_encoding(encoding_name) |
nothing calls this directly
no outgoing calls
no test coverage detected