@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,3055 @@
1
+ # SPDX-License-Identifier: MIT
2
+
3
+ from __future__ import annotations
4
+
5
+ import abc
6
+ import contextlib
7
+ import copy
8
+ import enum
9
+ import functools
10
+ import inspect
11
+ import itertools
12
+ import linecache
13
+ import sys
14
+ import types
15
+ import typing
16
+
17
+ from operator import itemgetter
18
+
19
+ # We need to import _compat itself in addition to the _compat members to avoid
20
+ # having the thread-local in the globals here.
21
+ from . import _compat, _config, setters
22
+ from ._compat import (
23
+ PY_3_10_PLUS,
24
+ PY_3_11_PLUS,
25
+ PY_3_13_PLUS,
26
+ _AnnotationExtractor,
27
+ _get_annotations,
28
+ get_generic_base,
29
+ )
30
+ from .exceptions import (
31
+ DefaultAlreadySetError,
32
+ FrozenInstanceError,
33
+ NotAnAttrsClassError,
34
+ UnannotatedAttributeError,
35
+ )
36
+
37
+
38
+ # This is used at least twice, so cache it here.
39
+ _OBJ_SETATTR = object.__setattr__
40
+ _INIT_FACTORY_PAT = "__attr_factory_%s"
41
+ _CLASSVAR_PREFIXES = (
42
+ "typing.ClassVar",
43
+ "t.ClassVar",
44
+ "ClassVar",
45
+ "typing_extensions.ClassVar",
46
+ )
47
+ # we don't use a double-underscore prefix because that triggers
48
+ # name mangling when trying to create a slot for the field
49
+ # (when slots=True)
50
+ _HASH_CACHE_FIELD = "_attrs_cached_hash"
51
+
52
+ _EMPTY_METADATA_SINGLETON = types.MappingProxyType({})
53
+
54
+ # Unique object for unequivocal getattr() defaults.
55
+ _SENTINEL = object()
56
+
57
+ _DEFAULT_ON_SETATTR = setters.pipe(setters.convert, setters.validate)
58
+
59
+
60
+ class _Nothing(enum.Enum):
61
+ """
62
+ Sentinel to indicate the lack of a value when `None` is ambiguous.
63
+
64
+ If extending attrs, you can use ``typing.Literal[NOTHING]`` to show
65
+ that a value may be ``NOTHING``.
66
+
67
+ .. versionchanged:: 21.1.0 ``bool(NOTHING)`` is now False.
68
+ .. versionchanged:: 22.2.0 ``NOTHING`` is now an ``enum.Enum`` variant.
69
+ """
70
+
71
+ NOTHING = enum.auto()
72
+
73
+ def __repr__(self):
74
+ return "NOTHING"
75
+
76
+ def __bool__(self):
77
+ return False
78
+
79
+
80
+ NOTHING = _Nothing.NOTHING
81
+ """
82
+ Sentinel to indicate the lack of a value when `None` is ambiguous.
83
+
84
+ When using in 3rd party code, use `attrs.NothingType` for type annotations.
85
+ """
86
+
87
+
88
+ class _CacheHashWrapper(int):
89
+ """
90
+ An integer subclass that pickles / copies as None
91
+
92
+ This is used for non-slots classes with ``cache_hash=True``, to avoid
93
+ serializing a potentially (even likely) invalid hash value. Since `None`
94
+ is the default value for uncalculated hashes, whenever this is copied,
95
+ the copy's value for the hash should automatically reset.
96
+
97
+ See GH #613 for more details.
98
+ """
99
+
100
+ def __reduce__(self, _none_constructor=type(None), _args=()): # noqa: B008
101
+ return _none_constructor, _args
102
+
103
+
104
+ def attrib(
105
+ default=NOTHING,
106
+ validator=None,
107
+ repr=True,
108
+ cmp=None,
109
+ hash=None,
110
+ init=True,
111
+ metadata=None,
112
+ type=None,
113
+ converter=None,
114
+ factory=None,
115
+ kw_only=False,
116
+ eq=None,
117
+ order=None,
118
+ on_setattr=None,
119
+ alias=None,
120
+ ):
121
+ """
122
+ Create a new field / attribute on a class.
123
+
124
+ Identical to `attrs.field`, except it's not keyword-only.
125
+
126
+ Consider using `attrs.field` in new code (``attr.ib`` will *never* go away,
127
+ though).
128
+
129
+ .. warning::
130
+
131
+ Does **nothing** unless the class is also decorated with
132
+ `attr.s` (or similar)!
133
+
134
+
135
+ .. versionadded:: 15.2.0 *convert*
136
+ .. versionadded:: 16.3.0 *metadata*
137
+ .. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
138
+ .. versionchanged:: 17.1.0
139
+ *hash* is `None` and therefore mirrors *eq* by default.
140
+ .. versionadded:: 17.3.0 *type*
141
+ .. deprecated:: 17.4.0 *convert*
142
+ .. versionadded:: 17.4.0
143
+ *converter* as a replacement for the deprecated *convert* to achieve
144
+ consistency with other noun-based arguments.
145
+ .. versionadded:: 18.1.0
146
+ ``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``.
147
+ .. versionadded:: 18.2.0 *kw_only*
148
+ .. versionchanged:: 19.2.0 *convert* keyword argument removed.
149
+ .. versionchanged:: 19.2.0 *repr* also accepts a custom callable.
150
+ .. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
151
+ .. versionadded:: 19.2.0 *eq* and *order*
152
+ .. versionadded:: 20.1.0 *on_setattr*
153
+ .. versionchanged:: 20.3.0 *kw_only* backported to Python 2
154
+ .. versionchanged:: 21.1.0
155
+ *eq*, *order*, and *cmp* also accept a custom callable
156
+ .. versionchanged:: 21.1.0 *cmp* undeprecated
157
+ .. versionadded:: 22.2.0 *alias*
158
+ """
159
+ eq, eq_key, order, order_key = _determine_attrib_eq_order(
160
+ cmp, eq, order, True
161
+ )
162
+
163
+ if hash is not None and hash is not True and hash is not False:
164
+ msg = "Invalid value for hash. Must be True, False, or None."
165
+ raise TypeError(msg)
166
+
167
+ if factory is not None:
168
+ if default is not NOTHING:
169
+ msg = (
170
+ "The `default` and `factory` arguments are mutually exclusive."
171
+ )
172
+ raise ValueError(msg)
173
+ if not callable(factory):
174
+ msg = "The `factory` argument must be a callable."
175
+ raise ValueError(msg)
176
+ default = Factory(factory)
177
+
178
+ if metadata is None:
179
+ metadata = {}
180
+
181
+ # Apply syntactic sugar by auto-wrapping.
182
+ if isinstance(on_setattr, (list, tuple)):
183
+ on_setattr = setters.pipe(*on_setattr)
184
+
185
+ if validator and isinstance(validator, (list, tuple)):
186
+ validator = and_(*validator)
187
+
188
+ if converter and isinstance(converter, (list, tuple)):
189
+ converter = pipe(*converter)
190
+
191
+ return _CountingAttr(
192
+ default=default,
193
+ validator=validator,
194
+ repr=repr,
195
+ cmp=None,
196
+ hash=hash,
197
+ init=init,
198
+ converter=converter,
199
+ metadata=metadata,
200
+ type=type,
201
+ kw_only=kw_only,
202
+ eq=eq,
203
+ eq_key=eq_key,
204
+ order=order,
205
+ order_key=order_key,
206
+ on_setattr=on_setattr,
207
+ alias=alias,
208
+ )
209
+
210
+
211
+ def _compile_and_eval(script, globs, locs=None, filename=""):
212
+ """
213
+ Evaluate the script with the given global (globs) and local (locs)
214
+ variables.
215
+ """
216
+ bytecode = compile(script, filename, "exec")
217
+ eval(bytecode, globs, locs)
218
+
219
+
220
+ def _make_method(name, script, filename, globs, locals=None):
221
+ """
222
+ Create the method with the script given and return the method object.
223
+ """
224
+ locs = {} if locals is None else locals
225
+
226
+ # In order of debuggers like PDB being able to step through the code,
227
+ # we add a fake linecache entry.
228
+ count = 1
229
+ base_filename = filename
230
+ while True:
231
+ linecache_tuple = (
232
+ len(script),
233
+ None,
234
+ script.splitlines(True),
235
+ filename,
236
+ )
237
+ old_val = linecache.cache.setdefault(filename, linecache_tuple)
238
+ if old_val == linecache_tuple:
239
+ break
240
+
241
+ filename = f"{base_filename[:-1]}-{count}>"
242
+ count += 1
243
+
244
+ _compile_and_eval(script, globs, locs, filename)
245
+
246
+ return locs[name]
247
+
248
+
249
+ def _make_attr_tuple_class(cls_name, attr_names):
250
+ """
251
+ Create a tuple subclass to hold `Attribute`s for an `attrs` class.
252
+
253
+ The subclass is a bare tuple with properties for names.
254
+
255
+ class MyClassAttributes(tuple):
256
+ __slots__ = ()
257
+ x = property(itemgetter(0))
258
+ """
259
+ attr_class_name = f"{cls_name}Attributes"
260
+ attr_class_template = [
261
+ f"class {attr_class_name}(tuple):",
262
+ " __slots__ = ()",
263
+ ]
264
+ if attr_names:
265
+ for i, attr_name in enumerate(attr_names):
266
+ attr_class_template.append(
267
+ f" {attr_name} = _attrs_property(_attrs_itemgetter({i}))"
268
+ )
269
+ else:
270
+ attr_class_template.append(" pass")
271
+ globs = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
272
+ _compile_and_eval("\n".join(attr_class_template), globs)
273
+ return globs[attr_class_name]
274
+
275
+
276
+ # Tuple class for extracted attributes from a class definition.
277
+ # `base_attrs` is a subset of `attrs`.
278
+ _Attributes = _make_attr_tuple_class(
279
+ "_Attributes",
280
+ [
281
+ # all attributes to build dunder methods for
282
+ "attrs",
283
+ # attributes that have been inherited
284
+ "base_attrs",
285
+ # map inherited attributes to their originating classes
286
+ "base_attrs_map",
287
+ ],
288
+ )
289
+
290
+
291
+ def _is_class_var(annot):
292
+ """
293
+ Check whether *annot* is a typing.ClassVar.
294
+
295
+ The string comparison hack is used to avoid evaluating all string
296
+ annotations which would put attrs-based classes at a performance
297
+ disadvantage compared to plain old classes.
298
+ """
299
+ annot = str(annot)
300
+
301
+ # Annotation can be quoted.
302
+ if annot.startswith(("'", '"')) and annot.endswith(("'", '"')):
303
+ annot = annot[1:-1]
304
+
305
+ return annot.startswith(_CLASSVAR_PREFIXES)
306
+
307
+
308
+ def _has_own_attribute(cls, attrib_name):
309
+ """
310
+ Check whether *cls* defines *attrib_name* (and doesn't just inherit it).
311
+ """
312
+ return attrib_name in cls.__dict__
313
+
314
+
315
+ def _collect_base_attrs(cls, taken_attr_names):
316
+ """
317
+ Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
318
+ """
319
+ base_attrs = []
320
+ base_attr_map = {} # A dictionary of base attrs to their classes.
321
+
322
+ # Traverse the MRO and collect attributes.
323
+ for base_cls in reversed(cls.__mro__[1:-1]):
324
+ for a in getattr(base_cls, "__attrs_attrs__", []):
325
+ if a.inherited or a.name in taken_attr_names:
326
+ continue
327
+
328
+ a = a.evolve(inherited=True) # noqa: PLW2901
329
+ base_attrs.append(a)
330
+ base_attr_map[a.name] = base_cls
331
+
332
+ # For each name, only keep the freshest definition i.e. the furthest at the
333
+ # back. base_attr_map is fine because it gets overwritten with every new
334
+ # instance.
335
+ filtered = []
336
+ seen = set()
337
+ for a in reversed(base_attrs):
338
+ if a.name in seen:
339
+ continue
340
+ filtered.insert(0, a)
341
+ seen.add(a.name)
342
+
343
+ return filtered, base_attr_map
344
+
345
+
346
+ def _collect_base_attrs_broken(cls, taken_attr_names):
347
+ """
348
+ Collect attr.ibs from base classes of *cls*, except *taken_attr_names*.
349
+
350
+ N.B. *taken_attr_names* will be mutated.
351
+
352
+ Adhere to the old incorrect behavior.
353
+
354
+ Notably it collects from the front and considers inherited attributes which
355
+ leads to the buggy behavior reported in #428.
356
+ """
357
+ base_attrs = []
358
+ base_attr_map = {} # A dictionary of base attrs to their classes.
359
+
360
+ # Traverse the MRO and collect attributes.
361
+ for base_cls in cls.__mro__[1:-1]:
362
+ for a in getattr(base_cls, "__attrs_attrs__", []):
363
+ if a.name in taken_attr_names:
364
+ continue
365
+
366
+ a = a.evolve(inherited=True) # noqa: PLW2901
367
+ taken_attr_names.add(a.name)
368
+ base_attrs.append(a)
369
+ base_attr_map[a.name] = base_cls
370
+
371
+ return base_attrs, base_attr_map
372
+
373
+
374
+ def _transform_attrs(
375
+ cls, these, auto_attribs, kw_only, collect_by_mro, field_transformer
376
+ ):
377
+ """
378
+ Transform all `_CountingAttr`s on a class into `Attribute`s.
379
+
380
+ If *these* is passed, use that and don't look for them on the class.
381
+
382
+ If *collect_by_mro* is True, collect them in the correct MRO order,
383
+ otherwise use the old -- incorrect -- order. See #428.
384
+
385
+ Return an `_Attributes`.
386
+ """
387
+ cd = cls.__dict__
388
+ anns = _get_annotations(cls)
389
+
390
+ if these is not None:
391
+ ca_list = list(these.items())
392
+ elif auto_attribs is True:
393
+ ca_names = {
394
+ name
395
+ for name, attr in cd.items()
396
+ if isinstance(attr, _CountingAttr)
397
+ }
398
+ ca_list = []
399
+ annot_names = set()
400
+ for attr_name, type in anns.items():
401
+ if _is_class_var(type):
402
+ continue
403
+ annot_names.add(attr_name)
404
+ a = cd.get(attr_name, NOTHING)
405
+
406
+ if not isinstance(a, _CountingAttr):
407
+ a = attrib() if a is NOTHING else attrib(default=a)
408
+ ca_list.append((attr_name, a))
409
+
410
+ unannotated = ca_names - annot_names
411
+ if len(unannotated) > 0:
412
+ raise UnannotatedAttributeError(
413
+ "The following `attr.ib`s lack a type annotation: "
414
+ + ", ".join(
415
+ sorted(unannotated, key=lambda n: cd.get(n).counter)
416
+ )
417
+ + "."
418
+ )
419
+ else:
420
+ ca_list = sorted(
421
+ (
422
+ (name, attr)
423
+ for name, attr in cd.items()
424
+ if isinstance(attr, _CountingAttr)
425
+ ),
426
+ key=lambda e: e[1].counter,
427
+ )
428
+
429
+ own_attrs = [
430
+ Attribute.from_counting_attr(
431
+ name=attr_name, ca=ca, type=anns.get(attr_name)
432
+ )
433
+ for attr_name, ca in ca_list
434
+ ]
435
+
436
+ if collect_by_mro:
437
+ base_attrs, base_attr_map = _collect_base_attrs(
438
+ cls, {a.name for a in own_attrs}
439
+ )
440
+ else:
441
+ base_attrs, base_attr_map = _collect_base_attrs_broken(
442
+ cls, {a.name for a in own_attrs}
443
+ )
444
+
445
+ if kw_only:
446
+ own_attrs = [a.evolve(kw_only=True) for a in own_attrs]
447
+ base_attrs = [a.evolve(kw_only=True) for a in base_attrs]
448
+
449
+ attrs = base_attrs + own_attrs
450
+
451
+ # Mandatory vs non-mandatory attr order only matters when they are part of
452
+ # the __init__ signature and when they aren't kw_only (which are moved to
453
+ # the end and can be mandatory or non-mandatory in any order, as they will
454
+ # be specified as keyword args anyway). Check the order of those attrs:
455
+ had_default = False
456
+ for a in (a for a in attrs if a.init is not False and a.kw_only is False):
457
+ if had_default is True and a.default is NOTHING:
458
+ msg = f"No mandatory attributes allowed after an attribute with a default value or factory. Attribute in question: {a!r}"
459
+ raise ValueError(msg)
460
+
461
+ if had_default is False and a.default is not NOTHING:
462
+ had_default = True
463
+
464
+ if field_transformer is not None:
465
+ attrs = field_transformer(cls, attrs)
466
+
467
+ # Resolve default field alias after executing field_transformer.
468
+ # This allows field_transformer to differentiate between explicit vs
469
+ # default aliases and supply their own defaults.
470
+ attrs = [
471
+ a.evolve(alias=_default_init_alias_for(a.name)) if not a.alias else a
472
+ for a in attrs
473
+ ]
474
+
475
+ # Create AttrsClass *after* applying the field_transformer since it may
476
+ # add or remove attributes!
477
+ attr_names = [a.name for a in attrs]
478
+ AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
479
+
480
+ return _Attributes((AttrsClass(attrs), base_attrs, base_attr_map))
481
+
482
+
483
+ def _make_cached_property_getattr(cached_properties, original_getattr, cls):
484
+ lines = [
485
+ # Wrapped to get `__class__` into closure cell for super()
486
+ # (It will be replaced with the newly constructed class after construction).
487
+ "def wrapper(_cls):",
488
+ " __class__ = _cls",
489
+ " def __getattr__(self, item, cached_properties=cached_properties, original_getattr=original_getattr, _cached_setattr_get=_cached_setattr_get):",
490
+ " func = cached_properties.get(item)",
491
+ " if func is not None:",
492
+ " result = func(self)",
493
+ " _setter = _cached_setattr_get(self)",
494
+ " _setter(item, result)",
495
+ " return result",
496
+ ]
497
+ if original_getattr is not None:
498
+ lines.append(
499
+ " return original_getattr(self, item)",
500
+ )
501
+ else:
502
+ lines.extend(
503
+ [
504
+ " try:",
505
+ " return super().__getattribute__(item)",
506
+ " except AttributeError:",
507
+ " if not hasattr(super(), '__getattr__'):",
508
+ " raise",
509
+ " return super().__getattr__(item)",
510
+ " original_error = f\"'{self.__class__.__name__}' object has no attribute '{item}'\"",
511
+ " raise AttributeError(original_error)",
512
+ ]
513
+ )
514
+
515
+ lines.extend(
516
+ [
517
+ " return __getattr__",
518
+ "__getattr__ = wrapper(_cls)",
519
+ ]
520
+ )
521
+
522
+ unique_filename = _generate_unique_filename(cls, "getattr")
523
+
524
+ glob = {
525
+ "cached_properties": cached_properties,
526
+ "_cached_setattr_get": _OBJ_SETATTR.__get__,
527
+ "original_getattr": original_getattr,
528
+ }
529
+
530
+ return _make_method(
531
+ "__getattr__",
532
+ "\n".join(lines),
533
+ unique_filename,
534
+ glob,
535
+ locals={
536
+ "_cls": cls,
537
+ },
538
+ )
539
+
540
+
541
+ def _frozen_setattrs(self, name, value):
542
+ """
543
+ Attached to frozen classes as __setattr__.
544
+ """
545
+ if isinstance(self, BaseException) and name in (
546
+ "__cause__",
547
+ "__context__",
548
+ "__traceback__",
549
+ "__suppress_context__",
550
+ "__notes__",
551
+ ):
552
+ BaseException.__setattr__(self, name, value)
553
+ return
554
+
555
+ raise FrozenInstanceError
556
+
557
+
558
+ def _frozen_delattrs(self, name):
559
+ """
560
+ Attached to frozen classes as __delattr__.
561
+ """
562
+ if isinstance(self, BaseException) and name in ("__notes__",):
563
+ BaseException.__delattr__(self, name)
564
+ return
565
+
566
+ raise FrozenInstanceError
567
+
568
+
569
+ def evolve(*args, **changes):
570
+ """
571
+ Create a new instance, based on the first positional argument with
572
+ *changes* applied.
573
+
574
+ .. tip::
575
+
576
+ On Python 3.13 and later, you can also use `copy.replace` instead.
577
+
578
+ Args:
579
+
580
+ inst:
581
+ Instance of a class with *attrs* attributes. *inst* must be passed
582
+ as a positional argument.
583
+
584
+ changes:
585
+ Keyword changes in the new copy.
586
+
587
+ Returns:
588
+ A copy of inst with *changes* incorporated.
589
+
590
+ Raises:
591
+ TypeError:
592
+ If *attr_name* couldn't be found in the class ``__init__``.
593
+
594
+ attrs.exceptions.NotAnAttrsClassError:
595
+ If *cls* is not an *attrs* class.
596
+
597
+ .. versionadded:: 17.1.0
598
+ .. deprecated:: 23.1.0
599
+ It is now deprecated to pass the instance using the keyword argument
600
+ *inst*. It will raise a warning until at least April 2024, after which
601
+ it will become an error. Always pass the instance as a positional
602
+ argument.
603
+ .. versionchanged:: 24.1.0
604
+ *inst* can't be passed as a keyword argument anymore.
605
+ """
606
+ try:
607
+ (inst,) = args
608
+ except ValueError:
609
+ msg = (
610
+ f"evolve() takes 1 positional argument, but {len(args)} were given"
611
+ )
612
+ raise TypeError(msg) from None
613
+
614
+ cls = inst.__class__
615
+ attrs = fields(cls)
616
+ for a in attrs:
617
+ if not a.init:
618
+ continue
619
+ attr_name = a.name # To deal with private attributes.
620
+ init_name = a.alias
621
+ if init_name not in changes:
622
+ changes[init_name] = getattr(inst, attr_name)
623
+
624
+ return cls(**changes)
625
+
626
+
627
+ class _ClassBuilder:
628
+ """
629
+ Iteratively build *one* class.
630
+ """
631
+
632
+ __slots__ = (
633
+ "_attr_names",
634
+ "_attrs",
635
+ "_base_attr_map",
636
+ "_base_names",
637
+ "_cache_hash",
638
+ "_cls",
639
+ "_cls_dict",
640
+ "_delete_attribs",
641
+ "_frozen",
642
+ "_has_custom_setattr",
643
+ "_has_post_init",
644
+ "_has_pre_init",
645
+ "_is_exc",
646
+ "_on_setattr",
647
+ "_pre_init_has_args",
648
+ "_slots",
649
+ "_weakref_slot",
650
+ "_wrote_own_setattr",
651
+ )
652
+
653
+ def __init__(
654
+ self,
655
+ cls,
656
+ these,
657
+ slots,
658
+ frozen,
659
+ weakref_slot,
660
+ getstate_setstate,
661
+ auto_attribs,
662
+ kw_only,
663
+ cache_hash,
664
+ is_exc,
665
+ collect_by_mro,
666
+ on_setattr,
667
+ has_custom_setattr,
668
+ field_transformer,
669
+ ):
670
+ attrs, base_attrs, base_map = _transform_attrs(
671
+ cls,
672
+ these,
673
+ auto_attribs,
674
+ kw_only,
675
+ collect_by_mro,
676
+ field_transformer,
677
+ )
678
+
679
+ self._cls = cls
680
+ self._cls_dict = dict(cls.__dict__) if slots else {}
681
+ self._attrs = attrs
682
+ self._base_names = {a.name for a in base_attrs}
683
+ self._base_attr_map = base_map
684
+ self._attr_names = tuple(a.name for a in attrs)
685
+ self._slots = slots
686
+ self._frozen = frozen
687
+ self._weakref_slot = weakref_slot
688
+ self._cache_hash = cache_hash
689
+ self._has_pre_init = bool(getattr(cls, "__attrs_pre_init__", False))
690
+ self._pre_init_has_args = False
691
+ if self._has_pre_init:
692
+ # Check if the pre init method has more arguments than just `self`
693
+ # We want to pass arguments if pre init expects arguments
694
+ pre_init_func = cls.__attrs_pre_init__
695
+ pre_init_signature = inspect.signature(pre_init_func)
696
+ self._pre_init_has_args = len(pre_init_signature.parameters) > 1
697
+ self._has_post_init = bool(getattr(cls, "__attrs_post_init__", False))
698
+ self._delete_attribs = not bool(these)
699
+ self._is_exc = is_exc
700
+ self._on_setattr = on_setattr
701
+
702
+ self._has_custom_setattr = has_custom_setattr
703
+ self._wrote_own_setattr = False
704
+
705
+ self._cls_dict["__attrs_attrs__"] = self._attrs
706
+
707
+ if frozen:
708
+ self._cls_dict["__setattr__"] = _frozen_setattrs
709
+ self._cls_dict["__delattr__"] = _frozen_delattrs
710
+
711
+ self._wrote_own_setattr = True
712
+ elif on_setattr in (
713
+ _DEFAULT_ON_SETATTR,
714
+ setters.validate,
715
+ setters.convert,
716
+ ):
717
+ has_validator = has_converter = False
718
+ for a in attrs:
719
+ if a.validator is not None:
720
+ has_validator = True
721
+ if a.converter is not None:
722
+ has_converter = True
723
+
724
+ if has_validator and has_converter:
725
+ break
726
+ if (
727
+ (
728
+ on_setattr == _DEFAULT_ON_SETATTR
729
+ and not (has_validator or has_converter)
730
+ )
731
+ or (on_setattr == setters.validate and not has_validator)
732
+ or (on_setattr == setters.convert and not has_converter)
733
+ ):
734
+ # If class-level on_setattr is set to convert + validate, but
735
+ # there's no field to convert or validate, pretend like there's
736
+ # no on_setattr.
737
+ self._on_setattr = None
738
+
739
+ if getstate_setstate:
740
+ (
741
+ self._cls_dict["__getstate__"],
742
+ self._cls_dict["__setstate__"],
743
+ ) = self._make_getstate_setstate()
744
+
745
+ def __repr__(self):
746
+ return f"<_ClassBuilder(cls={self._cls.__name__})>"
747
+
748
+ def build_class(self):
749
+ """
750
+ Finalize class based on the accumulated configuration.
751
+
752
+ Builder cannot be used after calling this method.
753
+ """
754
+ if self._slots is True:
755
+ cls = self._create_slots_class()
756
+ else:
757
+ cls = self._patch_original_class()
758
+ if PY_3_10_PLUS:
759
+ cls = abc.update_abstractmethods(cls)
760
+
761
+ # The method gets only called if it's not inherited from a base class.
762
+ # _has_own_attribute does NOT work properly for classmethods.
763
+ if (
764
+ getattr(cls, "__attrs_init_subclass__", None)
765
+ and "__attrs_init_subclass__" not in cls.__dict__
766
+ ):
767
+ cls.__attrs_init_subclass__()
768
+
769
+ return cls
770
+
771
+ def _patch_original_class(self):
772
+ """
773
+ Apply accumulated methods and return the class.
774
+ """
775
+ cls = self._cls
776
+ base_names = self._base_names
777
+
778
+ # Clean class of attribute definitions (`attr.ib()`s).
779
+ if self._delete_attribs:
780
+ for name in self._attr_names:
781
+ if (
782
+ name not in base_names
783
+ and getattr(cls, name, _SENTINEL) is not _SENTINEL
784
+ ):
785
+ # An AttributeError can happen if a base class defines a
786
+ # class variable and we want to set an attribute with the
787
+ # same name by using only a type annotation.
788
+ with contextlib.suppress(AttributeError):
789
+ delattr(cls, name)
790
+
791
+ # Attach our dunder methods.
792
+ for name, value in self._cls_dict.items():
793
+ setattr(cls, name, value)
794
+
795
+ # If we've inherited an attrs __setattr__ and don't write our own,
796
+ # reset it to object's.
797
+ if not self._wrote_own_setattr and getattr(
798
+ cls, "__attrs_own_setattr__", False
799
+ ):
800
+ cls.__attrs_own_setattr__ = False
801
+
802
+ if not self._has_custom_setattr:
803
+ cls.__setattr__ = _OBJ_SETATTR
804
+
805
+ return cls
806
+
807
+ def _create_slots_class(self):
808
+ """
809
+ Build and return a new class with a `__slots__` attribute.
810
+ """
811
+ cd = {
812
+ k: v
813
+ for k, v in self._cls_dict.items()
814
+ if k not in (*tuple(self._attr_names), "__dict__", "__weakref__")
815
+ }
816
+
817
+ # If our class doesn't have its own implementation of __setattr__
818
+ # (either from the user or by us), check the bases, if one of them has
819
+ # an attrs-made __setattr__, that needs to be reset. We don't walk the
820
+ # MRO because we only care about our immediate base classes.
821
+ # XXX: This can be confused by subclassing a slotted attrs class with
822
+ # XXX: a non-attrs class and subclass the resulting class with an attrs
823
+ # XXX: class. See `test_slotted_confused` for details. For now that's
824
+ # XXX: OK with us.
825
+ if not self._wrote_own_setattr:
826
+ cd["__attrs_own_setattr__"] = False
827
+
828
+ if not self._has_custom_setattr:
829
+ for base_cls in self._cls.__bases__:
830
+ if base_cls.__dict__.get("__attrs_own_setattr__", False):
831
+ cd["__setattr__"] = _OBJ_SETATTR
832
+ break
833
+
834
+ # Traverse the MRO to collect existing slots
835
+ # and check for an existing __weakref__.
836
+ existing_slots = {}
837
+ weakref_inherited = False
838
+ for base_cls in self._cls.__mro__[1:-1]:
839
+ if base_cls.__dict__.get("__weakref__", None) is not None:
840
+ weakref_inherited = True
841
+ existing_slots.update(
842
+ {
843
+ name: getattr(base_cls, name)
844
+ for name in getattr(base_cls, "__slots__", [])
845
+ }
846
+ )
847
+
848
+ base_names = set(self._base_names)
849
+
850
+ names = self._attr_names
851
+ if (
852
+ self._weakref_slot
853
+ and "__weakref__" not in getattr(self._cls, "__slots__", ())
854
+ and "__weakref__" not in names
855
+ and not weakref_inherited
856
+ ):
857
+ names += ("__weakref__",)
858
+
859
+ cached_properties = {
860
+ name: cached_property.func
861
+ for name, cached_property in cd.items()
862
+ if isinstance(cached_property, functools.cached_property)
863
+ }
864
+
865
+ # Collect methods with a `__class__` reference that are shadowed in the new class.
866
+ # To know to update them.
867
+ additional_closure_functions_to_update = []
868
+ if cached_properties:
869
+ class_annotations = _get_annotations(self._cls)
870
+ for name, func in cached_properties.items():
871
+ # Add cached properties to names for slotting.
872
+ names += (name,)
873
+ # Clear out function from class to avoid clashing.
874
+ del cd[name]
875
+ additional_closure_functions_to_update.append(func)
876
+ annotation = inspect.signature(func).return_annotation
877
+ if annotation is not inspect.Parameter.empty:
878
+ class_annotations[name] = annotation
879
+
880
+ original_getattr = cd.get("__getattr__")
881
+ if original_getattr is not None:
882
+ additional_closure_functions_to_update.append(original_getattr)
883
+
884
+ cd["__getattr__"] = _make_cached_property_getattr(
885
+ cached_properties, original_getattr, self._cls
886
+ )
887
+
888
+ # We only add the names of attributes that aren't inherited.
889
+ # Setting __slots__ to inherited attributes wastes memory.
890
+ slot_names = [name for name in names if name not in base_names]
891
+
892
+ # There are slots for attributes from current class
893
+ # that are defined in parent classes.
894
+ # As their descriptors may be overridden by a child class,
895
+ # we collect them here and update the class dict
896
+ reused_slots = {
897
+ slot: slot_descriptor
898
+ for slot, slot_descriptor in existing_slots.items()
899
+ if slot in slot_names
900
+ }
901
+ slot_names = [name for name in slot_names if name not in reused_slots]
902
+ cd.update(reused_slots)
903
+ if self._cache_hash:
904
+ slot_names.append(_HASH_CACHE_FIELD)
905
+
906
+ cd["__slots__"] = tuple(slot_names)
907
+
908
+ cd["__qualname__"] = self._cls.__qualname__
909
+
910
+ # Create new class based on old class and our methods.
911
+ cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd)
912
+
913
+ # The following is a fix for
914
+ # <https://github.com/python-attrs/attrs/issues/102>.
915
+ # If a method mentions `__class__` or uses the no-arg super(), the
916
+ # compiler will bake a reference to the class in the method itself
917
+ # as `method.__closure__`. Since we replace the class with a
918
+ # clone, we rewrite these references so it keeps working.
919
+ for item in itertools.chain(
920
+ cls.__dict__.values(), additional_closure_functions_to_update
921
+ ):
922
+ if isinstance(item, (classmethod, staticmethod)):
923
+ # Class- and staticmethods hide their functions inside.
924
+ # These might need to be rewritten as well.
925
+ closure_cells = getattr(item.__func__, "__closure__", None)
926
+ elif isinstance(item, property):
927
+ # Workaround for property `super()` shortcut (PY3-only).
928
+ # There is no universal way for other descriptors.
929
+ closure_cells = getattr(item.fget, "__closure__", None)
930
+ else:
931
+ closure_cells = getattr(item, "__closure__", None)
932
+
933
+ if not closure_cells: # Catch None or the empty list.
934
+ continue
935
+ for cell in closure_cells:
936
+ try:
937
+ match = cell.cell_contents is self._cls
938
+ except ValueError: # noqa: PERF203
939
+ # ValueError: Cell is empty
940
+ pass
941
+ else:
942
+ if match:
943
+ cell.cell_contents = cls
944
+ return cls
945
+
946
+ def add_repr(self, ns):
947
+ self._cls_dict["__repr__"] = self._add_method_dunders(
948
+ _make_repr(self._attrs, ns, self._cls)
949
+ )
950
+ return self
951
+
952
+ def add_str(self):
953
+ repr = self._cls_dict.get("__repr__")
954
+ if repr is None:
955
+ msg = "__str__ can only be generated if a __repr__ exists."
956
+ raise ValueError(msg)
957
+
958
+ def __str__(self):
959
+ return self.__repr__()
960
+
961
+ self._cls_dict["__str__"] = self._add_method_dunders(__str__)
962
+ return self
963
+
964
+ def _make_getstate_setstate(self):
965
+ """
966
+ Create custom __setstate__ and __getstate__ methods.
967
+ """
968
+ # __weakref__ is not writable.
969
+ state_attr_names = tuple(
970
+ an for an in self._attr_names if an != "__weakref__"
971
+ )
972
+
973
+ def slots_getstate(self):
974
+ """
975
+ Automatically created by attrs.
976
+ """
977
+ return {name: getattr(self, name) for name in state_attr_names}
978
+
979
+ hash_caching_enabled = self._cache_hash
980
+
981
+ def slots_setstate(self, state):
982
+ """
983
+ Automatically created by attrs.
984
+ """
985
+ __bound_setattr = _OBJ_SETATTR.__get__(self)
986
+ if isinstance(state, tuple):
987
+ # Backward compatibility with attrs instances pickled with
988
+ # attrs versions before v22.2.0 which stored tuples.
989
+ for name, value in zip(state_attr_names, state):
990
+ __bound_setattr(name, value)
991
+ else:
992
+ for name in state_attr_names:
993
+ if name in state:
994
+ __bound_setattr(name, state[name])
995
+
996
+ # The hash code cache is not included when the object is
997
+ # serialized, but it still needs to be initialized to None to
998
+ # indicate that the first call to __hash__ should be a cache
999
+ # miss.
1000
+ if hash_caching_enabled:
1001
+ __bound_setattr(_HASH_CACHE_FIELD, None)
1002
+
1003
+ return slots_getstate, slots_setstate
1004
+
1005
+ def make_unhashable(self):
1006
+ self._cls_dict["__hash__"] = None
1007
+ return self
1008
+
1009
+ def add_hash(self):
1010
+ self._cls_dict["__hash__"] = self._add_method_dunders(
1011
+ _make_hash(
1012
+ self._cls,
1013
+ self._attrs,
1014
+ frozen=self._frozen,
1015
+ cache_hash=self._cache_hash,
1016
+ )
1017
+ )
1018
+
1019
+ return self
1020
+
1021
+ def add_init(self):
1022
+ self._cls_dict["__init__"] = self._add_method_dunders(
1023
+ _make_init(
1024
+ self._cls,
1025
+ self._attrs,
1026
+ self._has_pre_init,
1027
+ self._pre_init_has_args,
1028
+ self._has_post_init,
1029
+ self._frozen,
1030
+ self._slots,
1031
+ self._cache_hash,
1032
+ self._base_attr_map,
1033
+ self._is_exc,
1034
+ self._on_setattr,
1035
+ attrs_init=False,
1036
+ )
1037
+ )
1038
+
1039
+ return self
1040
+
1041
+ def add_replace(self):
1042
+ self._cls_dict["__replace__"] = self._add_method_dunders(
1043
+ lambda self, **changes: evolve(self, **changes)
1044
+ )
1045
+ return self
1046
+
1047
+ def add_match_args(self):
1048
+ self._cls_dict["__match_args__"] = tuple(
1049
+ field.name
1050
+ for field in self._attrs
1051
+ if field.init and not field.kw_only
1052
+ )
1053
+
1054
+ def add_attrs_init(self):
1055
+ self._cls_dict["__attrs_init__"] = self._add_method_dunders(
1056
+ _make_init(
1057
+ self._cls,
1058
+ self._attrs,
1059
+ self._has_pre_init,
1060
+ self._pre_init_has_args,
1061
+ self._has_post_init,
1062
+ self._frozen,
1063
+ self._slots,
1064
+ self._cache_hash,
1065
+ self._base_attr_map,
1066
+ self._is_exc,
1067
+ self._on_setattr,
1068
+ attrs_init=True,
1069
+ )
1070
+ )
1071
+
1072
+ return self
1073
+
1074
+ def add_eq(self):
1075
+ cd = self._cls_dict
1076
+
1077
+ cd["__eq__"] = self._add_method_dunders(
1078
+ _make_eq(self._cls, self._attrs)
1079
+ )
1080
+ cd["__ne__"] = self._add_method_dunders(_make_ne())
1081
+
1082
+ return self
1083
+
1084
+ def add_order(self):
1085
+ cd = self._cls_dict
1086
+
1087
+ cd["__lt__"], cd["__le__"], cd["__gt__"], cd["__ge__"] = (
1088
+ self._add_method_dunders(meth)
1089
+ for meth in _make_order(self._cls, self._attrs)
1090
+ )
1091
+
1092
+ return self
1093
+
1094
+ def add_setattr(self):
1095
+ if self._frozen:
1096
+ return self
1097
+
1098
+ sa_attrs = {}
1099
+ for a in self._attrs:
1100
+ on_setattr = a.on_setattr or self._on_setattr
1101
+ if on_setattr and on_setattr is not setters.NO_OP:
1102
+ sa_attrs[a.name] = a, on_setattr
1103
+
1104
+ if not sa_attrs:
1105
+ return self
1106
+
1107
+ if self._has_custom_setattr:
1108
+ # We need to write a __setattr__ but there already is one!
1109
+ msg = "Can't combine custom __setattr__ with on_setattr hooks."
1110
+ raise ValueError(msg)
1111
+
1112
+ # docstring comes from _add_method_dunders
1113
+ def __setattr__(self, name, val):
1114
+ try:
1115
+ a, hook = sa_attrs[name]
1116
+ except KeyError:
1117
+ nval = val
1118
+ else:
1119
+ nval = hook(self, a, val)
1120
+
1121
+ _OBJ_SETATTR(self, name, nval)
1122
+
1123
+ self._cls_dict["__attrs_own_setattr__"] = True
1124
+ self._cls_dict["__setattr__"] = self._add_method_dunders(__setattr__)
1125
+ self._wrote_own_setattr = True
1126
+
1127
+ return self
1128
+
1129
+ def _add_method_dunders(self, method):
1130
+ """
1131
+ Add __module__ and __qualname__ to a *method* if possible.
1132
+ """
1133
+ with contextlib.suppress(AttributeError):
1134
+ method.__module__ = self._cls.__module__
1135
+
1136
+ with contextlib.suppress(AttributeError):
1137
+ method.__qualname__ = f"{self._cls.__qualname__}.{method.__name__}"
1138
+
1139
+ with contextlib.suppress(AttributeError):
1140
+ method.__doc__ = (
1141
+ "Method generated by attrs for class "
1142
+ f"{self._cls.__qualname__}."
1143
+ )
1144
+
1145
+ return method
1146
+
1147
+
1148
+ def _determine_attrs_eq_order(cmp, eq, order, default_eq):
1149
+ """
1150
+ Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
1151
+ values of eq and order. If *eq* is None, set it to *default_eq*.
1152
+ """
1153
+ if cmp is not None and any((eq is not None, order is not None)):
1154
+ msg = "Don't mix `cmp` with `eq' and `order`."
1155
+ raise ValueError(msg)
1156
+
1157
+ # cmp takes precedence due to bw-compatibility.
1158
+ if cmp is not None:
1159
+ return cmp, cmp
1160
+
1161
+ # If left None, equality is set to the specified default and ordering
1162
+ # mirrors equality.
1163
+ if eq is None:
1164
+ eq = default_eq
1165
+
1166
+ if order is None:
1167
+ order = eq
1168
+
1169
+ if eq is False and order is True:
1170
+ msg = "`order` can only be True if `eq` is True too."
1171
+ raise ValueError(msg)
1172
+
1173
+ return eq, order
1174
+
1175
+
1176
+ def _determine_attrib_eq_order(cmp, eq, order, default_eq):
1177
+ """
1178
+ Validate the combination of *cmp*, *eq*, and *order*. Derive the effective
1179
+ values of eq and order. If *eq* is None, set it to *default_eq*.
1180
+ """
1181
+ if cmp is not None and any((eq is not None, order is not None)):
1182
+ msg = "Don't mix `cmp` with `eq' and `order`."
1183
+ raise ValueError(msg)
1184
+
1185
+ def decide_callable_or_boolean(value):
1186
+ """
1187
+ Decide whether a key function is used.
1188
+ """
1189
+ if callable(value):
1190
+ value, key = True, value
1191
+ else:
1192
+ key = None
1193
+ return value, key
1194
+
1195
+ # cmp takes precedence due to bw-compatibility.
1196
+ if cmp is not None:
1197
+ cmp, cmp_key = decide_callable_or_boolean(cmp)
1198
+ return cmp, cmp_key, cmp, cmp_key
1199
+
1200
+ # If left None, equality is set to the specified default and ordering
1201
+ # mirrors equality.
1202
+ if eq is None:
1203
+ eq, eq_key = default_eq, None
1204
+ else:
1205
+ eq, eq_key = decide_callable_or_boolean(eq)
1206
+
1207
+ if order is None:
1208
+ order, order_key = eq, eq_key
1209
+ else:
1210
+ order, order_key = decide_callable_or_boolean(order)
1211
+
1212
+ if eq is False and order is True:
1213
+ msg = "`order` can only be True if `eq` is True too."
1214
+ raise ValueError(msg)
1215
+
1216
+ return eq, eq_key, order, order_key
1217
+
1218
+
1219
+ def _determine_whether_to_implement(
1220
+ cls, flag, auto_detect, dunders, default=True
1221
+ ):
1222
+ """
1223
+ Check whether we should implement a set of methods for *cls*.
1224
+
1225
+ *flag* is the argument passed into @attr.s like 'init', *auto_detect* the
1226
+ same as passed into @attr.s and *dunders* is a tuple of attribute names
1227
+ whose presence signal that the user has implemented it themselves.
1228
+
1229
+ Return *default* if no reason for either for or against is found.
1230
+ """
1231
+ if flag is True or flag is False:
1232
+ return flag
1233
+
1234
+ if flag is None and auto_detect is False:
1235
+ return default
1236
+
1237
+ # Logically, flag is None and auto_detect is True here.
1238
+ for dunder in dunders:
1239
+ if _has_own_attribute(cls, dunder):
1240
+ return False
1241
+
1242
+ return default
1243
+
1244
+
1245
+ def attrs(
1246
+ maybe_cls=None,
1247
+ these=None,
1248
+ repr_ns=None,
1249
+ repr=None,
1250
+ cmp=None,
1251
+ hash=None,
1252
+ init=None,
1253
+ slots=False,
1254
+ frozen=False,
1255
+ weakref_slot=True,
1256
+ str=False,
1257
+ auto_attribs=False,
1258
+ kw_only=False,
1259
+ cache_hash=False,
1260
+ auto_exc=False,
1261
+ eq=None,
1262
+ order=None,
1263
+ auto_detect=False,
1264
+ collect_by_mro=False,
1265
+ getstate_setstate=None,
1266
+ on_setattr=None,
1267
+ field_transformer=None,
1268
+ match_args=True,
1269
+ unsafe_hash=None,
1270
+ ):
1271
+ r"""
1272
+ A class decorator that adds :term:`dunder methods` according to the
1273
+ specified attributes using `attr.ib` or the *these* argument.
1274
+
1275
+ Consider using `attrs.define` / `attrs.frozen` in new code (``attr.s`` will
1276
+ *never* go away, though).
1277
+
1278
+ Args:
1279
+ repr_ns (str):
1280
+ When using nested classes, there was no way in Python 2 to
1281
+ automatically detect that. This argument allows to set a custom
1282
+ name for a more meaningful ``repr`` output. This argument is
1283
+ pointless in Python 3 and is therefore deprecated.
1284
+
1285
+ .. caution::
1286
+ Refer to `attrs.define` for the rest of the parameters, but note that they
1287
+ can have different defaults.
1288
+
1289
+ Notably, leaving *on_setattr* as `None` will **not** add any hooks.
1290
+
1291
+ .. versionadded:: 16.0.0 *slots*
1292
+ .. versionadded:: 16.1.0 *frozen*
1293
+ .. versionadded:: 16.3.0 *str*
1294
+ .. versionadded:: 16.3.0 Support for ``__attrs_post_init__``.
1295
+ .. versionchanged:: 17.1.0
1296
+ *hash* supports `None` as value which is also the default now.
1297
+ .. versionadded:: 17.3.0 *auto_attribs*
1298
+ .. versionchanged:: 18.1.0
1299
+ If *these* is passed, no attributes are deleted from the class body.
1300
+ .. versionchanged:: 18.1.0 If *these* is ordered, the order is retained.
1301
+ .. versionadded:: 18.2.0 *weakref_slot*
1302
+ .. deprecated:: 18.2.0
1303
+ ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a
1304
+ `DeprecationWarning` if the classes compared are subclasses of
1305
+ each other. ``__eq`` and ``__ne__`` never tried to compared subclasses
1306
+ to each other.
1307
+ .. versionchanged:: 19.2.0
1308
+ ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now do not consider
1309
+ subclasses comparable anymore.
1310
+ .. versionadded:: 18.2.0 *kw_only*
1311
+ .. versionadded:: 18.2.0 *cache_hash*
1312
+ .. versionadded:: 19.1.0 *auto_exc*
1313
+ .. deprecated:: 19.2.0 *cmp* Removal on or after 2021-06-01.
1314
+ .. versionadded:: 19.2.0 *eq* and *order*
1315
+ .. versionadded:: 20.1.0 *auto_detect*
1316
+ .. versionadded:: 20.1.0 *collect_by_mro*
1317
+ .. versionadded:: 20.1.0 *getstate_setstate*
1318
+ .. versionadded:: 20.1.0 *on_setattr*
1319
+ .. versionadded:: 20.3.0 *field_transformer*
1320
+ .. versionchanged:: 21.1.0
1321
+ ``init=False`` injects ``__attrs_init__``
1322
+ .. versionchanged:: 21.1.0 Support for ``__attrs_pre_init__``
1323
+ .. versionchanged:: 21.1.0 *cmp* undeprecated
1324
+ .. versionadded:: 21.3.0 *match_args*
1325
+ .. versionadded:: 22.2.0
1326
+ *unsafe_hash* as an alias for *hash* (for :pep:`681` compliance).
1327
+ .. deprecated:: 24.1.0 *repr_ns*
1328
+ .. versionchanged:: 24.1.0
1329
+ Instances are not compared as tuples of attributes anymore, but using a
1330
+ big ``and`` condition. This is faster and has more correct behavior for
1331
+ uncomparable values like `math.nan`.
1332
+ .. versionadded:: 24.1.0
1333
+ If a class has an *inherited* classmethod called
1334
+ ``__attrs_init_subclass__``, it is executed after the class is created.
1335
+ .. deprecated:: 24.1.0 *hash* is deprecated in favor of *unsafe_hash*.
1336
+ """
1337
+ if repr_ns is not None:
1338
+ import warnings
1339
+
1340
+ warnings.warn(
1341
+ DeprecationWarning(
1342
+ "The `repr_ns` argument is deprecated and will be removed in or after August 2025."
1343
+ ),
1344
+ stacklevel=2,
1345
+ )
1346
+
1347
+ eq_, order_ = _determine_attrs_eq_order(cmp, eq, order, None)
1348
+
1349
+ # unsafe_hash takes precedence due to PEP 681.
1350
+ if unsafe_hash is not None:
1351
+ hash = unsafe_hash
1352
+
1353
+ if isinstance(on_setattr, (list, tuple)):
1354
+ on_setattr = setters.pipe(*on_setattr)
1355
+
1356
+ def wrap(cls):
1357
+ is_frozen = frozen or _has_frozen_base_class(cls)
1358
+ is_exc = auto_exc is True and issubclass(cls, BaseException)
1359
+ has_own_setattr = auto_detect and _has_own_attribute(
1360
+ cls, "__setattr__"
1361
+ )
1362
+
1363
+ if has_own_setattr and is_frozen:
1364
+ msg = "Can't freeze a class with a custom __setattr__."
1365
+ raise ValueError(msg)
1366
+
1367
+ builder = _ClassBuilder(
1368
+ cls,
1369
+ these,
1370
+ slots,
1371
+ is_frozen,
1372
+ weakref_slot,
1373
+ _determine_whether_to_implement(
1374
+ cls,
1375
+ getstate_setstate,
1376
+ auto_detect,
1377
+ ("__getstate__", "__setstate__"),
1378
+ default=slots,
1379
+ ),
1380
+ auto_attribs,
1381
+ kw_only,
1382
+ cache_hash,
1383
+ is_exc,
1384
+ collect_by_mro,
1385
+ on_setattr,
1386
+ has_own_setattr,
1387
+ field_transformer,
1388
+ )
1389
+ if _determine_whether_to_implement(
1390
+ cls, repr, auto_detect, ("__repr__",)
1391
+ ):
1392
+ builder.add_repr(repr_ns)
1393
+ if str is True:
1394
+ builder.add_str()
1395
+
1396
+ eq = _determine_whether_to_implement(
1397
+ cls, eq_, auto_detect, ("__eq__", "__ne__")
1398
+ )
1399
+ if not is_exc and eq is True:
1400
+ builder.add_eq()
1401
+ if not is_exc and _determine_whether_to_implement(
1402
+ cls, order_, auto_detect, ("__lt__", "__le__", "__gt__", "__ge__")
1403
+ ):
1404
+ builder.add_order()
1405
+
1406
+ builder.add_setattr()
1407
+
1408
+ nonlocal hash
1409
+ if (
1410
+ hash is None
1411
+ and auto_detect is True
1412
+ and _has_own_attribute(cls, "__hash__")
1413
+ ):
1414
+ hash = False
1415
+
1416
+ if hash is not True and hash is not False and hash is not None:
1417
+ # Can't use `hash in` because 1 == True for example.
1418
+ msg = "Invalid value for hash. Must be True, False, or None."
1419
+ raise TypeError(msg)
1420
+
1421
+ if hash is False or (hash is None and eq is False) or is_exc:
1422
+ # Don't do anything. Should fall back to __object__'s __hash__
1423
+ # which is by id.
1424
+ if cache_hash:
1425
+ msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
1426
+ raise TypeError(msg)
1427
+ elif hash is True or (
1428
+ hash is None and eq is True and is_frozen is True
1429
+ ):
1430
+ # Build a __hash__ if told so, or if it's safe.
1431
+ builder.add_hash()
1432
+ else:
1433
+ # Raise TypeError on attempts to hash.
1434
+ if cache_hash:
1435
+ msg = "Invalid value for cache_hash. To use hash caching, hashing must be either explicitly or implicitly enabled."
1436
+ raise TypeError(msg)
1437
+ builder.make_unhashable()
1438
+
1439
+ if _determine_whether_to_implement(
1440
+ cls, init, auto_detect, ("__init__",)
1441
+ ):
1442
+ builder.add_init()
1443
+ else:
1444
+ builder.add_attrs_init()
1445
+ if cache_hash:
1446
+ msg = "Invalid value for cache_hash. To use hash caching, init must be True."
1447
+ raise TypeError(msg)
1448
+
1449
+ if PY_3_13_PLUS and not _has_own_attribute(cls, "__replace__"):
1450
+ builder.add_replace()
1451
+
1452
+ if (
1453
+ PY_3_10_PLUS
1454
+ and match_args
1455
+ and not _has_own_attribute(cls, "__match_args__")
1456
+ ):
1457
+ builder.add_match_args()
1458
+
1459
+ return builder.build_class()
1460
+
1461
+ # maybe_cls's type depends on the usage of the decorator. It's a class
1462
+ # if it's used as `@attrs` but `None` if used as `@attrs()`.
1463
+ if maybe_cls is None:
1464
+ return wrap
1465
+
1466
+ return wrap(maybe_cls)
1467
+
1468
+
1469
+ _attrs = attrs
1470
+ """
1471
+ Internal alias so we can use it in functions that take an argument called
1472
+ *attrs*.
1473
+ """
1474
+
1475
+
1476
+ def _has_frozen_base_class(cls):
1477
+ """
1478
+ Check whether *cls* has a frozen ancestor by looking at its
1479
+ __setattr__.
1480
+ """
1481
+ return cls.__setattr__ is _frozen_setattrs
1482
+
1483
+
1484
+ def _generate_unique_filename(cls, func_name):
1485
+ """
1486
+ Create a "filename" suitable for a function being generated.
1487
+ """
1488
+ return (
1489
+ f"<attrs generated {func_name} {cls.__module__}."
1490
+ f"{getattr(cls, '__qualname__', cls.__name__)}>"
1491
+ )
1492
+
1493
+
1494
+ def _make_hash(cls, attrs, frozen, cache_hash):
1495
+ attrs = tuple(
1496
+ a for a in attrs if a.hash is True or (a.hash is None and a.eq is True)
1497
+ )
1498
+
1499
+ tab = " "
1500
+
1501
+ unique_filename = _generate_unique_filename(cls, "hash")
1502
+ type_hash = hash(unique_filename)
1503
+ # If eq is custom generated, we need to include the functions in globs
1504
+ globs = {}
1505
+
1506
+ hash_def = "def __hash__(self"
1507
+ hash_func = "hash(("
1508
+ closing_braces = "))"
1509
+ if not cache_hash:
1510
+ hash_def += "):"
1511
+ else:
1512
+ hash_def += ", *"
1513
+
1514
+ hash_def += ", _cache_wrapper=__import__('attr._make')._make._CacheHashWrapper):"
1515
+ hash_func = "_cache_wrapper(" + hash_func
1516
+ closing_braces += ")"
1517
+
1518
+ method_lines = [hash_def]
1519
+
1520
+ def append_hash_computation_lines(prefix, indent):
1521
+ """
1522
+ Generate the code for actually computing the hash code.
1523
+ Below this will either be returned directly or used to compute
1524
+ a value which is then cached, depending on the value of cache_hash
1525
+ """
1526
+
1527
+ method_lines.extend(
1528
+ [
1529
+ indent + prefix + hash_func,
1530
+ indent + f" {type_hash},",
1531
+ ]
1532
+ )
1533
+
1534
+ for a in attrs:
1535
+ if a.eq_key:
1536
+ cmp_name = f"_{a.name}_key"
1537
+ globs[cmp_name] = a.eq_key
1538
+ method_lines.append(
1539
+ indent + f" {cmp_name}(self.{a.name}),"
1540
+ )
1541
+ else:
1542
+ method_lines.append(indent + f" self.{a.name},")
1543
+
1544
+ method_lines.append(indent + " " + closing_braces)
1545
+
1546
+ if cache_hash:
1547
+ method_lines.append(tab + f"if self.{_HASH_CACHE_FIELD} is None:")
1548
+ if frozen:
1549
+ append_hash_computation_lines(
1550
+ f"object.__setattr__(self, '{_HASH_CACHE_FIELD}', ", tab * 2
1551
+ )
1552
+ method_lines.append(tab * 2 + ")") # close __setattr__
1553
+ else:
1554
+ append_hash_computation_lines(
1555
+ f"self.{_HASH_CACHE_FIELD} = ", tab * 2
1556
+ )
1557
+ method_lines.append(tab + f"return self.{_HASH_CACHE_FIELD}")
1558
+ else:
1559
+ append_hash_computation_lines("return ", tab)
1560
+
1561
+ script = "\n".join(method_lines)
1562
+ return _make_method("__hash__", script, unique_filename, globs)
1563
+
1564
+
1565
+ def _add_hash(cls, attrs):
1566
+ """
1567
+ Add a hash method to *cls*.
1568
+ """
1569
+ cls.__hash__ = _make_hash(cls, attrs, frozen=False, cache_hash=False)
1570
+ return cls
1571
+
1572
+
1573
+ def _make_ne():
1574
+ """
1575
+ Create __ne__ method.
1576
+ """
1577
+
1578
+ def __ne__(self, other):
1579
+ """
1580
+ Check equality and either forward a NotImplemented or
1581
+ return the result negated.
1582
+ """
1583
+ result = self.__eq__(other)
1584
+ if result is NotImplemented:
1585
+ return NotImplemented
1586
+
1587
+ return not result
1588
+
1589
+ return __ne__
1590
+
1591
+
1592
+ def _make_eq(cls, attrs):
1593
+ """
1594
+ Create __eq__ method for *cls* with *attrs*.
1595
+ """
1596
+ attrs = [a for a in attrs if a.eq]
1597
+
1598
+ unique_filename = _generate_unique_filename(cls, "eq")
1599
+ lines = [
1600
+ "def __eq__(self, other):",
1601
+ " if other.__class__ is not self.__class__:",
1602
+ " return NotImplemented",
1603
+ ]
1604
+
1605
+ globs = {}
1606
+ if attrs:
1607
+ lines.append(" return (")
1608
+ for a in attrs:
1609
+ if a.eq_key:
1610
+ cmp_name = f"_{a.name}_key"
1611
+ # Add the key function to the global namespace
1612
+ # of the evaluated function.
1613
+ globs[cmp_name] = a.eq_key
1614
+ lines.append(
1615
+ f" {cmp_name}(self.{a.name}) == {cmp_name}(other.{a.name})"
1616
+ )
1617
+ else:
1618
+ lines.append(f" self.{a.name} == other.{a.name}")
1619
+ if a is not attrs[-1]:
1620
+ lines[-1] = f"{lines[-1]} and"
1621
+ lines.append(" )")
1622
+ else:
1623
+ lines.append(" return True")
1624
+
1625
+ script = "\n".join(lines)
1626
+
1627
+ return _make_method("__eq__", script, unique_filename, globs)
1628
+
1629
+
1630
+ def _make_order(cls, attrs):
1631
+ """
1632
+ Create ordering methods for *cls* with *attrs*.
1633
+ """
1634
+ attrs = [a for a in attrs if a.order]
1635
+
1636
+ def attrs_to_tuple(obj):
1637
+ """
1638
+ Save us some typing.
1639
+ """
1640
+ return tuple(
1641
+ key(value) if key else value
1642
+ for value, key in (
1643
+ (getattr(obj, a.name), a.order_key) for a in attrs
1644
+ )
1645
+ )
1646
+
1647
+ def __lt__(self, other):
1648
+ """
1649
+ Automatically created by attrs.
1650
+ """
1651
+ if other.__class__ is self.__class__:
1652
+ return attrs_to_tuple(self) < attrs_to_tuple(other)
1653
+
1654
+ return NotImplemented
1655
+
1656
+ def __le__(self, other):
1657
+ """
1658
+ Automatically created by attrs.
1659
+ """
1660
+ if other.__class__ is self.__class__:
1661
+ return attrs_to_tuple(self) <= attrs_to_tuple(other)
1662
+
1663
+ return NotImplemented
1664
+
1665
+ def __gt__(self, other):
1666
+ """
1667
+ Automatically created by attrs.
1668
+ """
1669
+ if other.__class__ is self.__class__:
1670
+ return attrs_to_tuple(self) > attrs_to_tuple(other)
1671
+
1672
+ return NotImplemented
1673
+
1674
+ def __ge__(self, other):
1675
+ """
1676
+ Automatically created by attrs.
1677
+ """
1678
+ if other.__class__ is self.__class__:
1679
+ return attrs_to_tuple(self) >= attrs_to_tuple(other)
1680
+
1681
+ return NotImplemented
1682
+
1683
+ return __lt__, __le__, __gt__, __ge__
1684
+
1685
+
1686
+ def _add_eq(cls, attrs=None):
1687
+ """
1688
+ Add equality methods to *cls* with *attrs*.
1689
+ """
1690
+ if attrs is None:
1691
+ attrs = cls.__attrs_attrs__
1692
+
1693
+ cls.__eq__ = _make_eq(cls, attrs)
1694
+ cls.__ne__ = _make_ne()
1695
+
1696
+ return cls
1697
+
1698
+
1699
+ def _make_repr(attrs, ns, cls):
1700
+ unique_filename = _generate_unique_filename(cls, "repr")
1701
+ # Figure out which attributes to include, and which function to use to
1702
+ # format them. The a.repr value can be either bool or a custom
1703
+ # callable.
1704
+ attr_names_with_reprs = tuple(
1705
+ (a.name, (repr if a.repr is True else a.repr), a.init)
1706
+ for a in attrs
1707
+ if a.repr is not False
1708
+ )
1709
+ globs = {
1710
+ name + "_repr": r for name, r, _ in attr_names_with_reprs if r != repr
1711
+ }
1712
+ globs["_compat"] = _compat
1713
+ globs["AttributeError"] = AttributeError
1714
+ globs["NOTHING"] = NOTHING
1715
+ attribute_fragments = []
1716
+ for name, r, i in attr_names_with_reprs:
1717
+ accessor = (
1718
+ "self." + name if i else 'getattr(self, "' + name + '", NOTHING)'
1719
+ )
1720
+ fragment = (
1721
+ "%s={%s!r}" % (name, accessor)
1722
+ if r == repr
1723
+ else "%s={%s_repr(%s)}" % (name, name, accessor)
1724
+ )
1725
+ attribute_fragments.append(fragment)
1726
+ repr_fragment = ", ".join(attribute_fragments)
1727
+
1728
+ if ns is None:
1729
+ cls_name_fragment = '{self.__class__.__qualname__.rsplit(">.", 1)[-1]}'
1730
+ else:
1731
+ cls_name_fragment = ns + ".{self.__class__.__name__}"
1732
+
1733
+ lines = [
1734
+ "def __repr__(self):",
1735
+ " try:",
1736
+ " already_repring = _compat.repr_context.already_repring",
1737
+ " except AttributeError:",
1738
+ " already_repring = {id(self),}",
1739
+ " _compat.repr_context.already_repring = already_repring",
1740
+ " else:",
1741
+ " if id(self) in already_repring:",
1742
+ " return '...'",
1743
+ " else:",
1744
+ " already_repring.add(id(self))",
1745
+ " try:",
1746
+ f" return f'{cls_name_fragment}({repr_fragment})'",
1747
+ " finally:",
1748
+ " already_repring.remove(id(self))",
1749
+ ]
1750
+
1751
+ return _make_method(
1752
+ "__repr__", "\n".join(lines), unique_filename, globs=globs
1753
+ )
1754
+
1755
+
1756
+ def _add_repr(cls, ns=None, attrs=None):
1757
+ """
1758
+ Add a repr method to *cls*.
1759
+ """
1760
+ if attrs is None:
1761
+ attrs = cls.__attrs_attrs__
1762
+
1763
+ cls.__repr__ = _make_repr(attrs, ns, cls)
1764
+ return cls
1765
+
1766
+
1767
+ def fields(cls):
1768
+ """
1769
+ Return the tuple of *attrs* attributes for a class.
1770
+
1771
+ The tuple also allows accessing the fields by their names (see below for
1772
+ examples).
1773
+
1774
+ Args:
1775
+ cls (type): Class to introspect.
1776
+
1777
+ Raises:
1778
+ TypeError: If *cls* is not a class.
1779
+
1780
+ attrs.exceptions.NotAnAttrsClassError:
1781
+ If *cls* is not an *attrs* class.
1782
+
1783
+ Returns:
1784
+ tuple (with name accessors) of `attrs.Attribute`
1785
+
1786
+ .. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
1787
+ by name.
1788
+ .. versionchanged:: 23.1.0 Add support for generic classes.
1789
+ """
1790
+ generic_base = get_generic_base(cls)
1791
+
1792
+ if generic_base is None and not isinstance(cls, type):
1793
+ msg = "Passed object must be a class."
1794
+ raise TypeError(msg)
1795
+
1796
+ attrs = getattr(cls, "__attrs_attrs__", None)
1797
+
1798
+ if attrs is None:
1799
+ if generic_base is not None:
1800
+ attrs = getattr(generic_base, "__attrs_attrs__", None)
1801
+ if attrs is not None:
1802
+ # Even though this is global state, stick it on here to speed
1803
+ # it up. We rely on `cls` being cached for this to be
1804
+ # efficient.
1805
+ cls.__attrs_attrs__ = attrs
1806
+ return attrs
1807
+ msg = f"{cls!r} is not an attrs-decorated class."
1808
+ raise NotAnAttrsClassError(msg)
1809
+
1810
+ return attrs
1811
+
1812
+
1813
+ def fields_dict(cls):
1814
+ """
1815
+ Return an ordered dictionary of *attrs* attributes for a class, whose keys
1816
+ are the attribute names.
1817
+
1818
+ Args:
1819
+ cls (type): Class to introspect.
1820
+
1821
+ Raises:
1822
+ TypeError: If *cls* is not a class.
1823
+
1824
+ attrs.exceptions.NotAnAttrsClassError:
1825
+ If *cls* is not an *attrs* class.
1826
+
1827
+ Returns:
1828
+ dict[str, attrs.Attribute]: Dict of attribute name to definition
1829
+
1830
+ .. versionadded:: 18.1.0
1831
+ """
1832
+ if not isinstance(cls, type):
1833
+ msg = "Passed object must be a class."
1834
+ raise TypeError(msg)
1835
+ attrs = getattr(cls, "__attrs_attrs__", None)
1836
+ if attrs is None:
1837
+ msg = f"{cls!r} is not an attrs-decorated class."
1838
+ raise NotAnAttrsClassError(msg)
1839
+ return {a.name: a for a in attrs}
1840
+
1841
+
1842
+ def validate(inst):
1843
+ """
1844
+ Validate all attributes on *inst* that have a validator.
1845
+
1846
+ Leaves all exceptions through.
1847
+
1848
+ Args:
1849
+ inst: Instance of a class with *attrs* attributes.
1850
+ """
1851
+ if _config._run_validators is False:
1852
+ return
1853
+
1854
+ for a in fields(inst.__class__):
1855
+ v = a.validator
1856
+ if v is not None:
1857
+ v(inst, a, getattr(inst, a.name))
1858
+
1859
+
1860
+ def _is_slot_attr(a_name, base_attr_map):
1861
+ """
1862
+ Check if the attribute name comes from a slot class.
1863
+ """
1864
+ cls = base_attr_map.get(a_name)
1865
+ return cls and "__slots__" in cls.__dict__
1866
+
1867
+
1868
+ def _make_init(
1869
+ cls,
1870
+ attrs,
1871
+ pre_init,
1872
+ pre_init_has_args,
1873
+ post_init,
1874
+ frozen,
1875
+ slots,
1876
+ cache_hash,
1877
+ base_attr_map,
1878
+ is_exc,
1879
+ cls_on_setattr,
1880
+ attrs_init,
1881
+ ):
1882
+ has_cls_on_setattr = (
1883
+ cls_on_setattr is not None and cls_on_setattr is not setters.NO_OP
1884
+ )
1885
+
1886
+ if frozen and has_cls_on_setattr:
1887
+ msg = "Frozen classes can't use on_setattr."
1888
+ raise ValueError(msg)
1889
+
1890
+ needs_cached_setattr = cache_hash or frozen
1891
+ filtered_attrs = []
1892
+ attr_dict = {}
1893
+ for a in attrs:
1894
+ if not a.init and a.default is NOTHING:
1895
+ continue
1896
+
1897
+ filtered_attrs.append(a)
1898
+ attr_dict[a.name] = a
1899
+
1900
+ if a.on_setattr is not None:
1901
+ if frozen is True:
1902
+ msg = "Frozen classes can't use on_setattr."
1903
+ raise ValueError(msg)
1904
+
1905
+ needs_cached_setattr = True
1906
+ elif has_cls_on_setattr and a.on_setattr is not setters.NO_OP:
1907
+ needs_cached_setattr = True
1908
+
1909
+ unique_filename = _generate_unique_filename(cls, "init")
1910
+
1911
+ script, globs, annotations = _attrs_to_init_script(
1912
+ filtered_attrs,
1913
+ frozen,
1914
+ slots,
1915
+ pre_init,
1916
+ pre_init_has_args,
1917
+ post_init,
1918
+ cache_hash,
1919
+ base_attr_map,
1920
+ is_exc,
1921
+ needs_cached_setattr,
1922
+ has_cls_on_setattr,
1923
+ "__attrs_init__" if attrs_init else "__init__",
1924
+ )
1925
+ if cls.__module__ in sys.modules:
1926
+ # This makes typing.get_type_hints(CLS.__init__) resolve string types.
1927
+ globs.update(sys.modules[cls.__module__].__dict__)
1928
+
1929
+ globs.update({"NOTHING": NOTHING, "attr_dict": attr_dict})
1930
+
1931
+ if needs_cached_setattr:
1932
+ # Save the lookup overhead in __init__ if we need to circumvent
1933
+ # setattr hooks.
1934
+ globs["_cached_setattr_get"] = _OBJ_SETATTR.__get__
1935
+
1936
+ init = _make_method(
1937
+ "__attrs_init__" if attrs_init else "__init__",
1938
+ script,
1939
+ unique_filename,
1940
+ globs,
1941
+ )
1942
+ init.__annotations__ = annotations
1943
+
1944
+ return init
1945
+
1946
+
1947
+ def _setattr(attr_name: str, value_var: str, has_on_setattr: bool) -> str:
1948
+ """
1949
+ Use the cached object.setattr to set *attr_name* to *value_var*.
1950
+ """
1951
+ return f"_setattr('{attr_name}', {value_var})"
1952
+
1953
+
1954
+ def _setattr_with_converter(
1955
+ attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
1956
+ ) -> str:
1957
+ """
1958
+ Use the cached object.setattr to set *attr_name* to *value_var*, but run
1959
+ its converter first.
1960
+ """
1961
+ return f"_setattr('{attr_name}', {converter._fmt_converter_call(attr_name, value_var)})"
1962
+
1963
+
1964
+ def _assign(attr_name: str, value: str, has_on_setattr: bool) -> str:
1965
+ """
1966
+ Unless *attr_name* has an on_setattr hook, use normal assignment. Otherwise
1967
+ relegate to _setattr.
1968
+ """
1969
+ if has_on_setattr:
1970
+ return _setattr(attr_name, value, True)
1971
+
1972
+ return f"self.{attr_name} = {value}"
1973
+
1974
+
1975
+ def _assign_with_converter(
1976
+ attr_name: str, value_var: str, has_on_setattr: bool, converter: Converter
1977
+ ) -> str:
1978
+ """
1979
+ Unless *attr_name* has an on_setattr hook, use normal assignment after
1980
+ conversion. Otherwise relegate to _setattr_with_converter.
1981
+ """
1982
+ if has_on_setattr:
1983
+ return _setattr_with_converter(attr_name, value_var, True, converter)
1984
+
1985
+ return f"self.{attr_name} = {converter._fmt_converter_call(attr_name, value_var)}"
1986
+
1987
+
1988
+ def _determine_setters(
1989
+ frozen: bool, slots: bool, base_attr_map: dict[str, type]
1990
+ ):
1991
+ """
1992
+ Determine the correct setter functions based on whether a class is frozen
1993
+ and/or slotted.
1994
+ """
1995
+ if frozen is True:
1996
+ if slots is True:
1997
+ return (), _setattr, _setattr_with_converter
1998
+
1999
+ # Dict frozen classes assign directly to __dict__.
2000
+ # But only if the attribute doesn't come from an ancestor slot
2001
+ # class.
2002
+ # Note _inst_dict will be used again below if cache_hash is True
2003
+
2004
+ def fmt_setter(
2005
+ attr_name: str, value_var: str, has_on_setattr: bool
2006
+ ) -> str:
2007
+ if _is_slot_attr(attr_name, base_attr_map):
2008
+ return _setattr(attr_name, value_var, has_on_setattr)
2009
+
2010
+ return f"_inst_dict['{attr_name}'] = {value_var}"
2011
+
2012
+ def fmt_setter_with_converter(
2013
+ attr_name: str,
2014
+ value_var: str,
2015
+ has_on_setattr: bool,
2016
+ converter: Converter,
2017
+ ) -> str:
2018
+ if has_on_setattr or _is_slot_attr(attr_name, base_attr_map):
2019
+ return _setattr_with_converter(
2020
+ attr_name, value_var, has_on_setattr, converter
2021
+ )
2022
+
2023
+ return f"_inst_dict['{attr_name}'] = {converter._fmt_converter_call(attr_name, value_var)}"
2024
+
2025
+ return (
2026
+ ("_inst_dict = self.__dict__",),
2027
+ fmt_setter,
2028
+ fmt_setter_with_converter,
2029
+ )
2030
+
2031
+ # Not frozen -- we can just assign directly.
2032
+ return (), _assign, _assign_with_converter
2033
+
2034
+
2035
+ def _attrs_to_init_script(
2036
+ attrs: list[Attribute],
2037
+ is_frozen: bool,
2038
+ is_slotted: bool,
2039
+ call_pre_init: bool,
2040
+ pre_init_has_args: bool,
2041
+ call_post_init: bool,
2042
+ does_cache_hash: bool,
2043
+ base_attr_map: dict[str, type],
2044
+ is_exc: bool,
2045
+ needs_cached_setattr: bool,
2046
+ has_cls_on_setattr: bool,
2047
+ method_name: str,
2048
+ ) -> tuple[str, dict, dict]:
2049
+ """
2050
+ Return a script of an initializer for *attrs*, a dict of globals, and
2051
+ annotations for the initializer.
2052
+
2053
+ The globals are required by the generated script.
2054
+ """
2055
+ lines = ["self.__attrs_pre_init__()"] if call_pre_init else []
2056
+
2057
+ if needs_cached_setattr:
2058
+ lines.append(
2059
+ # Circumvent the __setattr__ descriptor to save one lookup per
2060
+ # assignment. Note _setattr will be used again below if
2061
+ # does_cache_hash is True.
2062
+ "_setattr = _cached_setattr_get(self)"
2063
+ )
2064
+
2065
+ extra_lines, fmt_setter, fmt_setter_with_converter = _determine_setters(
2066
+ is_frozen, is_slotted, base_attr_map
2067
+ )
2068
+ lines.extend(extra_lines)
2069
+
2070
+ args = []
2071
+ kw_only_args = []
2072
+ attrs_to_validate = []
2073
+
2074
+ # This is a dictionary of names to validator and converter callables.
2075
+ # Injecting this into __init__ globals lets us avoid lookups.
2076
+ names_for_globals = {}
2077
+ annotations = {"return": None}
2078
+
2079
+ for a in attrs:
2080
+ if a.validator:
2081
+ attrs_to_validate.append(a)
2082
+
2083
+ attr_name = a.name
2084
+ has_on_setattr = a.on_setattr is not None or (
2085
+ a.on_setattr is not setters.NO_OP and has_cls_on_setattr
2086
+ )
2087
+ # a.alias is set to maybe-mangled attr_name in _ClassBuilder if not
2088
+ # explicitly provided
2089
+ arg_name = a.alias
2090
+
2091
+ has_factory = isinstance(a.default, Factory)
2092
+ maybe_self = "self" if has_factory and a.default.takes_self else ""
2093
+
2094
+ if a.converter is not None and not isinstance(a.converter, Converter):
2095
+ converter = Converter(a.converter)
2096
+ else:
2097
+ converter = a.converter
2098
+
2099
+ if a.init is False:
2100
+ if has_factory:
2101
+ init_factory_name = _INIT_FACTORY_PAT % (a.name,)
2102
+ if converter is not None:
2103
+ lines.append(
2104
+ fmt_setter_with_converter(
2105
+ attr_name,
2106
+ init_factory_name + f"({maybe_self})",
2107
+ has_on_setattr,
2108
+ converter,
2109
+ )
2110
+ )
2111
+ names_for_globals[converter._get_global_name(a.name)] = (
2112
+ converter.converter
2113
+ )
2114
+ else:
2115
+ lines.append(
2116
+ fmt_setter(
2117
+ attr_name,
2118
+ init_factory_name + f"({maybe_self})",
2119
+ has_on_setattr,
2120
+ )
2121
+ )
2122
+ names_for_globals[init_factory_name] = a.default.factory
2123
+ elif converter is not None:
2124
+ lines.append(
2125
+ fmt_setter_with_converter(
2126
+ attr_name,
2127
+ f"attr_dict['{attr_name}'].default",
2128
+ has_on_setattr,
2129
+ converter,
2130
+ )
2131
+ )
2132
+ names_for_globals[converter._get_global_name(a.name)] = (
2133
+ converter.converter
2134
+ )
2135
+ else:
2136
+ lines.append(
2137
+ fmt_setter(
2138
+ attr_name,
2139
+ f"attr_dict['{attr_name}'].default",
2140
+ has_on_setattr,
2141
+ )
2142
+ )
2143
+ elif a.default is not NOTHING and not has_factory:
2144
+ arg = f"{arg_name}=attr_dict['{attr_name}'].default"
2145
+ if a.kw_only:
2146
+ kw_only_args.append(arg)
2147
+ else:
2148
+ args.append(arg)
2149
+
2150
+ if converter is not None:
2151
+ lines.append(
2152
+ fmt_setter_with_converter(
2153
+ attr_name, arg_name, has_on_setattr, converter
2154
+ )
2155
+ )
2156
+ names_for_globals[converter._get_global_name(a.name)] = (
2157
+ converter.converter
2158
+ )
2159
+ else:
2160
+ lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
2161
+
2162
+ elif has_factory:
2163
+ arg = f"{arg_name}=NOTHING"
2164
+ if a.kw_only:
2165
+ kw_only_args.append(arg)
2166
+ else:
2167
+ args.append(arg)
2168
+ lines.append(f"if {arg_name} is not NOTHING:")
2169
+
2170
+ init_factory_name = _INIT_FACTORY_PAT % (a.name,)
2171
+ if converter is not None:
2172
+ lines.append(
2173
+ " "
2174
+ + fmt_setter_with_converter(
2175
+ attr_name, arg_name, has_on_setattr, converter
2176
+ )
2177
+ )
2178
+ lines.append("else:")
2179
+ lines.append(
2180
+ " "
2181
+ + fmt_setter_with_converter(
2182
+ attr_name,
2183
+ init_factory_name + "(" + maybe_self + ")",
2184
+ has_on_setattr,
2185
+ converter,
2186
+ )
2187
+ )
2188
+ names_for_globals[converter._get_global_name(a.name)] = (
2189
+ converter.converter
2190
+ )
2191
+ else:
2192
+ lines.append(
2193
+ " " + fmt_setter(attr_name, arg_name, has_on_setattr)
2194
+ )
2195
+ lines.append("else:")
2196
+ lines.append(
2197
+ " "
2198
+ + fmt_setter(
2199
+ attr_name,
2200
+ init_factory_name + "(" + maybe_self + ")",
2201
+ has_on_setattr,
2202
+ )
2203
+ )
2204
+ names_for_globals[init_factory_name] = a.default.factory
2205
+ else:
2206
+ if a.kw_only:
2207
+ kw_only_args.append(arg_name)
2208
+ else:
2209
+ args.append(arg_name)
2210
+
2211
+ if converter is not None:
2212
+ lines.append(
2213
+ fmt_setter_with_converter(
2214
+ attr_name, arg_name, has_on_setattr, converter
2215
+ )
2216
+ )
2217
+ names_for_globals[converter._get_global_name(a.name)] = (
2218
+ converter.converter
2219
+ )
2220
+ else:
2221
+ lines.append(fmt_setter(attr_name, arg_name, has_on_setattr))
2222
+
2223
+ if a.init is True:
2224
+ if a.type is not None and converter is None:
2225
+ annotations[arg_name] = a.type
2226
+ elif converter is not None and converter._first_param_type:
2227
+ # Use the type from the converter if present.
2228
+ annotations[arg_name] = converter._first_param_type
2229
+
2230
+ if attrs_to_validate: # we can skip this if there are no validators.
2231
+ names_for_globals["_config"] = _config
2232
+ lines.append("if _config._run_validators is True:")
2233
+ for a in attrs_to_validate:
2234
+ val_name = "__attr_validator_" + a.name
2235
+ attr_name = "__attr_" + a.name
2236
+ lines.append(f" {val_name}(self, {attr_name}, self.{a.name})")
2237
+ names_for_globals[val_name] = a.validator
2238
+ names_for_globals[attr_name] = a
2239
+
2240
+ if call_post_init:
2241
+ lines.append("self.__attrs_post_init__()")
2242
+
2243
+ # Because this is set only after __attrs_post_init__ is called, a crash
2244
+ # will result if post-init tries to access the hash code. This seemed
2245
+ # preferable to setting this beforehand, in which case alteration to field
2246
+ # values during post-init combined with post-init accessing the hash code
2247
+ # would result in silent bugs.
2248
+ if does_cache_hash:
2249
+ if is_frozen:
2250
+ if is_slotted:
2251
+ init_hash_cache = f"_setattr('{_HASH_CACHE_FIELD}', None)"
2252
+ else:
2253
+ init_hash_cache = f"_inst_dict['{_HASH_CACHE_FIELD}'] = None"
2254
+ else:
2255
+ init_hash_cache = f"self.{_HASH_CACHE_FIELD} = None"
2256
+ lines.append(init_hash_cache)
2257
+
2258
+ # For exceptions we rely on BaseException.__init__ for proper
2259
+ # initialization.
2260
+ if is_exc:
2261
+ vals = ",".join(f"self.{a.name}" for a in attrs if a.init)
2262
+
2263
+ lines.append(f"BaseException.__init__(self, {vals})")
2264
+
2265
+ args = ", ".join(args)
2266
+ pre_init_args = args
2267
+ if kw_only_args:
2268
+ # leading comma & kw_only args
2269
+ args += f"{', ' if args else ''}*, {', '.join(kw_only_args)}"
2270
+ pre_init_kw_only_args = ", ".join(
2271
+ [
2272
+ f"{kw_arg_name}={kw_arg_name}"
2273
+ # We need to remove the defaults from the kw_only_args.
2274
+ for kw_arg_name in (kwa.split("=")[0] for kwa in kw_only_args)
2275
+ ]
2276
+ )
2277
+ pre_init_args += ", " if pre_init_args else ""
2278
+ pre_init_args += pre_init_kw_only_args
2279
+
2280
+ if call_pre_init and pre_init_has_args:
2281
+ # If pre init method has arguments, pass same arguments as `__init__`.
2282
+ lines[0] = f"self.__attrs_pre_init__({pre_init_args})"
2283
+
2284
+ # Python <3.12 doesn't allow backslashes in f-strings.
2285
+ NL = "\n "
2286
+ return (
2287
+ f"""def {method_name}(self, {args}):
2288
+ {NL.join(lines) if lines else "pass"}
2289
+ """,
2290
+ names_for_globals,
2291
+ annotations,
2292
+ )
2293
+
2294
+
2295
+ def _default_init_alias_for(name: str) -> str:
2296
+ """
2297
+ The default __init__ parameter name for a field.
2298
+
2299
+ This performs private-name adjustment via leading-unscore stripping,
2300
+ and is the default value of Attribute.alias if not provided.
2301
+ """
2302
+
2303
+ return name.lstrip("_")
2304
+
2305
+
2306
+ class Attribute:
2307
+ """
2308
+ *Read-only* representation of an attribute.
2309
+
2310
+ .. warning::
2311
+
2312
+ You should never instantiate this class yourself.
2313
+
2314
+ The class has *all* arguments of `attr.ib` (except for ``factory`` which is
2315
+ only syntactic sugar for ``default=Factory(...)`` plus the following:
2316
+
2317
+ - ``name`` (`str`): The name of the attribute.
2318
+ - ``alias`` (`str`): The __init__ parameter name of the attribute, after
2319
+ any explicit overrides and default private-attribute-name handling.
2320
+ - ``inherited`` (`bool`): Whether or not that attribute has been inherited
2321
+ from a base class.
2322
+ - ``eq_key`` and ``order_key`` (`typing.Callable` or `None`): The
2323
+ callables that are used for comparing and ordering objects by this
2324
+ attribute, respectively. These are set by passing a callable to
2325
+ `attr.ib`'s ``eq``, ``order``, or ``cmp`` arguments. See also
2326
+ :ref:`comparison customization <custom-comparison>`.
2327
+
2328
+ Instances of this class are frequently used for introspection purposes
2329
+ like:
2330
+
2331
+ - `fields` returns a tuple of them.
2332
+ - Validators get them passed as the first argument.
2333
+ - The :ref:`field transformer <transform-fields>` hook receives a list of
2334
+ them.
2335
+ - The ``alias`` property exposes the __init__ parameter name of the field,
2336
+ with any overrides and default private-attribute handling applied.
2337
+
2338
+
2339
+ .. versionadded:: 20.1.0 *inherited*
2340
+ .. versionadded:: 20.1.0 *on_setattr*
2341
+ .. versionchanged:: 20.2.0 *inherited* is not taken into account for
2342
+ equality checks and hashing anymore.
2343
+ .. versionadded:: 21.1.0 *eq_key* and *order_key*
2344
+ .. versionadded:: 22.2.0 *alias*
2345
+
2346
+ For the full version history of the fields, see `attr.ib`.
2347
+ """
2348
+
2349
+ # These slots must NOT be reordered because we use them later for
2350
+ # instantiation.
2351
+ __slots__ = ( # noqa: RUF023
2352
+ "name",
2353
+ "default",
2354
+ "validator",
2355
+ "repr",
2356
+ "eq",
2357
+ "eq_key",
2358
+ "order",
2359
+ "order_key",
2360
+ "hash",
2361
+ "init",
2362
+ "metadata",
2363
+ "type",
2364
+ "converter",
2365
+ "kw_only",
2366
+ "inherited",
2367
+ "on_setattr",
2368
+ "alias",
2369
+ )
2370
+
2371
+ def __init__(
2372
+ self,
2373
+ name,
2374
+ default,
2375
+ validator,
2376
+ repr,
2377
+ cmp, # XXX: unused, remove along with other cmp code.
2378
+ hash,
2379
+ init,
2380
+ inherited,
2381
+ metadata=None,
2382
+ type=None,
2383
+ converter=None,
2384
+ kw_only=False,
2385
+ eq=None,
2386
+ eq_key=None,
2387
+ order=None,
2388
+ order_key=None,
2389
+ on_setattr=None,
2390
+ alias=None,
2391
+ ):
2392
+ eq, eq_key, order, order_key = _determine_attrib_eq_order(
2393
+ cmp, eq_key or eq, order_key or order, True
2394
+ )
2395
+
2396
+ # Cache this descriptor here to speed things up later.
2397
+ bound_setattr = _OBJ_SETATTR.__get__(self)
2398
+
2399
+ # Despite the big red warning, people *do* instantiate `Attribute`
2400
+ # themselves.
2401
+ bound_setattr("name", name)
2402
+ bound_setattr("default", default)
2403
+ bound_setattr("validator", validator)
2404
+ bound_setattr("repr", repr)
2405
+ bound_setattr("eq", eq)
2406
+ bound_setattr("eq_key", eq_key)
2407
+ bound_setattr("order", order)
2408
+ bound_setattr("order_key", order_key)
2409
+ bound_setattr("hash", hash)
2410
+ bound_setattr("init", init)
2411
+ bound_setattr("converter", converter)
2412
+ bound_setattr(
2413
+ "metadata",
2414
+ (
2415
+ types.MappingProxyType(dict(metadata)) # Shallow copy
2416
+ if metadata
2417
+ else _EMPTY_METADATA_SINGLETON
2418
+ ),
2419
+ )
2420
+ bound_setattr("type", type)
2421
+ bound_setattr("kw_only", kw_only)
2422
+ bound_setattr("inherited", inherited)
2423
+ bound_setattr("on_setattr", on_setattr)
2424
+ bound_setattr("alias", alias)
2425
+
2426
+ def __setattr__(self, name, value):
2427
+ raise FrozenInstanceError
2428
+
2429
+ @classmethod
2430
+ def from_counting_attr(cls, name, ca, type=None):
2431
+ # type holds the annotated value. deal with conflicts:
2432
+ if type is None:
2433
+ type = ca.type
2434
+ elif ca.type is not None:
2435
+ msg = "Type annotation and type argument cannot both be present"
2436
+ raise ValueError(msg)
2437
+ inst_dict = {
2438
+ k: getattr(ca, k)
2439
+ for k in Attribute.__slots__
2440
+ if k
2441
+ not in (
2442
+ "name",
2443
+ "validator",
2444
+ "default",
2445
+ "type",
2446
+ "inherited",
2447
+ ) # exclude methods and deprecated alias
2448
+ }
2449
+ return cls(
2450
+ name=name,
2451
+ validator=ca._validator,
2452
+ default=ca._default,
2453
+ type=type,
2454
+ cmp=None,
2455
+ inherited=False,
2456
+ **inst_dict,
2457
+ )
2458
+
2459
+ # Don't use attrs.evolve since fields(Attribute) doesn't work
2460
+ def evolve(self, **changes):
2461
+ """
2462
+ Copy *self* and apply *changes*.
2463
+
2464
+ This works similarly to `attrs.evolve` but that function does not work
2465
+ with :class:`attrs.Attribute`.
2466
+
2467
+ It is mainly meant to be used for `transform-fields`.
2468
+
2469
+ .. versionadded:: 20.3.0
2470
+ """
2471
+ new = copy.copy(self)
2472
+
2473
+ new._setattrs(changes.items())
2474
+
2475
+ return new
2476
+
2477
+ # Don't use _add_pickle since fields(Attribute) doesn't work
2478
+ def __getstate__(self):
2479
+ """
2480
+ Play nice with pickle.
2481
+ """
2482
+ return tuple(
2483
+ getattr(self, name) if name != "metadata" else dict(self.metadata)
2484
+ for name in self.__slots__
2485
+ )
2486
+
2487
+ def __setstate__(self, state):
2488
+ """
2489
+ Play nice with pickle.
2490
+ """
2491
+ self._setattrs(zip(self.__slots__, state))
2492
+
2493
+ def _setattrs(self, name_values_pairs):
2494
+ bound_setattr = _OBJ_SETATTR.__get__(self)
2495
+ for name, value in name_values_pairs:
2496
+ if name != "metadata":
2497
+ bound_setattr(name, value)
2498
+ else:
2499
+ bound_setattr(
2500
+ name,
2501
+ (
2502
+ types.MappingProxyType(dict(value))
2503
+ if value
2504
+ else _EMPTY_METADATA_SINGLETON
2505
+ ),
2506
+ )
2507
+
2508
+
2509
+ _a = [
2510
+ Attribute(
2511
+ name=name,
2512
+ default=NOTHING,
2513
+ validator=None,
2514
+ repr=True,
2515
+ cmp=None,
2516
+ eq=True,
2517
+ order=False,
2518
+ hash=(name != "metadata"),
2519
+ init=True,
2520
+ inherited=False,
2521
+ alias=_default_init_alias_for(name),
2522
+ )
2523
+ for name in Attribute.__slots__
2524
+ ]
2525
+
2526
+ Attribute = _add_hash(
2527
+ _add_eq(
2528
+ _add_repr(Attribute, attrs=_a),
2529
+ attrs=[a for a in _a if a.name != "inherited"],
2530
+ ),
2531
+ attrs=[a for a in _a if a.hash and a.name != "inherited"],
2532
+ )
2533
+
2534
+
2535
+ class _CountingAttr:
2536
+ """
2537
+ Intermediate representation of attributes that uses a counter to preserve
2538
+ the order in which the attributes have been defined.
2539
+
2540
+ *Internal* data structure of the attrs library. Running into is most
2541
+ likely the result of a bug like a forgotten `@attr.s` decorator.
2542
+ """
2543
+
2544
+ __slots__ = (
2545
+ "_default",
2546
+ "_validator",
2547
+ "alias",
2548
+ "converter",
2549
+ "counter",
2550
+ "eq",
2551
+ "eq_key",
2552
+ "hash",
2553
+ "init",
2554
+ "kw_only",
2555
+ "metadata",
2556
+ "on_setattr",
2557
+ "order",
2558
+ "order_key",
2559
+ "repr",
2560
+ "type",
2561
+ )
2562
+ __attrs_attrs__ = (
2563
+ *tuple(
2564
+ Attribute(
2565
+ name=name,
2566
+ alias=_default_init_alias_for(name),
2567
+ default=NOTHING,
2568
+ validator=None,
2569
+ repr=True,
2570
+ cmp=None,
2571
+ hash=True,
2572
+ init=True,
2573
+ kw_only=False,
2574
+ eq=True,
2575
+ eq_key=None,
2576
+ order=False,
2577
+ order_key=None,
2578
+ inherited=False,
2579
+ on_setattr=None,
2580
+ )
2581
+ for name in (
2582
+ "counter",
2583
+ "_default",
2584
+ "repr",
2585
+ "eq",
2586
+ "order",
2587
+ "hash",
2588
+ "init",
2589
+ "on_setattr",
2590
+ "alias",
2591
+ )
2592
+ ),
2593
+ Attribute(
2594
+ name="metadata",
2595
+ alias="metadata",
2596
+ default=None,
2597
+ validator=None,
2598
+ repr=True,
2599
+ cmp=None,
2600
+ hash=False,
2601
+ init=True,
2602
+ kw_only=False,
2603
+ eq=True,
2604
+ eq_key=None,
2605
+ order=False,
2606
+ order_key=None,
2607
+ inherited=False,
2608
+ on_setattr=None,
2609
+ ),
2610
+ )
2611
+ cls_counter = 0
2612
+
2613
+ def __init__(
2614
+ self,
2615
+ default,
2616
+ validator,
2617
+ repr,
2618
+ cmp,
2619
+ hash,
2620
+ init,
2621
+ converter,
2622
+ metadata,
2623
+ type,
2624
+ kw_only,
2625
+ eq,
2626
+ eq_key,
2627
+ order,
2628
+ order_key,
2629
+ on_setattr,
2630
+ alias,
2631
+ ):
2632
+ _CountingAttr.cls_counter += 1
2633
+ self.counter = _CountingAttr.cls_counter
2634
+ self._default = default
2635
+ self._validator = validator
2636
+ self.converter = converter
2637
+ self.repr = repr
2638
+ self.eq = eq
2639
+ self.eq_key = eq_key
2640
+ self.order = order
2641
+ self.order_key = order_key
2642
+ self.hash = hash
2643
+ self.init = init
2644
+ self.metadata = metadata
2645
+ self.type = type
2646
+ self.kw_only = kw_only
2647
+ self.on_setattr = on_setattr
2648
+ self.alias = alias
2649
+
2650
+ def validator(self, meth):
2651
+ """
2652
+ Decorator that adds *meth* to the list of validators.
2653
+
2654
+ Returns *meth* unchanged.
2655
+
2656
+ .. versionadded:: 17.1.0
2657
+ """
2658
+ if self._validator is None:
2659
+ self._validator = meth
2660
+ else:
2661
+ self._validator = and_(self._validator, meth)
2662
+ return meth
2663
+
2664
+ def default(self, meth):
2665
+ """
2666
+ Decorator that allows to set the default for an attribute.
2667
+
2668
+ Returns *meth* unchanged.
2669
+
2670
+ Raises:
2671
+ DefaultAlreadySetError: If default has been set before.
2672
+
2673
+ .. versionadded:: 17.1.0
2674
+ """
2675
+ if self._default is not NOTHING:
2676
+ raise DefaultAlreadySetError
2677
+
2678
+ self._default = Factory(meth, takes_self=True)
2679
+
2680
+ return meth
2681
+
2682
+
2683
+ _CountingAttr = _add_eq(_add_repr(_CountingAttr))
2684
+
2685
+
2686
+ class Factory:
2687
+ """
2688
+ Stores a factory callable.
2689
+
2690
+ If passed as the default value to `attrs.field`, the factory is used to
2691
+ generate a new value.
2692
+
2693
+ Args:
2694
+ factory (typing.Callable):
2695
+ A callable that takes either none or exactly one mandatory
2696
+ positional argument depending on *takes_self*.
2697
+
2698
+ takes_self (bool):
2699
+ Pass the partially initialized instance that is being initialized
2700
+ as a positional argument.
2701
+
2702
+ .. versionadded:: 17.1.0 *takes_self*
2703
+ """
2704
+
2705
+ __slots__ = ("factory", "takes_self")
2706
+
2707
+ def __init__(self, factory, takes_self=False):
2708
+ self.factory = factory
2709
+ self.takes_self = takes_self
2710
+
2711
+ def __getstate__(self):
2712
+ """
2713
+ Play nice with pickle.
2714
+ """
2715
+ return tuple(getattr(self, name) for name in self.__slots__)
2716
+
2717
+ def __setstate__(self, state):
2718
+ """
2719
+ Play nice with pickle.
2720
+ """
2721
+ for name, value in zip(self.__slots__, state):
2722
+ setattr(self, name, value)
2723
+
2724
+
2725
+ _f = [
2726
+ Attribute(
2727
+ name=name,
2728
+ default=NOTHING,
2729
+ validator=None,
2730
+ repr=True,
2731
+ cmp=None,
2732
+ eq=True,
2733
+ order=False,
2734
+ hash=True,
2735
+ init=True,
2736
+ inherited=False,
2737
+ )
2738
+ for name in Factory.__slots__
2739
+ ]
2740
+
2741
+ Factory = _add_hash(_add_eq(_add_repr(Factory, attrs=_f), attrs=_f), attrs=_f)
2742
+
2743
+
2744
+ class Converter:
2745
+ """
2746
+ Stores a converter callable.
2747
+
2748
+ Allows for the wrapped converter to take additional arguments. The
2749
+ arguments are passed in the order they are documented.
2750
+
2751
+ Args:
2752
+ converter (Callable): A callable that converts the passed value.
2753
+
2754
+ takes_self (bool):
2755
+ Pass the partially initialized instance that is being initialized
2756
+ as a positional argument. (default: `False`)
2757
+
2758
+ takes_field (bool):
2759
+ Pass the field definition (an :class:`Attribute`) into the
2760
+ converter as a positional argument. (default: `False`)
2761
+
2762
+ .. versionadded:: 24.1.0
2763
+ """
2764
+
2765
+ __slots__ = (
2766
+ "__call__",
2767
+ "_first_param_type",
2768
+ "_global_name",
2769
+ "converter",
2770
+ "takes_field",
2771
+ "takes_self",
2772
+ )
2773
+
2774
+ def __init__(self, converter, *, takes_self=False, takes_field=False):
2775
+ self.converter = converter
2776
+ self.takes_self = takes_self
2777
+ self.takes_field = takes_field
2778
+
2779
+ ex = _AnnotationExtractor(converter)
2780
+ self._first_param_type = ex.get_first_param_type()
2781
+
2782
+ if not (self.takes_self or self.takes_field):
2783
+ self.__call__ = lambda value, _, __: self.converter(value)
2784
+ elif self.takes_self and not self.takes_field:
2785
+ self.__call__ = lambda value, instance, __: self.converter(
2786
+ value, instance
2787
+ )
2788
+ elif not self.takes_self and self.takes_field:
2789
+ self.__call__ = lambda value, __, field: self.converter(
2790
+ value, field
2791
+ )
2792
+ else:
2793
+ self.__call__ = lambda value, instance, field: self.converter(
2794
+ value, instance, field
2795
+ )
2796
+
2797
+ rt = ex.get_return_type()
2798
+ if rt is not None:
2799
+ self.__call__.__annotations__["return"] = rt
2800
+
2801
+ @staticmethod
2802
+ def _get_global_name(attr_name: str) -> str:
2803
+ """
2804
+ Return the name that a converter for an attribute name *attr_name*
2805
+ would have.
2806
+ """
2807
+ return f"__attr_converter_{attr_name}"
2808
+
2809
+ def _fmt_converter_call(self, attr_name: str, value_var: str) -> str:
2810
+ """
2811
+ Return a string that calls the converter for an attribute name
2812
+ *attr_name* and the value in variable named *value_var* according to
2813
+ `self.takes_self` and `self.takes_field`.
2814
+ """
2815
+ if not (self.takes_self or self.takes_field):
2816
+ return f"{self._get_global_name(attr_name)}({value_var})"
2817
+
2818
+ if self.takes_self and self.takes_field:
2819
+ return f"{self._get_global_name(attr_name)}({value_var}, self, attr_dict['{attr_name}'])"
2820
+
2821
+ if self.takes_self:
2822
+ return f"{self._get_global_name(attr_name)}({value_var}, self)"
2823
+
2824
+ return f"{self._get_global_name(attr_name)}({value_var}, attr_dict['{attr_name}'])"
2825
+
2826
+ def __getstate__(self):
2827
+ """
2828
+ Return a dict containing only converter and takes_self -- the rest gets
2829
+ computed when loading.
2830
+ """
2831
+ return {
2832
+ "converter": self.converter,
2833
+ "takes_self": self.takes_self,
2834
+ "takes_field": self.takes_field,
2835
+ }
2836
+
2837
+ def __setstate__(self, state):
2838
+ """
2839
+ Load instance from state.
2840
+ """
2841
+ self.__init__(**state)
2842
+
2843
+
2844
+ _f = [
2845
+ Attribute(
2846
+ name=name,
2847
+ default=NOTHING,
2848
+ validator=None,
2849
+ repr=True,
2850
+ cmp=None,
2851
+ eq=True,
2852
+ order=False,
2853
+ hash=True,
2854
+ init=True,
2855
+ inherited=False,
2856
+ )
2857
+ for name in ("converter", "takes_self", "takes_field")
2858
+ ]
2859
+
2860
+ Converter = _add_hash(
2861
+ _add_eq(_add_repr(Converter, attrs=_f), attrs=_f), attrs=_f
2862
+ )
2863
+
2864
+
2865
+ def make_class(
2866
+ name, attrs, bases=(object,), class_body=None, **attributes_arguments
2867
+ ):
2868
+ r"""
2869
+ A quick way to create a new class called *name* with *attrs*.
2870
+
2871
+ .. note::
2872
+
2873
+ ``make_class()`` is a thin wrapper around `attr.s`, not `attrs.define`
2874
+ which means that it doesn't come with some of the improved defaults.
2875
+
2876
+ For example, if you want the same ``on_setattr`` behavior as in
2877
+ `attrs.define`, you have to pass the hooks yourself: ``make_class(...,
2878
+ on_setattr=setters.pipe(setters.convert, setters.validate)``
2879
+
2880
+ Args:
2881
+ name (str): The name for the new class.
2882
+
2883
+ attrs (list | dict):
2884
+ A list of names or a dictionary of mappings of names to `attr.ib`\
2885
+ s / `attrs.field`\ s.
2886
+
2887
+ The order is deduced from the order of the names or attributes
2888
+ inside *attrs*. Otherwise the order of the definition of the
2889
+ attributes is used.
2890
+
2891
+ bases (tuple[type, ...]): Classes that the new class will subclass.
2892
+
2893
+ class_body (dict):
2894
+ An optional dictionary of class attributes for the new class.
2895
+
2896
+ attributes_arguments: Passed unmodified to `attr.s`.
2897
+
2898
+ Returns:
2899
+ type: A new class with *attrs*.
2900
+
2901
+ .. versionadded:: 17.1.0 *bases*
2902
+ .. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
2903
+ .. versionchanged:: 23.2.0 *class_body*
2904
+ """
2905
+ if isinstance(attrs, dict):
2906
+ cls_dict = attrs
2907
+ elif isinstance(attrs, (list, tuple)):
2908
+ cls_dict = {a: attrib() for a in attrs}
2909
+ else:
2910
+ msg = "attrs argument must be a dict or a list."
2911
+ raise TypeError(msg)
2912
+
2913
+ pre_init = cls_dict.pop("__attrs_pre_init__", None)
2914
+ post_init = cls_dict.pop("__attrs_post_init__", None)
2915
+ user_init = cls_dict.pop("__init__", None)
2916
+
2917
+ body = {}
2918
+ if class_body is not None:
2919
+ body.update(class_body)
2920
+ if pre_init is not None:
2921
+ body["__attrs_pre_init__"] = pre_init
2922
+ if post_init is not None:
2923
+ body["__attrs_post_init__"] = post_init
2924
+ if user_init is not None:
2925
+ body["__init__"] = user_init
2926
+
2927
+ type_ = types.new_class(name, bases, {}, lambda ns: ns.update(body))
2928
+
2929
+ # For pickling to work, the __module__ variable needs to be set to the
2930
+ # frame where the class is created. Bypass this step in environments where
2931
+ # sys._getframe is not defined (Jython for example) or sys._getframe is not
2932
+ # defined for arguments greater than 0 (IronPython).
2933
+ with contextlib.suppress(AttributeError, ValueError):
2934
+ type_.__module__ = sys._getframe(1).f_globals.get(
2935
+ "__name__", "__main__"
2936
+ )
2937
+
2938
+ # We do it here for proper warnings with meaningful stacklevel.
2939
+ cmp = attributes_arguments.pop("cmp", None)
2940
+ (
2941
+ attributes_arguments["eq"],
2942
+ attributes_arguments["order"],
2943
+ ) = _determine_attrs_eq_order(
2944
+ cmp,
2945
+ attributes_arguments.get("eq"),
2946
+ attributes_arguments.get("order"),
2947
+ True,
2948
+ )
2949
+
2950
+ cls = _attrs(these=cls_dict, **attributes_arguments)(type_)
2951
+ # Only add type annotations now or "_attrs()" will complain:
2952
+ cls.__annotations__ = {
2953
+ k: v.type for k, v in cls_dict.items() if v.type is not None
2954
+ }
2955
+ return cls
2956
+
2957
+
2958
+ # These are required by within this module so we define them here and merely
2959
+ # import into .validators / .converters.
2960
+
2961
+
2962
+ @attrs(slots=True, unsafe_hash=True)
2963
+ class _AndValidator:
2964
+ """
2965
+ Compose many validators to a single one.
2966
+ """
2967
+
2968
+ _validators = attrib()
2969
+
2970
+ def __call__(self, inst, attr, value):
2971
+ for v in self._validators:
2972
+ v(inst, attr, value)
2973
+
2974
+
2975
+ def and_(*validators):
2976
+ """
2977
+ A validator that composes multiple validators into one.
2978
+
2979
+ When called on a value, it runs all wrapped validators.
2980
+
2981
+ Args:
2982
+ validators (~collections.abc.Iterable[typing.Callable]):
2983
+ Arbitrary number of validators.
2984
+
2985
+ .. versionadded:: 17.1.0
2986
+ """
2987
+ vals = []
2988
+ for validator in validators:
2989
+ vals.extend(
2990
+ validator._validators
2991
+ if isinstance(validator, _AndValidator)
2992
+ else [validator]
2993
+ )
2994
+
2995
+ return _AndValidator(tuple(vals))
2996
+
2997
+
2998
+ def pipe(*converters):
2999
+ """
3000
+ A converter that composes multiple converters into one.
3001
+
3002
+ When called on a value, it runs all wrapped converters, returning the
3003
+ *last* value.
3004
+
3005
+ Type annotations will be inferred from the wrapped converters', if they
3006
+ have any.
3007
+
3008
+ converters (~collections.abc.Iterable[typing.Callable]):
3009
+ Arbitrary number of converters.
3010
+
3011
+ .. versionadded:: 20.1.0
3012
+ """
3013
+
3014
+ return_instance = any(isinstance(c, Converter) for c in converters)
3015
+
3016
+ if return_instance:
3017
+
3018
+ def pipe_converter(val, inst, field):
3019
+ for c in converters:
3020
+ val = (
3021
+ c(val, inst, field) if isinstance(c, Converter) else c(val)
3022
+ )
3023
+
3024
+ return val
3025
+
3026
+ else:
3027
+
3028
+ def pipe_converter(val):
3029
+ for c in converters:
3030
+ val = c(val)
3031
+
3032
+ return val
3033
+
3034
+ if not converters:
3035
+ # If the converter list is empty, pipe_converter is the identity.
3036
+ A = typing.TypeVar("A")
3037
+ pipe_converter.__annotations__.update({"val": A, "return": A})
3038
+ else:
3039
+ # Get parameter type from first converter.
3040
+ t = _AnnotationExtractor(converters[0]).get_first_param_type()
3041
+ if t:
3042
+ pipe_converter.__annotations__["val"] = t
3043
+
3044
+ last = converters[-1]
3045
+ if not PY_3_11_PLUS and isinstance(last, Converter):
3046
+ last = last.__call__
3047
+
3048
+ # Get return type from last converter.
3049
+ rt = _AnnotationExtractor(last).get_return_type()
3050
+ if rt:
3051
+ pipe_converter.__annotations__["return"] = rt
3052
+
3053
+ if return_instance:
3054
+ return Converter(pipe_converter, takes_self=True, takes_field=True)
3055
+ return pipe_converter