@scrypted/arlo 0.11.24 → 0.11.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1313) hide show
  1. package/README.md +2 -0
  2. package/dist/plugin.zip +0 -0
  3. package/package.json +9 -1
  4. package/venv/bin/Activate.ps1 +247 -0
  5. package/venv/bin/activate +69 -0
  6. package/venv/bin/activate.csh +26 -0
  7. package/venv/bin/activate.fish +69 -0
  8. package/venv/bin/normalizer +8 -0
  9. package/venv/bin/pip +8 -0
  10. package/venv/bin/pip3 +8 -0
  11. package/venv/bin/pip3.10 +8 -0
  12. package/venv/lib/python3.10/site-packages/_cffi_backend.cpython-310-x86_64-linux-gnu.so +0 -0
  13. package/venv/lib/python3.10/site-packages/_distutils_hack/__init__.py +132 -0
  14. package/venv/lib/python3.10/site-packages/_distutils_hack/override.py +1 -0
  15. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/__init__.py +13 -0
  16. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/_staggered.py +202 -0
  17. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/impl.py +210 -0
  18. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/py.typed +0 -0
  19. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/types.py +12 -0
  20. package/venv/lib/python3.10/site-packages/aiohappyeyeballs/utils.py +97 -0
  21. package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/INSTALLER +1 -0
  22. package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/LICENSE +279 -0
  23. package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/METADATA +123 -0
  24. package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/RECORD +16 -0
  25. package/venv/lib/python3.10/site-packages/aiohappyeyeballs-2.4.6.dist-info/WHEEL +4 -0
  26. package/venv/lib/python3.10/site-packages/aiohttp/.hash/_cparser.pxd.hash +1 -0
  27. package/venv/lib/python3.10/site-packages/aiohttp/.hash/_find_header.pxd.hash +1 -0
  28. package/venv/lib/python3.10/site-packages/aiohttp/.hash/_http_parser.pyx.hash +1 -0
  29. package/venv/lib/python3.10/site-packages/aiohttp/.hash/_http_writer.pyx.hash +1 -0
  30. package/venv/lib/python3.10/site-packages/aiohttp/.hash/hdrs.py.hash +1 -0
  31. package/venv/lib/python3.10/site-packages/aiohttp/__init__.py +264 -0
  32. package/venv/lib/python3.10/site-packages/aiohttp/_cparser.pxd +158 -0
  33. package/venv/lib/python3.10/site-packages/aiohttp/_find_header.pxd +2 -0
  34. package/venv/lib/python3.10/site-packages/aiohttp/_headers.pxi +83 -0
  35. package/venv/lib/python3.10/site-packages/aiohttp/_http_parser.cpython-310-x86_64-linux-gnu.so +0 -0
  36. package/venv/lib/python3.10/site-packages/aiohttp/_http_parser.pyx +837 -0
  37. package/venv/lib/python3.10/site-packages/aiohttp/_http_writer.cpython-310-x86_64-linux-gnu.so +0 -0
  38. package/venv/lib/python3.10/site-packages/aiohttp/_http_writer.pyx +162 -0
  39. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/mask.pxd.hash +1 -0
  40. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/mask.pyx.hash +1 -0
  41. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/.hash/reader_c.pxd.hash +1 -0
  42. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/__init__.py +1 -0
  43. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/helpers.py +147 -0
  44. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.cpython-310-x86_64-linux-gnu.so +0 -0
  45. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.pxd +3 -0
  46. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/mask.pyx +48 -0
  47. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/models.py +84 -0
  48. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader.py +31 -0
  49. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.cpython-310-x86_64-linux-gnu.so +0 -0
  50. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.pxd +102 -0
  51. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_c.py +468 -0
  52. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/reader_py.py +468 -0
  53. package/venv/lib/python3.10/site-packages/aiohttp/_websocket/writer.py +177 -0
  54. package/venv/lib/python3.10/site-packages/aiohttp/abc.py +253 -0
  55. package/venv/lib/python3.10/site-packages/aiohttp/base_protocol.py +100 -0
  56. package/venv/lib/python3.10/site-packages/aiohttp/client.py +1550 -0
  57. package/venv/lib/python3.10/site-packages/aiohttp/client_exceptions.py +421 -0
  58. package/venv/lib/python3.10/site-packages/aiohttp/client_proto.py +307 -0
  59. package/venv/lib/python3.10/site-packages/aiohttp/client_reqrep.py +1315 -0
  60. package/venv/lib/python3.10/site-packages/aiohttp/client_ws.py +426 -0
  61. package/venv/lib/python3.10/site-packages/aiohttp/compression_utils.py +173 -0
  62. package/venv/lib/python3.10/site-packages/aiohttp/connector.py +1652 -0
  63. package/venv/lib/python3.10/site-packages/aiohttp/cookiejar.py +495 -0
  64. package/venv/lib/python3.10/site-packages/aiohttp/formdata.py +182 -0
  65. package/venv/lib/python3.10/site-packages/aiohttp/hdrs.py +121 -0
  66. package/venv/lib/python3.10/site-packages/aiohttp/helpers.py +944 -0
  67. package/venv/lib/python3.10/site-packages/aiohttp/http.py +72 -0
  68. package/venv/lib/python3.10/site-packages/aiohttp/http_exceptions.py +112 -0
  69. package/venv/lib/python3.10/site-packages/aiohttp/http_parser.py +1046 -0
  70. package/venv/lib/python3.10/site-packages/aiohttp/http_websocket.py +36 -0
  71. package/venv/lib/python3.10/site-packages/aiohttp/http_writer.py +249 -0
  72. package/venv/lib/python3.10/site-packages/aiohttp/log.py +8 -0
  73. package/venv/lib/python3.10/site-packages/aiohttp/multipart.py +1071 -0
  74. package/venv/lib/python3.10/site-packages/aiohttp/payload.py +519 -0
  75. package/venv/lib/python3.10/site-packages/aiohttp/payload_streamer.py +78 -0
  76. package/venv/lib/python3.10/site-packages/aiohttp/py.typed +1 -0
  77. package/venv/lib/python3.10/site-packages/aiohttp/pytest_plugin.py +436 -0
  78. package/venv/lib/python3.10/site-packages/aiohttp/resolver.py +187 -0
  79. package/venv/lib/python3.10/site-packages/aiohttp/streams.py +727 -0
  80. package/venv/lib/python3.10/site-packages/aiohttp/tcp_helpers.py +37 -0
  81. package/venv/lib/python3.10/site-packages/aiohttp/test_utils.py +770 -0
  82. package/venv/lib/python3.10/site-packages/aiohttp/tracing.py +470 -0
  83. package/venv/lib/python3.10/site-packages/aiohttp/typedefs.py +69 -0
  84. package/venv/lib/python3.10/site-packages/aiohttp/web.py +605 -0
  85. package/venv/lib/python3.10/site-packages/aiohttp/web_app.py +620 -0
  86. package/venv/lib/python3.10/site-packages/aiohttp/web_exceptions.py +452 -0
  87. package/venv/lib/python3.10/site-packages/aiohttp/web_fileresponse.py +418 -0
  88. package/venv/lib/python3.10/site-packages/aiohttp/web_log.py +216 -0
  89. package/venv/lib/python3.10/site-packages/aiohttp/web_middlewares.py +121 -0
  90. package/venv/lib/python3.10/site-packages/aiohttp/web_protocol.py +750 -0
  91. package/venv/lib/python3.10/site-packages/aiohttp/web_request.py +916 -0
  92. package/venv/lib/python3.10/site-packages/aiohttp/web_response.py +840 -0
  93. package/venv/lib/python3.10/site-packages/aiohttp/web_routedef.py +214 -0
  94. package/venv/lib/python3.10/site-packages/aiohttp/web_runner.py +399 -0
  95. package/venv/lib/python3.10/site-packages/aiohttp/web_server.py +84 -0
  96. package/venv/lib/python3.10/site-packages/aiohttp/web_urldispatcher.py +1301 -0
  97. package/venv/lib/python3.10/site-packages/aiohttp/web_ws.py +622 -0
  98. package/venv/lib/python3.10/site-packages/aiohttp/worker.py +252 -0
  99. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/INSTALLER +1 -0
  100. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/LICENSE.txt +13 -0
  101. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/METADATA +250 -0
  102. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/RECORD +132 -0
  103. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/REQUESTED +0 -0
  104. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/WHEEL +6 -0
  105. package/venv/lib/python3.10/site-packages/aiohttp-3.11.12.dist-info/top_level.txt +1 -0
  106. package/venv/lib/python3.10/site-packages/aiosignal/__init__.py +36 -0
  107. package/venv/lib/python3.10/site-packages/aiosignal/__init__.pyi +12 -0
  108. package/venv/lib/python3.10/site-packages/aiosignal/py.typed +0 -0
  109. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/INSTALLER +1 -0
  110. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/LICENSE +201 -0
  111. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/METADATA +123 -0
  112. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/RECORD +10 -0
  113. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/WHEEL +6 -0
  114. package/venv/lib/python3.10/site-packages/aiosignal-1.3.2.dist-info/top_level.txt +1 -0
  115. package/venv/lib/python3.10/site-packages/async_timeout/__init__.py +276 -0
  116. package/venv/lib/python3.10/site-packages/async_timeout/py.typed +1 -0
  117. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/INSTALLER +1 -0
  118. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/LICENSE +13 -0
  119. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/METADATA +163 -0
  120. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/RECORD +11 -0
  121. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/REQUESTED +0 -0
  122. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/WHEEL +5 -0
  123. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/top_level.txt +1 -0
  124. package/venv/lib/python3.10/site-packages/async_timeout-5.0.1.dist-info/zip-safe +1 -0
  125. package/venv/lib/python3.10/site-packages/attr/__init__.py +104 -0
  126. package/venv/lib/python3.10/site-packages/attr/__init__.pyi +389 -0
  127. package/venv/lib/python3.10/site-packages/attr/_cmp.py +160 -0
  128. package/venv/lib/python3.10/site-packages/attr/_cmp.pyi +13 -0
  129. package/venv/lib/python3.10/site-packages/attr/_compat.py +94 -0
  130. package/venv/lib/python3.10/site-packages/attr/_config.py +31 -0
  131. package/venv/lib/python3.10/site-packages/attr/_funcs.py +468 -0
  132. package/venv/lib/python3.10/site-packages/attr/_make.py +3055 -0
  133. package/venv/lib/python3.10/site-packages/attr/_next_gen.py +623 -0
  134. package/venv/lib/python3.10/site-packages/attr/_typing_compat.pyi +15 -0
  135. package/venv/lib/python3.10/site-packages/attr/_version_info.py +86 -0
  136. package/venv/lib/python3.10/site-packages/attr/_version_info.pyi +9 -0
  137. package/venv/lib/python3.10/site-packages/attr/converters.py +162 -0
  138. package/venv/lib/python3.10/site-packages/attr/converters.pyi +19 -0
  139. package/venv/lib/python3.10/site-packages/attr/exceptions.py +95 -0
  140. package/venv/lib/python3.10/site-packages/attr/exceptions.pyi +17 -0
  141. package/venv/lib/python3.10/site-packages/attr/filters.py +72 -0
  142. package/venv/lib/python3.10/site-packages/attr/filters.pyi +6 -0
  143. package/venv/lib/python3.10/site-packages/attr/py.typed +0 -0
  144. package/venv/lib/python3.10/site-packages/attr/setters.py +79 -0
  145. package/venv/lib/python3.10/site-packages/attr/setters.pyi +20 -0
  146. package/venv/lib/python3.10/site-packages/attr/validators.py +710 -0
  147. package/venv/lib/python3.10/site-packages/attr/validators.pyi +86 -0
  148. package/venv/lib/python3.10/site-packages/attrs/__init__.py +69 -0
  149. package/venv/lib/python3.10/site-packages/attrs/__init__.pyi +263 -0
  150. package/venv/lib/python3.10/site-packages/attrs/converters.py +3 -0
  151. package/venv/lib/python3.10/site-packages/attrs/exceptions.py +3 -0
  152. package/venv/lib/python3.10/site-packages/attrs/filters.py +3 -0
  153. package/venv/lib/python3.10/site-packages/attrs/py.typed +0 -0
  154. package/venv/lib/python3.10/site-packages/attrs/setters.py +3 -0
  155. package/venv/lib/python3.10/site-packages/attrs/validators.py +3 -0
  156. package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/INSTALLER +1 -0
  157. package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/METADATA +232 -0
  158. package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/RECORD +55 -0
  159. package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/WHEEL +4 -0
  160. package/venv/lib/python3.10/site-packages/attrs-25.1.0.dist-info/licenses/LICENSE +21 -0
  161. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/INSTALLER +1 -0
  162. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/METADATA +123 -0
  163. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/RECORD +90 -0
  164. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/REQUESTED +0 -0
  165. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/WHEEL +4 -0
  166. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/AUTHORS +49 -0
  167. package/venv/lib/python3.10/site-packages/beautifulsoup4-4.13.3.dist-info/licenses/LICENSE +31 -0
  168. package/venv/lib/python3.10/site-packages/bs4/__init__.py +1170 -0
  169. package/venv/lib/python3.10/site-packages/bs4/_deprecation.py +80 -0
  170. package/venv/lib/python3.10/site-packages/bs4/_typing.py +196 -0
  171. package/venv/lib/python3.10/site-packages/bs4/_warnings.py +98 -0
  172. package/venv/lib/python3.10/site-packages/bs4/builder/__init__.py +848 -0
  173. package/venv/lib/python3.10/site-packages/bs4/builder/_html5lib.py +594 -0
  174. package/venv/lib/python3.10/site-packages/bs4/builder/_htmlparser.py +474 -0
  175. package/venv/lib/python3.10/site-packages/bs4/builder/_lxml.py +490 -0
  176. package/venv/lib/python3.10/site-packages/bs4/css.py +338 -0
  177. package/venv/lib/python3.10/site-packages/bs4/dammit.py +1408 -0
  178. package/venv/lib/python3.10/site-packages/bs4/diagnose.py +268 -0
  179. package/venv/lib/python3.10/site-packages/bs4/element.py +2886 -0
  180. package/venv/lib/python3.10/site-packages/bs4/exceptions.py +28 -0
  181. package/venv/lib/python3.10/site-packages/bs4/filter.py +755 -0
  182. package/venv/lib/python3.10/site-packages/bs4/formatter.py +276 -0
  183. package/venv/lib/python3.10/site-packages/bs4/py.typed +0 -0
  184. package/venv/lib/python3.10/site-packages/bs4/tests/__init__.py +1305 -0
  185. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4670634698080256.testcase +1 -0
  186. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4818336571064320.testcase +1 -0
  187. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-4999465949331456.testcase +1 -0
  188. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5000587759190016.testcase +0 -0
  189. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5167584867909632.testcase +0 -0
  190. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5270998950477824.testcase +0 -0
  191. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5375146639360000.testcase +1 -0
  192. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5492400320282624.testcase +0 -0
  193. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5703933063462912.testcase +2 -0
  194. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5843991618256896.testcase +1 -0
  195. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-5984173902397440.testcase +0 -0
  196. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6124268085182464.testcase +1 -0
  197. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6241471367348224.testcase +1 -0
  198. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6306874195312640.testcase +1 -0
  199. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6450958476902400.testcase +0 -0
  200. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/clusterfuzz-testcase-minimized-bs4_fuzzer-6600557255327744.testcase +0 -0
  201. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/crash-0d306a50c8ed8bcd0785b67000fcd5dea1d33f08.testcase +0 -0
  202. package/venv/lib/python3.10/site-packages/bs4/tests/fuzz/crash-ffbdfa8a2b26f13537b68d3794b0478a4090ee4a.testcase +0 -0
  203. package/venv/lib/python3.10/site-packages/bs4/tests/test_builder.py +28 -0
  204. package/venv/lib/python3.10/site-packages/bs4/tests/test_builder_registry.py +139 -0
  205. package/venv/lib/python3.10/site-packages/bs4/tests/test_css.py +536 -0
  206. package/venv/lib/python3.10/site-packages/bs4/tests/test_dammit.py +433 -0
  207. package/venv/lib/python3.10/site-packages/bs4/tests/test_element.py +138 -0
  208. package/venv/lib/python3.10/site-packages/bs4/tests/test_filter.py +674 -0
  209. package/venv/lib/python3.10/site-packages/bs4/tests/test_formatter.py +170 -0
  210. package/venv/lib/python3.10/site-packages/bs4/tests/test_fuzz.py +181 -0
  211. package/venv/lib/python3.10/site-packages/bs4/tests/test_html5lib.py +264 -0
  212. package/venv/lib/python3.10/site-packages/bs4/tests/test_htmlparser.py +161 -0
  213. package/venv/lib/python3.10/site-packages/bs4/tests/test_lxml.py +196 -0
  214. package/venv/lib/python3.10/site-packages/bs4/tests/test_navigablestring.py +144 -0
  215. package/venv/lib/python3.10/site-packages/bs4/tests/test_pageelement.py +437 -0
  216. package/venv/lib/python3.10/site-packages/bs4/tests/test_soup.py +602 -0
  217. package/venv/lib/python3.10/site-packages/bs4/tests/test_tag.py +241 -0
  218. package/venv/lib/python3.10/site-packages/bs4/tests/test_tree.py +1452 -0
  219. package/venv/lib/python3.10/site-packages/cachetools/__init__.py +859 -0
  220. package/venv/lib/python3.10/site-packages/cachetools/func.py +121 -0
  221. package/venv/lib/python3.10/site-packages/cachetools/keys.py +62 -0
  222. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/INSTALLER +1 -0
  223. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/LICENSE +20 -0
  224. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/METADATA +151 -0
  225. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/RECORD +13 -0
  226. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/REQUESTED +0 -0
  227. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/WHEEL +5 -0
  228. package/venv/lib/python3.10/site-packages/cachetools-5.5.1.dist-info/top_level.txt +1 -0
  229. package/venv/lib/python3.10/site-packages/certifi/__init__.py +4 -0
  230. package/venv/lib/python3.10/site-packages/certifi/__main__.py +12 -0
  231. package/venv/lib/python3.10/site-packages/certifi/cacert.pem +4897 -0
  232. package/venv/lib/python3.10/site-packages/certifi/core.py +114 -0
  233. package/venv/lib/python3.10/site-packages/certifi/py.typed +0 -0
  234. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/INSTALLER +1 -0
  235. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/LICENSE +20 -0
  236. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/METADATA +77 -0
  237. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/RECORD +14 -0
  238. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/WHEEL +5 -0
  239. package/venv/lib/python3.10/site-packages/certifi-2025.1.31.dist-info/top_level.txt +1 -0
  240. package/venv/lib/python3.10/site-packages/cffi/__init__.py +14 -0
  241. package/venv/lib/python3.10/site-packages/cffi/_cffi_errors.h +149 -0
  242. package/venv/lib/python3.10/site-packages/cffi/_cffi_include.h +389 -0
  243. package/venv/lib/python3.10/site-packages/cffi/_embedding.h +550 -0
  244. package/venv/lib/python3.10/site-packages/cffi/_imp_emulation.py +83 -0
  245. package/venv/lib/python3.10/site-packages/cffi/_shimmed_dist_utils.py +45 -0
  246. package/venv/lib/python3.10/site-packages/cffi/api.py +967 -0
  247. package/venv/lib/python3.10/site-packages/cffi/backend_ctypes.py +1121 -0
  248. package/venv/lib/python3.10/site-packages/cffi/cffi_opcode.py +187 -0
  249. package/venv/lib/python3.10/site-packages/cffi/commontypes.py +82 -0
  250. package/venv/lib/python3.10/site-packages/cffi/cparser.py +1015 -0
  251. package/venv/lib/python3.10/site-packages/cffi/error.py +31 -0
  252. package/venv/lib/python3.10/site-packages/cffi/ffiplatform.py +113 -0
  253. package/venv/lib/python3.10/site-packages/cffi/lock.py +30 -0
  254. package/venv/lib/python3.10/site-packages/cffi/model.py +618 -0
  255. package/venv/lib/python3.10/site-packages/cffi/parse_c_type.h +181 -0
  256. package/venv/lib/python3.10/site-packages/cffi/pkgconfig.py +121 -0
  257. package/venv/lib/python3.10/site-packages/cffi/recompiler.py +1598 -0
  258. package/venv/lib/python3.10/site-packages/cffi/setuptools_ext.py +216 -0
  259. package/venv/lib/python3.10/site-packages/cffi/vengine_cpy.py +1084 -0
  260. package/venv/lib/python3.10/site-packages/cffi/vengine_gen.py +679 -0
  261. package/venv/lib/python3.10/site-packages/cffi/verifier.py +306 -0
  262. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/INSTALLER +1 -0
  263. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/LICENSE +26 -0
  264. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/METADATA +40 -0
  265. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/RECORD +48 -0
  266. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/WHEEL +6 -0
  267. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/entry_points.txt +2 -0
  268. package/venv/lib/python3.10/site-packages/cffi-1.17.1.dist-info/top_level.txt +2 -0
  269. package/venv/lib/python3.10/site-packages/charset_normalizer/__init__.py +48 -0
  270. package/venv/lib/python3.10/site-packages/charset_normalizer/__main__.py +6 -0
  271. package/venv/lib/python3.10/site-packages/charset_normalizer/api.py +668 -0
  272. package/venv/lib/python3.10/site-packages/charset_normalizer/cd.py +395 -0
  273. package/venv/lib/python3.10/site-packages/charset_normalizer/cli/__init__.py +8 -0
  274. package/venv/lib/python3.10/site-packages/charset_normalizer/cli/__main__.py +321 -0
  275. package/venv/lib/python3.10/site-packages/charset_normalizer/constant.py +1998 -0
  276. package/venv/lib/python3.10/site-packages/charset_normalizer/legacy.py +66 -0
  277. package/venv/lib/python3.10/site-packages/charset_normalizer/md.cpython-310-x86_64-linux-gnu.so +0 -0
  278. package/venv/lib/python3.10/site-packages/charset_normalizer/md.py +630 -0
  279. package/venv/lib/python3.10/site-packages/charset_normalizer/md__mypyc.cpython-310-x86_64-linux-gnu.so +0 -0
  280. package/venv/lib/python3.10/site-packages/charset_normalizer/models.py +360 -0
  281. package/venv/lib/python3.10/site-packages/charset_normalizer/py.typed +0 -0
  282. package/venv/lib/python3.10/site-packages/charset_normalizer/utils.py +408 -0
  283. package/venv/lib/python3.10/site-packages/charset_normalizer/version.py +8 -0
  284. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/INSTALLER +1 -0
  285. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/LICENSE +21 -0
  286. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/METADATA +721 -0
  287. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/RECORD +35 -0
  288. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/WHEEL +6 -0
  289. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/entry_points.txt +2 -0
  290. package/venv/lib/python3.10/site-packages/charset_normalizer-3.4.1.dist-info/top_level.txt +1 -0
  291. package/venv/lib/python3.10/site-packages/cloudscraper/__init__.py +407 -0
  292. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/2captcha.py +258 -0
  293. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/9kw.py +214 -0
  294. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/__init__.py +47 -0
  295. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/anticaptcha.py +199 -0
  296. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/capmonster.py +199 -0
  297. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/capsolver.py +188 -0
  298. package/venv/lib/python3.10/site-packages/cloudscraper/captcha/deathbycaptcha.py +276 -0
  299. package/venv/lib/python3.10/site-packages/cloudscraper/cloudflare.py +490 -0
  300. package/venv/lib/python3.10/site-packages/cloudscraper/exceptions.py +111 -0
  301. package/venv/lib/python3.10/site-packages/cloudscraper/help.py +72 -0
  302. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/__init__.py +56 -0
  303. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/chakracore.py +103 -0
  304. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/encapsulated.py +62 -0
  305. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/js2py.py +44 -0
  306. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/jsunfuck.py +97 -0
  307. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/native.py +233 -0
  308. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/nodejs.py +49 -0
  309. package/venv/lib/python3.10/site-packages/cloudscraper/interpreters/v8.py +33 -0
  310. package/venv/lib/python3.10/site-packages/cloudscraper/user_agent/__init__.py +124 -0
  311. package/venv/lib/python3.10/site-packages/cloudscraper/user_agent/browsers.json +7913 -0
  312. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/INSTALLER +1 -0
  313. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/LICENSE +22 -0
  314. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/METADATA +674 -0
  315. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/RECORD +48 -0
  316. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/REQUESTED +0 -0
  317. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/WHEEL +6 -0
  318. package/venv/lib/python3.10/site-packages/cloudscraper-1.2.71.dist-info/top_level.txt +1 -0
  319. package/venv/lib/python3.10/site-packages/curl_cffi/__init__.py +37 -0
  320. package/venv/lib/python3.10/site-packages/curl_cffi/__version__.py +8 -0
  321. package/venv/lib/python3.10/site-packages/curl_cffi/_asyncio_selector.py +344 -0
  322. package/venv/lib/python3.10/site-packages/curl_cffi/_wrapper.abi3.so +0 -0
  323. package/venv/lib/python3.10/site-packages/curl_cffi/aio.py +257 -0
  324. package/venv/lib/python3.10/site-packages/curl_cffi/const.py +581 -0
  325. package/venv/lib/python3.10/site-packages/curl_cffi/curl.py +548 -0
  326. package/venv/lib/python3.10/site-packages/curl_cffi/py.typed +1 -0
  327. package/venv/lib/python3.10/site-packages/curl_cffi/requests/__init__.py +146 -0
  328. package/venv/lib/python3.10/site-packages/curl_cffi/requests/cookies.py +355 -0
  329. package/venv/lib/python3.10/site-packages/curl_cffi/requests/errors.py +7 -0
  330. package/venv/lib/python3.10/site-packages/curl_cffi/requests/exceptions.py +219 -0
  331. package/venv/lib/python3.10/site-packages/curl_cffi/requests/headers.py +348 -0
  332. package/venv/lib/python3.10/site-packages/curl_cffi/requests/impersonate.py +360 -0
  333. package/venv/lib/python3.10/site-packages/curl_cffi/requests/models.py +292 -0
  334. package/venv/lib/python3.10/site-packages/curl_cffi/requests/session.py +1021 -0
  335. package/venv/lib/python3.10/site-packages/curl_cffi/requests/utils.py +663 -0
  336. package/venv/lib/python3.10/site-packages/curl_cffi/requests/websockets.py +711 -0
  337. package/venv/lib/python3.10/site-packages/curl_cffi/utils.py +13 -0
  338. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/INSTALLER +1 -0
  339. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/LICENSE +21 -0
  340. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/METADATA +333 -0
  341. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/RECORD +43 -0
  342. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/REQUESTED +0 -0
  343. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/WHEEL +6 -0
  344. package/venv/lib/python3.10/site-packages/curl_cffi-0.9.0.dist-info/top_level.txt +1 -0
  345. package/venv/lib/python3.10/site-packages/distutils-precedence.pth +1 -0
  346. package/venv/lib/python3.10/site-packages/frozenlist/__init__.py +98 -0
  347. package/venv/lib/python3.10/site-packages/frozenlist/__init__.pyi +47 -0
  348. package/venv/lib/python3.10/site-packages/frozenlist/_frozenlist.cpython-310-x86_64-linux-gnu.so +0 -0
  349. package/venv/lib/python3.10/site-packages/frozenlist/_frozenlist.pyx +123 -0
  350. package/venv/lib/python3.10/site-packages/frozenlist/py.typed +1 -0
  351. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/INSTALLER +1 -0
  352. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/LICENSE +201 -0
  353. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/METADATA +477 -0
  354. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/RECORD +12 -0
  355. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/WHEEL +8 -0
  356. package/venv/lib/python3.10/site-packages/frozenlist-1.5.0.dist-info/top_level.txt +1 -0
  357. package/venv/lib/python3.10/site-packages/idna/__init__.py +45 -0
  358. package/venv/lib/python3.10/site-packages/idna/codec.py +122 -0
  359. package/venv/lib/python3.10/site-packages/idna/compat.py +15 -0
  360. package/venv/lib/python3.10/site-packages/idna/core.py +437 -0
  361. package/venv/lib/python3.10/site-packages/idna/idnadata.py +4243 -0
  362. package/venv/lib/python3.10/site-packages/idna/intranges.py +57 -0
  363. package/venv/lib/python3.10/site-packages/idna/package_data.py +1 -0
  364. package/venv/lib/python3.10/site-packages/idna/py.typed +0 -0
  365. package/venv/lib/python3.10/site-packages/idna/uts46data.py +8681 -0
  366. package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/INSTALLER +1 -0
  367. package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/LICENSE.md +31 -0
  368. package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/METADATA +250 -0
  369. package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/RECORD +22 -0
  370. package/venv/lib/python3.10/site-packages/idna-3.10.dist-info/WHEEL +4 -0
  371. package/venv/lib/python3.10/site-packages/multidict/__init__.py +48 -0
  372. package/venv/lib/python3.10/site-packages/multidict/__init__.pyi +152 -0
  373. package/venv/lib/python3.10/site-packages/multidict/_abc.py +48 -0
  374. package/venv/lib/python3.10/site-packages/multidict/_compat.py +14 -0
  375. package/venv/lib/python3.10/site-packages/multidict/_multidict.cpython-310-x86_64-linux-gnu.so +0 -0
  376. package/venv/lib/python3.10/site-packages/multidict/_multidict_base.py +152 -0
  377. package/venv/lib/python3.10/site-packages/multidict/_multidict_py.py +527 -0
  378. package/venv/lib/python3.10/site-packages/multidict/py.typed +1 -0
  379. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/INSTALLER +1 -0
  380. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/LICENSE +13 -0
  381. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/METADATA +140 -0
  382. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/RECORD +19 -0
  383. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/WHEEL +6 -0
  384. package/venv/lib/python3.10/site-packages/multidict-6.1.0.dist-info/top_level.txt +1 -0
  385. package/venv/lib/python3.10/site-packages/paho/__init__.py +0 -0
  386. package/venv/lib/python3.10/site-packages/paho/mqtt/__init__.py +5 -0
  387. package/venv/lib/python3.10/site-packages/paho/mqtt/client.py +5004 -0
  388. package/venv/lib/python3.10/site-packages/paho/mqtt/enums.py +113 -0
  389. package/venv/lib/python3.10/site-packages/paho/mqtt/matcher.py +78 -0
  390. package/venv/lib/python3.10/site-packages/paho/mqtt/packettypes.py +43 -0
  391. package/venv/lib/python3.10/site-packages/paho/mqtt/properties.py +421 -0
  392. package/venv/lib/python3.10/site-packages/paho/mqtt/publish.py +306 -0
  393. package/venv/lib/python3.10/site-packages/paho/mqtt/py.typed +0 -0
  394. package/venv/lib/python3.10/site-packages/paho/mqtt/reasoncodes.py +223 -0
  395. package/venv/lib/python3.10/site-packages/paho/mqtt/subscribe.py +281 -0
  396. package/venv/lib/python3.10/site-packages/paho/mqtt/subscribeoptions.py +113 -0
  397. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/INSTALLER +1 -0
  398. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/METADATA +635 -0
  399. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/RECORD +29 -0
  400. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/REQUESTED +0 -0
  401. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/WHEEL +4 -0
  402. package/venv/lib/python3.10/site-packages/paho_mqtt-2.1.0.dist-info/licenses/LICENSE.txt +3 -0
  403. package/venv/lib/python3.10/site-packages/pip/__init__.py +13 -0
  404. package/venv/lib/python3.10/site-packages/pip/__main__.py +31 -0
  405. package/venv/lib/python3.10/site-packages/pip/_internal/__init__.py +19 -0
  406. package/venv/lib/python3.10/site-packages/pip/_internal/build_env.py +296 -0
  407. package/venv/lib/python3.10/site-packages/pip/_internal/cache.py +264 -0
  408. package/venv/lib/python3.10/site-packages/pip/_internal/cli/__init__.py +4 -0
  409. package/venv/lib/python3.10/site-packages/pip/_internal/cli/autocompletion.py +171 -0
  410. package/venv/lib/python3.10/site-packages/pip/_internal/cli/base_command.py +220 -0
  411. package/venv/lib/python3.10/site-packages/pip/_internal/cli/cmdoptions.py +1018 -0
  412. package/venv/lib/python3.10/site-packages/pip/_internal/cli/command_context.py +27 -0
  413. package/venv/lib/python3.10/site-packages/pip/_internal/cli/main.py +70 -0
  414. package/venv/lib/python3.10/site-packages/pip/_internal/cli/main_parser.py +87 -0
  415. package/venv/lib/python3.10/site-packages/pip/_internal/cli/parser.py +292 -0
  416. package/venv/lib/python3.10/site-packages/pip/_internal/cli/progress_bars.py +321 -0
  417. package/venv/lib/python3.10/site-packages/pip/_internal/cli/req_command.py +506 -0
  418. package/venv/lib/python3.10/site-packages/pip/_internal/cli/spinners.py +157 -0
  419. package/venv/lib/python3.10/site-packages/pip/_internal/cli/status_codes.py +6 -0
  420. package/venv/lib/python3.10/site-packages/pip/_internal/commands/__init__.py +127 -0
  421. package/venv/lib/python3.10/site-packages/pip/_internal/commands/cache.py +223 -0
  422. package/venv/lib/python3.10/site-packages/pip/_internal/commands/check.py +53 -0
  423. package/venv/lib/python3.10/site-packages/pip/_internal/commands/completion.py +96 -0
  424. package/venv/lib/python3.10/site-packages/pip/_internal/commands/configuration.py +266 -0
  425. package/venv/lib/python3.10/site-packages/pip/_internal/commands/debug.py +202 -0
  426. package/venv/lib/python3.10/site-packages/pip/_internal/commands/download.py +140 -0
  427. package/venv/lib/python3.10/site-packages/pip/_internal/commands/freeze.py +97 -0
  428. package/venv/lib/python3.10/site-packages/pip/_internal/commands/hash.py +59 -0
  429. package/venv/lib/python3.10/site-packages/pip/_internal/commands/help.py +41 -0
  430. package/venv/lib/python3.10/site-packages/pip/_internal/commands/index.py +139 -0
  431. package/venv/lib/python3.10/site-packages/pip/_internal/commands/install.py +771 -0
  432. package/venv/lib/python3.10/site-packages/pip/_internal/commands/list.py +363 -0
  433. package/venv/lib/python3.10/site-packages/pip/_internal/commands/search.py +174 -0
  434. package/venv/lib/python3.10/site-packages/pip/_internal/commands/show.py +178 -0
  435. package/venv/lib/python3.10/site-packages/pip/_internal/commands/uninstall.py +105 -0
  436. package/venv/lib/python3.10/site-packages/pip/_internal/commands/wheel.py +178 -0
  437. package/venv/lib/python3.10/site-packages/pip/_internal/configuration.py +366 -0
  438. package/venv/lib/python3.10/site-packages/pip/_internal/distributions/__init__.py +21 -0
  439. package/venv/lib/python3.10/site-packages/pip/_internal/distributions/base.py +36 -0
  440. package/venv/lib/python3.10/site-packages/pip/_internal/distributions/installed.py +20 -0
  441. package/venv/lib/python3.10/site-packages/pip/_internal/distributions/sdist.py +127 -0
  442. package/venv/lib/python3.10/site-packages/pip/_internal/distributions/wheel.py +31 -0
  443. package/venv/lib/python3.10/site-packages/pip/_internal/exceptions.py +658 -0
  444. package/venv/lib/python3.10/site-packages/pip/_internal/index/__init__.py +2 -0
  445. package/venv/lib/python3.10/site-packages/pip/_internal/index/collector.py +648 -0
  446. package/venv/lib/python3.10/site-packages/pip/_internal/index/package_finder.py +1004 -0
  447. package/venv/lib/python3.10/site-packages/pip/_internal/index/sources.py +224 -0
  448. package/venv/lib/python3.10/site-packages/pip/_internal/locations/__init__.py +520 -0
  449. package/venv/lib/python3.10/site-packages/pip/_internal/locations/_distutils.py +169 -0
  450. package/venv/lib/python3.10/site-packages/pip/_internal/locations/_sysconfig.py +219 -0
  451. package/venv/lib/python3.10/site-packages/pip/_internal/locations/base.py +52 -0
  452. package/venv/lib/python3.10/site-packages/pip/_internal/main.py +12 -0
  453. package/venv/lib/python3.10/site-packages/pip/_internal/metadata/__init__.py +62 -0
  454. package/venv/lib/python3.10/site-packages/pip/_internal/metadata/base.py +546 -0
  455. package/venv/lib/python3.10/site-packages/pip/_internal/metadata/pkg_resources.py +256 -0
  456. package/venv/lib/python3.10/site-packages/pip/_internal/models/__init__.py +2 -0
  457. package/venv/lib/python3.10/site-packages/pip/_internal/models/candidate.py +34 -0
  458. package/venv/lib/python3.10/site-packages/pip/_internal/models/direct_url.py +220 -0
  459. package/venv/lib/python3.10/site-packages/pip/_internal/models/format_control.py +80 -0
  460. package/venv/lib/python3.10/site-packages/pip/_internal/models/index.py +28 -0
  461. package/venv/lib/python3.10/site-packages/pip/_internal/models/link.py +288 -0
  462. package/venv/lib/python3.10/site-packages/pip/_internal/models/scheme.py +31 -0
  463. package/venv/lib/python3.10/site-packages/pip/_internal/models/search_scope.py +129 -0
  464. package/venv/lib/python3.10/site-packages/pip/_internal/models/selection_prefs.py +51 -0
  465. package/venv/lib/python3.10/site-packages/pip/_internal/models/target_python.py +110 -0
  466. package/venv/lib/python3.10/site-packages/pip/_internal/models/wheel.py +89 -0
  467. package/venv/lib/python3.10/site-packages/pip/_internal/network/__init__.py +2 -0
  468. package/venv/lib/python3.10/site-packages/pip/_internal/network/auth.py +323 -0
  469. package/venv/lib/python3.10/site-packages/pip/_internal/network/cache.py +69 -0
  470. package/venv/lib/python3.10/site-packages/pip/_internal/network/download.py +185 -0
  471. package/venv/lib/python3.10/site-packages/pip/_internal/network/lazy_wheel.py +210 -0
  472. package/venv/lib/python3.10/site-packages/pip/_internal/network/session.py +454 -0
  473. package/venv/lib/python3.10/site-packages/pip/_internal/network/utils.py +96 -0
  474. package/venv/lib/python3.10/site-packages/pip/_internal/network/xmlrpc.py +60 -0
  475. package/venv/lib/python3.10/site-packages/pip/_internal/operations/__init__.py +0 -0
  476. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  477. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata.py +39 -0
  478. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata_editable.py +41 -0
  479. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/metadata_legacy.py +74 -0
  480. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel.py +37 -0
  481. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel_editable.py +46 -0
  482. package/venv/lib/python3.10/site-packages/pip/_internal/operations/build/wheel_legacy.py +102 -0
  483. package/venv/lib/python3.10/site-packages/pip/_internal/operations/check.py +149 -0
  484. package/venv/lib/python3.10/site-packages/pip/_internal/operations/freeze.py +254 -0
  485. package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/__init__.py +2 -0
  486. package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/editable_legacy.py +47 -0
  487. package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/legacy.py +120 -0
  488. package/venv/lib/python3.10/site-packages/pip/_internal/operations/install/wheel.py +738 -0
  489. package/venv/lib/python3.10/site-packages/pip/_internal/operations/prepare.py +642 -0
  490. package/venv/lib/python3.10/site-packages/pip/_internal/pyproject.py +168 -0
  491. package/venv/lib/python3.10/site-packages/pip/_internal/req/__init__.py +94 -0
  492. package/venv/lib/python3.10/site-packages/pip/_internal/req/constructors.py +490 -0
  493. package/venv/lib/python3.10/site-packages/pip/_internal/req/req_file.py +536 -0
  494. package/venv/lib/python3.10/site-packages/pip/_internal/req/req_install.py +858 -0
  495. package/venv/lib/python3.10/site-packages/pip/_internal/req/req_set.py +189 -0
  496. package/venv/lib/python3.10/site-packages/pip/_internal/req/req_tracker.py +124 -0
  497. package/venv/lib/python3.10/site-packages/pip/_internal/req/req_uninstall.py +633 -0
  498. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/__init__.py +0 -0
  499. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/base.py +20 -0
  500. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  501. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/legacy/resolver.py +467 -0
  502. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  503. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/base.py +141 -0
  504. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/candidates.py +547 -0
  505. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/factory.py +739 -0
  506. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +155 -0
  507. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/provider.py +248 -0
  508. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/reporter.py +68 -0
  509. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/requirements.py +166 -0
  510. package/venv/lib/python3.10/site-packages/pip/_internal/resolution/resolvelib/resolver.py +292 -0
  511. package/venv/lib/python3.10/site-packages/pip/_internal/self_outdated_check.py +189 -0
  512. package/venv/lib/python3.10/site-packages/pip/_internal/utils/__init__.py +0 -0
  513. package/venv/lib/python3.10/site-packages/pip/_internal/utils/_log.py +38 -0
  514. package/venv/lib/python3.10/site-packages/pip/_internal/utils/appdirs.py +52 -0
  515. package/venv/lib/python3.10/site-packages/pip/_internal/utils/compat.py +63 -0
  516. package/venv/lib/python3.10/site-packages/pip/_internal/utils/compatibility_tags.py +165 -0
  517. package/venv/lib/python3.10/site-packages/pip/_internal/utils/datetime.py +11 -0
  518. package/venv/lib/python3.10/site-packages/pip/_internal/utils/deprecation.py +120 -0
  519. package/venv/lib/python3.10/site-packages/pip/_internal/utils/direct_url_helpers.py +87 -0
  520. package/venv/lib/python3.10/site-packages/pip/_internal/utils/distutils_args.py +42 -0
  521. package/venv/lib/python3.10/site-packages/pip/_internal/utils/egg_link.py +75 -0
  522. package/venv/lib/python3.10/site-packages/pip/_internal/utils/encoding.py +36 -0
  523. package/venv/lib/python3.10/site-packages/pip/_internal/utils/entrypoints.py +27 -0
  524. package/venv/lib/python3.10/site-packages/pip/_internal/utils/filesystem.py +182 -0
  525. package/venv/lib/python3.10/site-packages/pip/_internal/utils/filetypes.py +27 -0
  526. package/venv/lib/python3.10/site-packages/pip/_internal/utils/glibc.py +88 -0
  527. package/venv/lib/python3.10/site-packages/pip/_internal/utils/hashes.py +144 -0
  528. package/venv/lib/python3.10/site-packages/pip/_internal/utils/inject_securetransport.py +35 -0
  529. package/venv/lib/python3.10/site-packages/pip/_internal/utils/logging.py +343 -0
  530. package/venv/lib/python3.10/site-packages/pip/_internal/utils/misc.py +653 -0
  531. package/venv/lib/python3.10/site-packages/pip/_internal/utils/models.py +39 -0
  532. package/venv/lib/python3.10/site-packages/pip/_internal/utils/packaging.py +57 -0
  533. package/venv/lib/python3.10/site-packages/pip/_internal/utils/setuptools_build.py +195 -0
  534. package/venv/lib/python3.10/site-packages/pip/_internal/utils/subprocess.py +260 -0
  535. package/venv/lib/python3.10/site-packages/pip/_internal/utils/temp_dir.py +246 -0
  536. package/venv/lib/python3.10/site-packages/pip/_internal/utils/unpacking.py +258 -0
  537. package/venv/lib/python3.10/site-packages/pip/_internal/utils/urls.py +62 -0
  538. package/venv/lib/python3.10/site-packages/pip/_internal/utils/virtualenv.py +104 -0
  539. package/venv/lib/python3.10/site-packages/pip/_internal/utils/wheel.py +136 -0
  540. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/__init__.py +15 -0
  541. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/bazaar.py +101 -0
  542. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/git.py +526 -0
  543. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/mercurial.py +163 -0
  544. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/subversion.py +324 -0
  545. package/venv/lib/python3.10/site-packages/pip/_internal/vcs/versioncontrol.py +705 -0
  546. package/venv/lib/python3.10/site-packages/pip/_internal/wheel_builder.py +377 -0
  547. package/venv/lib/python3.10/site-packages/pip/_vendor/__init__.py +111 -0
  548. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/__init__.py +18 -0
  549. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/_cmd.py +61 -0
  550. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/adapter.py +137 -0
  551. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/cache.py +43 -0
  552. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +6 -0
  553. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +150 -0
  554. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +37 -0
  555. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/compat.py +32 -0
  556. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/controller.py +415 -0
  557. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/filewrapper.py +111 -0
  558. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/heuristics.py +139 -0
  559. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/serialize.py +186 -0
  560. package/venv/lib/python3.10/site-packages/pip/_vendor/cachecontrol/wrapper.py +33 -0
  561. package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/__init__.py +3 -0
  562. package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  563. package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/cacert.pem +4362 -0
  564. package/venv/lib/python3.10/site-packages/pip/_vendor/certifi/core.py +76 -0
  565. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/__init__.py +83 -0
  566. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  567. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/big5prober.py +47 -0
  568. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/chardistribution.py +233 -0
  569. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/charsetgroupprober.py +107 -0
  570. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/charsetprober.py +145 -0
  571. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cli/__init__.py +1 -0
  572. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cli/chardetect.py +84 -0
  573. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/codingstatemachine.py +88 -0
  574. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/compat.py +36 -0
  575. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/cp949prober.py +49 -0
  576. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/enums.py +76 -0
  577. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/escprober.py +101 -0
  578. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/escsm.py +246 -0
  579. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/eucjpprober.py +92 -0
  580. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euckrfreq.py +195 -0
  581. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euckrprober.py +47 -0
  582. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euctwfreq.py +387 -0
  583. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/euctwprober.py +46 -0
  584. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312freq.py +283 -0
  585. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/gb2312prober.py +46 -0
  586. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/hebrewprober.py +292 -0
  587. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/jisfreq.py +325 -0
  588. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/jpcntx.py +233 -0
  589. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +4650 -0
  590. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langgreekmodel.py +4398 -0
  591. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langhebrewmodel.py +4383 -0
  592. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langhungarianmodel.py +4650 -0
  593. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langrussianmodel.py +5718 -0
  594. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langthaimodel.py +4383 -0
  595. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/langturkishmodel.py +4383 -0
  596. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/latin1prober.py +145 -0
  597. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcharsetprober.py +91 -0
  598. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +54 -0
  599. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/mbcssm.py +572 -0
  600. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/metadata/__init__.py +0 -0
  601. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/metadata/languages.py +310 -0
  602. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sbcharsetprober.py +145 -0
  603. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +83 -0
  604. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/sjisprober.py +92 -0
  605. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/universaldetector.py +286 -0
  606. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/utf8prober.py +82 -0
  607. package/venv/lib/python3.10/site-packages/pip/_vendor/chardet/version.py +9 -0
  608. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/__init__.py +6 -0
  609. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/ansi.py +102 -0
  610. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/ansitowin32.py +258 -0
  611. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/initialise.py +80 -0
  612. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/win32.py +152 -0
  613. package/venv/lib/python3.10/site-packages/pip/_vendor/colorama/winterm.py +169 -0
  614. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/__init__.py +23 -0
  615. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/compat.py +1116 -0
  616. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/database.py +1345 -0
  617. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/index.py +509 -0
  618. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/locators.py +1300 -0
  619. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/manifest.py +393 -0
  620. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/markers.py +152 -0
  621. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/metadata.py +1058 -0
  622. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/resources.py +358 -0
  623. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/scripts.py +429 -0
  624. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/util.py +1932 -0
  625. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/version.py +739 -0
  626. package/venv/lib/python3.10/site-packages/pip/_vendor/distlib/wheel.py +1053 -0
  627. package/venv/lib/python3.10/site-packages/pip/_vendor/distro.py +1386 -0
  628. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/__init__.py +35 -0
  629. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_ihatexml.py +289 -0
  630. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_inputstream.py +918 -0
  631. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_tokenizer.py +1735 -0
  632. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/__init__.py +5 -0
  633. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/_base.py +40 -0
  634. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_trie/py.py +67 -0
  635. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/_utils.py +159 -0
  636. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/constants.py +2946 -0
  637. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/__init__.py +0 -0
  638. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/alphabeticalattributes.py +29 -0
  639. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/base.py +12 -0
  640. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/inject_meta_charset.py +73 -0
  641. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/lint.py +93 -0
  642. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/optionaltags.py +207 -0
  643. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/sanitizer.py +916 -0
  644. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/filters/whitespace.py +38 -0
  645. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/html5parser.py +2795 -0
  646. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/serializer.py +409 -0
  647. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/__init__.py +30 -0
  648. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py +54 -0
  649. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treeadapters/sax.py +50 -0
  650. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py +88 -0
  651. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/base.py +417 -0
  652. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/dom.py +239 -0
  653. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree.py +343 -0
  654. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py +392 -0
  655. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/__init__.py +154 -0
  656. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/base.py +252 -0
  657. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/dom.py +43 -0
  658. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/etree.py +131 -0
  659. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/etree_lxml.py +215 -0
  660. package/venv/lib/python3.10/site-packages/pip/_vendor/html5lib/treewalkers/genshi.py +69 -0
  661. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/__init__.py +44 -0
  662. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/codec.py +112 -0
  663. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/compat.py +13 -0
  664. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/core.py +397 -0
  665. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/idnadata.py +2137 -0
  666. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/intranges.py +54 -0
  667. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/package_data.py +2 -0
  668. package/venv/lib/python3.10/site-packages/pip/_vendor/idna/uts46data.py +8512 -0
  669. package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/__init__.py +54 -0
  670. package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/_version.py +1 -0
  671. package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  672. package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/ext.py +193 -0
  673. package/venv/lib/python3.10/site-packages/pip/_vendor/msgpack/fallback.py +1012 -0
  674. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/__about__.py +26 -0
  675. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/__init__.py +25 -0
  676. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_manylinux.py +301 -0
  677. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_musllinux.py +136 -0
  678. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/_structures.py +61 -0
  679. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/markers.py +304 -0
  680. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/requirements.py +146 -0
  681. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/specifiers.py +802 -0
  682. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/tags.py +487 -0
  683. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/utils.py +136 -0
  684. package/venv/lib/python3.10/site-packages/pip/_vendor/packaging/version.py +504 -0
  685. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/__init__.py +6 -0
  686. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/build.py +127 -0
  687. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/check.py +207 -0
  688. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/colorlog.py +115 -0
  689. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/compat.py +51 -0
  690. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/dirtools.py +44 -0
  691. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/envbuild.py +171 -0
  692. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/__init__.py +17 -0
  693. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py +363 -0
  694. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/meta.py +92 -0
  695. package/venv/lib/python3.10/site-packages/pip/_vendor/pep517/wrappers.py +375 -0
  696. package/venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/__init__.py +3296 -0
  697. package/venv/lib/python3.10/site-packages/pip/_vendor/pkg_resources/py31compat.py +23 -0
  698. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/__init__.py +331 -0
  699. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/__main__.py +46 -0
  700. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/android.py +119 -0
  701. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/api.py +156 -0
  702. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/macos.py +64 -0
  703. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/unix.py +181 -0
  704. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/version.py +4 -0
  705. package/venv/lib/python3.10/site-packages/pip/_vendor/platformdirs/windows.py +182 -0
  706. package/venv/lib/python3.10/site-packages/pip/_vendor/progress/__init__.py +189 -0
  707. package/venv/lib/python3.10/site-packages/pip/_vendor/progress/bar.py +93 -0
  708. package/venv/lib/python3.10/site-packages/pip/_vendor/progress/colors.py +79 -0
  709. package/venv/lib/python3.10/site-packages/pip/_vendor/progress/counter.py +47 -0
  710. package/venv/lib/python3.10/site-packages/pip/_vendor/progress/spinner.py +45 -0
  711. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/__init__.py +83 -0
  712. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/__main__.py +17 -0
  713. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/cmdline.py +663 -0
  714. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/console.py +70 -0
  715. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/filter.py +71 -0
  716. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/filters/__init__.py +937 -0
  717. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatter.py +94 -0
  718. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/__init__.py +153 -0
  719. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/_mapping.py +84 -0
  720. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/bbcode.py +108 -0
  721. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/groff.py +168 -0
  722. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/html.py +983 -0
  723. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/img.py +641 -0
  724. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/irc.py +179 -0
  725. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/latex.py +511 -0
  726. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/other.py +161 -0
  727. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py +83 -0
  728. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/rtf.py +146 -0
  729. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/svg.py +188 -0
  730. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/terminal.py +127 -0
  731. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/formatters/terminal256.py +338 -0
  732. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexer.py +879 -0
  733. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/__init__.py +341 -0
  734. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/_mapping.py +580 -0
  735. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/lexers/python.py +1188 -0
  736. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/modeline.py +43 -0
  737. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/plugin.py +69 -0
  738. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/regexopt.py +91 -0
  739. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/scanner.py +104 -0
  740. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/sphinxext.py +155 -0
  741. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/style.py +197 -0
  742. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/styles/__init__.py +93 -0
  743. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/token.py +212 -0
  744. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/unistring.py +153 -0
  745. package/venv/lib/python3.10/site-packages/pip/_vendor/pygments/util.py +308 -0
  746. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/__init__.py +328 -0
  747. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/actions.py +207 -0
  748. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/common.py +424 -0
  749. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/core.py +5789 -0
  750. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/diagram/__init__.py +593 -0
  751. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/exceptions.py +267 -0
  752. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/helpers.py +1069 -0
  753. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/results.py +760 -0
  754. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/testing.py +331 -0
  755. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/unicode.py +332 -0
  756. package/venv/lib/python3.10/site-packages/pip/_vendor/pyparsing/util.py +235 -0
  757. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/__init__.py +154 -0
  758. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/__version__.py +14 -0
  759. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/_internal_utils.py +42 -0
  760. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/adapters.py +538 -0
  761. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/api.py +159 -0
  762. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/auth.py +305 -0
  763. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/certs.py +18 -0
  764. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/compat.py +77 -0
  765. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/cookies.py +549 -0
  766. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/exceptions.py +133 -0
  767. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/help.py +132 -0
  768. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/hooks.py +34 -0
  769. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/models.py +973 -0
  770. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/packages.py +16 -0
  771. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/sessions.py +771 -0
  772. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/status_codes.py +123 -0
  773. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/structures.py +105 -0
  774. package/venv/lib/python3.10/site-packages/pip/_vendor/requests/utils.py +1060 -0
  775. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/__init__.py +26 -0
  776. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
  777. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +6 -0
  778. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/providers.py +133 -0
  779. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/reporters.py +43 -0
  780. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/resolvers.py +482 -0
  781. package/venv/lib/python3.10/site-packages/pip/_vendor/resolvelib/structs.py +165 -0
  782. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/__init__.py +172 -0
  783. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/__main__.py +280 -0
  784. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_cell_widths.py +451 -0
  785. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_emoji_codes.py +3610 -0
  786. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_emoji_replace.py +32 -0
  787. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_extension.py +10 -0
  788. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_inspect.py +210 -0
  789. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_log_render.py +94 -0
  790. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_loop.py +43 -0
  791. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_lru_cache.py +34 -0
  792. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_palettes.py +309 -0
  793. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_pick.py +17 -0
  794. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_ratio.py +160 -0
  795. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_spinners.py +848 -0
  796. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_stack.py +16 -0
  797. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_timer.py +19 -0
  798. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_windows.py +72 -0
  799. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/_wrap.py +55 -0
  800. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/abc.py +33 -0
  801. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/align.py +312 -0
  802. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/ansi.py +228 -0
  803. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/bar.py +94 -0
  804. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/box.py +483 -0
  805. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/cells.py +147 -0
  806. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/color.py +581 -0
  807. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/color_triplet.py +38 -0
  808. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/columns.py +187 -0
  809. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/console.py +2211 -0
  810. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/constrain.py +37 -0
  811. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/containers.py +167 -0
  812. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/control.py +175 -0
  813. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/default_styles.py +183 -0
  814. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/diagnose.py +6 -0
  815. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/emoji.py +96 -0
  816. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/errors.py +34 -0
  817. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/file_proxy.py +54 -0
  818. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/filesize.py +89 -0
  819. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/highlighter.py +147 -0
  820. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/json.py +140 -0
  821. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/jupyter.py +92 -0
  822. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/layout.py +444 -0
  823. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/live.py +365 -0
  824. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/live_render.py +113 -0
  825. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/logging.py +268 -0
  826. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/markup.py +244 -0
  827. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/measure.py +149 -0
  828. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/padding.py +141 -0
  829. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/pager.py +34 -0
  830. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/palette.py +100 -0
  831. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/panel.py +250 -0
  832. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/pretty.py +903 -0
  833. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/progress.py +1036 -0
  834. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/progress_bar.py +216 -0
  835. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/prompt.py +376 -0
  836. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/protocol.py +42 -0
  837. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/region.py +10 -0
  838. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/repr.py +151 -0
  839. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/rule.py +115 -0
  840. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/scope.py +86 -0
  841. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/screen.py +54 -0
  842. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/segment.py +720 -0
  843. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/spinner.py +134 -0
  844. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/status.py +132 -0
  845. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/style.py +785 -0
  846. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/styled.py +42 -0
  847. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/syntax.py +735 -0
  848. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/table.py +968 -0
  849. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/tabulate.py +51 -0
  850. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/terminal_theme.py +55 -0
  851. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/text.py +1282 -0
  852. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/theme.py +112 -0
  853. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/themes.py +5 -0
  854. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/traceback.py +678 -0
  855. package/venv/lib/python3.10/site-packages/pip/_vendor/rich/tree.py +249 -0
  856. package/venv/lib/python3.10/site-packages/pip/_vendor/six.py +998 -0
  857. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/__init__.py +517 -0
  858. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/_asyncio.py +92 -0
  859. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/_utils.py +68 -0
  860. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/after.py +46 -0
  861. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/before.py +41 -0
  862. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/before_sleep.py +58 -0
  863. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/nap.py +43 -0
  864. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/retry.py +213 -0
  865. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/stop.py +96 -0
  866. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/tornadoweb.py +59 -0
  867. package/venv/lib/python3.10/site-packages/pip/_vendor/tenacity/wait.py +191 -0
  868. package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/__init__.py +6 -0
  869. package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/_parser.py +703 -0
  870. package/venv/lib/python3.10/site-packages/pip/_vendor/tomli/_re.py +83 -0
  871. package/venv/lib/python3.10/site-packages/pip/_vendor/typing_extensions.py +2296 -0
  872. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/__init__.py +85 -0
  873. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/_collections.py +355 -0
  874. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/_version.py +2 -0
  875. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/connection.py +569 -0
  876. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/connectionpool.py +1113 -0
  877. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  878. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
  879. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  880. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
  881. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +397 -0
  882. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
  883. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +130 -0
  884. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +511 -0
  885. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +922 -0
  886. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
  887. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/exceptions.py +323 -0
  888. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/fields.py +274 -0
  889. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
  890. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  891. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  892. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
  893. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/packages/six.py +1077 -0
  894. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/poolmanager.py +539 -0
  895. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/request.py +170 -0
  896. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/response.py +821 -0
  897. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
  898. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/connection.py +149 -0
  899. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/proxy.py +57 -0
  900. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
  901. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/request.py +143 -0
  902. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
  903. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/retry.py +622 -0
  904. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_.py +495 -0
  905. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +161 -0
  906. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
  907. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/timeout.py +268 -0
  908. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/url.py +432 -0
  909. package/venv/lib/python3.10/site-packages/pip/_vendor/urllib3/util/wait.py +153 -0
  910. package/venv/lib/python3.10/site-packages/pip/_vendor/vendor.txt +25 -0
  911. package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  912. package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  913. package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  914. package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  915. package/venv/lib/python3.10/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  916. package/venv/lib/python3.10/site-packages/pip/py.typed +4 -0
  917. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/INSTALLER +1 -0
  918. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/LICENSE.txt +20 -0
  919. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/METADATA +92 -0
  920. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/RECORD +1037 -0
  921. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/REQUESTED +0 -0
  922. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/WHEEL +5 -0
  923. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/entry_points.txt +5 -0
  924. package/venv/lib/python3.10/site-packages/pip-22.0.2.dist-info/top_level.txt +1 -0
  925. package/venv/lib/python3.10/site-packages/pkg_resources/__init__.py +3303 -0
  926. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/__init__.py +0 -0
  927. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/appdirs.py +608 -0
  928. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/__about__.py +26 -0
  929. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/__init__.py +25 -0
  930. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_manylinux.py +301 -0
  931. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_musllinux.py +136 -0
  932. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/_structures.py +67 -0
  933. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/markers.py +304 -0
  934. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py +146 -0
  935. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/specifiers.py +828 -0
  936. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/tags.py +484 -0
  937. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/utils.py +136 -0
  938. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/version.py +504 -0
  939. package/venv/lib/python3.10/site-packages/pkg_resources/_vendor/pyparsing.py +5742 -0
  940. package/venv/lib/python3.10/site-packages/pkg_resources/extern/__init__.py +73 -0
  941. package/venv/lib/python3.10/site-packages/pkg_resources/tests/data/my-test-package-source/setup.py +6 -0
  942. package/venv/lib/python3.10/site-packages/propcache/__init__.py +32 -0
  943. package/venv/lib/python3.10/site-packages/propcache/_helpers.py +39 -0
  944. package/venv/lib/python3.10/site-packages/propcache/_helpers_c.cpython-310-x86_64-linux-gnu.so +0 -0
  945. package/venv/lib/python3.10/site-packages/propcache/_helpers_c.pyx +84 -0
  946. package/venv/lib/python3.10/site-packages/propcache/_helpers_py.py +56 -0
  947. package/venv/lib/python3.10/site-packages/propcache/api.py +8 -0
  948. package/venv/lib/python3.10/site-packages/propcache/py.typed +1 -0
  949. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/INSTALLER +1 -0
  950. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/LICENSE +202 -0
  951. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/METADATA +275 -0
  952. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/NOTICE +13 -0
  953. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/RECORD +18 -0
  954. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/WHEEL +6 -0
  955. package/venv/lib/python3.10/site-packages/propcache-0.2.1.dist-info/top_level.txt +1 -0
  956. package/venv/lib/python3.10/site-packages/pycparser/__init__.py +93 -0
  957. package/venv/lib/python3.10/site-packages/pycparser/_ast_gen.py +336 -0
  958. package/venv/lib/python3.10/site-packages/pycparser/_build_tables.py +40 -0
  959. package/venv/lib/python3.10/site-packages/pycparser/_c_ast.cfg +195 -0
  960. package/venv/lib/python3.10/site-packages/pycparser/ast_transforms.py +164 -0
  961. package/venv/lib/python3.10/site-packages/pycparser/c_ast.py +1125 -0
  962. package/venv/lib/python3.10/site-packages/pycparser/c_generator.py +502 -0
  963. package/venv/lib/python3.10/site-packages/pycparser/c_lexer.py +555 -0
  964. package/venv/lib/python3.10/site-packages/pycparser/c_parser.py +1950 -0
  965. package/venv/lib/python3.10/site-packages/pycparser/lextab.py +10 -0
  966. package/venv/lib/python3.10/site-packages/pycparser/ply/__init__.py +5 -0
  967. package/venv/lib/python3.10/site-packages/pycparser/ply/cpp.py +905 -0
  968. package/venv/lib/python3.10/site-packages/pycparser/ply/ctokens.py +133 -0
  969. package/venv/lib/python3.10/site-packages/pycparser/ply/lex.py +1099 -0
  970. package/venv/lib/python3.10/site-packages/pycparser/ply/yacc.py +3494 -0
  971. package/venv/lib/python3.10/site-packages/pycparser/ply/ygen.py +74 -0
  972. package/venv/lib/python3.10/site-packages/pycparser/plyparser.py +133 -0
  973. package/venv/lib/python3.10/site-packages/pycparser/yacctab.py +369 -0
  974. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/INSTALLER +1 -0
  975. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/LICENSE +27 -0
  976. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/METADATA +28 -0
  977. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/RECORD +41 -0
  978. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/WHEEL +5 -0
  979. package/venv/lib/python3.10/site-packages/pycparser-2.22.dist-info/top_level.txt +1 -0
  980. package/venv/lib/python3.10/site-packages/pyparsing/__init__.py +326 -0
  981. package/venv/lib/python3.10/site-packages/pyparsing/actions.py +219 -0
  982. package/venv/lib/python3.10/site-packages/pyparsing/common.py +434 -0
  983. package/venv/lib/python3.10/site-packages/pyparsing/core.py +6226 -0
  984. package/venv/lib/python3.10/site-packages/pyparsing/diagram/__init__.py +744 -0
  985. package/venv/lib/python3.10/site-packages/pyparsing/exceptions.py +314 -0
  986. package/venv/lib/python3.10/site-packages/pyparsing/helpers.py +1102 -0
  987. package/venv/lib/python3.10/site-packages/pyparsing/py.typed +0 -0
  988. package/venv/lib/python3.10/site-packages/pyparsing/results.py +816 -0
  989. package/venv/lib/python3.10/site-packages/pyparsing/testing.py +362 -0
  990. package/venv/lib/python3.10/site-packages/pyparsing/unicode.py +356 -0
  991. package/venv/lib/python3.10/site-packages/pyparsing/util.py +398 -0
  992. package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/INSTALLER +1 -0
  993. package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/LICENSE +18 -0
  994. package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/METADATA +124 -0
  995. package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/RECORD +28 -0
  996. package/venv/lib/python3.10/site-packages/pyparsing-3.2.1.dist-info/WHEEL +4 -0
  997. package/venv/lib/python3.10/site-packages/requests/__init__.py +184 -0
  998. package/venv/lib/python3.10/site-packages/requests/__version__.py +14 -0
  999. package/venv/lib/python3.10/site-packages/requests/_internal_utils.py +50 -0
  1000. package/venv/lib/python3.10/site-packages/requests/adapters.py +719 -0
  1001. package/venv/lib/python3.10/site-packages/requests/api.py +157 -0
  1002. package/venv/lib/python3.10/site-packages/requests/auth.py +314 -0
  1003. package/venv/lib/python3.10/site-packages/requests/certs.py +17 -0
  1004. package/venv/lib/python3.10/site-packages/requests/compat.py +94 -0
  1005. package/venv/lib/python3.10/site-packages/requests/cookies.py +561 -0
  1006. package/venv/lib/python3.10/site-packages/requests/exceptions.py +151 -0
  1007. package/venv/lib/python3.10/site-packages/requests/help.py +134 -0
  1008. package/venv/lib/python3.10/site-packages/requests/hooks.py +33 -0
  1009. package/venv/lib/python3.10/site-packages/requests/models.py +1037 -0
  1010. package/venv/lib/python3.10/site-packages/requests/packages.py +23 -0
  1011. package/venv/lib/python3.10/site-packages/requests/sessions.py +831 -0
  1012. package/venv/lib/python3.10/site-packages/requests/status_codes.py +128 -0
  1013. package/venv/lib/python3.10/site-packages/requests/structures.py +99 -0
  1014. package/venv/lib/python3.10/site-packages/requests/utils.py +1096 -0
  1015. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/INSTALLER +1 -0
  1016. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/LICENSE +175 -0
  1017. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/METADATA +119 -0
  1018. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/RECORD +43 -0
  1019. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/REQUESTED +0 -0
  1020. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/WHEEL +5 -0
  1021. package/venv/lib/python3.10/site-packages/requests-2.32.3.dist-info/top_level.txt +1 -0
  1022. package/venv/lib/python3.10/site-packages/requests_toolbelt/__init__.py +34 -0
  1023. package/venv/lib/python3.10/site-packages/requests_toolbelt/_compat.py +302 -0
  1024. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/__init__.py +15 -0
  1025. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/appengine.py +206 -0
  1026. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/fingerprint.py +48 -0
  1027. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/host_header_ssl.py +43 -0
  1028. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/socket_options.py +129 -0
  1029. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/source.py +67 -0
  1030. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/ssl.py +66 -0
  1031. package/venv/lib/python3.10/site-packages/requests_toolbelt/adapters/x509.py +196 -0
  1032. package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/__init__.py +0 -0
  1033. package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/_digest_auth_compat.py +29 -0
  1034. package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/guess.py +146 -0
  1035. package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/handler.py +142 -0
  1036. package/venv/lib/python3.10/site-packages/requests_toolbelt/auth/http_proxy_digest.py +103 -0
  1037. package/venv/lib/python3.10/site-packages/requests_toolbelt/cookies/__init__.py +0 -0
  1038. package/venv/lib/python3.10/site-packages/requests_toolbelt/cookies/forgetful.py +7 -0
  1039. package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/__init__.py +0 -0
  1040. package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/stream.py +176 -0
  1041. package/venv/lib/python3.10/site-packages/requests_toolbelt/downloadutils/tee.py +123 -0
  1042. package/venv/lib/python3.10/site-packages/requests_toolbelt/exceptions.py +25 -0
  1043. package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/__init__.py +31 -0
  1044. package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/decoder.py +156 -0
  1045. package/venv/lib/python3.10/site-packages/requests_toolbelt/multipart/encoder.py +655 -0
  1046. package/venv/lib/python3.10/site-packages/requests_toolbelt/sessions.py +89 -0
  1047. package/venv/lib/python3.10/site-packages/requests_toolbelt/streaming_iterator.py +116 -0
  1048. package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/__init__.py +97 -0
  1049. package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/pool.py +211 -0
  1050. package/venv/lib/python3.10/site-packages/requests_toolbelt/threaded/thread.py +53 -0
  1051. package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/__init__.py +0 -0
  1052. package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/deprecated.py +91 -0
  1053. package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/dump.py +198 -0
  1054. package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/formdata.py +108 -0
  1055. package/venv/lib/python3.10/site-packages/requests_toolbelt/utils/user_agent.py +143 -0
  1056. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/AUTHORS.rst +57 -0
  1057. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/INSTALLER +1 -0
  1058. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/LICENSE +13 -0
  1059. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/METADATA +521 -0
  1060. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/RECORD +75 -0
  1061. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/WHEEL +6 -0
  1062. package/venv/lib/python3.10/site-packages/requests_toolbelt-1.0.0.dist-info/top_level.txt +1 -0
  1063. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/__init__.py +1 -0
  1064. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/_scrypted_arlo_go.cpython-310-x86_64-linux-gnu.h +555 -0
  1065. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/_scrypted_arlo_go.cpython-310-x86_64-linux-gnu.so +0 -0
  1066. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/build.py +344 -0
  1067. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/go.py +2215 -0
  1068. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.c +6019 -0
  1069. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.go +3612 -0
  1070. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go.py +1910 -0
  1071. package/venv/lib/python3.10/site-packages/scrypted_arlo_go/scrypted_arlo_go_go.h +555 -0
  1072. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/INSTALLER +1 -0
  1073. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/METADATA +11 -0
  1074. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/RECORD +19 -0
  1075. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/REQUESTED +0 -0
  1076. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/WHEEL +8 -0
  1077. package/venv/lib/python3.10/site-packages/scrypted_arlo_go-0.7.6.dist-info/top_level.txt +1 -0
  1078. package/venv/lib/python3.10/site-packages/setuptools/__init__.py +242 -0
  1079. package/venv/lib/python3.10/site-packages/setuptools/_deprecation_warning.py +7 -0
  1080. package/venv/lib/python3.10/site-packages/setuptools/_distutils/__init__.py +24 -0
  1081. package/venv/lib/python3.10/site-packages/setuptools/_distutils/_msvccompiler.py +561 -0
  1082. package/venv/lib/python3.10/site-packages/setuptools/_distutils/archive_util.py +256 -0
  1083. package/venv/lib/python3.10/site-packages/setuptools/_distutils/bcppcompiler.py +393 -0
  1084. package/venv/lib/python3.10/site-packages/setuptools/_distutils/ccompiler.py +1123 -0
  1085. package/venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py +403 -0
  1086. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/__init__.py +31 -0
  1087. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist.py +143 -0
  1088. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_dumb.py +123 -0
  1089. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_msi.py +749 -0
  1090. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_rpm.py +579 -0
  1091. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/bdist_wininst.py +377 -0
  1092. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build.py +157 -0
  1093. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_clib.py +209 -0
  1094. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_ext.py +755 -0
  1095. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_py.py +392 -0
  1096. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/build_scripts.py +152 -0
  1097. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/check.py +148 -0
  1098. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/clean.py +76 -0
  1099. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/config.py +344 -0
  1100. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install.py +721 -0
  1101. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_data.py +79 -0
  1102. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_egg_info.py +84 -0
  1103. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_headers.py +47 -0
  1104. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_lib.py +217 -0
  1105. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/install_scripts.py +60 -0
  1106. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/py37compat.py +30 -0
  1107. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/register.py +304 -0
  1108. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py +494 -0
  1109. package/venv/lib/python3.10/site-packages/setuptools/_distutils/command/upload.py +214 -0
  1110. package/venv/lib/python3.10/site-packages/setuptools/_distutils/config.py +130 -0
  1111. package/venv/lib/python3.10/site-packages/setuptools/_distutils/core.py +249 -0
  1112. package/venv/lib/python3.10/site-packages/setuptools/_distutils/cygwinccompiler.py +425 -0
  1113. package/venv/lib/python3.10/site-packages/setuptools/_distutils/debug.py +5 -0
  1114. package/venv/lib/python3.10/site-packages/setuptools/_distutils/dep_util.py +92 -0
  1115. package/venv/lib/python3.10/site-packages/setuptools/_distutils/dir_util.py +210 -0
  1116. package/venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py +1257 -0
  1117. package/venv/lib/python3.10/site-packages/setuptools/_distutils/errors.py +97 -0
  1118. package/venv/lib/python3.10/site-packages/setuptools/_distutils/extension.py +240 -0
  1119. package/venv/lib/python3.10/site-packages/setuptools/_distutils/fancy_getopt.py +457 -0
  1120. package/venv/lib/python3.10/site-packages/setuptools/_distutils/file_util.py +238 -0
  1121. package/venv/lib/python3.10/site-packages/setuptools/_distutils/filelist.py +355 -0
  1122. package/venv/lib/python3.10/site-packages/setuptools/_distutils/log.py +77 -0
  1123. package/venv/lib/python3.10/site-packages/setuptools/_distutils/msvc9compiler.py +788 -0
  1124. package/venv/lib/python3.10/site-packages/setuptools/_distutils/msvccompiler.py +643 -0
  1125. package/venv/lib/python3.10/site-packages/setuptools/_distutils/py35compat.py +19 -0
  1126. package/venv/lib/python3.10/site-packages/setuptools/_distutils/py38compat.py +7 -0
  1127. package/venv/lib/python3.10/site-packages/setuptools/_distutils/spawn.py +106 -0
  1128. package/venv/lib/python3.10/site-packages/setuptools/_distutils/sysconfig.py +601 -0
  1129. package/venv/lib/python3.10/site-packages/setuptools/_distutils/text_file.py +286 -0
  1130. package/venv/lib/python3.10/site-packages/setuptools/_distutils/unixccompiler.py +325 -0
  1131. package/venv/lib/python3.10/site-packages/setuptools/_distutils/util.py +548 -0
  1132. package/venv/lib/python3.10/site-packages/setuptools/_distutils/version.py +363 -0
  1133. package/venv/lib/python3.10/site-packages/setuptools/_distutils/versionpredicate.py +169 -0
  1134. package/venv/lib/python3.10/site-packages/setuptools/_imp.py +82 -0
  1135. package/venv/lib/python3.10/site-packages/setuptools/_vendor/__init__.py +0 -0
  1136. package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/__init__.py +4 -0
  1137. package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/more.py +3825 -0
  1138. package/venv/lib/python3.10/site-packages/setuptools/_vendor/more_itertools/recipes.py +620 -0
  1139. package/venv/lib/python3.10/site-packages/setuptools/_vendor/ordered_set.py +488 -0
  1140. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/__about__.py +26 -0
  1141. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/__init__.py +25 -0
  1142. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_manylinux.py +301 -0
  1143. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_musllinux.py +136 -0
  1144. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/_structures.py +67 -0
  1145. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/markers.py +304 -0
  1146. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/requirements.py +146 -0
  1147. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/specifiers.py +828 -0
  1148. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/tags.py +484 -0
  1149. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/utils.py +136 -0
  1150. package/venv/lib/python3.10/site-packages/setuptools/_vendor/packaging/version.py +504 -0
  1151. package/venv/lib/python3.10/site-packages/setuptools/_vendor/pyparsing.py +5742 -0
  1152. package/venv/lib/python3.10/site-packages/setuptools/archive_util.py +205 -0
  1153. package/venv/lib/python3.10/site-packages/setuptools/build_meta.py +290 -0
  1154. package/venv/lib/python3.10/site-packages/setuptools/cli-32.exe +0 -0
  1155. package/venv/lib/python3.10/site-packages/setuptools/cli-64.exe +0 -0
  1156. package/venv/lib/python3.10/site-packages/setuptools/cli-arm64.exe +0 -0
  1157. package/venv/lib/python3.10/site-packages/setuptools/cli.exe +0 -0
  1158. package/venv/lib/python3.10/site-packages/setuptools/command/__init__.py +8 -0
  1159. package/venv/lib/python3.10/site-packages/setuptools/command/alias.py +78 -0
  1160. package/venv/lib/python3.10/site-packages/setuptools/command/bdist_egg.py +456 -0
  1161. package/venv/lib/python3.10/site-packages/setuptools/command/bdist_rpm.py +40 -0
  1162. package/venv/lib/python3.10/site-packages/setuptools/command/build_clib.py +101 -0
  1163. package/venv/lib/python3.10/site-packages/setuptools/command/build_ext.py +328 -0
  1164. package/venv/lib/python3.10/site-packages/setuptools/command/build_py.py +242 -0
  1165. package/venv/lib/python3.10/site-packages/setuptools/command/develop.py +193 -0
  1166. package/venv/lib/python3.10/site-packages/setuptools/command/dist_info.py +36 -0
  1167. package/venv/lib/python3.10/site-packages/setuptools/command/easy_install.py +2354 -0
  1168. package/venv/lib/python3.10/site-packages/setuptools/command/egg_info.py +755 -0
  1169. package/venv/lib/python3.10/site-packages/setuptools/command/install.py +132 -0
  1170. package/venv/lib/python3.10/site-packages/setuptools/command/install_egg_info.py +82 -0
  1171. package/venv/lib/python3.10/site-packages/setuptools/command/install_lib.py +148 -0
  1172. package/venv/lib/python3.10/site-packages/setuptools/command/install_scripts.py +69 -0
  1173. package/venv/lib/python3.10/site-packages/setuptools/command/launcher manifest.xml +15 -0
  1174. package/venv/lib/python3.10/site-packages/setuptools/command/py36compat.py +134 -0
  1175. package/venv/lib/python3.10/site-packages/setuptools/command/register.py +18 -0
  1176. package/venv/lib/python3.10/site-packages/setuptools/command/rotate.py +64 -0
  1177. package/venv/lib/python3.10/site-packages/setuptools/command/saveopts.py +22 -0
  1178. package/venv/lib/python3.10/site-packages/setuptools/command/sdist.py +196 -0
  1179. package/venv/lib/python3.10/site-packages/setuptools/command/setopt.py +149 -0
  1180. package/venv/lib/python3.10/site-packages/setuptools/command/test.py +252 -0
  1181. package/venv/lib/python3.10/site-packages/setuptools/command/upload.py +17 -0
  1182. package/venv/lib/python3.10/site-packages/setuptools/command/upload_docs.py +202 -0
  1183. package/venv/lib/python3.10/site-packages/setuptools/config.py +751 -0
  1184. package/venv/lib/python3.10/site-packages/setuptools/dep_util.py +25 -0
  1185. package/venv/lib/python3.10/site-packages/setuptools/depends.py +176 -0
  1186. package/venv/lib/python3.10/site-packages/setuptools/dist.py +1156 -0
  1187. package/venv/lib/python3.10/site-packages/setuptools/errors.py +40 -0
  1188. package/venv/lib/python3.10/site-packages/setuptools/extension.py +55 -0
  1189. package/venv/lib/python3.10/site-packages/setuptools/extern/__init__.py +73 -0
  1190. package/venv/lib/python3.10/site-packages/setuptools/glob.py +167 -0
  1191. package/venv/lib/python3.10/site-packages/setuptools/gui-32.exe +0 -0
  1192. package/venv/lib/python3.10/site-packages/setuptools/gui-64.exe +0 -0
  1193. package/venv/lib/python3.10/site-packages/setuptools/gui-arm64.exe +0 -0
  1194. package/venv/lib/python3.10/site-packages/setuptools/gui.exe +0 -0
  1195. package/venv/lib/python3.10/site-packages/setuptools/installer.py +104 -0
  1196. package/venv/lib/python3.10/site-packages/setuptools/launch.py +36 -0
  1197. package/venv/lib/python3.10/site-packages/setuptools/monkey.py +177 -0
  1198. package/venv/lib/python3.10/site-packages/setuptools/msvc.py +1805 -0
  1199. package/venv/lib/python3.10/site-packages/setuptools/namespaces.py +107 -0
  1200. package/venv/lib/python3.10/site-packages/setuptools/package_index.py +1150 -0
  1201. package/venv/lib/python3.10/site-packages/setuptools/py34compat.py +13 -0
  1202. package/venv/lib/python3.10/site-packages/setuptools/sandbox.py +530 -0
  1203. package/venv/lib/python3.10/site-packages/setuptools/script (dev).tmpl +6 -0
  1204. package/venv/lib/python3.10/site-packages/setuptools/script.tmpl +3 -0
  1205. package/venv/lib/python3.10/site-packages/setuptools/unicode_utils.py +42 -0
  1206. package/venv/lib/python3.10/site-packages/setuptools/version.py +6 -0
  1207. package/venv/lib/python3.10/site-packages/setuptools/wheel.py +213 -0
  1208. package/venv/lib/python3.10/site-packages/setuptools/windows_support.py +29 -0
  1209. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/INSTALLER +1 -0
  1210. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/LICENSE +19 -0
  1211. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/METADATA +125 -0
  1212. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/RECORD +298 -0
  1213. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/REQUESTED +0 -0
  1214. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/WHEEL +5 -0
  1215. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/entry_points.txt +56 -0
  1216. package/venv/lib/python3.10/site-packages/setuptools-59.6.0.dist-info/top_level.txt +4 -0
  1217. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/INSTALLER +1 -0
  1218. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/LICENSE +18 -0
  1219. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/METADATA +43 -0
  1220. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/RECORD +8 -0
  1221. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/WHEEL +6 -0
  1222. package/venv/lib/python3.10/site-packages/six-1.17.0.dist-info/top_level.txt +1 -0
  1223. package/venv/lib/python3.10/site-packages/six.py +1003 -0
  1224. package/venv/lib/python3.10/site-packages/soupsieve/__init__.py +168 -0
  1225. package/venv/lib/python3.10/site-packages/soupsieve/__meta__.py +197 -0
  1226. package/venv/lib/python3.10/site-packages/soupsieve/css_match.py +1582 -0
  1227. package/venv/lib/python3.10/site-packages/soupsieve/css_parser.py +1289 -0
  1228. package/venv/lib/python3.10/site-packages/soupsieve/css_types.py +407 -0
  1229. package/venv/lib/python3.10/site-packages/soupsieve/pretty.py +139 -0
  1230. package/venv/lib/python3.10/site-packages/soupsieve/py.typed +0 -0
  1231. package/venv/lib/python3.10/site-packages/soupsieve/util.py +117 -0
  1232. package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/INSTALLER +1 -0
  1233. package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/METADATA +114 -0
  1234. package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/RECORD +20 -0
  1235. package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/WHEEL +4 -0
  1236. package/venv/lib/python3.10/site-packages/soupsieve-2.6.dist-info/licenses/LICENSE.md +21 -0
  1237. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/PKG-INFO +98 -0
  1238. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/SOURCES.txt +12 -0
  1239. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/dependency_links.txt +1 -0
  1240. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/installed-files.txt +7 -0
  1241. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/requires.txt +2 -0
  1242. package/venv/lib/python3.10/site-packages/sseclient-0.0.22.egg-info/top_level.txt +1 -0
  1243. package/venv/lib/python3.10/site-packages/sseclient.py +165 -0
  1244. package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/INSTALLER +1 -0
  1245. package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/LICENSE +279 -0
  1246. package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/METADATA +67 -0
  1247. package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/RECORD +7 -0
  1248. package/venv/lib/python3.10/site-packages/typing_extensions-4.12.2.dist-info/WHEEL +4 -0
  1249. package/venv/lib/python3.10/site-packages/typing_extensions.py +3641 -0
  1250. package/venv/lib/python3.10/site-packages/urllib3/__init__.py +211 -0
  1251. package/venv/lib/python3.10/site-packages/urllib3/_base_connection.py +165 -0
  1252. package/venv/lib/python3.10/site-packages/urllib3/_collections.py +479 -0
  1253. package/venv/lib/python3.10/site-packages/urllib3/_request_methods.py +278 -0
  1254. package/venv/lib/python3.10/site-packages/urllib3/_version.py +16 -0
  1255. package/venv/lib/python3.10/site-packages/urllib3/connection.py +1044 -0
  1256. package/venv/lib/python3.10/site-packages/urllib3/connectionpool.py +1178 -0
  1257. package/venv/lib/python3.10/site-packages/urllib3/contrib/__init__.py +0 -0
  1258. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/__init__.py +16 -0
  1259. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/connection.py +255 -0
  1260. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/emscripten_fetch_worker.js +110 -0
  1261. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/fetch.py +708 -0
  1262. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/request.py +22 -0
  1263. package/venv/lib/python3.10/site-packages/urllib3/contrib/emscripten/response.py +285 -0
  1264. package/venv/lib/python3.10/site-packages/urllib3/contrib/pyopenssl.py +554 -0
  1265. package/venv/lib/python3.10/site-packages/urllib3/contrib/socks.py +228 -0
  1266. package/venv/lib/python3.10/site-packages/urllib3/exceptions.py +327 -0
  1267. package/venv/lib/python3.10/site-packages/urllib3/fields.py +341 -0
  1268. package/venv/lib/python3.10/site-packages/urllib3/filepost.py +89 -0
  1269. package/venv/lib/python3.10/site-packages/urllib3/http2/__init__.py +53 -0
  1270. package/venv/lib/python3.10/site-packages/urllib3/http2/connection.py +356 -0
  1271. package/venv/lib/python3.10/site-packages/urllib3/http2/probe.py +87 -0
  1272. package/venv/lib/python3.10/site-packages/urllib3/poolmanager.py +637 -0
  1273. package/venv/lib/python3.10/site-packages/urllib3/py.typed +2 -0
  1274. package/venv/lib/python3.10/site-packages/urllib3/response.py +1278 -0
  1275. package/venv/lib/python3.10/site-packages/urllib3/util/__init__.py +42 -0
  1276. package/venv/lib/python3.10/site-packages/urllib3/util/connection.py +137 -0
  1277. package/venv/lib/python3.10/site-packages/urllib3/util/proxy.py +43 -0
  1278. package/venv/lib/python3.10/site-packages/urllib3/util/request.py +258 -0
  1279. package/venv/lib/python3.10/site-packages/urllib3/util/response.py +101 -0
  1280. package/venv/lib/python3.10/site-packages/urllib3/util/retry.py +533 -0
  1281. package/venv/lib/python3.10/site-packages/urllib3/util/ssl_.py +504 -0
  1282. package/venv/lib/python3.10/site-packages/urllib3/util/ssl_match_hostname.py +159 -0
  1283. package/venv/lib/python3.10/site-packages/urllib3/util/ssltransport.py +271 -0
  1284. package/venv/lib/python3.10/site-packages/urllib3/util/timeout.py +275 -0
  1285. package/venv/lib/python3.10/site-packages/urllib3/util/url.py +469 -0
  1286. package/venv/lib/python3.10/site-packages/urllib3/util/util.py +42 -0
  1287. package/venv/lib/python3.10/site-packages/urllib3/util/wait.py +124 -0
  1288. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/INSTALLER +1 -0
  1289. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/METADATA +154 -0
  1290. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/RECORD +80 -0
  1291. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/REQUESTED +0 -0
  1292. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/WHEEL +4 -0
  1293. package/venv/lib/python3.10/site-packages/urllib3-2.3.0.dist-info/licenses/LICENSE.txt +21 -0
  1294. package/venv/lib/python3.10/site-packages/yarl/__init__.py +14 -0
  1295. package/venv/lib/python3.10/site-packages/yarl/_parse.py +189 -0
  1296. package/venv/lib/python3.10/site-packages/yarl/_path.py +41 -0
  1297. package/venv/lib/python3.10/site-packages/yarl/_query.py +118 -0
  1298. package/venv/lib/python3.10/site-packages/yarl/_quoters.py +32 -0
  1299. package/venv/lib/python3.10/site-packages/yarl/_quoting.py +18 -0
  1300. package/venv/lib/python3.10/site-packages/yarl/_quoting_c.cpython-310-x86_64-linux-gnu.so +0 -0
  1301. package/venv/lib/python3.10/site-packages/yarl/_quoting_c.pyi +16 -0
  1302. package/venv/lib/python3.10/site-packages/yarl/_quoting_c.pyx +423 -0
  1303. package/venv/lib/python3.10/site-packages/yarl/_quoting_py.py +197 -0
  1304. package/venv/lib/python3.10/site-packages/yarl/_url.py +1584 -0
  1305. package/venv/lib/python3.10/site-packages/yarl/py.typed +1 -0
  1306. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/INSTALLER +1 -0
  1307. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/LICENSE +202 -0
  1308. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/METADATA +2279 -0
  1309. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/NOTICE +13 -0
  1310. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/RECORD +27 -0
  1311. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/WHEEL +6 -0
  1312. package/venv/lib/python3.10/site-packages/yarl-1.18.3.dist-info/top_level.txt +1 -0
  1313. package/venv/pyvenv.cfg +3 -0
@@ -0,0 +1,2886 @@
1
+ from __future__ import annotations
2
+
3
+ # Use of this source code is governed by the MIT license.
4
+ __license__ = "MIT"
5
+
6
+ import re
7
+ import warnings
8
+
9
+ from bs4.css import CSS
10
+ from bs4._deprecation import (
11
+ _deprecated,
12
+ _deprecated_alias,
13
+ _deprecated_function_alias,
14
+ )
15
+ from bs4.formatter import (
16
+ Formatter,
17
+ HTMLFormatter,
18
+ XMLFormatter,
19
+ )
20
+ from bs4._warnings import AttributeResemblesVariableWarning
21
+
22
+ from typing import (
23
+ Any,
24
+ Callable,
25
+ Dict,
26
+ Generic,
27
+ Iterable,
28
+ Iterator,
29
+ List,
30
+ Mapping,
31
+ Optional,
32
+ Pattern,
33
+ Set,
34
+ TYPE_CHECKING,
35
+ Tuple,
36
+ Type,
37
+ TypeVar,
38
+ Union,
39
+ cast,
40
+ )
41
+ from typing_extensions import (
42
+ Self,
43
+ TypeAlias,
44
+ )
45
+
46
+ if TYPE_CHECKING:
47
+ from bs4 import BeautifulSoup
48
+ from bs4.builder import TreeBuilder
49
+ from bs4.filter import ElementFilter
50
+ from bs4.formatter import (
51
+ _EntitySubstitutionFunction,
52
+ _FormatterOrName,
53
+ )
54
+ from bs4._typing import (
55
+ _AtMostOneElement,
56
+ _AttributeValue,
57
+ _AttributeValues,
58
+ _Encoding,
59
+ _InsertableElement,
60
+ _OneElement,
61
+ _QueryResults,
62
+ _RawOrProcessedAttributeValues,
63
+ _StrainableElement,
64
+ _StrainableAttribute,
65
+ _StrainableAttributes,
66
+ _StrainableString,
67
+ )
68
+
69
+ _OneOrMoreStringTypes: TypeAlias = Union[
70
+ Type["NavigableString"], Iterable[Type["NavigableString"]]
71
+ ]
72
+
73
+ _FindMethodName: TypeAlias = Optional[Union["_StrainableElement", "ElementFilter"]]
74
+
75
+ # Deprecated module-level attributes.
76
+ # See https://peps.python.org/pep-0562/
77
+ _deprecated_names = dict(
78
+ whitespace_re="The {name} attribute was deprecated in version 4.7.0. If you need it, make your own copy."
79
+ )
80
+ #: :meta private:
81
+ _deprecated_whitespace_re: Pattern[str] = re.compile(r"\s+")
82
+
83
+
84
+ def __getattr__(name: str) -> Any:
85
+ if name in _deprecated_names:
86
+ message = _deprecated_names[name]
87
+ warnings.warn(message.format(name=name), DeprecationWarning, stacklevel=2)
88
+
89
+ return globals()[f"_deprecated_{name}"]
90
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
91
+
92
+
93
+ #: Documents output by Beautiful Soup will be encoded with
94
+ #: this encoding unless you specify otherwise.
95
+ DEFAULT_OUTPUT_ENCODING: str = "utf-8"
96
+
97
+ #: A regular expression that can be used to split on whitespace.
98
+ nonwhitespace_re: Pattern[str] = re.compile(r"\S+")
99
+
100
+ #: These encodings are recognized by Python (so `Tag.encode`
101
+ #: could theoretically support them) but XML and HTML don't recognize
102
+ #: them (so they should not show up in an XML or HTML document as that
103
+ #: document's encoding).
104
+ #:
105
+ #: If an XML document is encoded in one of these encodings, no encoding
106
+ #: will be mentioned in the XML declaration. If an HTML document is
107
+ #: encoded in one of these encodings, and the HTML document has a
108
+ #: <meta> tag that mentions an encoding, the encoding will be given as
109
+ #: the empty string.
110
+ #:
111
+ #: Source:
112
+ #: Python documentation, `Python Specific Encodings <https://docs.python.org/3/library/codecs.html#python-specific-encodings>`_
113
+ PYTHON_SPECIFIC_ENCODINGS: Set[_Encoding] = set(
114
+ [
115
+ "idna",
116
+ "mbcs",
117
+ "oem",
118
+ "palmos",
119
+ "punycode",
120
+ "raw_unicode_escape",
121
+ "undefined",
122
+ "unicode_escape",
123
+ "raw-unicode-escape",
124
+ "unicode-escape",
125
+ "string-escape",
126
+ "string_escape",
127
+ ]
128
+ )
129
+
130
+
131
+ class NamespacedAttribute(str):
132
+ """A namespaced attribute (e.g. the 'xml:lang' in 'xml:lang="en"')
133
+ which remembers the namespace prefix ('xml') and the name ('lang')
134
+ that were used to create it.
135
+ """
136
+
137
+ prefix: Optional[str]
138
+ name: Optional[str]
139
+ namespace: Optional[str]
140
+
141
+ def __new__(
142
+ cls,
143
+ prefix: Optional[str],
144
+ name: Optional[str] = None,
145
+ namespace: Optional[str] = None,
146
+ ) -> Self:
147
+ if not name:
148
+ # This is the default namespace. Its name "has no value"
149
+ # per https://www.w3.org/TR/xml-names/#defaulting
150
+ name = None
151
+
152
+ if not name:
153
+ obj = str.__new__(cls, prefix)
154
+ elif not prefix:
155
+ # Not really namespaced.
156
+ obj = str.__new__(cls, name)
157
+ else:
158
+ obj = str.__new__(cls, prefix + ":" + name)
159
+ obj.prefix = prefix
160
+ obj.name = name
161
+ obj.namespace = namespace
162
+ return obj
163
+
164
+
165
+ class AttributeValueWithCharsetSubstitution(str):
166
+ """An abstract class standing in for a character encoding specified
167
+ inside an HTML ``<meta>`` tag.
168
+
169
+ Subclasses exist for each place such a character encoding might be
170
+ found: either inside the ``charset`` attribute
171
+ (`CharsetMetaAttributeValue`) or inside the ``content`` attribute
172
+ (`ContentMetaAttributeValue`)
173
+
174
+ This allows Beautiful Soup to replace that part of the HTML file
175
+ with a different encoding when ouputting a tree as a string.
176
+ """
177
+
178
+ # The original, un-encoded value of the ``content`` attribute.
179
+ #: :meta private:
180
+ original_value: str
181
+
182
+ def substitute_encoding(self, eventual_encoding: str) -> str:
183
+ """Do whatever's necessary in this implementation-specific
184
+ portion an HTML document to substitute in a specific encoding.
185
+ """
186
+ raise NotImplementedError()
187
+
188
+
189
+ class CharsetMetaAttributeValue(AttributeValueWithCharsetSubstitution):
190
+ """A generic stand-in for the value of a ``<meta>`` tag's ``charset``
191
+ attribute.
192
+
193
+ When Beautiful Soup parses the markup ``<meta charset="utf8">``, the
194
+ value of the ``charset`` attribute will become one of these objects.
195
+
196
+ If the document is later encoded to an encoding other than UTF-8, its
197
+ ``<meta>`` tag will mention the new encoding instead of ``utf8``.
198
+ """
199
+
200
+ def __new__(cls, original_value: str) -> Self:
201
+ # We don't need to use the original value for anything, but
202
+ # it might be useful for the user to know.
203
+ obj = str.__new__(cls, original_value)
204
+ obj.original_value = original_value
205
+ return obj
206
+
207
+ def substitute_encoding(self, eventual_encoding: _Encoding = "utf-8") -> str:
208
+ """When an HTML document is being encoded to a given encoding, the
209
+ value of a ``<meta>`` tag's ``charset`` becomes the name of
210
+ the encoding.
211
+ """
212
+ if eventual_encoding in PYTHON_SPECIFIC_ENCODINGS:
213
+ return ""
214
+ return eventual_encoding
215
+
216
+
217
+ class AttributeValueList(List[str]):
218
+ """Class for the list used to hold the values of attributes which
219
+ have multiple values (such as HTML's 'class'). It's just a regular
220
+ list, but you can subclass it and pass it in to the TreeBuilder
221
+ constructor as attribute_value_list_class, to have your subclass
222
+ instantiated instead.
223
+ """
224
+
225
+
226
+ class AttributeDict(Dict[Any,Any]):
227
+ """Superclass for the dictionary used to hold a tag's
228
+ attributes. You can use this, but it's just a regular dict with no
229
+ special logic.
230
+ """
231
+
232
+
233
+ class XMLAttributeDict(AttributeDict):
234
+ """A dictionary for holding a Tag's attributes, which processes
235
+ incoming values for consistency with the HTML spec.
236
+ """
237
+
238
+ def __setitem__(self, key: str, value: Any) -> None:
239
+ """Set an attribute value, possibly modifying it to comply with
240
+ the XML spec.
241
+
242
+ This just means converting common non-string values to
243
+ strings: XML attributes may have "any literal string as a
244
+ value."
245
+ """
246
+ if value is None:
247
+ value = ""
248
+ if isinstance(value, bool):
249
+ # XML does not define any rules for boolean attributes.
250
+ # Preserve the old Beautiful Soup behavior (a bool that
251
+ # gets converted to a string on output) rather than
252
+ # guessing what the value should be.
253
+ pass
254
+ elif isinstance(value, (int, float)):
255
+ # It's dangerous to convert _every_ attribute value into a
256
+ # plain string, since an attribute value may be a more
257
+ # sophisticated string-like object
258
+ # (e.g. CharsetMetaAttributeValue). But we can definitely
259
+ # convert numeric values and booleans, which are the most common.
260
+ value = str(value)
261
+
262
+ super().__setitem__(key, value)
263
+
264
+
265
+ class HTMLAttributeDict(AttributeDict):
266
+ """A dictionary for holding a Tag's attributes, which processes
267
+ incoming values for consistency with the HTML spec, which says
268
+ 'Attribute values are a mixture of text and character
269
+ references...'
270
+
271
+ Basically, this means converting common non-string values into
272
+ strings, like XMLAttributeDict, though HTML also has some rules
273
+ around boolean attributes that XML doesn't have.
274
+ """
275
+
276
+ def __setitem__(self, key: str, value: Any) -> None:
277
+ """Set an attribute value, possibly modifying it to comply
278
+ with the HTML spec,
279
+ """
280
+ if value in (False, None):
281
+ # 'The values "true" and "false" are not allowed on
282
+ # boolean attributes. To represent a false value, the
283
+ # attribute has to be omitted altogether.'
284
+ if key in self:
285
+ del self[key]
286
+ return
287
+ if isinstance(value, bool):
288
+ # 'If the [boolean] attribute is present, its value must
289
+ # either be the empty string or a value that is an ASCII
290
+ # case-insensitive match for the attribute's canonical
291
+ # name, with no leading or trailing whitespace.'
292
+ #
293
+ # [fixme] It's not clear to me whether "canonical name"
294
+ # means fully-qualified name, unqualified name, or
295
+ # (probably not) name with namespace prefix. For now I'm
296
+ # going with unqualified name.
297
+ if isinstance(key, NamespacedAttribute):
298
+ value = key.name
299
+ else:
300
+ value = key
301
+ elif isinstance(value, (int, float)):
302
+ # See note in XMLAttributeDict for the reasoning why we
303
+ # only do this to numbers.
304
+ value = str(value)
305
+ super().__setitem__(key, value)
306
+
307
+
308
+ class ContentMetaAttributeValue(AttributeValueWithCharsetSubstitution):
309
+ """A generic stand-in for the value of a ``<meta>`` tag's ``content``
310
+ attribute.
311
+
312
+ When Beautiful Soup parses the markup:
313
+ ``<meta http-equiv="content-type" content="text/html; charset=utf8">``
314
+
315
+ The value of the ``content`` attribute will become one of these objects.
316
+
317
+ If the document is later encoded to an encoding other than UTF-8, its
318
+ ``<meta>`` tag will mention the new encoding instead of ``utf8``.
319
+ """
320
+
321
+ #: Match the 'charset' argument inside the 'content' attribute
322
+ #: of a <meta> tag.
323
+ #: :meta private:
324
+ CHARSET_RE: Pattern[str] = re.compile(r"((^|;)\s*charset=)([^;]*)", re.M)
325
+
326
+ def __new__(cls, original_value: str) -> Self:
327
+ cls.CHARSET_RE.search(original_value)
328
+ obj = str.__new__(cls, original_value)
329
+ obj.original_value = original_value
330
+ return obj
331
+
332
+ def substitute_encoding(self, eventual_encoding: _Encoding = "utf-8") -> str:
333
+ """When an HTML document is being encoded to a given encoding, the
334
+ value of the ``charset=`` in a ``<meta>`` tag's ``content`` becomes
335
+ the name of the encoding.
336
+ """
337
+ if eventual_encoding in PYTHON_SPECIFIC_ENCODINGS:
338
+ return self.CHARSET_RE.sub("", self.original_value)
339
+
340
+ def rewrite(match: re.Match[str]) -> str:
341
+ return match.group(1) + eventual_encoding
342
+
343
+ return self.CHARSET_RE.sub(rewrite, self.original_value)
344
+
345
+
346
+ class PageElement(object):
347
+ """An abstract class representing a single element in the parse tree.
348
+
349
+ `NavigableString`, `Tag`, etc. are all subclasses of
350
+ `PageElement`. For this reason you'll see a lot of methods that
351
+ return `PageElement`, but you'll never see an actual `PageElement`
352
+ object. For the most part you can think of `PageElement` as
353
+ meaning "a `Tag` or a `NavigableString`."
354
+ """
355
+
356
+ #: In general, we can't tell just by looking at an element whether
357
+ #: it's contained in an XML document or an HTML document. But for
358
+ #: `Tag` objects (q.v.) we can store this information at parse time.
359
+ #: :meta private:
360
+ known_xml: Optional[bool] = None
361
+
362
+ #: Whether or not this element has been decomposed from the tree
363
+ #: it was created in.
364
+ _decomposed: bool
365
+
366
+ parent: Optional[Tag]
367
+ next_element: _AtMostOneElement
368
+ previous_element: _AtMostOneElement
369
+ next_sibling: _AtMostOneElement
370
+ previous_sibling: _AtMostOneElement
371
+
372
+ #: Whether or not this element is hidden from generated output.
373
+ #: Only the `BeautifulSoup` object itself is hidden.
374
+ hidden: bool = False
375
+
376
+ def setup(
377
+ self,
378
+ parent: Optional[Tag] = None,
379
+ previous_element: _AtMostOneElement = None,
380
+ next_element: _AtMostOneElement = None,
381
+ previous_sibling: _AtMostOneElement = None,
382
+ next_sibling: _AtMostOneElement = None,
383
+ ) -> None:
384
+ """Sets up the initial relations between this element and
385
+ other elements.
386
+
387
+ :param parent: The parent of this element.
388
+
389
+ :param previous_element: The element parsed immediately before
390
+ this one.
391
+
392
+ :param next_element: The element parsed immediately before
393
+ this one.
394
+
395
+ :param previous_sibling: The most recently encountered element
396
+ on the same level of the parse tree as this one.
397
+
398
+ :param previous_sibling: The next element to be encountered
399
+ on the same level of the parse tree as this one.
400
+ """
401
+ self.parent = parent
402
+
403
+ self.previous_element = previous_element
404
+ if self.previous_element is not None:
405
+ self.previous_element.next_element = self
406
+
407
+ self.next_element = next_element
408
+ if self.next_element is not None:
409
+ self.next_element.previous_element = self
410
+
411
+ self.next_sibling = next_sibling
412
+ if self.next_sibling is not None:
413
+ self.next_sibling.previous_sibling = self
414
+
415
+ if (
416
+ previous_sibling is None
417
+ and self.parent is not None
418
+ and self.parent.contents
419
+ ):
420
+ previous_sibling = self.parent.contents[-1]
421
+
422
+ self.previous_sibling = previous_sibling
423
+ if self.previous_sibling is not None:
424
+ self.previous_sibling.next_sibling = self
425
+
426
+ def format_string(self, s: str, formatter: Optional[_FormatterOrName]) -> str:
427
+ """Format the given string using the given formatter.
428
+
429
+ :param s: A string.
430
+ :param formatter: A Formatter object, or a string naming one of the standard formatters.
431
+ """
432
+ if formatter is None:
433
+ return s
434
+ if not isinstance(formatter, Formatter):
435
+ formatter = self.formatter_for_name(formatter)
436
+ output = formatter.substitute(s)
437
+ return output
438
+
439
+ def formatter_for_name(
440
+ self, formatter_name: Union[_FormatterOrName, _EntitySubstitutionFunction]
441
+ ) -> Formatter:
442
+ """Look up or create a Formatter for the given identifier,
443
+ if necessary.
444
+
445
+ :param formatter: Can be a `Formatter` object (used as-is), a
446
+ function (used as the entity substitution hook for an
447
+ `bs4.formatter.XMLFormatter` or
448
+ `bs4.formatter.HTMLFormatter`), or a string (used to look
449
+ up an `bs4.formatter.XMLFormatter` or
450
+ `bs4.formatter.HTMLFormatter` in the appropriate registry.
451
+
452
+ """
453
+ if isinstance(formatter_name, Formatter):
454
+ return formatter_name
455
+ c: type[Formatter]
456
+ registry: Mapping[Optional[str], Formatter]
457
+ if self._is_xml:
458
+ c = XMLFormatter
459
+ registry = XMLFormatter.REGISTRY
460
+ else:
461
+ c = HTMLFormatter
462
+ registry = HTMLFormatter.REGISTRY
463
+ if callable(formatter_name):
464
+ return c(entity_substitution=formatter_name)
465
+ return registry[formatter_name]
466
+
467
+ @property
468
+ def _is_xml(self) -> bool:
469
+ """Is this element part of an XML tree or an HTML tree?
470
+
471
+ This is used in formatter_for_name, when deciding whether an
472
+ XMLFormatter or HTMLFormatter is more appropriate. It can be
473
+ inefficient, but it should be called very rarely.
474
+ """
475
+ if self.known_xml is not None:
476
+ # Most of the time we will have determined this when the
477
+ # document is parsed.
478
+ return self.known_xml
479
+
480
+ # Otherwise, it's likely that this element was created by
481
+ # direct invocation of the constructor from within the user's
482
+ # Python code.
483
+ if self.parent is None:
484
+ # This is the top-level object. It should have .known_xml set
485
+ # from tree creation. If not, take a guess--BS is usually
486
+ # used on HTML markup.
487
+ return getattr(self, "is_xml", False)
488
+ return self.parent._is_xml
489
+
490
+ nextSibling = _deprecated_alias("nextSibling", "next_sibling", "4.0.0")
491
+ previousSibling = _deprecated_alias("previousSibling", "previous_sibling", "4.0.0")
492
+
493
+ def __deepcopy__(self, memo: Dict[Any, Any], recursive: bool = False) -> Self:
494
+ raise NotImplementedError()
495
+
496
+ def __copy__(self) -> Self:
497
+ """A copy of a PageElement can only be a deep copy, because
498
+ only one PageElement can occupy a given place in a parse tree.
499
+ """
500
+ return self.__deepcopy__({})
501
+
502
+ default: Iterable[type[NavigableString]] = tuple() #: :meta private:
503
+
504
+ def _all_strings(
505
+ self, strip: bool = False, types: Iterable[type[NavigableString]] = default
506
+ ) -> Iterator[str]:
507
+ """Yield all strings of certain classes, possibly stripping them.
508
+
509
+ This is implemented differently in `Tag` and `NavigableString`.
510
+ """
511
+ raise NotImplementedError()
512
+
513
+ @property
514
+ def stripped_strings(self) -> Iterator[str]:
515
+ """Yield all interesting strings in this PageElement, stripping them
516
+ first.
517
+
518
+ See `Tag` for information on which strings are considered
519
+ interesting in a given context.
520
+ """
521
+ for string in self._all_strings(True):
522
+ yield string
523
+
524
+ def get_text(
525
+ self,
526
+ separator: str = "",
527
+ strip: bool = False,
528
+ types: Iterable[Type[NavigableString]] = default,
529
+ ) -> str:
530
+ """Get all child strings of this PageElement, concatenated using the
531
+ given separator.
532
+
533
+ :param separator: Strings will be concatenated using this separator.
534
+
535
+ :param strip: If True, strings will be stripped before being
536
+ concatenated.
537
+
538
+ :param types: A tuple of NavigableString subclasses. Any
539
+ strings of a subclass not found in this list will be
540
+ ignored. Although there are exceptions, the default
541
+ behavior in most cases is to consider only NavigableString
542
+ and CData objects. That means no comments, processing
543
+ instructions, etc.
544
+
545
+ :return: A string.
546
+ """
547
+ return separator.join([s for s in self._all_strings(strip, types=types)])
548
+
549
+ getText = get_text
550
+ text = property(get_text)
551
+
552
+ def replace_with(self, *args: PageElement) -> Self:
553
+ """Replace this `PageElement` with one or more other `PageElement`,
554
+ objects, keeping the rest of the tree the same.
555
+
556
+ :return: This `PageElement`, no longer part of the tree.
557
+ """
558
+ if self.parent is None:
559
+ raise ValueError(
560
+ "Cannot replace one element with another when the "
561
+ "element to be replaced is not part of a tree."
562
+ )
563
+ if len(args) == 1 and args[0] is self:
564
+ # Replacing an element with itself is a no-op.
565
+ return self
566
+ if any(x is self.parent for x in args):
567
+ raise ValueError("Cannot replace a Tag with its parent.")
568
+ old_parent = self.parent
569
+ my_index = self.parent.index(self)
570
+ self.extract(_self_index=my_index)
571
+ for idx, replace_with in enumerate(args, start=my_index):
572
+ old_parent.insert(idx, replace_with)
573
+ return self
574
+
575
+ replaceWith = _deprecated_function_alias("replaceWith", "replace_with", "4.0.0")
576
+
577
+ def wrap(self, wrap_inside: Tag) -> Tag:
578
+ """Wrap this `PageElement` inside a `Tag`.
579
+
580
+ :return: ``wrap_inside``, occupying the position in the tree that used
581
+ to be occupied by this object, and with this object now inside it.
582
+ """
583
+ me = self.replace_with(wrap_inside)
584
+ wrap_inside.append(me)
585
+ return wrap_inside
586
+
587
+ def extract(self, _self_index: Optional[int] = None) -> Self:
588
+ """Destructively rips this element out of the tree.
589
+
590
+ :param _self_index: The location of this element in its parent's
591
+ .contents, if known. Passing this in allows for a performance
592
+ optimization.
593
+
594
+ :return: this `PageElement`, no longer part of the tree.
595
+ """
596
+ if self.parent is not None:
597
+ if _self_index is None:
598
+ _self_index = self.parent.index(self)
599
+ del self.parent.contents[_self_index]
600
+
601
+ # Find the two elements that would be next to each other if
602
+ # this element (and any children) hadn't been parsed. Connect
603
+ # the two.
604
+ last_child = self._last_descendant()
605
+
606
+ # last_child can't be None because we passed accept_self=True
607
+ # into _last_descendant. Worst case, last_child will be
608
+ # self. Making this cast removes several mypy complaints later
609
+ # on as we manipulate last_child.
610
+ last_child = cast(PageElement, last_child)
611
+ next_element = last_child.next_element
612
+
613
+ if self.previous_element is not None:
614
+ if self.previous_element is not next_element:
615
+ self.previous_element.next_element = next_element
616
+ if next_element is not None and next_element is not self.previous_element:
617
+ next_element.previous_element = self.previous_element
618
+ self.previous_element = None
619
+ last_child.next_element = None
620
+
621
+ self.parent = None
622
+ if (
623
+ self.previous_sibling is not None
624
+ and self.previous_sibling is not self.next_sibling
625
+ ):
626
+ self.previous_sibling.next_sibling = self.next_sibling
627
+ if (
628
+ self.next_sibling is not None
629
+ and self.next_sibling is not self.previous_sibling
630
+ ):
631
+ self.next_sibling.previous_sibling = self.previous_sibling
632
+ self.previous_sibling = self.next_sibling = None
633
+ return self
634
+
635
+ def decompose(self) -> None:
636
+ """Recursively destroys this `PageElement` and its children.
637
+
638
+ The element will be removed from the tree and wiped out; so
639
+ will everything beneath it.
640
+
641
+ The behavior of a decomposed `PageElement` is undefined and you
642
+ should never use one for anything, but if you need to *check*
643
+ whether an element has been decomposed, you can use the
644
+ `PageElement.decomposed` property.
645
+ """
646
+ self.extract()
647
+ e: _AtMostOneElement = self
648
+ next_up: _AtMostOneElement = None
649
+ while e is not None:
650
+ next_up = e.next_element
651
+ e.__dict__.clear()
652
+ if isinstance(e, Tag):
653
+ e.contents = []
654
+ e._decomposed = True
655
+ e = next_up
656
+
657
+ def _last_descendant(
658
+ self, is_initialized: bool = True, accept_self: bool = True
659
+ ) -> _AtMostOneElement:
660
+ """Finds the last element beneath this object to be parsed.
661
+
662
+ Special note to help you figure things out if your type
663
+ checking is tripped up by the fact that this method returns
664
+ _AtMostOneElement instead of PageElement: the only time
665
+ this method returns None is if `accept_self` is False and the
666
+ `PageElement` has no children--either it's a NavigableString
667
+ or an empty Tag.
668
+
669
+ :param is_initialized: Has `PageElement.setup` been called on
670
+ this `PageElement` yet?
671
+
672
+ :param accept_self: Is ``self`` an acceptable answer to the
673
+ question?
674
+ """
675
+ if is_initialized and self.next_sibling is not None:
676
+ last_child = self.next_sibling.previous_element
677
+ else:
678
+ last_child = self
679
+ while isinstance(last_child, Tag) and last_child.contents:
680
+ last_child = last_child.contents[-1]
681
+ if not accept_self and last_child is self:
682
+ last_child = None
683
+ return last_child
684
+
685
+ _lastRecursiveChild = _deprecated_alias(
686
+ "_lastRecursiveChild", "_last_descendant", "4.0.0"
687
+ )
688
+
689
+ def insert_before(self, *args: _InsertableElement) -> List[PageElement]:
690
+ """Makes the given element(s) the immediate predecessor of this one.
691
+
692
+ All the elements will have the same `PageElement.parent` as
693
+ this one, and the given elements will occur immediately before
694
+ this one.
695
+
696
+ :param args: One or more PageElements.
697
+
698
+ :return The list of PageElements that were inserted.
699
+ """
700
+ parent = self.parent
701
+ if parent is None:
702
+ raise ValueError("Element has no parent, so 'before' has no meaning.")
703
+ if any(x is self for x in args):
704
+ raise ValueError("Can't insert an element before itself.")
705
+ results: List[PageElement] = []
706
+ for predecessor in args:
707
+ # Extract first so that the index won't be screwed up if they
708
+ # are siblings.
709
+ if isinstance(predecessor, PageElement):
710
+ predecessor.extract()
711
+ index = parent.index(self)
712
+ results.extend(parent.insert(index, predecessor))
713
+
714
+ return results
715
+
716
+ def insert_after(self, *args: _InsertableElement) -> List[PageElement]:
717
+ """Makes the given element(s) the immediate successor of this one.
718
+
719
+ The elements will have the same `PageElement.parent` as this
720
+ one, and the given elements will occur immediately after this
721
+ one.
722
+
723
+ :param args: One or more PageElements.
724
+
725
+ :return The list of PageElements that were inserted.
726
+ """
727
+ # Do all error checking before modifying the tree.
728
+ parent = self.parent
729
+ if parent is None:
730
+ raise ValueError("Element has no parent, so 'after' has no meaning.")
731
+ if any(x is self for x in args):
732
+ raise ValueError("Can't insert an element after itself.")
733
+
734
+ offset = 0
735
+ results: List[PageElement] = []
736
+ for successor in args:
737
+ # Extract first so that the index won't be screwed up if they
738
+ # are siblings.
739
+ if isinstance(successor, PageElement):
740
+ successor.extract()
741
+ index = parent.index(self)
742
+ results.extend(parent.insert(index + 1 + offset, successor))
743
+ offset += 1
744
+
745
+ return results
746
+
747
+ def find_next(
748
+ self,
749
+ name: _FindMethodName = None,
750
+ attrs: _StrainableAttributes = {},
751
+ string: Optional[_StrainableString] = None,
752
+ **kwargs: _StrainableAttribute,
753
+ ) -> _AtMostOneElement:
754
+ """Find the first PageElement that matches the given criteria and
755
+ appears later in the document than this PageElement.
756
+
757
+ All find_* methods take a common set of arguments. See the online
758
+ documentation for detailed explanations.
759
+
760
+ :param name: A filter on tag name.
761
+ :param attrs: Additional filters on attribute values.
762
+ :param string: A filter for a NavigableString with specific text.
763
+ :kwargs: Additional filters on attribute values.
764
+ """
765
+ return self._find_one(self.find_all_next, name, attrs, string, **kwargs)
766
+
767
+ findNext = _deprecated_function_alias("findNext", "find_next", "4.0.0")
768
+
769
+ def find_all_next(
770
+ self,
771
+ name: _FindMethodName = None,
772
+ attrs: _StrainableAttributes = {},
773
+ string: Optional[_StrainableString] = None,
774
+ limit: Optional[int] = None,
775
+ _stacklevel: int = 2,
776
+ **kwargs: _StrainableAttribute,
777
+ ) -> _QueryResults:
778
+ """Find all `PageElement` objects that match the given criteria and
779
+ appear later in the document than this `PageElement`.
780
+
781
+ All find_* methods take a common set of arguments. See the online
782
+ documentation for detailed explanations.
783
+
784
+ :param name: A filter on tag name.
785
+ :param attrs: Additional filters on attribute values.
786
+ :param string: A filter for a NavigableString with specific text.
787
+ :param limit: Stop looking after finding this many results.
788
+ :param _stacklevel: Used internally to improve warning messages.
789
+ :kwargs: Additional filters on attribute values.
790
+ """
791
+ return self._find_all(
792
+ name,
793
+ attrs,
794
+ string,
795
+ limit,
796
+ self.next_elements,
797
+ _stacklevel=_stacklevel + 1,
798
+ **kwargs,
799
+ )
800
+
801
+ findAllNext = _deprecated_function_alias("findAllNext", "find_all_next", "4.0.0")
802
+
803
+ def find_next_sibling(
804
+ self,
805
+ name: _FindMethodName = None,
806
+ attrs: _StrainableAttributes = {},
807
+ string: Optional[_StrainableString] = None,
808
+ **kwargs: _StrainableAttribute,
809
+ ) -> _AtMostOneElement:
810
+ """Find the closest sibling to this PageElement that matches the
811
+ given criteria and appears later in the document.
812
+
813
+ All find_* methods take a common set of arguments. See the
814
+ online documentation for detailed explanations.
815
+
816
+ :param name: A filter on tag name.
817
+ :param attrs: Additional filters on attribute values.
818
+ :param string: A filter for a `NavigableString` with specific text.
819
+ :kwargs: Additional filters on attribute values.
820
+ """
821
+ return self._find_one(self.find_next_siblings, name, attrs, string, **kwargs)
822
+
823
+ findNextSibling = _deprecated_function_alias(
824
+ "findNextSibling", "find_next_sibling", "4.0.0"
825
+ )
826
+
827
+ def find_next_siblings(
828
+ self,
829
+ name: _FindMethodName = None,
830
+ attrs: _StrainableAttributes = {},
831
+ string: Optional[_StrainableString] = None,
832
+ limit: Optional[int] = None,
833
+ _stacklevel: int = 2,
834
+ **kwargs: _StrainableAttribute,
835
+ ) -> _QueryResults:
836
+ """Find all siblings of this `PageElement` that match the given criteria
837
+ and appear later in the document.
838
+
839
+ All find_* methods take a common set of arguments. See the online
840
+ documentation for detailed explanations.
841
+
842
+ :param name: A filter on tag name.
843
+ :param attrs: Additional filters on attribute values.
844
+ :param string: A filter for a `NavigableString` with specific text.
845
+ :param limit: Stop looking after finding this many results.
846
+ :param _stacklevel: Used internally to improve warning messages.
847
+ :kwargs: Additional filters on attribute values.
848
+ """
849
+ return self._find_all(
850
+ name,
851
+ attrs,
852
+ string,
853
+ limit,
854
+ self.next_siblings,
855
+ _stacklevel=_stacklevel + 1,
856
+ **kwargs,
857
+ )
858
+
859
+ findNextSiblings = _deprecated_function_alias(
860
+ "findNextSiblings", "find_next_siblings", "4.0.0"
861
+ )
862
+ fetchNextSiblings = _deprecated_function_alias(
863
+ "fetchNextSiblings", "find_next_siblings", "3.0.0"
864
+ )
865
+
866
+ def find_previous(
867
+ self,
868
+ name: _FindMethodName = None,
869
+ attrs: _StrainableAttributes = {},
870
+ string: Optional[_StrainableString] = None,
871
+ **kwargs: _StrainableAttribute,
872
+ ) -> _AtMostOneElement:
873
+ """Look backwards in the document from this `PageElement` and find the
874
+ first `PageElement` that matches the given criteria.
875
+
876
+ All find_* methods take a common set of arguments. See the online
877
+ documentation for detailed explanations.
878
+
879
+ :param name: A filter on tag name.
880
+ :param attrs: Additional filters on attribute values.
881
+ :param string: A filter for a `NavigableString` with specific text.
882
+ :kwargs: Additional filters on attribute values.
883
+ """
884
+ return self._find_one(self.find_all_previous, name, attrs, string, **kwargs)
885
+
886
+ findPrevious = _deprecated_function_alias("findPrevious", "find_previous", "3.0.0")
887
+
888
+ def find_all_previous(
889
+ self,
890
+ name: _FindMethodName = None,
891
+ attrs: _StrainableAttributes = {},
892
+ string: Optional[_StrainableString] = None,
893
+ limit: Optional[int] = None,
894
+ _stacklevel: int = 2,
895
+ **kwargs: _StrainableAttribute,
896
+ ) -> _QueryResults:
897
+ """Look backwards in the document from this `PageElement` and find all
898
+ `PageElement` that match the given criteria.
899
+
900
+ All find_* methods take a common set of arguments. See the online
901
+ documentation for detailed explanations.
902
+
903
+ :param name: A filter on tag name.
904
+ :param attrs: Additional filters on attribute values.
905
+ :param string: A filter for a `NavigableString` with specific text.
906
+ :param limit: Stop looking after finding this many results.
907
+ :param _stacklevel: Used internally to improve warning messages.
908
+ :kwargs: Additional filters on attribute values.
909
+ """
910
+ return self._find_all(
911
+ name,
912
+ attrs,
913
+ string,
914
+ limit,
915
+ self.previous_elements,
916
+ _stacklevel=_stacklevel + 1,
917
+ **kwargs,
918
+ )
919
+
920
+ findAllPrevious = _deprecated_function_alias(
921
+ "findAllPrevious", "find_all_previous", "4.0.0"
922
+ )
923
+ fetchAllPrevious = _deprecated_function_alias(
924
+ "fetchAllPrevious", "find_all_previous", "3.0.0"
925
+ )
926
+
927
+ def find_previous_sibling(
928
+ self,
929
+ name: _FindMethodName = None,
930
+ attrs: _StrainableAttributes = {},
931
+ string: Optional[_StrainableString] = None,
932
+ **kwargs: _StrainableAttribute,
933
+ ) -> _AtMostOneElement:
934
+ """Returns the closest sibling to this `PageElement` that matches the
935
+ given criteria and appears earlier in the document.
936
+
937
+ All find_* methods take a common set of arguments. See the online
938
+ documentation for detailed explanations.
939
+
940
+ :param name: A filter on tag name.
941
+ :param attrs: Additional filters on attribute values.
942
+ :param string: A filter for a `NavigableString` with specific text.
943
+ :kwargs: Additional filters on attribute values.
944
+ """
945
+ return self._find_one(
946
+ self.find_previous_siblings, name, attrs, string, **kwargs
947
+ )
948
+
949
+ findPreviousSibling = _deprecated_function_alias(
950
+ "findPreviousSibling", "find_previous_sibling", "4.0.0"
951
+ )
952
+
953
+ def find_previous_siblings(
954
+ self,
955
+ name: _FindMethodName = None,
956
+ attrs: _StrainableAttributes = {},
957
+ string: Optional[_StrainableString] = None,
958
+ limit: Optional[int] = None,
959
+ _stacklevel: int = 2,
960
+ **kwargs: _StrainableAttribute,
961
+ ) -> _QueryResults:
962
+ """Returns all siblings to this PageElement that match the
963
+ given criteria and appear earlier in the document.
964
+
965
+ All find_* methods take a common set of arguments. See the online
966
+ documentation for detailed explanations.
967
+
968
+ :param name: A filter on tag name.
969
+ :param attrs: Additional filters on attribute values.
970
+ :param string: A filter for a NavigableString with specific text.
971
+ :param limit: Stop looking after finding this many results.
972
+ :param _stacklevel: Used internally to improve warning messages.
973
+ :kwargs: Additional filters on attribute values.
974
+ """
975
+ return self._find_all(
976
+ name,
977
+ attrs,
978
+ string,
979
+ limit,
980
+ self.previous_siblings,
981
+ _stacklevel=_stacklevel + 1,
982
+ **kwargs,
983
+ )
984
+
985
+ findPreviousSiblings = _deprecated_function_alias(
986
+ "findPreviousSiblings", "find_previous_siblings", "4.0.0"
987
+ )
988
+ fetchPreviousSiblings = _deprecated_function_alias(
989
+ "fetchPreviousSiblings", "find_previous_siblings", "3.0.0"
990
+ )
991
+
992
+ def find_parent(
993
+ self,
994
+ name: _FindMethodName = None,
995
+ attrs: _StrainableAttributes = {},
996
+ **kwargs: _StrainableAttribute,
997
+ ) -> _AtMostOneElement:
998
+ """Find the closest parent of this PageElement that matches the given
999
+ criteria.
1000
+
1001
+ All find_* methods take a common set of arguments. See the online
1002
+ documentation for detailed explanations.
1003
+
1004
+ :param name: A filter on tag name.
1005
+ :param attrs: Additional filters on attribute values.
1006
+ :param self: Whether the PageElement itself should be considered
1007
+ as one of its 'parents'.
1008
+ :kwargs: Additional filters on attribute values.
1009
+ """
1010
+ # NOTE: We can't use _find_one because findParents takes a different
1011
+ # set of arguments.
1012
+ r = None
1013
+ results = self.find_parents(
1014
+ name, attrs, 1, _stacklevel=3, **kwargs
1015
+ )
1016
+ if results:
1017
+ r = results[0]
1018
+ return r
1019
+
1020
+ findParent = _deprecated_function_alias("findParent", "find_parent", "4.0.0")
1021
+
1022
+ def find_parents(
1023
+ self,
1024
+ name: _FindMethodName = None,
1025
+ attrs: _StrainableAttributes = {},
1026
+ limit: Optional[int] = None,
1027
+ _stacklevel: int = 2,
1028
+ **kwargs: _StrainableAttribute,
1029
+ ) -> _QueryResults:
1030
+ """Find all parents of this `PageElement` that match the given criteria.
1031
+
1032
+ All find_* methods take a common set of arguments. See the online
1033
+ documentation for detailed explanations.
1034
+
1035
+ :param name: A filter on tag name.
1036
+ :param attrs: Additional filters on attribute values.
1037
+ :param limit: Stop looking after finding this many results.
1038
+ :param _stacklevel: Used internally to improve warning messages.
1039
+ :kwargs: Additional filters on attribute values.
1040
+ """
1041
+ iterator = self.parents
1042
+ return self._find_all(
1043
+ name, attrs, None, limit, iterator, _stacklevel=_stacklevel + 1, **kwargs
1044
+ )
1045
+
1046
+ findParents = _deprecated_function_alias("findParents", "find_parents", "4.0.0")
1047
+ fetchParents = _deprecated_function_alias("fetchParents", "find_parents", "3.0.0")
1048
+
1049
+ @property
1050
+ def next(self) -> _AtMostOneElement:
1051
+ """The `PageElement`, if any, that was parsed just after this one."""
1052
+ return self.next_element
1053
+
1054
+ @property
1055
+ def previous(self) -> _AtMostOneElement:
1056
+ """The `PageElement`, if any, that was parsed just before this one."""
1057
+ return self.previous_element
1058
+
1059
+ # These methods do the real heavy lifting.
1060
+
1061
+ def _find_one(
1062
+ self,
1063
+ # TODO-TYPING: "There is no syntax to indicate optional or
1064
+ # keyword arguments; such function types are rarely used
1065
+ # as callback types." - So, not sure how to get more
1066
+ # specific here.
1067
+ method: Callable,
1068
+ name: _FindMethodName,
1069
+ attrs: _StrainableAttributes,
1070
+ string: Optional[_StrainableString],
1071
+ **kwargs: _StrainableAttribute,
1072
+ ) -> _AtMostOneElement:
1073
+ r: _AtMostOneElement = None
1074
+ results: _QueryResults = method(name, attrs, string, 1, _stacklevel=4, **kwargs)
1075
+ if results:
1076
+ r = results[0]
1077
+ return r
1078
+
1079
+ def _find_all(
1080
+ self,
1081
+ name: _FindMethodName,
1082
+ attrs: _StrainableAttributes,
1083
+ string: Optional[_StrainableString],
1084
+ limit: Optional[int],
1085
+ generator: Iterator[PageElement],
1086
+ _stacklevel: int = 3,
1087
+ **kwargs: _StrainableAttribute,
1088
+ ) -> _QueryResults:
1089
+ """Iterates over a generator looking for things that match."""
1090
+
1091
+ if string is None and "text" in kwargs:
1092
+ string = kwargs.pop("text")
1093
+ warnings.warn(
1094
+ "The 'text' argument to find()-type methods is deprecated. Use 'string' instead.",
1095
+ DeprecationWarning,
1096
+ stacklevel=_stacklevel,
1097
+ )
1098
+
1099
+ if "_class" in kwargs:
1100
+ warnings.warn(
1101
+ AttributeResemblesVariableWarning.MESSAGE
1102
+ % dict(
1103
+ original="_class",
1104
+ autocorrect="class_",
1105
+ ),
1106
+ AttributeResemblesVariableWarning,
1107
+ stacklevel=_stacklevel,
1108
+ )
1109
+
1110
+ from bs4.filter import ElementFilter
1111
+
1112
+ if isinstance(name, ElementFilter):
1113
+ matcher = name
1114
+ else:
1115
+ matcher = SoupStrainer(name, attrs, string, **kwargs)
1116
+
1117
+ result: Iterable[_OneElement]
1118
+ if string is None and not limit and not attrs and not kwargs:
1119
+ if name is True or name is None:
1120
+ # Optimization to find all tags.
1121
+ result = (element for element in generator if isinstance(element, Tag))
1122
+ return ResultSet(matcher, result)
1123
+ elif isinstance(name, str):
1124
+ # Optimization to find all tags with a given name.
1125
+ if name.count(":") == 1:
1126
+ # This is a name with a prefix. If this is a namespace-aware document,
1127
+ # we need to match the local name against tag.name. If not,
1128
+ # we need to match the fully-qualified name against tag.name.
1129
+ prefix, local_name = name.split(":", 1)
1130
+ else:
1131
+ prefix = None
1132
+ local_name = name
1133
+ result = []
1134
+ for element in generator:
1135
+ if not isinstance(element, Tag):
1136
+ continue
1137
+ if element.name == name or (
1138
+ element.name == local_name
1139
+ and (prefix is None or element.prefix == prefix)
1140
+ ):
1141
+ result.append(element)
1142
+ return ResultSet(matcher, result)
1143
+ return matcher.find_all(generator, limit)
1144
+
1145
+ # These generators can be used to navigate starting from both
1146
+ # NavigableStrings and Tags.
1147
+ @property
1148
+ def next_elements(self) -> Iterator[PageElement]:
1149
+ """All PageElements that were parsed after this one."""
1150
+ i = self.next_element
1151
+ while i is not None:
1152
+ successor = i.next_element
1153
+ yield i
1154
+ i = successor
1155
+
1156
+ @property
1157
+ def self_and_next_elements(self) -> Iterator[PageElement]:
1158
+ """This PageElement, then all PageElements that were parsed after it."""
1159
+ return self._self_and(self.next_elements)
1160
+
1161
+ @property
1162
+ def next_siblings(self) -> Iterator[PageElement]:
1163
+ """All PageElements that are siblings of this one but were parsed
1164
+ later.
1165
+ """
1166
+ i = self.next_sibling
1167
+ while i is not None:
1168
+ successor = i.next_sibling
1169
+ yield i
1170
+ i = successor
1171
+
1172
+ @property
1173
+ def self_and_next_siblings(self) -> Iterator[PageElement]:
1174
+ """This PageElement, then all of its siblings."""
1175
+ return self._self_and(self.next_siblings)
1176
+
1177
+ @property
1178
+ def previous_elements(self) -> Iterator[PageElement]:
1179
+ """All PageElements that were parsed before this one.
1180
+
1181
+ :yield: A sequence of PageElements.
1182
+ """
1183
+ i = self.previous_element
1184
+ while i is not None:
1185
+ successor = i.previous_element
1186
+ yield i
1187
+ i = successor
1188
+
1189
+ @property
1190
+ def self_and_previous_elements(self) -> Iterator[PageElement]:
1191
+ """This PageElement, then all elements that were parsed
1192
+ earlier."""
1193
+ return self._self_and(self.previous_elements)
1194
+
1195
+ @property
1196
+ def previous_siblings(self) -> Iterator[PageElement]:
1197
+ """All PageElements that are siblings of this one but were parsed
1198
+ earlier.
1199
+
1200
+ :yield: A sequence of PageElements.
1201
+ """
1202
+ i = self.previous_sibling
1203
+ while i is not None:
1204
+ successor = i.previous_sibling
1205
+ yield i
1206
+ i = successor
1207
+
1208
+ @property
1209
+ def self_and_previous_siblings(self) -> Iterator[PageElement]:
1210
+ """This PageElement, then all of its siblings that were parsed
1211
+ earlier."""
1212
+ return self._self_and(self.previous_siblings)
1213
+
1214
+ @property
1215
+ def parents(self) -> Iterator[Tag]:
1216
+ """All elements that are parents of this PageElement.
1217
+
1218
+ :yield: A sequence of Tags, ending with a BeautifulSoup object.
1219
+ """
1220
+ i = self.parent
1221
+ while i is not None:
1222
+ successor = i.parent
1223
+ yield i
1224
+ i = successor
1225
+
1226
+ @property
1227
+ def self_and_parents(self) -> Iterator[PageElement]:
1228
+ """This element, then all of its parents.
1229
+
1230
+ :yield: A sequence of PageElements, ending with a BeautifulSoup object.
1231
+ """
1232
+ return self._self_and(self.parents)
1233
+
1234
+ def _self_and(self, other_generator:Iterator[PageElement]) -> Iterator[PageElement]:
1235
+ """Modify a generator by yielding this element, then everything
1236
+ yielded by the other generator.
1237
+ """
1238
+ if not self.hidden:
1239
+ yield self
1240
+ for i in other_generator:
1241
+ yield i
1242
+
1243
+ @property
1244
+ def decomposed(self) -> bool:
1245
+ """Check whether a PageElement has been decomposed."""
1246
+ return getattr(self, "_decomposed", False) or False
1247
+
1248
+ @_deprecated("next_elements", "4.0.0")
1249
+ def nextGenerator(self) -> Iterator[PageElement]:
1250
+ ":meta private:"
1251
+ return self.next_elements
1252
+
1253
+ @_deprecated("next_siblings", "4.0.0")
1254
+ def nextSiblingGenerator(self) -> Iterator[PageElement]:
1255
+ ":meta private:"
1256
+ return self.next_siblings
1257
+
1258
+ @_deprecated("previous_elements", "4.0.0")
1259
+ def previousGenerator(self) -> Iterator[PageElement]:
1260
+ ":meta private:"
1261
+ return self.previous_elements
1262
+
1263
+ @_deprecated("previous_siblings", "4.0.0")
1264
+ def previousSiblingGenerator(self) -> Iterator[PageElement]:
1265
+ ":meta private:"
1266
+ return self.previous_siblings
1267
+
1268
+ @_deprecated("parents", "4.0.0")
1269
+ def parentGenerator(self) -> Iterator[PageElement]:
1270
+ ":meta private:"
1271
+ return self.parents
1272
+
1273
+
1274
+ class NavigableString(str, PageElement):
1275
+ """A Python string that is part of a parse tree.
1276
+
1277
+ When Beautiful Soup parses the markup ``<b>penguin</b>``, it will
1278
+ create a `NavigableString` for the string "penguin".
1279
+ """
1280
+
1281
+ #: A string prepended to the body of the 'real' string
1282
+ #: when formatting it as part of a document, such as the '<!--'
1283
+ #: in an HTML comment.
1284
+ PREFIX: str = ""
1285
+
1286
+ #: A string appended to the body of the 'real' string
1287
+ #: when formatting it as part of a document, such as the '-->'
1288
+ #: in an HTML comment.
1289
+ SUFFIX: str = ""
1290
+
1291
+ def __new__(cls, value: Union[str, bytes]) -> Self:
1292
+ """Create a new NavigableString.
1293
+
1294
+ When unpickling a NavigableString, this method is called with
1295
+ the string in DEFAULT_OUTPUT_ENCODING. That encoding needs to be
1296
+ passed in to the superclass's __new__ or the superclass won't know
1297
+ how to handle non-ASCII characters.
1298
+ """
1299
+ if isinstance(value, str):
1300
+ u = str.__new__(cls, value)
1301
+ else:
1302
+ u = str.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
1303
+ u.hidden = False
1304
+ u.setup()
1305
+ return u
1306
+
1307
+ def __deepcopy__(self, memo: Dict[Any, Any], recursive: bool = False) -> Self:
1308
+ """A copy of a NavigableString has the same contents and class
1309
+ as the original, but it is not connected to the parse tree.
1310
+
1311
+ :param recursive: This parameter is ignored; it's only defined
1312
+ so that NavigableString.__deepcopy__ implements the same
1313
+ signature as Tag.__deepcopy__.
1314
+ """
1315
+ return type(self)(self)
1316
+
1317
+ def __getnewargs__(self) -> Tuple[str]:
1318
+ return (str(self),)
1319
+
1320
+ @property
1321
+ def string(self) -> str:
1322
+ """Convenience property defined to match `Tag.string`.
1323
+
1324
+ :return: This property always returns the `NavigableString` it was
1325
+ called on.
1326
+
1327
+ :meta private:
1328
+ """
1329
+ return self
1330
+
1331
+ def output_ready(self, formatter: _FormatterOrName = "minimal") -> str:
1332
+ """Run the string through the provided formatter, making it
1333
+ ready for output as part of an HTML or XML document.
1334
+
1335
+ :param formatter: A `Formatter` object, or a string naming one
1336
+ of the standard formatters.
1337
+ """
1338
+ output = self.format_string(self, formatter)
1339
+ return self.PREFIX + output + self.SUFFIX
1340
+
1341
+ @property
1342
+ def name(self) -> None:
1343
+ """Since a NavigableString is not a Tag, it has no .name.
1344
+
1345
+ This property is implemented so that code like this doesn't crash
1346
+ when run on a mixture of Tag and NavigableString objects:
1347
+ [x.name for x in tag.children]
1348
+
1349
+ :meta private:
1350
+ """
1351
+ return None
1352
+
1353
+ @name.setter
1354
+ def name(self, name: str) -> None:
1355
+ """Prevent NavigableString.name from ever being set.
1356
+
1357
+ :meta private:
1358
+ """
1359
+ raise AttributeError("A NavigableString cannot be given a name.")
1360
+
1361
+ def _all_strings(
1362
+ self, strip: bool = False, types: _OneOrMoreStringTypes = PageElement.default
1363
+ ) -> Iterator[str]:
1364
+ """Yield all strings of certain classes, possibly stripping them.
1365
+
1366
+ This makes it easy for NavigableString to implement methods
1367
+ like get_text() as conveniences, creating a consistent
1368
+ text-extraction API across all PageElements.
1369
+
1370
+ :param strip: If True, all strings will be stripped before being
1371
+ yielded.
1372
+
1373
+ :param types: A tuple of NavigableString subclasses. If this
1374
+ NavigableString isn't one of those subclasses, the
1375
+ sequence will be empty. By default, the subclasses
1376
+ considered are NavigableString and CData objects. That
1377
+ means no comments, processing instructions, etc.
1378
+
1379
+ :yield: A sequence that either contains this string, or is empty.
1380
+ """
1381
+ if types is self.default:
1382
+ # This is kept in Tag because it's full of subclasses of
1383
+ # this class, which aren't defined until later in the file.
1384
+ types = Tag.MAIN_CONTENT_STRING_TYPES
1385
+
1386
+ # Do nothing if the caller is looking for specific types of
1387
+ # string, and we're of a different type.
1388
+ #
1389
+ # We check specific types instead of using isinstance(self,
1390
+ # types) because all of these classes subclass
1391
+ # NavigableString. Anyone who's using this feature probably
1392
+ # wants generic NavigableStrings but not other stuff.
1393
+ my_type = type(self)
1394
+ if types is not None:
1395
+ if isinstance(types, type):
1396
+ # Looking for a single type.
1397
+ if my_type is not types:
1398
+ return
1399
+ elif my_type not in types:
1400
+ # Looking for one of a list of types.
1401
+ return
1402
+
1403
+ value = self
1404
+ if strip:
1405
+ final_value = value.strip()
1406
+ else:
1407
+ final_value = self
1408
+ if len(final_value) > 0:
1409
+ yield final_value
1410
+
1411
+ @property
1412
+ def strings(self) -> Iterator[str]:
1413
+ """Yield this string, but only if it is interesting.
1414
+
1415
+ This is defined the way it is for compatibility with
1416
+ `Tag.strings`. See `Tag` for information on which strings are
1417
+ interesting in a given context.
1418
+
1419
+ :yield: A sequence that either contains this string, or is empty.
1420
+ """
1421
+ return self._all_strings()
1422
+
1423
+
1424
+ class PreformattedString(NavigableString):
1425
+ """A `NavigableString` not subject to the normal formatting rules.
1426
+
1427
+ This is an abstract class used for special kinds of strings such
1428
+ as comments (`Comment`) and CDATA blocks (`CData`).
1429
+ """
1430
+
1431
+ PREFIX: str = ""
1432
+ SUFFIX: str = ""
1433
+
1434
+ def output_ready(self, formatter: Optional[_FormatterOrName] = None) -> str:
1435
+ """Make this string ready for output by adding any subclass-specific
1436
+ prefix or suffix.
1437
+
1438
+ :param formatter: A `Formatter` object, or a string naming one
1439
+ of the standard formatters. The string will be passed into the
1440
+ `Formatter`, but only to trigger any side effects: the return
1441
+ value is ignored.
1442
+
1443
+ :return: The string, with any subclass-specific prefix and
1444
+ suffix added on.
1445
+ """
1446
+ if formatter is not None:
1447
+ self.format_string(self, formatter)
1448
+ return self.PREFIX + self + self.SUFFIX
1449
+
1450
+
1451
+ class CData(PreformattedString):
1452
+ """A `CDATA section <https://dev.w3.org/html5/spec-LC/syntax.html#cdata-sections>`_."""
1453
+
1454
+ PREFIX: str = "<![CDATA["
1455
+ SUFFIX: str = "]]>"
1456
+
1457
+
1458
+ class ProcessingInstruction(PreformattedString):
1459
+ """A SGML processing instruction."""
1460
+
1461
+ PREFIX: str = "<?"
1462
+ SUFFIX: str = ">"
1463
+
1464
+
1465
+ class XMLProcessingInstruction(ProcessingInstruction):
1466
+ """An `XML processing instruction <https://www.w3.org/TR/REC-xml/#sec-pi>`_."""
1467
+
1468
+ PREFIX: str = "<?"
1469
+ SUFFIX: str = "?>"
1470
+
1471
+
1472
+ class Comment(PreformattedString):
1473
+ """An `HTML comment <https://dev.w3.org/html5/spec-LC/syntax.html#comments>`_ or `XML comment <https://www.w3.org/TR/REC-xml/#sec-comments>`_."""
1474
+
1475
+ PREFIX: str = "<!--"
1476
+ SUFFIX: str = "-->"
1477
+
1478
+
1479
+ class Declaration(PreformattedString):
1480
+ """An `XML declaration <https://www.w3.org/TR/REC-xml/#sec-prolog-dtd>`_."""
1481
+
1482
+ PREFIX: str = "<?"
1483
+ SUFFIX: str = "?>"
1484
+
1485
+
1486
+ class Doctype(PreformattedString):
1487
+ """A `document type declaration <https://www.w3.org/TR/REC-xml/#dt-doctype>`_."""
1488
+
1489
+ @classmethod
1490
+ def for_name_and_ids(
1491
+ cls, name: str, pub_id: Optional[str], system_id: Optional[str]
1492
+ ) -> Doctype:
1493
+ """Generate an appropriate document type declaration for a given
1494
+ public ID and system ID.
1495
+
1496
+ :param name: The name of the document's root element, e.g. 'html'.
1497
+ :param pub_id: The Formal Public Identifier for this document type,
1498
+ e.g. '-//W3C//DTD XHTML 1.1//EN'
1499
+ :param system_id: The system identifier for this document type,
1500
+ e.g. 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'
1501
+ """
1502
+ return Doctype(cls._string_for_name_and_ids(name, pub_id, system_id))
1503
+
1504
+ @classmethod
1505
+ def _string_for_name_and_ids(
1506
+ self, name: str, pub_id: Optional[str], system_id: Optional[str]
1507
+ ) -> str:
1508
+ """Generate a string to be used as the basis of a Doctype object.
1509
+
1510
+ This is a separate method from for_name_and_ids() because the lxml
1511
+ TreeBuilder needs to call it.
1512
+ """
1513
+ value = name or ""
1514
+ if pub_id is not None:
1515
+ value += ' PUBLIC "%s"' % pub_id
1516
+ if system_id is not None:
1517
+ value += ' "%s"' % system_id
1518
+ elif system_id is not None:
1519
+ value += ' SYSTEM "%s"' % system_id
1520
+ return value
1521
+
1522
+ PREFIX: str = "<!DOCTYPE "
1523
+ SUFFIX: str = ">\n"
1524
+
1525
+
1526
+ class Stylesheet(NavigableString):
1527
+ """A `NavigableString` representing the contents of a `<style> HTML
1528
+ tag <https://dev.w3.org/html5/spec-LC/Overview.html#the-style-element>`_
1529
+ (probably CSS).
1530
+
1531
+ Used to distinguish embedded stylesheets from textual content.
1532
+ """
1533
+
1534
+
1535
+ class Script(NavigableString):
1536
+ """A `NavigableString` representing the contents of a `<script>
1537
+ HTML tag
1538
+ <https://dev.w3.org/html5/spec-LC/Overview.html#the-script-element>`_
1539
+ (probably Javascript).
1540
+
1541
+ Used to distinguish executable code from textual content.
1542
+ """
1543
+
1544
+
1545
+ class TemplateString(NavigableString):
1546
+ """A `NavigableString` representing a string found inside an `HTML
1547
+ <template> tag <https://html.spec.whatwg.org/multipage/scripting.html#the-template-element>`_
1548
+ embedded in a larger document.
1549
+
1550
+ Used to distinguish such strings from the main body of the document.
1551
+ """
1552
+
1553
+
1554
+ class RubyTextString(NavigableString):
1555
+ """A NavigableString representing the contents of an `<rt> HTML
1556
+ tag <https://dev.w3.org/html5/spec-LC/text-level-semantics.html#the-rt-element>`_.
1557
+
1558
+ Can be used to distinguish such strings from the strings they're
1559
+ annotating.
1560
+ """
1561
+
1562
+
1563
+ class RubyParenthesisString(NavigableString):
1564
+ """A NavigableString representing the contents of an `<rp> HTML
1565
+ tag <https://dev.w3.org/html5/spec-LC/text-level-semantics.html#the-rp-element>`_.
1566
+ """
1567
+
1568
+
1569
+ class Tag(PageElement):
1570
+ """An HTML or XML tag that is part of a parse tree, along with its
1571
+ attributes, contents, and relationships to other parts of the tree.
1572
+
1573
+ When Beautiful Soup parses the markup ``<b>penguin</b>``, it will
1574
+ create a `Tag` object representing the ``<b>`` tag. You can
1575
+ instantiate `Tag` objects directly, but it's not necessary unless
1576
+ you're adding entirely new markup to a parsed document. Most of
1577
+ the constructor arguments are intended for use by the `TreeBuilder`
1578
+ that's parsing a document.
1579
+
1580
+ :param parser: A `BeautifulSoup` object representing the parse tree this
1581
+ `Tag` will be part of.
1582
+ :param builder: The `TreeBuilder` being used to build the tree.
1583
+ :param name: The name of the tag.
1584
+ :param namespace: The URI of this tag's XML namespace, if any.
1585
+ :param prefix: The prefix for this tag's XML namespace, if any.
1586
+ :param attrs: A dictionary of attribute values.
1587
+ :param parent: The `Tag` to use as the parent of this `Tag`. May be
1588
+ the `BeautifulSoup` object itself.
1589
+ :param previous: The `PageElement` that was parsed immediately before
1590
+ parsing this tag.
1591
+ :param is_xml: If True, this is an XML tag. Otherwise, this is an
1592
+ HTML tag.
1593
+ :param sourceline: The line number where this tag was found in its
1594
+ source document.
1595
+ :param sourcepos: The character position within ``sourceline`` where this
1596
+ tag was found.
1597
+ :param can_be_empty_element: If True, this tag should be
1598
+ represented as <tag/>. If False, this tag should be represented
1599
+ as <tag></tag>.
1600
+ :param cdata_list_attributes: A dictionary of attributes whose values should
1601
+ be parsed as lists of strings if they ever show up on this tag.
1602
+ :param preserve_whitespace_tags: Names of tags whose contents
1603
+ should have their whitespace preserved if they are encountered inside
1604
+ this tag.
1605
+ :param interesting_string_types: When iterating over this tag's
1606
+ string contents in methods like `Tag.strings` or
1607
+ `PageElement.get_text`, these are the types of strings that are
1608
+ interesting enough to be considered. By default,
1609
+ `NavigableString` (normal strings) and `CData` (CDATA
1610
+ sections) are the only interesting string subtypes.
1611
+ :param namespaces: A dictionary mapping currently active
1612
+ namespace prefixes to URIs, as of the point in the parsing process when
1613
+ this tag was encountered. This can be used later to
1614
+ construct CSS selectors.
1615
+
1616
+ """
1617
+
1618
+ def __init__(
1619
+ self,
1620
+ parser: Optional[BeautifulSoup] = None,
1621
+ builder: Optional[TreeBuilder] = None,
1622
+ name: Optional[str] = None,
1623
+ namespace: Optional[str] = None,
1624
+ prefix: Optional[str] = None,
1625
+ attrs: Optional[_RawOrProcessedAttributeValues] = None,
1626
+ parent: Optional[Union[BeautifulSoup, Tag]] = None,
1627
+ previous: _AtMostOneElement = None,
1628
+ is_xml: Optional[bool] = None,
1629
+ sourceline: Optional[int] = None,
1630
+ sourcepos: Optional[int] = None,
1631
+ can_be_empty_element: Optional[bool] = None,
1632
+ cdata_list_attributes: Optional[Dict[str, Set[str]]] = None,
1633
+ preserve_whitespace_tags: Optional[Set[str]] = None,
1634
+ interesting_string_types: Optional[Set[Type[NavigableString]]] = None,
1635
+ namespaces: Optional[Dict[str, str]] = None,
1636
+ # NOTE: Any new arguments here need to be mirrored in
1637
+ # Tag.copy_self, and potentially BeautifulSoup.new_tag
1638
+ # as well.
1639
+ ):
1640
+ if parser is None:
1641
+ self.parser_class = None
1642
+ else:
1643
+ # We don't actually store the parser object: that lets extracted
1644
+ # chunks be garbage-collected.
1645
+ self.parser_class = parser.__class__
1646
+ if name is None:
1647
+ raise ValueError("No value provided for new tag's name.")
1648
+ self.name = name
1649
+ self.namespace = namespace
1650
+ self._namespaces = namespaces or {}
1651
+ self.prefix = prefix
1652
+ if (not builder or builder.store_line_numbers) and (
1653
+ sourceline is not None or sourcepos is not None
1654
+ ):
1655
+ self.sourceline = sourceline
1656
+ self.sourcepos = sourcepos
1657
+ else:
1658
+ self.sourceline = sourceline
1659
+ self.sourcepos = sourcepos
1660
+
1661
+ attr_dict_class: type[AttributeDict]
1662
+ attribute_value_list_class: type[AttributeValueList]
1663
+ if builder is None:
1664
+ if is_xml:
1665
+ attr_dict_class = XMLAttributeDict
1666
+ else:
1667
+ attr_dict_class = HTMLAttributeDict
1668
+ attribute_value_list_class = AttributeValueList
1669
+ else:
1670
+ attr_dict_class = builder.attribute_dict_class
1671
+ attribute_value_list_class = builder.attribute_value_list_class
1672
+ self.attribute_value_list_class = attribute_value_list_class
1673
+
1674
+ if attrs is None:
1675
+ self.attrs = attr_dict_class()
1676
+ else:
1677
+ if builder is not None and builder.cdata_list_attributes:
1678
+ self.attrs = builder._replace_cdata_list_attribute_values(
1679
+ self.name, attrs
1680
+ )
1681
+ else:
1682
+ self.attrs = attr_dict_class()
1683
+ # Make sure that the values of any multi-valued
1684
+ # attributes (e.g. when a Tag is copied) are stored in
1685
+ # new lists.
1686
+ for k, v in attrs.items():
1687
+ if isinstance(v, list):
1688
+ v = v.__class__(v)
1689
+ self.attrs[k] = v
1690
+
1691
+ # If possible, determine ahead of time whether this tag is an
1692
+ # XML tag.
1693
+ if builder:
1694
+ self.known_xml = builder.is_xml
1695
+ else:
1696
+ self.known_xml = is_xml
1697
+ self.contents: List[PageElement] = []
1698
+ self.setup(parent, previous)
1699
+ self.hidden = False
1700
+
1701
+ if builder is None:
1702
+ # In the absence of a TreeBuilder, use whatever values were
1703
+ # passed in here. They're probably None, unless this is a copy of some
1704
+ # other tag.
1705
+ self.can_be_empty_element = can_be_empty_element
1706
+ self.cdata_list_attributes = cdata_list_attributes
1707
+ self.preserve_whitespace_tags = preserve_whitespace_tags
1708
+ self.interesting_string_types = interesting_string_types
1709
+ else:
1710
+ # Set up any substitutions for this tag, such as the charset in a META tag.
1711
+ self.attribute_value_list_class = builder.attribute_value_list_class
1712
+ builder.set_up_substitutions(self)
1713
+
1714
+ # Ask the TreeBuilder whether this tag might be an empty-element tag.
1715
+ self.can_be_empty_element = builder.can_be_empty_element(name)
1716
+
1717
+ # Keep track of the list of attributes of this tag that
1718
+ # might need to be treated as a list.
1719
+ #
1720
+ # For performance reasons, we store the whole data structure
1721
+ # rather than asking the question of every tag. Asking would
1722
+ # require building a new data structure every time, and
1723
+ # (unlike can_be_empty_element), we almost never need
1724
+ # to check this.
1725
+ self.cdata_list_attributes = builder.cdata_list_attributes
1726
+
1727
+ # Keep track of the names that might cause this tag to be treated as a
1728
+ # whitespace-preserved tag.
1729
+ self.preserve_whitespace_tags = builder.preserve_whitespace_tags
1730
+
1731
+ if self.name in builder.string_containers:
1732
+ # This sort of tag uses a special string container
1733
+ # subclass for most of its strings. We need to be able
1734
+ # to look up the proper container subclass.
1735
+ self.interesting_string_types = {builder.string_containers[self.name]}
1736
+ else:
1737
+ self.interesting_string_types = self.MAIN_CONTENT_STRING_TYPES
1738
+
1739
+ parser_class: Optional[type[BeautifulSoup]]
1740
+ name: str
1741
+ namespace: Optional[str]
1742
+ prefix: Optional[str]
1743
+ attrs: _AttributeValues
1744
+ sourceline: Optional[int]
1745
+ sourcepos: Optional[int]
1746
+ known_xml: Optional[bool]
1747
+ contents: List[PageElement]
1748
+ hidden: bool
1749
+ interesting_string_types: Optional[Set[Type[NavigableString]]]
1750
+
1751
+ can_be_empty_element: Optional[bool]
1752
+ cdata_list_attributes: Optional[Dict[str, Set[str]]]
1753
+ preserve_whitespace_tags: Optional[Set[str]]
1754
+
1755
+ #: :meta private:
1756
+ parserClass = _deprecated_alias("parserClass", "parser_class", "4.0.0")
1757
+
1758
+ def __deepcopy__(self, memo: Dict[Any, Any], recursive: bool = True) -> Self:
1759
+ """A deepcopy of a Tag is a new Tag, unconnected to the parse tree.
1760
+ Its contents are a copy of the old Tag's contents.
1761
+ """
1762
+ clone = self.copy_self()
1763
+
1764
+ if recursive:
1765
+ # Clone this tag's descendants recursively, but without
1766
+ # making any recursive function calls.
1767
+ tag_stack: List[Tag] = [clone]
1768
+ for event, element in self._event_stream(self.descendants):
1769
+ if event is Tag.END_ELEMENT_EVENT:
1770
+ # Stop appending incoming Tags to the Tag that was
1771
+ # just closed.
1772
+ tag_stack.pop()
1773
+ else:
1774
+ descendant_clone = element.__deepcopy__(memo, recursive=False)
1775
+ # Add to its parent's .contents
1776
+ tag_stack[-1].append(descendant_clone)
1777
+
1778
+ if event is Tag.START_ELEMENT_EVENT:
1779
+ # Add the Tag itself to the stack so that its
1780
+ # children will be .appended to it.
1781
+ tag_stack.append(cast(Tag, descendant_clone))
1782
+ return clone
1783
+
1784
+ def copy_self(self) -> Self:
1785
+ """Create a new Tag just like this one, but with no
1786
+ contents and unattached to any parse tree.
1787
+
1788
+ This is the first step in the deepcopy process, but you can
1789
+ call it on its own to create a copy of a Tag without copying its
1790
+ contents.
1791
+ """
1792
+ clone = type(self)(
1793
+ None,
1794
+ None,
1795
+ self.name,
1796
+ self.namespace,
1797
+ self.prefix,
1798
+ self.attrs,
1799
+ is_xml=self._is_xml,
1800
+ sourceline=self.sourceline,
1801
+ sourcepos=self.sourcepos,
1802
+ can_be_empty_element=self.can_be_empty_element,
1803
+ cdata_list_attributes=self.cdata_list_attributes,
1804
+ preserve_whitespace_tags=self.preserve_whitespace_tags,
1805
+ interesting_string_types=self.interesting_string_types,
1806
+ namespaces=self._namespaces,
1807
+ )
1808
+ for attr in ("can_be_empty_element", "hidden"):
1809
+ setattr(clone, attr, getattr(self, attr))
1810
+ return clone
1811
+
1812
+ @property
1813
+ def is_empty_element(self) -> bool:
1814
+ """Is this tag an empty-element tag? (aka a self-closing tag)
1815
+
1816
+ A tag that has contents is never an empty-element tag.
1817
+
1818
+ A tag that has no contents may or may not be an empty-element
1819
+ tag. It depends on the `TreeBuilder` used to create the
1820
+ tag. If the builder has a designated list of empty-element
1821
+ tags, then only a tag whose name shows up in that list is
1822
+ considered an empty-element tag. This is usually the case
1823
+ for HTML documents.
1824
+
1825
+ If the builder has no designated list of empty-element, then
1826
+ any tag with no contents is an empty-element tag. This is usually
1827
+ the case for XML documents.
1828
+ """
1829
+ return len(self.contents) == 0 and self.can_be_empty_element is True
1830
+
1831
+ @_deprecated("is_empty_element", "4.0.0")
1832
+ def isSelfClosing(self) -> bool:
1833
+ ": :meta private:"
1834
+ return self.is_empty_element
1835
+
1836
+ @property
1837
+ def string(self) -> Optional[str]:
1838
+ """Convenience property to get the single string within this
1839
+ `Tag`, assuming there is just one.
1840
+
1841
+ :return: If this `Tag` has a single child that's a
1842
+ `NavigableString`, the return value is that string. If this
1843
+ element has one child `Tag`, the return value is that child's
1844
+ `Tag.string`, recursively. If this `Tag` has no children,
1845
+ or has more than one child, the return value is ``None``.
1846
+
1847
+ If this property is unexpectedly returning ``None`` for you,
1848
+ it's probably because your `Tag` has more than one thing
1849
+ inside it.
1850
+ """
1851
+ if len(self.contents) != 1:
1852
+ return None
1853
+ child = self.contents[0]
1854
+ if isinstance(child, NavigableString):
1855
+ return child
1856
+ elif isinstance(child, Tag):
1857
+ return child.string
1858
+ return None
1859
+
1860
+ @string.setter
1861
+ def string(self, string: str) -> None:
1862
+ """Replace the `Tag.contents` of this `Tag` with a single string."""
1863
+ self.clear()
1864
+ if isinstance(string, NavigableString):
1865
+ new_class = string.__class__
1866
+ else:
1867
+ new_class = NavigableString
1868
+ self.append(new_class(string))
1869
+
1870
+ #: :meta private:
1871
+ MAIN_CONTENT_STRING_TYPES = {NavigableString, CData}
1872
+
1873
+ def _all_strings(
1874
+ self, strip: bool = False, types: _OneOrMoreStringTypes = PageElement.default
1875
+ ) -> Iterator[str]:
1876
+ """Yield all strings of certain classes, possibly stripping them.
1877
+
1878
+ :param strip: If True, all strings will be stripped before being
1879
+ yielded.
1880
+
1881
+ :param types: A tuple of NavigableString subclasses. Any strings of
1882
+ a subclass not found in this list will be ignored. By
1883
+ default, the subclasses considered are the ones found in
1884
+ self.interesting_string_types. If that's not specified,
1885
+ only NavigableString and CData objects will be
1886
+ considered. That means no comments, processing
1887
+ instructions, etc.
1888
+ """
1889
+ if types is self.default:
1890
+ if self.interesting_string_types is None:
1891
+ types = self.MAIN_CONTENT_STRING_TYPES
1892
+ else:
1893
+ types = self.interesting_string_types
1894
+
1895
+ for descendant in self.descendants:
1896
+ if not isinstance(descendant, NavigableString):
1897
+ continue
1898
+ descendant_type = type(descendant)
1899
+ if isinstance(types, type):
1900
+ if descendant_type is not types:
1901
+ # We're not interested in strings of this type.
1902
+ continue
1903
+ elif types is not None and descendant_type not in types:
1904
+ # We're not interested in strings of this type.
1905
+ continue
1906
+ if strip:
1907
+ stripped = descendant.strip()
1908
+ if len(stripped) == 0:
1909
+ continue
1910
+ yield stripped
1911
+ else:
1912
+ yield descendant
1913
+
1914
+ strings = property(_all_strings)
1915
+
1916
+ def insert(self, position: int, *new_children: _InsertableElement) -> List[PageElement]:
1917
+ """Insert one or more new PageElements as a child of this `Tag`.
1918
+
1919
+ This works similarly to :py:meth:`list.insert`, except you can insert
1920
+ multiple elements at once.
1921
+
1922
+ :param position: The numeric position that should be occupied
1923
+ in this Tag's `Tag.children` by the first new `PageElement`.
1924
+
1925
+ :param new_children: The PageElements to insert.
1926
+
1927
+ :return The newly inserted PageElements.
1928
+ """
1929
+ inserted: List[PageElement] = []
1930
+ for new_child in new_children:
1931
+ inserted.extend(self._insert(position, new_child))
1932
+ position += 1
1933
+ return inserted
1934
+
1935
+ def _insert(self, position: int, new_child: _InsertableElement) -> List[PageElement]:
1936
+ if new_child is None:
1937
+ raise ValueError("Cannot insert None into a tag.")
1938
+ if new_child is self:
1939
+ raise ValueError("Cannot insert a tag into itself.")
1940
+ if isinstance(new_child, str) and not isinstance(new_child, NavigableString):
1941
+ new_child = NavigableString(new_child)
1942
+
1943
+ from bs4 import BeautifulSoup
1944
+ if isinstance(new_child, BeautifulSoup):
1945
+ # We don't want to end up with a situation where one BeautifulSoup
1946
+ # object contains another. Insert the BeautifulSoup's children and
1947
+ # return them.
1948
+ return self.insert(position, *list(new_child.contents))
1949
+ position = min(position, len(self.contents))
1950
+ if hasattr(new_child, "parent") and new_child.parent is not None:
1951
+ # We're 'inserting' an element that's already one
1952
+ # of this object's children.
1953
+ if new_child.parent is self:
1954
+ current_index = self.index(new_child)
1955
+ if current_index < position:
1956
+ # We're moving this element further down the list
1957
+ # of this object's children. That means that when
1958
+ # we extract this element, our target index will
1959
+ # jump down one.
1960
+ position -= 1
1961
+ elif current_index == position:
1962
+ # We're 'inserting' an element into its current location.
1963
+ # This is a no-op.
1964
+ return [new_child]
1965
+ new_child.extract()
1966
+
1967
+ new_child.parent = self
1968
+ previous_child = None
1969
+ if position == 0:
1970
+ new_child.previous_sibling = None
1971
+ new_child.previous_element = self
1972
+ else:
1973
+ previous_child = self.contents[position - 1]
1974
+ new_child.previous_sibling = previous_child
1975
+ new_child.previous_sibling.next_sibling = new_child
1976
+ new_child.previous_element = previous_child._last_descendant(False)
1977
+ if new_child.previous_element is not None:
1978
+ new_child.previous_element.next_element = new_child
1979
+
1980
+ new_childs_last_element = new_child._last_descendant(
1981
+ is_initialized=False, accept_self=True
1982
+ )
1983
+ # new_childs_last_element can't be None because we passed
1984
+ # accept_self=True into _last_descendant. Worst case,
1985
+ # new_childs_last_element will be new_child itself. Making
1986
+ # this cast removes several mypy complaints later on as we
1987
+ # manipulate new_childs_last_element.
1988
+ new_childs_last_element = cast(PageElement, new_childs_last_element)
1989
+
1990
+ if position >= len(self.contents):
1991
+ new_child.next_sibling = None
1992
+
1993
+ parent: Optional[Tag] = self
1994
+ parents_next_sibling = None
1995
+ while parents_next_sibling is None and parent is not None:
1996
+ parents_next_sibling = parent.next_sibling
1997
+ parent = parent.parent
1998
+ if parents_next_sibling is not None:
1999
+ # We found the element that comes next in the document.
2000
+ break
2001
+ if parents_next_sibling is not None:
2002
+ new_childs_last_element.next_element = parents_next_sibling
2003
+ else:
2004
+ # The last element of this tag is the last element in
2005
+ # the document.
2006
+ new_childs_last_element.next_element = None
2007
+ else:
2008
+ next_child = self.contents[position]
2009
+ new_child.next_sibling = next_child
2010
+ if new_child.next_sibling is not None:
2011
+ new_child.next_sibling.previous_sibling = new_child
2012
+ new_childs_last_element.next_element = next_child
2013
+
2014
+ if new_childs_last_element.next_element is not None:
2015
+ new_childs_last_element.next_element.previous_element = (
2016
+ new_childs_last_element
2017
+ )
2018
+ self.contents.insert(position, new_child)
2019
+
2020
+ return [new_child]
2021
+
2022
+ def unwrap(self) -> Self:
2023
+ """Replace this `PageElement` with its contents.
2024
+
2025
+ :return: This object, no longer part of the tree.
2026
+ """
2027
+ my_parent = self.parent
2028
+ if my_parent is None:
2029
+ raise ValueError(
2030
+ "Cannot replace an element with its contents when that "
2031
+ "element is not part of a tree."
2032
+ )
2033
+ my_index = my_parent.index(self)
2034
+ self.extract(_self_index=my_index)
2035
+ for child in reversed(self.contents[:]):
2036
+ my_parent.insert(my_index, child)
2037
+ return self
2038
+
2039
+ replace_with_children = unwrap
2040
+
2041
+ @_deprecated("unwrap", "4.0.0")
2042
+ def replaceWithChildren(self) -> _OneElement:
2043
+ ": :meta private:"
2044
+ return self.unwrap()
2045
+
2046
+ def append(self, tag: _InsertableElement) -> PageElement:
2047
+ """
2048
+ Appends the given `PageElement` to the contents of this `Tag`.
2049
+
2050
+ :param tag: A PageElement.
2051
+
2052
+ :return The newly appended PageElement.
2053
+ """
2054
+ return self.insert(len(self.contents), tag)[0]
2055
+
2056
+ def extend(self, tags: Union[Iterable[_InsertableElement], Tag]) -> List[PageElement]:
2057
+ """Appends one or more objects to the contents of this
2058
+ `Tag`.
2059
+
2060
+ :param tags: If a list of `PageElement` objects is provided,
2061
+ they will be appended to this tag's contents, one at a time.
2062
+ If a single `Tag` is provided, its `Tag.contents` will be
2063
+ used to extend this object's `Tag.contents`.
2064
+
2065
+ :return The list of PageElements that were appended.
2066
+ """
2067
+ tag_list: Iterable[_InsertableElement]
2068
+
2069
+ if isinstance(tags, Tag):
2070
+ tag_list = list(tags.contents)
2071
+ elif isinstance(tags, (PageElement, str)):
2072
+ # The caller should really be using append() instead,
2073
+ # but we can make it work.
2074
+ warnings.warn(
2075
+ "A single non-Tag item was passed into Tag.extend. Use Tag.append instead.",
2076
+ UserWarning,
2077
+ stacklevel=2,
2078
+ )
2079
+ if isinstance(tags, str) and not isinstance(tags, PageElement):
2080
+ tags = NavigableString(tags)
2081
+ tag_list = [tags]
2082
+ elif isinstance(tags, Iterable):
2083
+ # Moving items around the tree may change their position in
2084
+ # the original list. Make a list that won't change.
2085
+ tag_list = list(tags)
2086
+
2087
+ results: List[PageElement] = []
2088
+ for tag in tag_list:
2089
+ results.append(self.append(tag))
2090
+
2091
+ return results
2092
+
2093
+ def clear(self, decompose: bool = False) -> None:
2094
+ """Destroy all children of this `Tag` by calling
2095
+ `PageElement.extract` on them.
2096
+
2097
+ :param decompose: If this is True, `PageElement.decompose` (a
2098
+ more destructive method) will be called instead of
2099
+ `PageElement.extract`.
2100
+ """
2101
+ for element in self.contents[:]:
2102
+ if decompose:
2103
+ element.decompose()
2104
+ else:
2105
+ element.extract()
2106
+
2107
+ def smooth(self) -> None:
2108
+ """Smooth out the children of this `Tag` by consolidating consecutive
2109
+ strings.
2110
+
2111
+ If you perform a lot of operations that modify the tree,
2112
+ calling this method afterwards can make pretty-printed output
2113
+ look more natural.
2114
+ """
2115
+ # Mark the first position of every pair of children that need
2116
+ # to be consolidated. Do this rather than making a copy of
2117
+ # self.contents, since in most cases very few strings will be
2118
+ # affected.
2119
+ marked = []
2120
+ for i, a in enumerate(self.contents):
2121
+ if isinstance(a, Tag):
2122
+ # Recursively smooth children.
2123
+ a.smooth()
2124
+ if i == len(self.contents) - 1:
2125
+ # This is the last item in .contents, and it's not a
2126
+ # tag. There's no chance it needs any work.
2127
+ continue
2128
+ b = self.contents[i + 1]
2129
+ if (
2130
+ isinstance(a, NavigableString)
2131
+ and isinstance(b, NavigableString)
2132
+ and not isinstance(a, PreformattedString)
2133
+ and not isinstance(b, PreformattedString)
2134
+ ):
2135
+ marked.append(i)
2136
+
2137
+ # Go over the marked positions in reverse order, so that
2138
+ # removing items from .contents won't affect the remaining
2139
+ # positions.
2140
+ for i in reversed(marked):
2141
+ a = cast(NavigableString, self.contents[i])
2142
+ b = cast(NavigableString, self.contents[i + 1])
2143
+ b.extract()
2144
+ n = NavigableString(a + b)
2145
+ a.replace_with(n)
2146
+
2147
+ def index(self, element: PageElement) -> int:
2148
+ """Find the index of a child of this `Tag` (by identity, not value).
2149
+
2150
+ Doing this by identity avoids issues when a `Tag` contains two
2151
+ children that have string equality.
2152
+
2153
+ :param element: Look for this `PageElement` in this object's contents.
2154
+ """
2155
+ for i, child in enumerate(self.contents):
2156
+ if child is element:
2157
+ return i
2158
+ raise ValueError("Tag.index: element not in tag")
2159
+
2160
+ def get(
2161
+ self, key: str, default: Optional[_AttributeValue] = None
2162
+ ) -> Optional[_AttributeValue]:
2163
+ """Returns the value of the 'key' attribute for the tag, or
2164
+ the value given for 'default' if it doesn't have that
2165
+ attribute.
2166
+
2167
+ :param key: The attribute to look for.
2168
+ :param default: Use this value if the attribute is not present
2169
+ on this `Tag`.
2170
+ """
2171
+ return self.attrs.get(key, default)
2172
+
2173
+ def get_attribute_list(
2174
+ self, key: str, default: Optional[AttributeValueList] = None
2175
+ ) -> AttributeValueList:
2176
+ """The same as get(), but always returns a (possibly empty) list.
2177
+
2178
+ :param key: The attribute to look for.
2179
+ :param default: Use this value if the attribute is not present
2180
+ on this `Tag`.
2181
+ :return: A list of strings, usually empty or containing only a single
2182
+ value.
2183
+ """
2184
+ list_value: AttributeValueList
2185
+ value = self.get(key, default)
2186
+ if value is None:
2187
+ list_value = self.attribute_value_list_class()
2188
+ elif isinstance(value, list):
2189
+ list_value = value
2190
+ else:
2191
+ if not isinstance(value, str):
2192
+ value = cast(str, value)
2193
+ list_value = self.attribute_value_list_class([value])
2194
+ return list_value
2195
+
2196
+ def has_attr(self, key: str) -> bool:
2197
+ """Does this `Tag` have an attribute with the given name?"""
2198
+ return key in self.attrs
2199
+
2200
+ def __hash__(self) -> int:
2201
+ return str(self).__hash__()
2202
+
2203
+ def __getitem__(self, key: str) -> _AttributeValue:
2204
+ """tag[key] returns the value of the 'key' attribute for the Tag,
2205
+ and throws an exception if it's not there."""
2206
+ return self.attrs[key]
2207
+
2208
+ def __iter__(self) -> Iterator[PageElement]:
2209
+ "Iterating over a Tag iterates over its contents."
2210
+ return iter(self.contents)
2211
+
2212
+ def __len__(self) -> int:
2213
+ "The length of a Tag is the length of its list of contents."
2214
+ return len(self.contents)
2215
+
2216
+ def __contains__(self, x: Any) -> bool:
2217
+ return x in self.contents
2218
+
2219
+ def __bool__(self) -> bool:
2220
+ "A tag is non-None even if it has no contents."
2221
+ return True
2222
+
2223
+ def __setitem__(self, key: str, value: _AttributeValue) -> None:
2224
+ """Setting tag[key] sets the value of the 'key' attribute for the
2225
+ tag."""
2226
+ self.attrs[key] = value
2227
+
2228
+ def __delitem__(self, key: str) -> None:
2229
+ "Deleting tag[key] deletes all 'key' attributes for the tag."
2230
+ self.attrs.pop(key, None)
2231
+
2232
+ def __call__(
2233
+ self,
2234
+ name: Optional[_StrainableElement] = None,
2235
+ attrs: _StrainableAttributes = {},
2236
+ recursive: bool = True,
2237
+ string: Optional[_StrainableString] = None,
2238
+ limit: Optional[int] = None,
2239
+ _stacklevel: int = 2,
2240
+ **kwargs: _StrainableAttribute,
2241
+ ) -> _QueryResults:
2242
+ """Calling a Tag like a function is the same as calling its
2243
+ find_all() method. Eg. tag('a') returns a list of all the A tags
2244
+ found within this tag."""
2245
+ return self.find_all(
2246
+ name, attrs, recursive, string, limit, _stacklevel, **kwargs
2247
+ )
2248
+
2249
+ def __getattr__(self, subtag: str) -> Optional[Tag]:
2250
+ """Calling tag.subtag is the same as calling tag.find(name="subtag")"""
2251
+ # print("Getattr %s.%s" % (self.__class__, tag))
2252
+ result: _AtMostOneElement
2253
+ if len(subtag) > 3 and subtag.endswith("Tag"):
2254
+ # BS3: soup.aTag -> "soup.find("a")
2255
+ tag_name = subtag[:-3]
2256
+ warnings.warn(
2257
+ '.%(name)sTag is deprecated, use .find("%(name)s") instead. If you really were looking for a tag called %(name)sTag, use .find("%(name)sTag")'
2258
+ % dict(name=tag_name),
2259
+ DeprecationWarning,
2260
+ stacklevel=2,
2261
+ )
2262
+ result = self.find(tag_name)
2263
+ # We special case contents to avoid recursion.
2264
+ elif not subtag.startswith("__") and not subtag == "contents":
2265
+ result = self.find(subtag)
2266
+ else:
2267
+ raise AttributeError(
2268
+ "'%s' object has no attribute '%s'" % (self.__class__, subtag)
2269
+ )
2270
+ return cast(Optional[Tag], result)
2271
+
2272
+ def __eq__(self, other: Any) -> bool:
2273
+ """Returns true iff this Tag has the same name, the same attributes,
2274
+ and the same contents (recursively) as `other`."""
2275
+ if self is other:
2276
+ return True
2277
+ if not isinstance(other, Tag):
2278
+ return False
2279
+ if (
2280
+ not hasattr(other, "name")
2281
+ or not hasattr(other, "attrs")
2282
+ or not hasattr(other, "contents")
2283
+ or self.name != other.name
2284
+ or self.attrs != other.attrs
2285
+ or len(self) != len(other)
2286
+ ):
2287
+ return False
2288
+ for i, my_child in enumerate(self.contents):
2289
+ if my_child != other.contents[i]:
2290
+ return False
2291
+ return True
2292
+
2293
+ def __ne__(self, other: Any) -> bool:
2294
+ """Returns true iff this Tag is not identical to `other`,
2295
+ as defined in __eq__."""
2296
+ return not self == other
2297
+
2298
+ def __repr__(self) -> str:
2299
+ """Renders this `Tag` as a string."""
2300
+ return self.decode()
2301
+
2302
+ __str__ = __unicode__ = __repr__
2303
+
2304
+ def encode(
2305
+ self,
2306
+ encoding: _Encoding = DEFAULT_OUTPUT_ENCODING,
2307
+ indent_level: Optional[int] = None,
2308
+ formatter: _FormatterOrName = "minimal",
2309
+ errors: str = "xmlcharrefreplace",
2310
+ ) -> bytes:
2311
+ """Render this `Tag` and its contents as a bytestring.
2312
+
2313
+ :param encoding: The encoding to use when converting to
2314
+ a bytestring. This may also affect the text of the document,
2315
+ specifically any encoding declarations within the document.
2316
+ :param indent_level: Each line of the rendering will be
2317
+ indented this many levels. (The ``formatter`` decides what a
2318
+ 'level' means, in terms of spaces or other characters
2319
+ output.) This is used internally in recursive calls while
2320
+ pretty-printing.
2321
+ :param formatter: Either a `Formatter` object, or a string naming one of
2322
+ the standard formatters.
2323
+ :param errors: An error handling strategy such as
2324
+ 'xmlcharrefreplace'. This value is passed along into
2325
+ :py:meth:`str.encode` and its value should be one of the `error
2326
+ handling constants defined by Python's codecs module
2327
+ <https://docs.python.org/3/library/codecs.html#error-handlers>`_.
2328
+ """
2329
+ # Turn the data structure into Unicode, then encode the
2330
+ # Unicode.
2331
+ u = self.decode(indent_level, encoding, formatter)
2332
+ return u.encode(encoding, errors)
2333
+
2334
+ def decode(
2335
+ self,
2336
+ indent_level: Optional[int] = None,
2337
+ eventual_encoding: _Encoding = DEFAULT_OUTPUT_ENCODING,
2338
+ formatter: _FormatterOrName = "minimal",
2339
+ iterator: Optional[Iterator[PageElement]] = None,
2340
+ ) -> str:
2341
+ """Render this `Tag` and its contents as a Unicode string.
2342
+
2343
+ :param indent_level: Each line of the rendering will be
2344
+ indented this many levels. (The ``formatter`` decides what a
2345
+ 'level' means, in terms of spaces or other characters
2346
+ output.) This is used internally in recursive calls while
2347
+ pretty-printing.
2348
+ :param encoding: The encoding you intend to use when
2349
+ converting the string to a bytestring. decode() is *not*
2350
+ responsible for performing that encoding. This information
2351
+ is needed so that a real encoding can be substituted in if
2352
+ the document contains an encoding declaration (e.g. in a
2353
+ <meta> tag).
2354
+ :param formatter: Either a `Formatter` object, or a string
2355
+ naming one of the standard formatters.
2356
+ :param iterator: The iterator to use when navigating over the
2357
+ parse tree. This is only used by `Tag.decode_contents` and
2358
+ you probably won't need to use it.
2359
+ """
2360
+ pieces = []
2361
+ # First off, turn a non-Formatter `formatter` into a Formatter
2362
+ # object. This will stop the lookup from happening over and
2363
+ # over again.
2364
+ if not isinstance(formatter, Formatter):
2365
+ formatter = self.formatter_for_name(formatter)
2366
+
2367
+ if indent_level is True:
2368
+ indent_level = 0
2369
+
2370
+ # The currently active tag that put us into string literal
2371
+ # mode. Until this element is closed, children will be treated
2372
+ # as string literals and not pretty-printed. String literal
2373
+ # mode is turned on immediately after this tag begins, and
2374
+ # turned off immediately before it's closed. This means there
2375
+ # will be whitespace before and after the tag itself.
2376
+ string_literal_tag = None
2377
+
2378
+ for event, element in self._event_stream(iterator):
2379
+ if event in (Tag.START_ELEMENT_EVENT, Tag.EMPTY_ELEMENT_EVENT):
2380
+ element = cast(Tag, element)
2381
+ piece = element._format_tag(eventual_encoding, formatter, opening=True)
2382
+ elif event is Tag.END_ELEMENT_EVENT:
2383
+ element = cast(Tag, element)
2384
+ piece = element._format_tag(eventual_encoding, formatter, opening=False)
2385
+ if indent_level is not None:
2386
+ indent_level -= 1
2387
+ else:
2388
+ element = cast(NavigableString, element)
2389
+ piece = element.output_ready(formatter)
2390
+
2391
+ # Now we need to apply the 'prettiness' -- extra
2392
+ # whitespace before and/or after this tag. This can get
2393
+ # complicated because certain tags, like <pre> and
2394
+ # <script>, can't be prettified, since adding whitespace would
2395
+ # change the meaning of the content.
2396
+
2397
+ # The default behavior is to add whitespace before and
2398
+ # after an element when string literal mode is off, and to
2399
+ # leave things as they are when string literal mode is on.
2400
+ if string_literal_tag:
2401
+ indent_before = indent_after = False
2402
+ else:
2403
+ indent_before = indent_after = True
2404
+
2405
+ # The only time the behavior is more complex than that is
2406
+ # when we encounter an opening or closing tag that might
2407
+ # put us into or out of string literal mode.
2408
+ if (
2409
+ event is Tag.START_ELEMENT_EVENT
2410
+ and not string_literal_tag
2411
+ and not cast(Tag, element)._should_pretty_print()
2412
+ ):
2413
+ # We are about to enter string literal mode. Add
2414
+ # whitespace before this tag, but not after. We
2415
+ # will stay in string literal mode until this tag
2416
+ # is closed.
2417
+ indent_before = True
2418
+ indent_after = False
2419
+ string_literal_tag = element
2420
+ elif event is Tag.END_ELEMENT_EVENT and element is string_literal_tag:
2421
+ # We are about to exit string literal mode by closing
2422
+ # the tag that sent us into that mode. Add whitespace
2423
+ # after this tag, but not before.
2424
+ indent_before = False
2425
+ indent_after = True
2426
+ string_literal_tag = None
2427
+
2428
+ # Now we know whether to add whitespace before and/or
2429
+ # after this element.
2430
+ if indent_level is not None:
2431
+ if indent_before or indent_after:
2432
+ if isinstance(element, NavigableString):
2433
+ piece = piece.strip()
2434
+ if piece:
2435
+ piece = self._indent_string(
2436
+ piece, indent_level, formatter, indent_before, indent_after
2437
+ )
2438
+ if event == Tag.START_ELEMENT_EVENT:
2439
+ indent_level += 1
2440
+ pieces.append(piece)
2441
+ return "".join(pieces)
2442
+
2443
+ class _TreeTraversalEvent(object):
2444
+ """An internal class representing an event in the process
2445
+ of traversing a parse tree.
2446
+
2447
+ :meta private:
2448
+ """
2449
+
2450
+ # Stand-ins for the different events yielded by _event_stream
2451
+ START_ELEMENT_EVENT = _TreeTraversalEvent() #: :meta private:
2452
+ END_ELEMENT_EVENT = _TreeTraversalEvent() #: :meta private:
2453
+ EMPTY_ELEMENT_EVENT = _TreeTraversalEvent() #: :meta private:
2454
+ STRING_ELEMENT_EVENT = _TreeTraversalEvent() #: :meta private:
2455
+
2456
+ def _event_stream(
2457
+ self, iterator: Optional[Iterator[PageElement]] = None
2458
+ ) -> Iterator[Tuple[_TreeTraversalEvent, PageElement]]:
2459
+ """Yield a sequence of events that can be used to reconstruct the DOM
2460
+ for this element.
2461
+
2462
+ This lets us recreate the nested structure of this element
2463
+ (e.g. when formatting it as a string) without using recursive
2464
+ method calls.
2465
+
2466
+ This is similar in concept to the SAX API, but it's a simpler
2467
+ interface designed for internal use. The events are different
2468
+ from SAX and the arguments associated with the events are Tags
2469
+ and other Beautiful Soup objects.
2470
+
2471
+ :param iterator: An alternate iterator to use when traversing
2472
+ the tree.
2473
+ """
2474
+ tag_stack: List[Tag] = []
2475
+
2476
+ iterator = iterator or self.self_and_descendants
2477
+
2478
+ for c in iterator:
2479
+ # If the parent of the element we're about to yield is not
2480
+ # the tag currently on the stack, it means that the tag on
2481
+ # the stack closed before this element appeared.
2482
+ while tag_stack and c.parent != tag_stack[-1]:
2483
+ now_closed_tag = tag_stack.pop()
2484
+ yield Tag.END_ELEMENT_EVENT, now_closed_tag
2485
+
2486
+ if isinstance(c, Tag):
2487
+ if c.is_empty_element:
2488
+ yield Tag.EMPTY_ELEMENT_EVENT, c
2489
+ else:
2490
+ yield Tag.START_ELEMENT_EVENT, c
2491
+ tag_stack.append(c)
2492
+ continue
2493
+ else:
2494
+ yield Tag.STRING_ELEMENT_EVENT, c
2495
+
2496
+ while tag_stack:
2497
+ now_closed_tag = tag_stack.pop()
2498
+ yield Tag.END_ELEMENT_EVENT, now_closed_tag
2499
+
2500
+ def _indent_string(
2501
+ self,
2502
+ s: str,
2503
+ indent_level: int,
2504
+ formatter: Formatter,
2505
+ indent_before: bool,
2506
+ indent_after: bool,
2507
+ ) -> str:
2508
+ """Add indentation whitespace before and/or after a string.
2509
+
2510
+ :param s: The string to amend with whitespace.
2511
+ :param indent_level: The indentation level; affects how much
2512
+ whitespace goes before the string.
2513
+ :param indent_before: Whether or not to add whitespace
2514
+ before the string.
2515
+ :param indent_after: Whether or not to add whitespace
2516
+ (a newline) after the string.
2517
+ """
2518
+ space_before = ""
2519
+ if indent_before and indent_level:
2520
+ space_before = formatter.indent * indent_level
2521
+
2522
+ space_after = ""
2523
+ if indent_after:
2524
+ space_after = "\n"
2525
+
2526
+ return space_before + s + space_after
2527
+
2528
+ def _format_tag(
2529
+ self, eventual_encoding: str, formatter: Formatter, opening: bool
2530
+ ) -> str:
2531
+ if self.hidden:
2532
+ # A hidden tag is invisible, although its contents
2533
+ # are visible.
2534
+ return ""
2535
+
2536
+ # A tag starts with the < character (see below).
2537
+
2538
+ # Then the / character, if this is a closing tag.
2539
+ closing_slash = ""
2540
+ if not opening:
2541
+ closing_slash = "/"
2542
+
2543
+ # Then an optional namespace prefix.
2544
+ prefix = ""
2545
+ if self.prefix:
2546
+ prefix = self.prefix + ":"
2547
+
2548
+ # Then a list of attribute values, if this is an opening tag.
2549
+ attribute_string = ""
2550
+ if opening:
2551
+ attributes = formatter.attributes(self)
2552
+ attrs = []
2553
+ for key, val in attributes:
2554
+ if val is None:
2555
+ decoded = key
2556
+ else:
2557
+ if isinstance(val, list) or isinstance(val, tuple):
2558
+ val = " ".join(val)
2559
+ elif not isinstance(val, str):
2560
+ val = str(val)
2561
+ elif (
2562
+ isinstance(val, AttributeValueWithCharsetSubstitution)
2563
+ and eventual_encoding is not None
2564
+ ):
2565
+ val = val.substitute_encoding(eventual_encoding)
2566
+
2567
+ text = formatter.attribute_value(val)
2568
+ decoded = str(key) + "=" + formatter.quoted_attribute_value(text)
2569
+ attrs.append(decoded)
2570
+ if attrs:
2571
+ attribute_string = " " + " ".join(attrs)
2572
+
2573
+ # Then an optional closing slash (for a void element in an
2574
+ # XML document).
2575
+ void_element_closing_slash = ""
2576
+ if self.is_empty_element:
2577
+ void_element_closing_slash = formatter.void_element_close_prefix or ""
2578
+
2579
+ # Put it all together.
2580
+ return (
2581
+ "<"
2582
+ + closing_slash
2583
+ + prefix
2584
+ + self.name
2585
+ + attribute_string
2586
+ + void_element_closing_slash
2587
+ + ">"
2588
+ )
2589
+
2590
+ def _should_pretty_print(self, indent_level: int = 1) -> bool:
2591
+ """Should this tag be pretty-printed?
2592
+
2593
+ Most of them should, but some (such as <pre> in HTML
2594
+ documents) should not.
2595
+ """
2596
+ return indent_level is not None and (
2597
+ not self.preserve_whitespace_tags
2598
+ or self.name not in self.preserve_whitespace_tags
2599
+ )
2600
+
2601
+ def prettify(
2602
+ self,
2603
+ encoding: Optional[_Encoding] = None,
2604
+ formatter: _FormatterOrName = "minimal",
2605
+ ) -> Union[str, bytes]:
2606
+ """Pretty-print this `Tag` as a string or bytestring.
2607
+
2608
+ :param encoding: The encoding of the bytestring, or None if you want Unicode.
2609
+ :param formatter: A Formatter object, or a string naming one of
2610
+ the standard formatters.
2611
+ :return: A string (if no ``encoding`` is provided) or a bytestring
2612
+ (otherwise).
2613
+ """
2614
+ if encoding is None:
2615
+ return self.decode(indent_level=0, formatter=formatter)
2616
+ else:
2617
+ return self.encode(encoding=encoding, indent_level=0, formatter=formatter)
2618
+
2619
+ def decode_contents(
2620
+ self,
2621
+ indent_level: Optional[int] = None,
2622
+ eventual_encoding: _Encoding = DEFAULT_OUTPUT_ENCODING,
2623
+ formatter: _FormatterOrName = "minimal",
2624
+ ) -> str:
2625
+ """Renders the contents of this tag as a Unicode string.
2626
+
2627
+ :param indent_level: Each line of the rendering will be
2628
+ indented this many levels. (The formatter decides what a
2629
+ 'level' means in terms of spaces or other characters
2630
+ output.) Used internally in recursive calls while
2631
+ pretty-printing.
2632
+
2633
+ :param eventual_encoding: The tag is destined to be
2634
+ encoded into this encoding. decode_contents() is *not*
2635
+ responsible for performing that encoding. This information
2636
+ is needed so that a real encoding can be substituted in if
2637
+ the document contains an encoding declaration (e.g. in a
2638
+ <meta> tag).
2639
+
2640
+ :param formatter: A `Formatter` object, or a string naming one of
2641
+ the standard Formatters.
2642
+ """
2643
+ return self.decode(
2644
+ indent_level, eventual_encoding, formatter, iterator=self.descendants
2645
+ )
2646
+
2647
+ def encode_contents(
2648
+ self,
2649
+ indent_level: Optional[int] = None,
2650
+ encoding: _Encoding = DEFAULT_OUTPUT_ENCODING,
2651
+ formatter: _FormatterOrName = "minimal",
2652
+ ) -> bytes:
2653
+ """Renders the contents of this PageElement as a bytestring.
2654
+
2655
+ :param indent_level: Each line of the rendering will be
2656
+ indented this many levels. (The ``formatter`` decides what a
2657
+ 'level' means, in terms of spaces or other characters
2658
+ output.) This is used internally in recursive calls while
2659
+ pretty-printing.
2660
+ :param formatter: Either a `Formatter` object, or a string naming one of
2661
+ the standard formatters.
2662
+ :param encoding: The bytestring will be in this encoding.
2663
+ """
2664
+ contents = self.decode_contents(indent_level, encoding, formatter)
2665
+ return contents.encode(encoding)
2666
+
2667
+ @_deprecated("encode_contents", "4.0.0")
2668
+ def renderContents(
2669
+ self,
2670
+ encoding: _Encoding = DEFAULT_OUTPUT_ENCODING,
2671
+ prettyPrint: bool = False,
2672
+ indentLevel: Optional[int] = 0,
2673
+ ) -> bytes:
2674
+ """Deprecated method for BS3 compatibility.
2675
+
2676
+ :meta private:
2677
+ """
2678
+ if not prettyPrint:
2679
+ indentLevel = None
2680
+ return self.encode_contents(indent_level=indentLevel, encoding=encoding)
2681
+
2682
+ # Soup methods
2683
+
2684
+ def find(
2685
+ self,
2686
+ name: _FindMethodName = None,
2687
+ attrs: _StrainableAttributes = {},
2688
+ recursive: bool = True,
2689
+ string: Optional[_StrainableString] = None,
2690
+ **kwargs: _StrainableAttribute,
2691
+ ) -> _AtMostOneElement:
2692
+ """Look in the children of this PageElement and find the first
2693
+ PageElement that matches the given criteria.
2694
+
2695
+ All find_* methods take a common set of arguments. See the online
2696
+ documentation for detailed explanations.
2697
+
2698
+ :param name: A filter on tag name.
2699
+ :param attrs: Additional filters on attribute values.
2700
+ :param recursive: If this is True, find() will perform a
2701
+ recursive search of this Tag's children. Otherwise,
2702
+ only the direct children will be considered.
2703
+ :param string: A filter on the `Tag.string` attribute.
2704
+ :param limit: Stop looking after finding this many results.
2705
+ :kwargs: Additional filters on attribute values.
2706
+ """
2707
+ r = None
2708
+ results = self.find_all(name, attrs, recursive, string, 1, _stacklevel=3, **kwargs)
2709
+ if results:
2710
+ r = results[0]
2711
+ return r
2712
+
2713
+ findChild = _deprecated_function_alias("findChild", "find", "3.0.0")
2714
+
2715
+ def find_all(
2716
+ self,
2717
+ name: _FindMethodName = None,
2718
+ attrs: _StrainableAttributes = {},
2719
+ recursive: bool = True,
2720
+ string: Optional[_StrainableString] = None,
2721
+ limit: Optional[int] = None,
2722
+ _stacklevel: int = 2,
2723
+ **kwargs: _StrainableAttribute,
2724
+ ) -> _QueryResults:
2725
+ """Look in the children of this `PageElement` and find all
2726
+ `PageElement` objects that match the given criteria.
2727
+
2728
+ All find_* methods take a common set of arguments. See the online
2729
+ documentation for detailed explanations.
2730
+
2731
+ :param name: A filter on tag name.
2732
+ :param attrs: Additional filters on attribute values.
2733
+ :param recursive: If this is True, find_all() will perform a
2734
+ recursive search of this PageElement's children. Otherwise,
2735
+ only the direct children will be considered.
2736
+ :param limit: Stop looking after finding this many results.
2737
+ :param _stacklevel: Used internally to improve warning messages.
2738
+ :kwargs: Additional filters on attribute values.
2739
+ """
2740
+ generator = self.descendants
2741
+ if not recursive:
2742
+ generator = self.children
2743
+ return self._find_all(
2744
+ name, attrs, string, limit, generator, _stacklevel=_stacklevel + 1, **kwargs
2745
+ )
2746
+
2747
+ findAll = _deprecated_function_alias("findAll", "find_all", "4.0.0")
2748
+ findChildren = _deprecated_function_alias("findChildren", "find_all", "3.0.0")
2749
+
2750
+ # Generator methods
2751
+ @property
2752
+ def children(self) -> Iterator[PageElement]:
2753
+ """Iterate over all direct children of this `PageElement`."""
2754
+ return (x for x in self.contents)
2755
+
2756
+ @property
2757
+ def self_and_descendants(self) -> Iterator[PageElement]:
2758
+ """Iterate over this `Tag` and its children in a
2759
+ breadth-first sequence.
2760
+ """
2761
+ return self._self_and(self.descendants)
2762
+
2763
+ @property
2764
+ def descendants(self) -> Iterator[PageElement]:
2765
+ """Iterate over all children of this `Tag` in a
2766
+ breadth-first sequence.
2767
+ """
2768
+ if not len(self.contents):
2769
+ return
2770
+ # _last_descendant() can't return None here because
2771
+ # accept_self is True. Worst case, last_descendant will end up
2772
+ # as self.
2773
+ last_descendant = cast(PageElement, self._last_descendant(accept_self=True))
2774
+ stopNode = last_descendant.next_element
2775
+ current: _AtMostOneElement = self.contents[0]
2776
+ while current is not stopNode and current is not None:
2777
+ successor = current.next_element
2778
+ yield current
2779
+ current = successor
2780
+
2781
+ # CSS selector code
2782
+ def select_one(
2783
+ self, selector: str, namespaces: Optional[Dict[str, str]] = None, **kwargs: Any
2784
+ ) -> Optional[Tag]:
2785
+ """Perform a CSS selection operation on the current element.
2786
+
2787
+ :param selector: A CSS selector.
2788
+
2789
+ :param namespaces: A dictionary mapping namespace prefixes
2790
+ used in the CSS selector to namespace URIs. By default,
2791
+ Beautiful Soup will use the prefixes it encountered while
2792
+ parsing the document.
2793
+
2794
+ :param kwargs: Keyword arguments to be passed into Soup Sieve's
2795
+ soupsieve.select() method.
2796
+ """
2797
+ return self.css.select_one(selector, namespaces, **kwargs)
2798
+
2799
+ def select(
2800
+ self,
2801
+ selector: str,
2802
+ namespaces: Optional[Dict[str, str]] = None,
2803
+ limit: int = 0,
2804
+ **kwargs: Any,
2805
+ ) -> ResultSet[Tag]:
2806
+ """Perform a CSS selection operation on the current element.
2807
+
2808
+ This uses the SoupSieve library.
2809
+
2810
+ :param selector: A string containing a CSS selector.
2811
+
2812
+ :param namespaces: A dictionary mapping namespace prefixes
2813
+ used in the CSS selector to namespace URIs. By default,
2814
+ Beautiful Soup will use the prefixes it encountered while
2815
+ parsing the document.
2816
+
2817
+ :param limit: After finding this number of results, stop looking.
2818
+
2819
+ :param kwargs: Keyword arguments to be passed into SoupSieve's
2820
+ soupsieve.select() method.
2821
+ """
2822
+ return self.css.select(selector, namespaces, limit, **kwargs)
2823
+
2824
+ @property
2825
+ def css(self) -> CSS:
2826
+ """Return an interface to the CSS selector API."""
2827
+ return CSS(self)
2828
+
2829
+ # Old names for backwards compatibility
2830
+ @_deprecated("children", "4.0.0")
2831
+ def childGenerator(self) -> Iterator[PageElement]:
2832
+ """Deprecated generator.
2833
+
2834
+ :meta private:
2835
+ """
2836
+ return self.children
2837
+
2838
+ @_deprecated("descendants", "4.0.0")
2839
+ def recursiveChildGenerator(self) -> Iterator[PageElement]:
2840
+ """Deprecated generator.
2841
+
2842
+ :meta private:
2843
+ """
2844
+ return self.descendants
2845
+
2846
+ @_deprecated("has_attr", "4.0.0")
2847
+ def has_key(self, key: str) -> bool:
2848
+ """Deprecated method. This was kind of misleading because has_key()
2849
+ (attributes) was different from __in__ (contents).
2850
+
2851
+ has_key() is gone in Python 3, anyway.
2852
+
2853
+ :meta private:
2854
+ """
2855
+ return self.has_attr(key)
2856
+
2857
+
2858
+ _PageElementT = TypeVar("_PageElementT", bound=PageElement)
2859
+
2860
+
2861
+ class ResultSet(List[_PageElementT], Generic[_PageElementT]):
2862
+ """A ResultSet is a list of `PageElement` objects, gathered as the result
2863
+ of matching an :py:class:`ElementFilter` against a parse tree. Basically, a list of
2864
+ search results.
2865
+ """
2866
+
2867
+ source: Optional[ElementFilter]
2868
+
2869
+ def __init__(
2870
+ self, source: Optional[ElementFilter], result: Iterable[_PageElementT] = ()
2871
+ ) -> None:
2872
+ super(ResultSet, self).__init__(result)
2873
+ self.source = source
2874
+
2875
+ def __getattr__(self, key: str) -> None:
2876
+ """Raise a helpful exception to explain a common code fix."""
2877
+ raise AttributeError(
2878
+ f"""ResultSet object has no attribute "{key}". You're probably treating a list of elements like a single element. Did you call find_all() when you meant to call find()?"""
2879
+ )
2880
+
2881
+
2882
+ # Now that all the classes used by SoupStrainer have been defined,
2883
+ # import SoupStrainer itself into this module to preserve the
2884
+ # backwards compatibility of anyone who imports
2885
+ # bs4.element.SoupStrainer.
2886
+ from bs4.filter import SoupStrainer # noqa: E402