@gnost-cli/darwin-arm64 0.0.1 → 0.5.1-rc.1

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 (1407) hide show
  1. package/README.md +1 -1
  2. package/bundle/_internal/6ec57f84c680d3a3778b__mypyc.cpython-312-darwin.so +4 -0
  3. package/bundle/_internal/Python +0 -0
  4. package/bundle/_internal/Python.framework/Python +0 -0
  5. package/bundle/_internal/Python.framework/Resources/Info.plist +30 -0
  6. package/bundle/_internal/Python.framework/Versions/3.12/Python +0 -0
  7. package/bundle/_internal/Python.framework/Versions/3.12/Resources/Info.plist +30 -0
  8. package/bundle/_internal/Python.framework/Versions/Current/Python +0 -0
  9. package/bundle/_internal/Python.framework/Versions/Current/Resources/Info.plist +30 -0
  10. package/bundle/_internal/ast_serialize/ast_serialize.abi3.so +0 -0
  11. package/bundle/_internal/bandit/__init__.py +20 -0
  12. package/bundle/_internal/bandit/__main__.py +17 -0
  13. package/bundle/_internal/bandit/blacklists/__init__.py +0 -0
  14. package/bundle/_internal/bandit/blacklists/calls.py +670 -0
  15. package/bundle/_internal/bandit/blacklists/imports.py +425 -0
  16. package/bundle/_internal/bandit/blacklists/utils.py +17 -0
  17. package/bundle/_internal/bandit/cli/__init__.py +0 -0
  18. package/bundle/_internal/bandit/cli/baseline.py +252 -0
  19. package/bundle/_internal/bandit/cli/config_generator.py +207 -0
  20. package/bundle/_internal/bandit/cli/main.py +701 -0
  21. package/bundle/_internal/bandit/core/__init__.py +15 -0
  22. package/bundle/_internal/bandit/core/blacklisting.py +72 -0
  23. package/bundle/_internal/bandit/core/config.py +271 -0
  24. package/bundle/_internal/bandit/core/constants.py +40 -0
  25. package/bundle/_internal/bandit/core/context.py +316 -0
  26. package/bundle/_internal/bandit/core/docs_utils.py +54 -0
  27. package/bundle/_internal/bandit/core/extension_loader.py +114 -0
  28. package/bundle/_internal/bandit/core/issue.py +245 -0
  29. package/bundle/_internal/bandit/core/manager.py +499 -0
  30. package/bundle/_internal/bandit/core/meta_ast.py +44 -0
  31. package/bundle/_internal/bandit/core/metrics.py +106 -0
  32. package/bundle/_internal/bandit/core/node_visitor.py +297 -0
  33. package/bundle/_internal/bandit/core/test_properties.py +83 -0
  34. package/bundle/_internal/bandit/core/test_set.py +114 -0
  35. package/bundle/_internal/bandit/core/tester.py +168 -0
  36. package/bundle/_internal/bandit/core/utils.py +398 -0
  37. package/bundle/_internal/bandit/formatters/__init__.py +0 -0
  38. package/bundle/_internal/bandit/formatters/csv.py +82 -0
  39. package/bundle/_internal/bandit/formatters/custom.py +161 -0
  40. package/bundle/_internal/bandit/formatters/html.py +394 -0
  41. package/bundle/_internal/bandit/formatters/json.py +155 -0
  42. package/bundle/_internal/bandit/formatters/sarif.py +374 -0
  43. package/bundle/_internal/bandit/formatters/screen.py +244 -0
  44. package/bundle/_internal/bandit/formatters/text.py +200 -0
  45. package/bundle/_internal/bandit/formatters/utils.py +14 -0
  46. package/bundle/_internal/bandit/formatters/xml.py +97 -0
  47. package/bundle/_internal/bandit/formatters/yaml.py +126 -0
  48. package/bundle/_internal/bandit/plugins/__init__.py +0 -0
  49. package/bundle/_internal/bandit/plugins/app_debug.py +63 -0
  50. package/bundle/_internal/bandit/plugins/asserts.py +83 -0
  51. package/bundle/_internal/bandit/plugins/crypto_request_no_cert_validation.py +75 -0
  52. package/bundle/_internal/bandit/plugins/django_sql_injection.py +155 -0
  53. package/bundle/_internal/bandit/plugins/django_xss.py +287 -0
  54. package/bundle/_internal/bandit/plugins/exec.py +55 -0
  55. package/bundle/_internal/bandit/plugins/general_bad_file_permissions.py +99 -0
  56. package/bundle/_internal/bandit/plugins/general_bind_all_interfaces.py +52 -0
  57. package/bundle/_internal/bandit/plugins/general_hardcoded_password.py +282 -0
  58. package/bundle/_internal/bandit/plugins/general_hardcoded_tmp.py +79 -0
  59. package/bundle/_internal/bandit/plugins/hashlib_insecure_functions.py +121 -0
  60. package/bundle/_internal/bandit/plugins/huggingface_unsafe_download.py +166 -0
  61. package/bundle/_internal/bandit/plugins/injection_paramiko.py +63 -0
  62. package/bundle/_internal/bandit/plugins/injection_shell.py +706 -0
  63. package/bundle/_internal/bandit/plugins/injection_sql.py +143 -0
  64. package/bundle/_internal/bandit/plugins/injection_wildcard.py +144 -0
  65. package/bundle/_internal/bandit/plugins/insecure_ssl_tls.py +285 -0
  66. package/bundle/_internal/bandit/plugins/jinja2_templates.py +134 -0
  67. package/bundle/_internal/bandit/plugins/logging_config_insecure_listen.py +58 -0
  68. package/bundle/_internal/bandit/plugins/mako_templates.py +69 -0
  69. package/bundle/_internal/bandit/plugins/markupsafe_markup_xss.py +118 -0
  70. package/bundle/_internal/bandit/plugins/pytorch_load.py +77 -0
  71. package/bundle/_internal/bandit/plugins/request_without_timeout.py +84 -0
  72. package/bundle/_internal/bandit/plugins/snmp_security_check.py +110 -0
  73. package/bundle/_internal/bandit/plugins/ssh_no_host_key_verification.py +76 -0
  74. package/bundle/_internal/bandit/plugins/tarfile_unsafe_members.py +121 -0
  75. package/bundle/_internal/bandit/plugins/trojansource.py +82 -0
  76. package/bundle/_internal/bandit/plugins/try_except_continue.py +108 -0
  77. package/bundle/_internal/bandit/plugins/try_except_pass.py +106 -0
  78. package/bundle/_internal/bandit/plugins/weak_cryptographic_key.py +165 -0
  79. package/bundle/_internal/bandit/plugins/yaml_load.py +76 -0
  80. package/bundle/_internal/bandit-1.9.4.dist-info/INSTALLER +1 -0
  81. package/bundle/_internal/bandit-1.9.4.dist-info/METADATA +212 -0
  82. package/bundle/_internal/bandit-1.9.4.dist-info/RECORD +150 -0
  83. package/bundle/_internal/bandit-1.9.4.dist-info/WHEEL +5 -0
  84. package/bundle/_internal/bandit-1.9.4.dist-info/entry_points.txt +63 -0
  85. package/bundle/_internal/bandit-1.9.4.dist-info/licenses/LICENSE +175 -0
  86. package/bundle/_internal/bandit-1.9.4.dist-info/pbr.json +1 -0
  87. package/bundle/_internal/bandit-1.9.4.dist-info/top_level.txt +1 -0
  88. package/bundle/_internal/base_library.zip +0 -0
  89. package/bundle/_internal/bin/ruff +0 -0
  90. package/bundle/_internal/gnost/__init__.py +1 -0
  91. package/bundle/_internal/gnost/analysis/__init__.py +0 -0
  92. package/bundle/_internal/gnost/analysis/analyzers/__init__.py +11 -0
  93. package/bundle/_internal/gnost/analysis/analyzers/maintainability_analyzer.py +901 -0
  94. package/bundle/_internal/gnost/analysis/analyzers/observability_analyzer.py +592 -0
  95. package/bundle/_internal/gnost/analysis/analyzers/readability_analyzer.py +968 -0
  96. package/bundle/_internal/gnost/analysis/analyzers/robustness_analyzer.py +944 -0
  97. package/bundle/_internal/gnost/analysis/config/mypy.ini +4 -0
  98. package/bundle/_internal/gnost/analysis/core/__init__.py +0 -0
  99. package/bundle/_internal/gnost/analysis/core/aggregator.py +584 -0
  100. package/bundle/_internal/gnost/analysis/core/engine.py +430 -0
  101. package/bundle/_internal/gnost/analysis/core/file_utils.py +209 -0
  102. package/bundle/_internal/gnost/analysis/core/interfaces.py +304 -0
  103. package/bundle/_internal/gnost/analysis/core/models.py +479 -0
  104. package/bundle/_internal/gnost/analysis/core/tool_runner.py +153 -0
  105. package/bundle/_internal/gnost/analysis/core/transformers.py +779 -0
  106. package/bundle/_internal/gnost/analysis/utils/__init__.py +0 -0
  107. package/bundle/_internal/gnost/analysis/utils/analyze.py +132 -0
  108. package/bundle/_internal/gnost/analysis/utils/df_handling.py +215 -0
  109. package/bundle/_internal/gnost/analysis/utils/duplicate_code.py +42 -0
  110. package/bundle/_internal/gnost/analysis/utils/extract.py +172 -0
  111. package/bundle/_internal/gnost/analysis/utils/mi.py +130 -0
  112. package/bundle/_internal/gnost/analysis/utils/tool_command.py +63 -0
  113. package/bundle/_internal/gnost/cli/__init__.py +3 -0
  114. package/bundle/_internal/gnost/cli/app.py +696 -0
  115. package/bundle/_internal/gnost/cli/commands/__init__.py +3 -0
  116. package/bundle/_internal/gnost/cli/commands/analysis.py +190 -0
  117. package/bundle/_internal/gnost/cli/commands/onboard.py +507 -0
  118. package/bundle/_internal/gnost/cli/commands/show.py +70 -0
  119. package/bundle/_internal/gnost/config/__init__.py +0 -0
  120. package/bundle/_internal/gnost/config/languages.py +10 -0
  121. package/bundle/_internal/gnost/config/settings.py +240 -0
  122. package/bundle/_internal/gnost/core/__init__.py +0 -0
  123. package/bundle/_internal/gnost/core/callgraph.py +399 -0
  124. package/bundle/_internal/gnost/core/caution.py +315 -0
  125. package/bundle/_internal/gnost/core/cycles.py +148 -0
  126. package/bundle/_internal/gnost/core/flow.py +204 -0
  127. package/bundle/_internal/gnost/core/graph.py +108 -0
  128. package/bundle/_internal/gnost/core/insight_builder.py +164 -0
  129. package/bundle/_internal/gnost/core/ranker.py +119 -0
  130. package/bundle/_internal/gnost/core/resolver.py +304 -0
  131. package/bundle/_internal/gnost/languages/base.py +108 -0
  132. package/bundle/_internal/gnost/languages/java.py +104 -0
  133. package/bundle/_internal/gnost/languages/javascript.py +153 -0
  134. package/bundle/_internal/gnost/languages/manifests.py +45 -0
  135. package/bundle/_internal/gnost/languages/python.py +318 -0
  136. package/bundle/_internal/gnost/languages/typescript.py +6 -0
  137. package/bundle/_internal/gnost/models/__init__.py +0 -0
  138. package/bundle/_internal/gnost/models/insights.py +68 -0
  139. package/bundle/_internal/gnost/reporters/__init__.py +3 -0
  140. package/bundle/_internal/gnost/reporters/analysis_html.py +1292 -0
  141. package/bundle/_internal/gnost/reporters/diagram_viewer.py +153 -0
  142. package/bundle/_internal/gnost/reporters/files.py +18 -0
  143. package/bundle/_internal/gnost/reporters/folders.py +18 -0
  144. package/bundle/_internal/gnost/reporters/insights_json.py +189 -0
  145. package/bundle/_internal/gnost/reporters/loc_summary.py +19 -0
  146. package/bundle/_internal/gnost/reporters/markdown.py +372 -0
  147. package/bundle/_internal/gnost/reporters/mermaid.py +543 -0
  148. package/bundle/_internal/gnost/reporters/mermaid_graph.py +309 -0
  149. package/bundle/_internal/gnost/reporters/readme.py +81 -0
  150. package/bundle/_internal/gnost/reporters/stats.py +13 -0
  151. package/bundle/_internal/gnost/reporters/summary.py +223 -0
  152. package/bundle/_internal/gnost/reporters/templates/analyzer_guides.json +247 -0
  153. package/bundle/_internal/gnost/reporters/templates/analyzer_guides_layout.html +9 -0
  154. package/bundle/_internal/gnost/reporters/templates/graph_viewer.html +427 -0
  155. package/bundle/_internal/gnost/reporters/vendor/THIRD_PARTY_NOTICES.md +205 -0
  156. package/bundle/_internal/gnost/reporters/vendor/cose-base.js +3214 -0
  157. package/bundle/_internal/gnost/reporters/vendor/cytoscape-fcose.js +1549 -0
  158. package/bundle/_internal/gnost/reporters/vendor/cytoscape.min.js +32 -0
  159. package/bundle/_internal/gnost/reporters/vendor/layout-base.js +5230 -0
  160. package/bundle/_internal/gnost/reporters/vendor/marked.min.js +6 -0
  161. package/bundle/_internal/gnost/reporters/vendor/mermaid.min.js +2314 -0
  162. package/bundle/_internal/gnost/reporters/vendor/svg-pan-zoom.min.js +3 -0
  163. package/bundle/_internal/gnost/reporters/vendor/vendor.json +44 -0
  164. package/bundle/_internal/gnost/routes/__init__.py +45 -0
  165. package/bundle/_internal/gnost/routes/java.py +72 -0
  166. package/bundle/_internal/gnost/routes/javascript.py +275 -0
  167. package/bundle/_internal/gnost/routes/models.py +58 -0
  168. package/bundle/_internal/gnost/routes/python.py +429 -0
  169. package/bundle/_internal/gnost/scanner/__init__.py +4 -0
  170. package/bundle/_internal/gnost/scanner/classify.py +13 -0
  171. package/bundle/_internal/gnost/scanner/engine.py +169 -0
  172. package/bundle/_internal/gnost/scanner/filters.py +196 -0
  173. package/bundle/_internal/gnost/scanner/loc.py +93 -0
  174. package/bundle/_internal/gnost/scanner/models.py +27 -0
  175. package/bundle/_internal/gnost/schemas/insights.schema.json +517 -0
  176. package/bundle/_internal/gnost/utils/__init__.py +0 -0
  177. package/bundle/_internal/gnost/utils/logger.py +85 -0
  178. package/bundle/_internal/gnost/utils/paths.py +29 -0
  179. package/bundle/_internal/gnost/utils/printer.py +46 -0
  180. package/bundle/_internal/gnost/utils/progress.py +20 -0
  181. package/bundle/_internal/gnost-0.5.1rc1.dist-info/INSTALLER +1 -0
  182. package/bundle/_internal/gnost-0.5.1rc1.dist-info/METADATA +130 -0
  183. package/bundle/_internal/gnost-0.5.1rc1.dist-info/RECORD +178 -0
  184. package/bundle/_internal/gnost-0.5.1rc1.dist-info/REQUESTED +0 -0
  185. package/bundle/_internal/gnost-0.5.1rc1.dist-info/WHEEL +5 -0
  186. package/bundle/_internal/gnost-0.5.1rc1.dist-info/direct_url.json +1 -0
  187. package/bundle/_internal/gnost-0.5.1rc1.dist-info/entry_points.txt +2 -0
  188. package/bundle/_internal/gnost-0.5.1rc1.dist-info/licenses/LICENSE +21 -0
  189. package/bundle/_internal/gnost-0.5.1rc1.dist-info/top_level.txt +1 -0
  190. package/bundle/_internal/libcrypto.3.dylib +0 -0
  191. package/bundle/_internal/libncurses.6.dylib +0 -0
  192. package/bundle/_internal/librt/base64.cpython-312-darwin.so +0 -0
  193. package/bundle/_internal/librt/internal.cpython-312-darwin.so +0 -0
  194. package/bundle/_internal/libssl.3.dylib +0 -0
  195. package/bundle/_internal/mypy/__init__.cpython-312-darwin.so +0 -0
  196. package/bundle/_internal/mypy/__init__.py +1 -0
  197. package/bundle/_internal/mypy/__main__.py +52 -0
  198. package/bundle/_internal/mypy/api.cpython-312-darwin.so +0 -0
  199. package/bundle/_internal/mypy/api.py +95 -0
  200. package/bundle/_internal/mypy/applytype.cpython-312-darwin.so +0 -0
  201. package/bundle/_internal/mypy/applytype.py +317 -0
  202. package/bundle/_internal/mypy/argmap.cpython-312-darwin.so +0 -0
  203. package/bundle/_internal/mypy/argmap.py +269 -0
  204. package/bundle/_internal/mypy/binder.cpython-312-darwin.so +0 -0
  205. package/bundle/_internal/mypy/binder.py +710 -0
  206. package/bundle/_internal/mypy/bogus_type.py +27 -0
  207. package/bundle/_internal/mypy/build.cpython-312-darwin.so +0 -0
  208. package/bundle/_internal/mypy/build.py +5533 -0
  209. package/bundle/_internal/mypy/build_worker/__init__.cpython-312-darwin.so +0 -0
  210. package/bundle/_internal/mypy/build_worker/__init__.py +0 -0
  211. package/bundle/_internal/mypy/build_worker/__main__.py +6 -0
  212. package/bundle/_internal/mypy/build_worker/worker.cpython-312-darwin.so +0 -0
  213. package/bundle/_internal/mypy/build_worker/worker.py +379 -0
  214. package/bundle/_internal/mypy/cache.cpython-312-darwin.so +0 -0
  215. package/bundle/_internal/mypy/cache.py +626 -0
  216. package/bundle/_internal/mypy/checker.cpython-312-darwin.so +0 -0
  217. package/bundle/_internal/mypy/checker.py +10110 -0
  218. package/bundle/_internal/mypy/checker_shared.cpython-312-darwin.so +0 -0
  219. package/bundle/_internal/mypy/checker_shared.py +377 -0
  220. package/bundle/_internal/mypy/checker_state.cpython-312-darwin.so +0 -0
  221. package/bundle/_internal/mypy/checker_state.py +30 -0
  222. package/bundle/_internal/mypy/checkexpr.cpython-312-darwin.so +0 -0
  223. package/bundle/_internal/mypy/checkexpr.py +7018 -0
  224. package/bundle/_internal/mypy/checkmember.cpython-312-darwin.so +0 -0
  225. package/bundle/_internal/mypy/checkmember.py +1593 -0
  226. package/bundle/_internal/mypy/checkpattern.cpython-312-darwin.so +0 -0
  227. package/bundle/_internal/mypy/checkpattern.py +883 -0
  228. package/bundle/_internal/mypy/checkstrformat.cpython-312-darwin.so +0 -0
  229. package/bundle/_internal/mypy/checkstrformat.py +1103 -0
  230. package/bundle/_internal/mypy/config_parser.cpython-312-darwin.so +0 -0
  231. package/bundle/_internal/mypy/config_parser.py +749 -0
  232. package/bundle/_internal/mypy/constant_fold.cpython-312-darwin.so +0 -0
  233. package/bundle/_internal/mypy/constant_fold.py +187 -0
  234. package/bundle/_internal/mypy/constraints.cpython-312-darwin.so +0 -0
  235. package/bundle/_internal/mypy/constraints.py +1748 -0
  236. package/bundle/_internal/mypy/copytype.cpython-312-darwin.so +0 -0
  237. package/bundle/_internal/mypy/copytype.py +137 -0
  238. package/bundle/_internal/mypy/defaults.cpython-312-darwin.so +0 -0
  239. package/bundle/_internal/mypy/defaults.py +67 -0
  240. package/bundle/_internal/mypy/dmypy/__init__.cpython-312-darwin.so +0 -0
  241. package/bundle/_internal/mypy/dmypy/__init__.py +0 -0
  242. package/bundle/_internal/mypy/dmypy/__main__.py +6 -0
  243. package/bundle/_internal/mypy/dmypy/client.cpython-312-darwin.so +0 -0
  244. package/bundle/_internal/mypy/dmypy/client.py +732 -0
  245. package/bundle/_internal/mypy/dmypy_os.cpython-312-darwin.so +0 -0
  246. package/bundle/_internal/mypy/dmypy_os.py +43 -0
  247. package/bundle/_internal/mypy/dmypy_server.cpython-312-darwin.so +0 -0
  248. package/bundle/_internal/mypy/dmypy_server.py +1132 -0
  249. package/bundle/_internal/mypy/dmypy_util.cpython-312-darwin.so +0 -0
  250. package/bundle/_internal/mypy/dmypy_util.py +117 -0
  251. package/bundle/_internal/mypy/erasetype.cpython-312-darwin.so +0 -0
  252. package/bundle/_internal/mypy/erasetype.py +301 -0
  253. package/bundle/_internal/mypy/error_formatter.cpython-312-darwin.so +0 -0
  254. package/bundle/_internal/mypy/error_formatter.py +39 -0
  255. package/bundle/_internal/mypy/errorcodes.cpython-312-darwin.so +0 -0
  256. package/bundle/_internal/mypy/errorcodes.py +340 -0
  257. package/bundle/_internal/mypy/errors.cpython-312-darwin.so +0 -0
  258. package/bundle/_internal/mypy/errors.py +1468 -0
  259. package/bundle/_internal/mypy/evalexpr.cpython-312-darwin.so +0 -0
  260. package/bundle/_internal/mypy/evalexpr.py +211 -0
  261. package/bundle/_internal/mypy/expandtype.cpython-312-darwin.so +0 -0
  262. package/bundle/_internal/mypy/expandtype.py +662 -0
  263. package/bundle/_internal/mypy/exportjson.py +616 -0
  264. package/bundle/_internal/mypy/exprtotype.cpython-312-darwin.so +0 -0
  265. package/bundle/_internal/mypy/exprtotype.py +285 -0
  266. package/bundle/_internal/mypy/fastparse.cpython-312-darwin.so +0 -0
  267. package/bundle/_internal/mypy/fastparse.py +2267 -0
  268. package/bundle/_internal/mypy/find_sources.cpython-312-darwin.so +0 -0
  269. package/bundle/_internal/mypy/find_sources.py +257 -0
  270. package/bundle/_internal/mypy/fixup.cpython-312-darwin.so +0 -0
  271. package/bundle/_internal/mypy/fixup.py +438 -0
  272. package/bundle/_internal/mypy/freetree.cpython-312-darwin.so +0 -0
  273. package/bundle/_internal/mypy/freetree.py +23 -0
  274. package/bundle/_internal/mypy/fscache.cpython-312-darwin.so +0 -0
  275. package/bundle/_internal/mypy/fscache.py +312 -0
  276. package/bundle/_internal/mypy/fswatcher.cpython-312-darwin.so +0 -0
  277. package/bundle/_internal/mypy/fswatcher.py +106 -0
  278. package/bundle/_internal/mypy/gclogger.cpython-312-darwin.so +0 -0
  279. package/bundle/_internal/mypy/gclogger.py +48 -0
  280. package/bundle/_internal/mypy/git.cpython-312-darwin.so +0 -0
  281. package/bundle/_internal/mypy/git.py +69 -0
  282. package/bundle/_internal/mypy/graph_utils.cpython-312-darwin.so +0 -0
  283. package/bundle/_internal/mypy/graph_utils.py +161 -0
  284. package/bundle/_internal/mypy/indirection.cpython-312-darwin.so +0 -0
  285. package/bundle/_internal/mypy/indirection.py +176 -0
  286. package/bundle/_internal/mypy/infer.cpython-312-darwin.so +0 -0
  287. package/bundle/_internal/mypy/infer.py +80 -0
  288. package/bundle/_internal/mypy/inspections.cpython-312-darwin.so +0 -0
  289. package/bundle/_internal/mypy/inspections.py +626 -0
  290. package/bundle/_internal/mypy/ipc.cpython-312-darwin.so +0 -0
  291. package/bundle/_internal/mypy/ipc.py +508 -0
  292. package/bundle/_internal/mypy/join.cpython-312-darwin.so +0 -0
  293. package/bundle/_internal/mypy/join.py +962 -0
  294. package/bundle/_internal/mypy/known_modules.cpython-312-darwin.so +0 -0
  295. package/bundle/_internal/mypy/known_modules.py +174 -0
  296. package/bundle/_internal/mypy/literals.cpython-312-darwin.so +0 -0
  297. package/bundle/_internal/mypy/literals.py +327 -0
  298. package/bundle/_internal/mypy/lookup.cpython-312-darwin.so +0 -0
  299. package/bundle/_internal/mypy/lookup.py +80 -0
  300. package/bundle/_internal/mypy/main.cpython-312-darwin.so +0 -0
  301. package/bundle/_internal/mypy/main.py +1793 -0
  302. package/bundle/_internal/mypy/maptype.cpython-312-darwin.so +0 -0
  303. package/bundle/_internal/mypy/maptype.py +109 -0
  304. package/bundle/_internal/mypy/meet.cpython-312-darwin.so +0 -0
  305. package/bundle/_internal/mypy/meet.py +1371 -0
  306. package/bundle/_internal/mypy/memprofile.cpython-312-darwin.so +0 -0
  307. package/bundle/_internal/mypy/memprofile.py +122 -0
  308. package/bundle/_internal/mypy/message_registry.cpython-312-darwin.so +0 -0
  309. package/bundle/_internal/mypy/message_registry.py +378 -0
  310. package/bundle/_internal/mypy/messages.cpython-312-darwin.so +0 -0
  311. package/bundle/_internal/mypy/messages.py +3535 -0
  312. package/bundle/_internal/mypy/metastore.cpython-312-darwin.so +0 -0
  313. package/bundle/_internal/mypy/metastore.py +278 -0
  314. package/bundle/_internal/mypy/mixedtraverser.cpython-312-darwin.so +0 -0
  315. package/bundle/_internal/mypy/mixedtraverser.py +147 -0
  316. package/bundle/_internal/mypy/modulefinder.cpython-312-darwin.so +0 -0
  317. package/bundle/_internal/mypy/modulefinder.py +1008 -0
  318. package/bundle/_internal/mypy/moduleinspect.cpython-312-darwin.so +0 -0
  319. package/bundle/_internal/mypy/moduleinspect.py +184 -0
  320. package/bundle/_internal/mypy/modules_state.cpython-312-darwin.so +0 -0
  321. package/bundle/_internal/mypy/modules_state.py +20 -0
  322. package/bundle/_internal/mypy/mro.cpython-312-darwin.so +0 -0
  323. package/bundle/_internal/mypy/mro.py +62 -0
  324. package/bundle/_internal/mypy/nativeparse.cpython-312-darwin.so +0 -0
  325. package/bundle/_internal/mypy/nativeparse.py +2199 -0
  326. package/bundle/_internal/mypy/nodes.cpython-312-darwin.so +0 -0
  327. package/bundle/_internal/mypy/nodes.py +5608 -0
  328. package/bundle/_internal/mypy/operators.cpython-312-darwin.so +0 -0
  329. package/bundle/_internal/mypy/operators.py +126 -0
  330. package/bundle/_internal/mypy/options.cpython-312-darwin.so +0 -0
  331. package/bundle/_internal/mypy/options.py +678 -0
  332. package/bundle/_internal/mypy/parse.cpython-312-darwin.so +0 -0
  333. package/bundle/_internal/mypy/parse.py +135 -0
  334. package/bundle/_internal/mypy/partially_defined.cpython-312-darwin.so +0 -0
  335. package/bundle/_internal/mypy/partially_defined.py +703 -0
  336. package/bundle/_internal/mypy/patterns.cpython-312-darwin.so +0 -0
  337. package/bundle/_internal/mypy/patterns.py +162 -0
  338. package/bundle/_internal/mypy/plugin.cpython-312-darwin.so +0 -0
  339. package/bundle/_internal/mypy/plugin.py +945 -0
  340. package/bundle/_internal/mypy/plugins/__init__.py +0 -0
  341. package/bundle/_internal/mypy/plugins/attrs.cpython-312-darwin.so +0 -0
  342. package/bundle/_internal/mypy/plugins/attrs.py +1179 -0
  343. package/bundle/_internal/mypy/plugins/common.cpython-312-darwin.so +0 -0
  344. package/bundle/_internal/mypy/plugins/common.py +441 -0
  345. package/bundle/_internal/mypy/plugins/constants.cpython-312-darwin.so +0 -0
  346. package/bundle/_internal/mypy/plugins/constants.py +20 -0
  347. package/bundle/_internal/mypy/plugins/ctypes.cpython-312-darwin.so +0 -0
  348. package/bundle/_internal/mypy/plugins/ctypes.py +245 -0
  349. package/bundle/_internal/mypy/plugins/dataclasses.cpython-312-darwin.so +0 -0
  350. package/bundle/_internal/mypy/plugins/dataclasses.py +1135 -0
  351. package/bundle/_internal/mypy/plugins/default.cpython-312-darwin.so +0 -0
  352. package/bundle/_internal/mypy/plugins/default.py +612 -0
  353. package/bundle/_internal/mypy/plugins/enums.cpython-312-darwin.so +0 -0
  354. package/bundle/_internal/mypy/plugins/enums.py +299 -0
  355. package/bundle/_internal/mypy/plugins/functools.cpython-312-darwin.so +0 -0
  356. package/bundle/_internal/mypy/plugins/functools.py +399 -0
  357. package/bundle/_internal/mypy/plugins/proper_plugin.cpython-312-darwin.so +0 -0
  358. package/bundle/_internal/mypy/plugins/proper_plugin.py +178 -0
  359. package/bundle/_internal/mypy/plugins/singledispatch.cpython-312-darwin.so +0 -0
  360. package/bundle/_internal/mypy/plugins/singledispatch.py +212 -0
  361. package/bundle/_internal/mypy/py.typed +1 -0
  362. package/bundle/_internal/mypy/pyinfo.py +79 -0
  363. package/bundle/_internal/mypy/reachability.cpython-312-darwin.so +0 -0
  364. package/bundle/_internal/mypy/reachability.py +388 -0
  365. package/bundle/_internal/mypy/refinfo.cpython-312-darwin.so +0 -0
  366. package/bundle/_internal/mypy/refinfo.py +92 -0
  367. package/bundle/_internal/mypy/renaming.cpython-312-darwin.so +0 -0
  368. package/bundle/_internal/mypy/renaming.py +583 -0
  369. package/bundle/_internal/mypy/report.cpython-312-darwin.so +0 -0
  370. package/bundle/_internal/mypy/report.py +930 -0
  371. package/bundle/_internal/mypy/scope.cpython-312-darwin.so +0 -0
  372. package/bundle/_internal/mypy/scope.py +125 -0
  373. package/bundle/_internal/mypy/semanal.cpython-312-darwin.so +0 -0
  374. package/bundle/_internal/mypy/semanal.py +8674 -0
  375. package/bundle/_internal/mypy/semanal_classprop.cpython-312-darwin.so +0 -0
  376. package/bundle/_internal/mypy/semanal_classprop.py +188 -0
  377. package/bundle/_internal/mypy/semanal_enum.cpython-312-darwin.so +0 -0
  378. package/bundle/_internal/mypy/semanal_enum.py +259 -0
  379. package/bundle/_internal/mypy/semanal_infer.cpython-312-darwin.so +0 -0
  380. package/bundle/_internal/mypy/semanal_infer.py +135 -0
  381. package/bundle/_internal/mypy/semanal_main.cpython-312-darwin.so +0 -0
  382. package/bundle/_internal/mypy/semanal_main.py +542 -0
  383. package/bundle/_internal/mypy/semanal_namedtuple.cpython-312-darwin.so +0 -0
  384. package/bundle/_internal/mypy/semanal_namedtuple.py +679 -0
  385. package/bundle/_internal/mypy/semanal_newtype.cpython-312-darwin.so +0 -0
  386. package/bundle/_internal/mypy/semanal_newtype.py +272 -0
  387. package/bundle/_internal/mypy/semanal_pass1.cpython-312-darwin.so +0 -0
  388. package/bundle/_internal/mypy/semanal_pass1.py +159 -0
  389. package/bundle/_internal/mypy/semanal_shared.cpython-312-darwin.so +0 -0
  390. package/bundle/_internal/mypy/semanal_shared.py +499 -0
  391. package/bundle/_internal/mypy/semanal_typeargs.cpython-312-darwin.so +0 -0
  392. package/bundle/_internal/mypy/semanal_typeargs.py +309 -0
  393. package/bundle/_internal/mypy/semanal_typeddict.cpython-312-darwin.so +0 -0
  394. package/bundle/_internal/mypy/semanal_typeddict.py +826 -0
  395. package/bundle/_internal/mypy/server/__init__.py +0 -0
  396. package/bundle/_internal/mypy/server/astdiff.cpython-312-darwin.so +0 -0
  397. package/bundle/_internal/mypy/server/astdiff.py +552 -0
  398. package/bundle/_internal/mypy/server/astmerge.cpython-312-darwin.so +0 -0
  399. package/bundle/_internal/mypy/server/astmerge.py +583 -0
  400. package/bundle/_internal/mypy/server/aststrip.cpython-312-darwin.so +0 -0
  401. package/bundle/_internal/mypy/server/aststrip.py +255 -0
  402. package/bundle/_internal/mypy/server/deps.cpython-312-darwin.so +0 -0
  403. package/bundle/_internal/mypy/server/deps.py +1153 -0
  404. package/bundle/_internal/mypy/server/mergecheck.cpython-312-darwin.so +0 -0
  405. package/bundle/_internal/mypy/server/mergecheck.py +84 -0
  406. package/bundle/_internal/mypy/server/objgraph.cpython-312-darwin.so +0 -0
  407. package/bundle/_internal/mypy/server/objgraph.py +101 -0
  408. package/bundle/_internal/mypy/server/subexpr.cpython-312-darwin.so +0 -0
  409. package/bundle/_internal/mypy/server/subexpr.py +208 -0
  410. package/bundle/_internal/mypy/server/target.cpython-312-darwin.so +0 -0
  411. package/bundle/_internal/mypy/server/target.py +11 -0
  412. package/bundle/_internal/mypy/server/trigger.cpython-312-darwin.so +0 -0
  413. package/bundle/_internal/mypy/server/trigger.py +26 -0
  414. package/bundle/_internal/mypy/server/update.cpython-312-darwin.so +0 -0
  415. package/bundle/_internal/mypy/server/update.py +1372 -0
  416. package/bundle/_internal/mypy/sharedparse.cpython-312-darwin.so +0 -0
  417. package/bundle/_internal/mypy/sharedparse.py +114 -0
  418. package/bundle/_internal/mypy/solve.cpython-312-darwin.so +0 -0
  419. package/bundle/_internal/mypy/solve.py +602 -0
  420. package/bundle/_internal/mypy/split_namespace.py +35 -0
  421. package/bundle/_internal/mypy/state.cpython-312-darwin.so +0 -0
  422. package/bundle/_internal/mypy/state.py +29 -0
  423. package/bundle/_internal/mypy/stats.cpython-312-darwin.so +0 -0
  424. package/bundle/_internal/mypy/stats.py +494 -0
  425. package/bundle/_internal/mypy/strconv.cpython-312-darwin.so +0 -0
  426. package/bundle/_internal/mypy/strconv.py +707 -0
  427. package/bundle/_internal/mypy/stubdoc.py +545 -0
  428. package/bundle/_internal/mypy/stubgen.cpython-312-darwin.so +0 -0
  429. package/bundle/_internal/mypy/stubgen.py +2064 -0
  430. package/bundle/_internal/mypy/stubgenc.py +1046 -0
  431. package/bundle/_internal/mypy/stubinfo.cpython-312-darwin.so +0 -0
  432. package/bundle/_internal/mypy/stubinfo.py +321 -0
  433. package/bundle/_internal/mypy/stubtest.py +2676 -0
  434. package/bundle/_internal/mypy/stubutil.cpython-312-darwin.so +0 -0
  435. package/bundle/_internal/mypy/stubutil.py +895 -0
  436. package/bundle/_internal/mypy/subtypes.cpython-312-darwin.so +0 -0
  437. package/bundle/_internal/mypy/subtypes.py +2572 -0
  438. package/bundle/_internal/mypy/suggestions.cpython-312-darwin.so +0 -0
  439. package/bundle/_internal/mypy/suggestions.py +1068 -0
  440. package/bundle/_internal/mypy/test/__init__.py +0 -0
  441. package/bundle/_internal/mypy/test/config.py +31 -0
  442. package/bundle/_internal/mypy/test/data.py +864 -0
  443. package/bundle/_internal/mypy/test/helpers.py +546 -0
  444. package/bundle/_internal/mypy/test/meta/__init__.py +0 -0
  445. package/bundle/_internal/mypy/test/meta/_pytest.py +72 -0
  446. package/bundle/_internal/mypy/test/meta/test_diff_helper.py +47 -0
  447. package/bundle/_internal/mypy/test/meta/test_parse_data.py +69 -0
  448. package/bundle/_internal/mypy/test/meta/test_update_data.py +131 -0
  449. package/bundle/_internal/mypy/test/test_config_parser.py +130 -0
  450. package/bundle/_internal/mypy/test/test_diff_cache.py +209 -0
  451. package/bundle/_internal/mypy/test/test_find_sources.py +376 -0
  452. package/bundle/_internal/mypy/test/test_nativeparse.py +306 -0
  453. package/bundle/_internal/mypy/test/test_ref_info.py +46 -0
  454. package/bundle/_internal/mypy/test/testapi.py +45 -0
  455. package/bundle/_internal/mypy/test/testargs.py +202 -0
  456. package/bundle/_internal/mypy/test/testcheck.py +360 -0
  457. package/bundle/_internal/mypy/test/testcmdline.py +162 -0
  458. package/bundle/_internal/mypy/test/testconstraints.py +134 -0
  459. package/bundle/_internal/mypy/test/testdaemon.py +132 -0
  460. package/bundle/_internal/mypy/test/testdeps.py +85 -0
  461. package/bundle/_internal/mypy/test/testdiff.py +70 -0
  462. package/bundle/_internal/mypy/test/testerrorstream.py +46 -0
  463. package/bundle/_internal/mypy/test/testexportjson.py +104 -0
  464. package/bundle/_internal/mypy/test/testfinegrained.py +453 -0
  465. package/bundle/_internal/mypy/test/testfinegrainedcache.py +18 -0
  466. package/bundle/_internal/mypy/test/testformatter.py +85 -0
  467. package/bundle/_internal/mypy/test/testfscache.py +100 -0
  468. package/bundle/_internal/mypy/test/testgraph.py +138 -0
  469. package/bundle/_internal/mypy/test/testinfer.py +373 -0
  470. package/bundle/_internal/mypy/test/testipc.py +154 -0
  471. package/bundle/_internal/mypy/test/testmerge.py +235 -0
  472. package/bundle/_internal/mypy/test/testmodulefinder.py +284 -0
  473. package/bundle/_internal/mypy/test/testmypyc.py +26 -0
  474. package/bundle/_internal/mypy/test/testoutput.py +64 -0
  475. package/bundle/_internal/mypy/test/testparse.py +131 -0
  476. package/bundle/_internal/mypy/test/testpep561.py +174 -0
  477. package/bundle/_internal/mypy/test/testpythoneval.py +116 -0
  478. package/bundle/_internal/mypy/test/testreports.py +59 -0
  479. package/bundle/_internal/mypy/test/testsemanal.py +219 -0
  480. package/bundle/_internal/mypy/test/testsolve.py +287 -0
  481. package/bundle/_internal/mypy/test/teststubgen.py +1650 -0
  482. package/bundle/_internal/mypy/test/teststubinfo.py +24 -0
  483. package/bundle/_internal/mypy/test/teststubtest.py +3417 -0
  484. package/bundle/_internal/mypy/test/testsubtypes.py +306 -0
  485. package/bundle/_internal/mypy/test/testtransform.py +64 -0
  486. package/bundle/_internal/mypy/test/testtypegen.py +83 -0
  487. package/bundle/_internal/mypy/test/testtypes.py +1666 -0
  488. package/bundle/_internal/mypy/test/testutil.py +111 -0
  489. package/bundle/_internal/mypy/test/typefixture.py +419 -0
  490. package/bundle/_internal/mypy/test/update_data.py +87 -0
  491. package/bundle/_internal/mypy/test/visitors.cpython-312-darwin.so +0 -0
  492. package/bundle/_internal/mypy/test/visitors.py +77 -0
  493. package/bundle/_internal/mypy/traverser.cpython-312-darwin.so +0 -0
  494. package/bundle/_internal/mypy/traverser.py +1106 -0
  495. package/bundle/_internal/mypy/treetransform.cpython-312-darwin.so +0 -0
  496. package/bundle/_internal/mypy/treetransform.py +820 -0
  497. package/bundle/_internal/mypy/tvar_scope.cpython-312-darwin.so +0 -0
  498. package/bundle/_internal/mypy/tvar_scope.py +154 -0
  499. package/bundle/_internal/mypy/type_visitor.cpython-312-darwin.so +0 -0
  500. package/bundle/_internal/mypy/type_visitor.py +630 -0
  501. package/bundle/_internal/mypy/typeanal.cpython-312-darwin.so +0 -0
  502. package/bundle/_internal/mypy/typeanal.py +2961 -0
  503. package/bundle/_internal/mypy/typeops.cpython-312-darwin.so +0 -0
  504. package/bundle/_internal/mypy/typeops.py +1355 -0
  505. package/bundle/_internal/mypy/types.cpython-312-darwin.so +0 -0
  506. package/bundle/_internal/mypy/types.py +4639 -0
  507. package/bundle/_internal/mypy/types_utils.cpython-312-darwin.so +0 -0
  508. package/bundle/_internal/mypy/types_utils.py +183 -0
  509. package/bundle/_internal/mypy/typeshed/LICENSE +237 -0
  510. package/bundle/_internal/mypy/typeshed/stdlib/VERSIONS +349 -0
  511. package/bundle/_internal/mypy/typeshed/stdlib/__future__.pyi +36 -0
  512. package/bundle/_internal/mypy/typeshed/stdlib/__main__.pyi +1 -0
  513. package/bundle/_internal/mypy/typeshed/stdlib/_ast.pyi +141 -0
  514. package/bundle/_internal/mypy/typeshed/stdlib/_asyncio.pyi +114 -0
  515. package/bundle/_internal/mypy/typeshed/stdlib/_bisect.pyi +103 -0
  516. package/bundle/_internal/mypy/typeshed/stdlib/_blake2.pyi +119 -0
  517. package/bundle/_internal/mypy/typeshed/stdlib/_bz2.pyi +24 -0
  518. package/bundle/_internal/mypy/typeshed/stdlib/_codecs.pyi +125 -0
  519. package/bundle/_internal/mypy/typeshed/stdlib/_collections_abc.pyi +105 -0
  520. package/bundle/_internal/mypy/typeshed/stdlib/_compat_pickle.pyi +10 -0
  521. package/bundle/_internal/mypy/typeshed/stdlib/_compression.pyi +39 -0
  522. package/bundle/_internal/mypy/typeshed/stdlib/_contextvars.pyi +69 -0
  523. package/bundle/_internal/mypy/typeshed/stdlib/_csv.pyi +116 -0
  524. package/bundle/_internal/mypy/typeshed/stdlib/_ctypes.pyi +375 -0
  525. package/bundle/_internal/mypy/typeshed/stdlib/_curses.pyi +583 -0
  526. package/bundle/_internal/mypy/typeshed/stdlib/_curses_panel.pyi +27 -0
  527. package/bundle/_internal/mypy/typeshed/stdlib/_dbm.pyi +46 -0
  528. package/bundle/_internal/mypy/typeshed/stdlib/_decimal.pyi +73 -0
  529. package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib.pyi +121 -0
  530. package/bundle/_internal/mypy/typeshed/stdlib/_frozen_importlib_external.pyi +218 -0
  531. package/bundle/_internal/mypy/typeshed/stdlib/_gdbm.pyi +50 -0
  532. package/bundle/_internal/mypy/typeshed/stdlib/_hashlib.pyi +127 -0
  533. package/bundle/_internal/mypy/typeshed/stdlib/_heapq.pyi +18 -0
  534. package/bundle/_internal/mypy/typeshed/stdlib/_imp.pyi +30 -0
  535. package/bundle/_internal/mypy/typeshed/stdlib/_interpchannels.pyi +86 -0
  536. package/bundle/_internal/mypy/typeshed/stdlib/_interpqueues.pyi +31 -0
  537. package/bundle/_internal/mypy/typeshed/stdlib/_interpreters.pyi +68 -0
  538. package/bundle/_internal/mypy/typeshed/stdlib/_io.pyi +330 -0
  539. package/bundle/_internal/mypy/typeshed/stdlib/_json.pyi +59 -0
  540. package/bundle/_internal/mypy/typeshed/stdlib/_locale.pyi +121 -0
  541. package/bundle/_internal/mypy/typeshed/stdlib/_lsprof.pyi +34 -0
  542. package/bundle/_internal/mypy/typeshed/stdlib/_lzma.pyi +71 -0
  543. package/bundle/_internal/mypy/typeshed/stdlib/_markupbase.pyi +10 -0
  544. package/bundle/_internal/mypy/typeshed/stdlib/_msi.pyi +97 -0
  545. package/bundle/_internal/mypy/typeshed/stdlib/_multibytecodec.pyi +49 -0
  546. package/bundle/_internal/mypy/typeshed/stdlib/_operator.pyi +130 -0
  547. package/bundle/_internal/mypy/typeshed/stdlib/_osx_support.pyi +34 -0
  548. package/bundle/_internal/mypy/typeshed/stdlib/_pickle.pyi +114 -0
  549. package/bundle/_internal/mypy/typeshed/stdlib/_posixsubprocess.pyi +59 -0
  550. package/bundle/_internal/mypy/typeshed/stdlib/_py_abc.pyi +14 -0
  551. package/bundle/_internal/mypy/typeshed/stdlib/_pydecimal.pyi +50 -0
  552. package/bundle/_internal/mypy/typeshed/stdlib/_queue.pyi +18 -0
  553. package/bundle/_internal/mypy/typeshed/stdlib/_random.pyi +14 -0
  554. package/bundle/_internal/mypy/typeshed/stdlib/_remote_debugging.pyi +186 -0
  555. package/bundle/_internal/mypy/typeshed/stdlib/_sitebuiltins.pyi +18 -0
  556. package/bundle/_internal/mypy/typeshed/stdlib/_socket.pyi +966 -0
  557. package/bundle/_internal/mypy/typeshed/stdlib/_sqlite3.pyi +311 -0
  558. package/bundle/_internal/mypy/typeshed/stdlib/_ssl.pyi +303 -0
  559. package/bundle/_internal/mypy/typeshed/stdlib/_stat.pyi +119 -0
  560. package/bundle/_internal/mypy/typeshed/stdlib/_struct.pyi +24 -0
  561. package/bundle/_internal/mypy/typeshed/stdlib/_thread.pyi +125 -0
  562. package/bundle/_internal/mypy/typeshed/stdlib/_threading_local.pyi +24 -0
  563. package/bundle/_internal/mypy/typeshed/stdlib/_tkinter.pyi +156 -0
  564. package/bundle/_internal/mypy/typeshed/stdlib/_tracemalloc.pyi +13 -0
  565. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/README.md +34 -0
  566. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/__init__.pyi +415 -0
  567. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/_type_checker_internals.pyi +102 -0
  568. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/dbapi.pyi +36 -0
  569. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/importlib.pyi +18 -0
  570. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/wsgi.pyi +43 -0
  571. package/bundle/_internal/mypy/typeshed/stdlib/_typeshed/xml.pyi +9 -0
  572. package/bundle/_internal/mypy/typeshed/stdlib/_warnings.pyi +54 -0
  573. package/bundle/_internal/mypy/typeshed/stdlib/_weakref.pyi +15 -0
  574. package/bundle/_internal/mypy/typeshed/stdlib/_weakrefset.pyi +49 -0
  575. package/bundle/_internal/mypy/typeshed/stdlib/_winapi.pyi +319 -0
  576. package/bundle/_internal/mypy/typeshed/stdlib/_zstd.pyi +102 -0
  577. package/bundle/_internal/mypy/typeshed/stdlib/abc.pyi +50 -0
  578. package/bundle/_internal/mypy/typeshed/stdlib/aifc.pyi +79 -0
  579. package/bundle/_internal/mypy/typeshed/stdlib/annotationlib.pyi +156 -0
  580. package/bundle/_internal/mypy/typeshed/stdlib/antigravity.pyi +3 -0
  581. package/bundle/_internal/mypy/typeshed/stdlib/argparse.pyi +866 -0
  582. package/bundle/_internal/mypy/typeshed/stdlib/array.pyi +113 -0
  583. package/bundle/_internal/mypy/typeshed/stdlib/ast.pyi +2199 -0
  584. package/bundle/_internal/mypy/typeshed/stdlib/asynchat.pyi +21 -0
  585. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/__init__.pyi +1022 -0
  586. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_events.pyi +607 -0
  587. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_futures.pyi +17 -0
  588. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_subprocess.pyi +62 -0
  589. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/base_tasks.pyi +17 -0
  590. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/constants.pyi +20 -0
  591. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/coroutines.pyi +45 -0
  592. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/events.pyi +803 -0
  593. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/exceptions.pyi +44 -0
  594. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/format_helpers.pyi +31 -0
  595. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/futures.pyi +19 -0
  596. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/graph.pyi +29 -0
  597. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/locks.pyi +83 -0
  598. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/log.pyi +3 -0
  599. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/mixins.pyi +9 -0
  600. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/proactor_events.pyi +53 -0
  601. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/protocols.pyi +39 -0
  602. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/queues.pyi +45 -0
  603. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/runners.pyi +41 -0
  604. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/selector_events.pyi +10 -0
  605. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/sslproto.pyi +164 -0
  606. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/staggered.pyi +10 -0
  607. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/streams.pyi +124 -0
  608. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/subprocess.pyi +166 -0
  609. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/taskgroups.pyi +41 -0
  610. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tasks.pyi +315 -0
  611. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/threads.pyi +9 -0
  612. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/timeouts.pyi +20 -0
  613. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/tools.pyi +51 -0
  614. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/transports.pyi +57 -0
  615. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/trsock.pyi +137 -0
  616. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/unix_events.pyi +277 -0
  617. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_events.pyi +122 -0
  618. package/bundle/_internal/mypy/typeshed/stdlib/asyncio/windows_utils.pyi +49 -0
  619. package/bundle/_internal/mypy/typeshed/stdlib/asyncore.pyi +91 -0
  620. package/bundle/_internal/mypy/typeshed/stdlib/atexit.pyi +11 -0
  621. package/bundle/_internal/mypy/typeshed/stdlib/audioop.pyi +44 -0
  622. package/bundle/_internal/mypy/typeshed/stdlib/base64.pyi +124 -0
  623. package/bundle/_internal/mypy/typeshed/stdlib/bdb.pyi +139 -0
  624. package/bundle/_internal/mypy/typeshed/stdlib/binascii.pyi +102 -0
  625. package/bundle/_internal/mypy/typeshed/stdlib/binhex.pyi +44 -0
  626. package/bundle/_internal/mypy/typeshed/stdlib/bisect.pyi +4 -0
  627. package/bundle/_internal/mypy/typeshed/stdlib/builtins.pyi +2470 -0
  628. package/bundle/_internal/mypy/typeshed/stdlib/bz2.pyi +121 -0
  629. package/bundle/_internal/mypy/typeshed/stdlib/cProfile.pyi +33 -0
  630. package/bundle/_internal/mypy/typeshed/stdlib/calendar.pyi +249 -0
  631. package/bundle/_internal/mypy/typeshed/stdlib/cgi.pyi +120 -0
  632. package/bundle/_internal/mypy/typeshed/stdlib/cgitb.pyi +32 -0
  633. package/bundle/_internal/mypy/typeshed/stdlib/chunk.pyi +20 -0
  634. package/bundle/_internal/mypy/typeshed/stdlib/cmath.pyi +36 -0
  635. package/bundle/_internal/mypy/typeshed/stdlib/cmd.pyi +46 -0
  636. package/bundle/_internal/mypy/typeshed/stdlib/code.pyi +55 -0
  637. package/bundle/_internal/mypy/typeshed/stdlib/codecs.pyi +357 -0
  638. package/bundle/_internal/mypy/typeshed/stdlib/codeop.pyi +21 -0
  639. package/bundle/_internal/mypy/typeshed/stdlib/collections/__init__.pyi +565 -0
  640. package/bundle/_internal/mypy/typeshed/stdlib/collections/abc.pyi +2 -0
  641. package/bundle/_internal/mypy/typeshed/stdlib/colorsys.pyi +15 -0
  642. package/bundle/_internal/mypy/typeshed/stdlib/compileall.pyi +51 -0
  643. package/bundle/_internal/mypy/typeshed/stdlib/compression/__init__.pyi +0 -0
  644. package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/__init__.pyi +0 -0
  645. package/bundle/_internal/mypy/typeshed/stdlib/compression/_common/_streams.pyi +37 -0
  646. package/bundle/_internal/mypy/typeshed/stdlib/compression/bz2.pyi +1 -0
  647. package/bundle/_internal/mypy/typeshed/stdlib/compression/gzip.pyi +1 -0
  648. package/bundle/_internal/mypy/typeshed/stdlib/compression/lzma.pyi +1 -0
  649. package/bundle/_internal/mypy/typeshed/stdlib/compression/zlib.pyi +1 -0
  650. package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/__init__.pyi +94 -0
  651. package/bundle/_internal/mypy/typeshed/stdlib/compression/zstd/_zstdfile.pyi +117 -0
  652. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/__init__.pyi +0 -0
  653. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/__init__.pyi +71 -0
  654. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/_base.pyi +119 -0
  655. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/interpreter.pyi +82 -0
  656. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/process.pyi +248 -0
  657. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/futures/thread.pyi +143 -0
  658. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/__init__.pyi +68 -0
  659. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_crossinterp.pyi +30 -0
  660. package/bundle/_internal/mypy/typeshed/stdlib/concurrent/interpreters/_queues.pyi +74 -0
  661. package/bundle/_internal/mypy/typeshed/stdlib/configparser.pyi +509 -0
  662. package/bundle/_internal/mypy/typeshed/stdlib/contextlib.pyi +211 -0
  663. package/bundle/_internal/mypy/typeshed/stdlib/contextvars.pyi +3 -0
  664. package/bundle/_internal/mypy/typeshed/stdlib/copy.pyi +37 -0
  665. package/bundle/_internal/mypy/typeshed/stdlib/copyreg.pyi +20 -0
  666. package/bundle/_internal/mypy/typeshed/stdlib/crypt.pyi +26 -0
  667. package/bundle/_internal/mypy/typeshed/stdlib/csv.pyi +153 -0
  668. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/__init__.pyi +394 -0
  669. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/_endian.pyi +16 -0
  670. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/__init__.pyi +3 -0
  671. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dyld.pyi +8 -0
  672. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/dylib.pyi +14 -0
  673. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/macholib/framework.pyi +14 -0
  674. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/util.pyi +11 -0
  675. package/bundle/_internal/mypy/typeshed/stdlib/ctypes/wintypes.pyi +321 -0
  676. package/bundle/_internal/mypy/typeshed/stdlib/curses/__init__.pyi +38 -0
  677. package/bundle/_internal/mypy/typeshed/stdlib/curses/ascii.pyi +62 -0
  678. package/bundle/_internal/mypy/typeshed/stdlib/curses/has_key.pyi +1 -0
  679. package/bundle/_internal/mypy/typeshed/stdlib/curses/panel.pyi +1 -0
  680. package/bundle/_internal/mypy/typeshed/stdlib/curses/textpad.pyi +11 -0
  681. package/bundle/_internal/mypy/typeshed/stdlib/dataclasses.pyi +401 -0
  682. package/bundle/_internal/mypy/typeshed/stdlib/datetime.pyi +381 -0
  683. package/bundle/_internal/mypy/typeshed/stdlib/dbm/__init__.pyi +105 -0
  684. package/bundle/_internal/mypy/typeshed/stdlib/dbm/dumb.pyi +41 -0
  685. package/bundle/_internal/mypy/typeshed/stdlib/dbm/gnu.pyi +1 -0
  686. package/bundle/_internal/mypy/typeshed/stdlib/dbm/ndbm.pyi +1 -0
  687. package/bundle/_internal/mypy/typeshed/stdlib/dbm/sqlite3.pyi +34 -0
  688. package/bundle/_internal/mypy/typeshed/stdlib/decimal.pyi +278 -0
  689. package/bundle/_internal/mypy/typeshed/stdlib/difflib.pyi +157 -0
  690. package/bundle/_internal/mypy/typeshed/stdlib/dis.pyi +302 -0
  691. package/bundle/_internal/mypy/typeshed/stdlib/distutils/__init__.pyi +5 -0
  692. package/bundle/_internal/mypy/typeshed/stdlib/distutils/_msvccompiler.pyi +13 -0
  693. package/bundle/_internal/mypy/typeshed/stdlib/distutils/archive_util.pyi +36 -0
  694. package/bundle/_internal/mypy/typeshed/stdlib/distutils/bcppcompiler.pyi +3 -0
  695. package/bundle/_internal/mypy/typeshed/stdlib/distutils/ccompiler.pyi +182 -0
  696. package/bundle/_internal/mypy/typeshed/stdlib/distutils/cmd.pyi +238 -0
  697. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/__init__.pyi +41 -0
  698. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist.pyi +27 -0
  699. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_dumb.pyi +22 -0
  700. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_msi.pyi +45 -0
  701. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_packager.pyi +0 -0
  702. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/bdist_rpm.pyi +53 -0
  703. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build.pyi +34 -0
  704. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_clib.pyi +29 -0
  705. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_ext.pyi +52 -0
  706. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_py.pyi +45 -0
  707. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/build_scripts.pyi +25 -0
  708. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/check.pyi +39 -0
  709. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/clean.pyi +18 -0
  710. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/config.pyi +84 -0
  711. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install.pyi +67 -0
  712. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_data.pyi +20 -0
  713. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_egg_info.pyi +19 -0
  714. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_headers.pyi +17 -0
  715. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_lib.pyi +26 -0
  716. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/install_scripts.pyi +19 -0
  717. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/register.pyi +20 -0
  718. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/sdist.pyi +45 -0
  719. package/bundle/_internal/mypy/typeshed/stdlib/distutils/command/upload.pyi +18 -0
  720. package/bundle/_internal/mypy/typeshed/stdlib/distutils/config.pyi +17 -0
  721. package/bundle/_internal/mypy/typeshed/stdlib/distutils/core.pyi +58 -0
  722. package/bundle/_internal/mypy/typeshed/stdlib/distutils/cygwinccompiler.pyi +20 -0
  723. package/bundle/_internal/mypy/typeshed/stdlib/distutils/debug.pyi +3 -0
  724. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dep_util.pyi +14 -0
  725. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dir_util.pyi +23 -0
  726. package/bundle/_internal/mypy/typeshed/stdlib/distutils/dist.pyi +318 -0
  727. package/bundle/_internal/mypy/typeshed/stdlib/distutils/errors.pyi +19 -0
  728. package/bundle/_internal/mypy/typeshed/stdlib/distutils/extension.pyi +36 -0
  729. package/bundle/_internal/mypy/typeshed/stdlib/distutils/fancy_getopt.pyi +45 -0
  730. package/bundle/_internal/mypy/typeshed/stdlib/distutils/file_util.pyi +40 -0
  731. package/bundle/_internal/mypy/typeshed/stdlib/distutils/filelist.pyi +61 -0
  732. package/bundle/_internal/mypy/typeshed/stdlib/distutils/log.pyi +26 -0
  733. package/bundle/_internal/mypy/typeshed/stdlib/distutils/msvccompiler.pyi +3 -0
  734. package/bundle/_internal/mypy/typeshed/stdlib/distutils/spawn.pyi +10 -0
  735. package/bundle/_internal/mypy/typeshed/stdlib/distutils/sysconfig.pyi +32 -0
  736. package/bundle/_internal/mypy/typeshed/stdlib/distutils/text_file.pyi +21 -0
  737. package/bundle/_internal/mypy/typeshed/stdlib/distutils/unixccompiler.pyi +3 -0
  738. package/bundle/_internal/mypy/typeshed/stdlib/distutils/util.pyi +53 -0
  739. package/bundle/_internal/mypy/typeshed/stdlib/distutils/version.pyi +36 -0
  740. package/bundle/_internal/mypy/typeshed/stdlib/doctest.pyi +265 -0
  741. package/bundle/_internal/mypy/typeshed/stdlib/email/__init__.pyi +68 -0
  742. package/bundle/_internal/mypy/typeshed/stdlib/email/_header_value_parser.pyi +415 -0
  743. package/bundle/_internal/mypy/typeshed/stdlib/email/_policybase.pyi +80 -0
  744. package/bundle/_internal/mypy/typeshed/stdlib/email/base64mime.pyi +13 -0
  745. package/bundle/_internal/mypy/typeshed/stdlib/email/charset.pyi +44 -0
  746. package/bundle/_internal/mypy/typeshed/stdlib/email/contentmanager.pyi +11 -0
  747. package/bundle/_internal/mypy/typeshed/stdlib/email/encoders.pyi +8 -0
  748. package/bundle/_internal/mypy/typeshed/stdlib/email/errors.pyi +38 -0
  749. package/bundle/_internal/mypy/typeshed/stdlib/email/feedparser.pyi +24 -0
  750. package/bundle/_internal/mypy/typeshed/stdlib/email/generator.pyi +79 -0
  751. package/bundle/_internal/mypy/typeshed/stdlib/email/header.pyi +32 -0
  752. package/bundle/_internal/mypy/typeshed/stdlib/email/headerregistry.pyi +196 -0
  753. package/bundle/_internal/mypy/typeshed/stdlib/email/iterators.pyi +15 -0
  754. package/bundle/_internal/mypy/typeshed/stdlib/email/message.pyi +191 -0
  755. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/__init__.pyi +0 -0
  756. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/application.pyi +17 -0
  757. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/audio.pyi +17 -0
  758. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/base.pyi +8 -0
  759. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/image.pyi +17 -0
  760. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/message.pyi +8 -0
  761. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/multipart.pyi +18 -0
  762. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/nonmultipart.pyi +5 -0
  763. package/bundle/_internal/mypy/typeshed/stdlib/email/mime/text.pyi +9 -0
  764. package/bundle/_internal/mypy/typeshed/stdlib/email/parser.pyi +42 -0
  765. package/bundle/_internal/mypy/typeshed/stdlib/email/policy.pyi +78 -0
  766. package/bundle/_internal/mypy/typeshed/stdlib/email/quoprimime.pyi +28 -0
  767. package/bundle/_internal/mypy/typeshed/stdlib/email/utils.pyi +72 -0
  768. package/bundle/_internal/mypy/typeshed/stdlib/encodings/__init__.pyi +15 -0
  769. package/bundle/_internal/mypy/typeshed/stdlib/encodings/aliases.pyi +1 -0
  770. package/bundle/_internal/mypy/typeshed/stdlib/encodings/ascii.pyi +30 -0
  771. package/bundle/_internal/mypy/typeshed/stdlib/encodings/base64_codec.pyi +26 -0
  772. package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5.pyi +23 -0
  773. package/bundle/_internal/mypy/typeshed/stdlib/encodings/big5hkscs.pyi +23 -0
  774. package/bundle/_internal/mypy/typeshed/stdlib/encodings/bz2_codec.pyi +26 -0
  775. package/bundle/_internal/mypy/typeshed/stdlib/encodings/charmap.pyi +33 -0
  776. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp037.pyi +21 -0
  777. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1006.pyi +21 -0
  778. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1026.pyi +21 -0
  779. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1125.pyi +21 -0
  780. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1140.pyi +21 -0
  781. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1250.pyi +21 -0
  782. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1251.pyi +21 -0
  783. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1252.pyi +21 -0
  784. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1253.pyi +21 -0
  785. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1254.pyi +21 -0
  786. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1255.pyi +21 -0
  787. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1256.pyi +21 -0
  788. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1257.pyi +21 -0
  789. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp1258.pyi +21 -0
  790. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp273.pyi +21 -0
  791. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp424.pyi +21 -0
  792. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp437.pyi +21 -0
  793. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp500.pyi +21 -0
  794. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp720.pyi +21 -0
  795. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp737.pyi +21 -0
  796. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp775.pyi +21 -0
  797. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp850.pyi +21 -0
  798. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp852.pyi +21 -0
  799. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp855.pyi +21 -0
  800. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp856.pyi +21 -0
  801. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp857.pyi +21 -0
  802. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp858.pyi +21 -0
  803. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp860.pyi +21 -0
  804. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp861.pyi +21 -0
  805. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp862.pyi +21 -0
  806. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp863.pyi +21 -0
  807. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp864.pyi +21 -0
  808. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp865.pyi +21 -0
  809. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp866.pyi +21 -0
  810. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp869.pyi +21 -0
  811. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp874.pyi +21 -0
  812. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp875.pyi +21 -0
  813. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp932.pyi +23 -0
  814. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp949.pyi +23 -0
  815. package/bundle/_internal/mypy/typeshed/stdlib/encodings/cp950.pyi +23 -0
  816. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jis_2004.pyi +23 -0
  817. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jisx0213.pyi +23 -0
  818. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_jp.pyi +23 -0
  819. package/bundle/_internal/mypy/typeshed/stdlib/encodings/euc_kr.pyi +23 -0
  820. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb18030.pyi +23 -0
  821. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gb2312.pyi +23 -0
  822. package/bundle/_internal/mypy/typeshed/stdlib/encodings/gbk.pyi +23 -0
  823. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hex_codec.pyi +26 -0
  824. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hp_roman8.pyi +21 -0
  825. package/bundle/_internal/mypy/typeshed/stdlib/encodings/hz.pyi +23 -0
  826. package/bundle/_internal/mypy/typeshed/stdlib/encodings/idna.pyi +26 -0
  827. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp.pyi +23 -0
  828. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_1.pyi +23 -0
  829. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2.pyi +23 -0
  830. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_2004.pyi +23 -0
  831. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_3.pyi +23 -0
  832. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_jp_ext.pyi +23 -0
  833. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso2022_kr.pyi +23 -0
  834. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_1.pyi +21 -0
  835. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_10.pyi +21 -0
  836. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_11.pyi +21 -0
  837. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_13.pyi +21 -0
  838. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_14.pyi +21 -0
  839. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_15.pyi +21 -0
  840. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_16.pyi +21 -0
  841. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_2.pyi +21 -0
  842. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_3.pyi +21 -0
  843. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_4.pyi +21 -0
  844. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_5.pyi +21 -0
  845. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_6.pyi +21 -0
  846. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_7.pyi +21 -0
  847. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_8.pyi +21 -0
  848. package/bundle/_internal/mypy/typeshed/stdlib/encodings/iso8859_9.pyi +21 -0
  849. package/bundle/_internal/mypy/typeshed/stdlib/encodings/johab.pyi +23 -0
  850. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_r.pyi +21 -0
  851. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_t.pyi +21 -0
  852. package/bundle/_internal/mypy/typeshed/stdlib/encodings/koi8_u.pyi +21 -0
  853. package/bundle/_internal/mypy/typeshed/stdlib/encodings/kz1048.pyi +21 -0
  854. package/bundle/_internal/mypy/typeshed/stdlib/encodings/latin_1.pyi +30 -0
  855. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_arabic.pyi +21 -0
  856. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_croatian.pyi +21 -0
  857. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_cyrillic.pyi +21 -0
  858. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_farsi.pyi +21 -0
  859. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_greek.pyi +21 -0
  860. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_iceland.pyi +21 -0
  861. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_latin2.pyi +21 -0
  862. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_roman.pyi +21 -0
  863. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_romanian.pyi +21 -0
  864. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mac_turkish.pyi +21 -0
  865. package/bundle/_internal/mypy/typeshed/stdlib/encodings/mbcs.pyi +28 -0
  866. package/bundle/_internal/mypy/typeshed/stdlib/encodings/oem.pyi +28 -0
  867. package/bundle/_internal/mypy/typeshed/stdlib/encodings/palmos.pyi +21 -0
  868. package/bundle/_internal/mypy/typeshed/stdlib/encodings/ptcp154.pyi +21 -0
  869. package/bundle/_internal/mypy/typeshed/stdlib/encodings/punycode.pyi +33 -0
  870. package/bundle/_internal/mypy/typeshed/stdlib/encodings/quopri_codec.pyi +26 -0
  871. package/bundle/_internal/mypy/typeshed/stdlib/encodings/raw_unicode_escape.pyi +23 -0
  872. package/bundle/_internal/mypy/typeshed/stdlib/encodings/rot_13.pyi +23 -0
  873. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis.pyi +23 -0
  874. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jis_2004.pyi +23 -0
  875. package/bundle/_internal/mypy/typeshed/stdlib/encodings/shift_jisx0213.pyi +23 -0
  876. package/bundle/_internal/mypy/typeshed/stdlib/encodings/tis_620.pyi +21 -0
  877. package/bundle/_internal/mypy/typeshed/stdlib/encodings/undefined.pyi +20 -0
  878. package/bundle/_internal/mypy/typeshed/stdlib/encodings/unicode_escape.pyi +23 -0
  879. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16.pyi +20 -0
  880. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_be.pyi +26 -0
  881. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_16_le.pyi +26 -0
  882. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32.pyi +20 -0
  883. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_be.pyi +26 -0
  884. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_32_le.pyi +26 -0
  885. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_7.pyi +26 -0
  886. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8.pyi +26 -0
  887. package/bundle/_internal/mypy/typeshed/stdlib/encodings/utf_8_sig.pyi +22 -0
  888. package/bundle/_internal/mypy/typeshed/stdlib/encodings/uu_codec.pyi +28 -0
  889. package/bundle/_internal/mypy/typeshed/stdlib/encodings/zlib_codec.pyi +26 -0
  890. package/bundle/_internal/mypy/typeshed/stdlib/ensurepip/__init__.pyi +12 -0
  891. package/bundle/_internal/mypy/typeshed/stdlib/enum.pyi +374 -0
  892. package/bundle/_internal/mypy/typeshed/stdlib/errno.pyi +227 -0
  893. package/bundle/_internal/mypy/typeshed/stdlib/faulthandler.pyi +61 -0
  894. package/bundle/_internal/mypy/typeshed/stdlib/fcntl.pyi +157 -0
  895. package/bundle/_internal/mypy/typeshed/stdlib/filecmp.pyi +65 -0
  896. package/bundle/_internal/mypy/typeshed/stdlib/fileinput.pyi +141 -0
  897. package/bundle/_internal/mypy/typeshed/stdlib/fnmatch.pyi +16 -0
  898. package/bundle/_internal/mypy/typeshed/stdlib/fractions.pyi +185 -0
  899. package/bundle/_internal/mypy/typeshed/stdlib/ftplib.pyi +174 -0
  900. package/bundle/_internal/mypy/typeshed/stdlib/functools.pyi +287 -0
  901. package/bundle/_internal/mypy/typeshed/stdlib/gc.pyi +32 -0
  902. package/bundle/_internal/mypy/typeshed/stdlib/genericpath.pyi +98 -0
  903. package/bundle/_internal/mypy/typeshed/stdlib/getopt.pyi +27 -0
  904. package/bundle/_internal/mypy/typeshed/stdlib/getpass.pyi +14 -0
  905. package/bundle/_internal/mypy/typeshed/stdlib/gettext.pyi +190 -0
  906. package/bundle/_internal/mypy/typeshed/stdlib/glob.pyi +50 -0
  907. package/bundle/_internal/mypy/typeshed/stdlib/graphlib.pyi +29 -0
  908. package/bundle/_internal/mypy/typeshed/stdlib/grp.pyi +21 -0
  909. package/bundle/_internal/mypy/typeshed/stdlib/gzip.pyi +181 -0
  910. package/bundle/_internal/mypy/typeshed/stdlib/hashlib.pyi +112 -0
  911. package/bundle/_internal/mypy/typeshed/stdlib/heapq.pyi +32 -0
  912. package/bundle/_internal/mypy/typeshed/stdlib/hmac.pyi +33 -0
  913. package/bundle/_internal/mypy/typeshed/stdlib/html/__init__.pyi +7 -0
  914. package/bundle/_internal/mypy/typeshed/stdlib/html/entities.pyi +8 -0
  915. package/bundle/_internal/mypy/typeshed/stdlib/html/parser.pyi +40 -0
  916. package/bundle/_internal/mypy/typeshed/stdlib/http/__init__.pyi +118 -0
  917. package/bundle/_internal/mypy/typeshed/stdlib/http/client.pyi +318 -0
  918. package/bundle/_internal/mypy/typeshed/stdlib/http/cookiejar.pyi +158 -0
  919. package/bundle/_internal/mypy/typeshed/stdlib/http/cookies.pyi +57 -0
  920. package/bundle/_internal/mypy/typeshed/stdlib/http/server.pyi +139 -0
  921. package/bundle/_internal/mypy/typeshed/stdlib/imaplib.pyi +212 -0
  922. package/bundle/_internal/mypy/typeshed/stdlib/imghdr.pyi +18 -0
  923. package/bundle/_internal/mypy/typeshed/stdlib/imp.pyi +63 -0
  924. package/bundle/_internal/mypy/typeshed/stdlib/importlib/__init__.pyi +17 -0
  925. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_abc.pyi +21 -0
  926. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap.pyi +2 -0
  927. package/bundle/_internal/mypy/typeshed/stdlib/importlib/_bootstrap_external.pyi +2 -0
  928. package/bundle/_internal/mypy/typeshed/stdlib/importlib/abc.pyi +165 -0
  929. package/bundle/_internal/mypy/typeshed/stdlib/importlib/machinery.pyi +43 -0
  930. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/__init__.pyi +310 -0
  931. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/_meta.pyi +65 -0
  932. package/bundle/_internal/mypy/typeshed/stdlib/importlib/metadata/diagnose.pyi +2 -0
  933. package/bundle/_internal/mypy/typeshed/stdlib/importlib/readers.pyi +69 -0
  934. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/__init__.pyi +81 -0
  935. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_common.pyi +48 -0
  936. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/_functional.pyi +35 -0
  937. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/abc.pyi +64 -0
  938. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/readers.pyi +14 -0
  939. package/bundle/_internal/mypy/typeshed/stdlib/importlib/resources/simple.pyi +59 -0
  940. package/bundle/_internal/mypy/typeshed/stdlib/importlib/simple.pyi +11 -0
  941. package/bundle/_internal/mypy/typeshed/stdlib/importlib/util.pyi +75 -0
  942. package/bundle/_internal/mypy/typeshed/stdlib/inspect.pyi +749 -0
  943. package/bundle/_internal/mypy/typeshed/stdlib/io.pyi +75 -0
  944. package/bundle/_internal/mypy/typeshed/stdlib/ipaddress.pyi +249 -0
  945. package/bundle/_internal/mypy/typeshed/stdlib/itertools.pyi +376 -0
  946. package/bundle/_internal/mypy/typeshed/stdlib/json/__init__.pyi +93 -0
  947. package/bundle/_internal/mypy/typeshed/stdlib/json/decoder.pyi +50 -0
  948. package/bundle/_internal/mypy/typeshed/stdlib/json/encoder.pyi +40 -0
  949. package/bundle/_internal/mypy/typeshed/stdlib/json/scanner.pyi +7 -0
  950. package/bundle/_internal/mypy/typeshed/stdlib/json/tool.pyi +1 -0
  951. package/bundle/_internal/mypy/typeshed/stdlib/keyword.pyi +16 -0
  952. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/__init__.pyi +0 -0
  953. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/btm_matcher.pyi +28 -0
  954. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixer_base.pyi +42 -0
  955. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/__init__.pyi +0 -0
  956. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_apply.pyi +8 -0
  957. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_asserts.pyi +10 -0
  958. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_basestring.pyi +8 -0
  959. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_buffer.pyi +8 -0
  960. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_dict.pyi +16 -0
  961. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_except.pyi +14 -0
  962. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exec.pyi +8 -0
  963. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_execfile.pyi +8 -0
  964. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_exitfunc.pyi +13 -0
  965. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_filter.pyi +9 -0
  966. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_funcattrs.pyi +8 -0
  967. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_future.pyi +8 -0
  968. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_getcwdu.pyi +8 -0
  969. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_has_key.pyi +8 -0
  970. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_idioms.pyi +15 -0
  971. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_import.pyi +16 -0
  972. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports.pyi +21 -0
  973. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_imports2.pyi +8 -0
  974. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_input.pyi +11 -0
  975. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_intern.pyi +9 -0
  976. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_isinstance.pyi +8 -0
  977. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools.pyi +9 -0
  978. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_itertools_imports.pyi +7 -0
  979. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_long.pyi +7 -0
  980. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_map.pyi +9 -0
  981. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_metaclass.pyi +17 -0
  982. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_methodattrs.pyi +10 -0
  983. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ne.pyi +8 -0
  984. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_next.pyi +19 -0
  985. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_nonzero.pyi +8 -0
  986. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_numliterals.pyi +8 -0
  987. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_operator.pyi +12 -0
  988. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_paren.pyi +8 -0
  989. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_print.pyi +12 -0
  990. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raise.pyi +8 -0
  991. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_raw_input.pyi +8 -0
  992. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reduce.pyi +8 -0
  993. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_reload.pyi +9 -0
  994. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_renames.pyi +17 -0
  995. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_repr.pyi +8 -0
  996. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_set_literal.pyi +7 -0
  997. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_standarderror.pyi +8 -0
  998. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_sys_exc.pyi +9 -0
  999. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_throw.pyi +8 -0
  1000. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_tuple_params.pyi +16 -0
  1001. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_types.pyi +8 -0
  1002. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_unicode.pyi +12 -0
  1003. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_urllib.pyi +15 -0
  1004. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_ws_comma.pyi +12 -0
  1005. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xrange.pyi +20 -0
  1006. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_xreadlines.pyi +8 -0
  1007. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/fixes/fix_zip.pyi +9 -0
  1008. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/main.pyi +42 -0
  1009. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/__init__.pyi +8 -0
  1010. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/driver.pyi +27 -0
  1011. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/grammar.pyi +25 -0
  1012. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/literals.pyi +7 -0
  1013. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/parse.pyi +30 -0
  1014. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/pgen.pyi +53 -0
  1015. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/token.pyi +69 -0
  1016. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pgen2/tokenize.pyi +96 -0
  1017. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pygram.pyi +114 -0
  1018. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/pytree.pyi +118 -0
  1019. package/bundle/_internal/mypy/typeshed/stdlib/lib2to3/refactor.pyi +86 -0
  1020. package/bundle/_internal/mypy/typeshed/stdlib/linecache.pyi +18 -0
  1021. package/bundle/_internal/mypy/typeshed/stdlib/locale.pyi +160 -0
  1022. package/bundle/_internal/mypy/typeshed/stdlib/logging/__init__.pyi +674 -0
  1023. package/bundle/_internal/mypy/typeshed/stdlib/logging/config.pyi +141 -0
  1024. package/bundle/_internal/mypy/typeshed/stdlib/logging/handlers.pyi +258 -0
  1025. package/bundle/_internal/mypy/typeshed/stdlib/lzma.pyi +181 -0
  1026. package/bundle/_internal/mypy/typeshed/stdlib/mailbox.pyi +307 -0
  1027. package/bundle/_internal/mypy/typeshed/stdlib/mailcap.pyi +11 -0
  1028. package/bundle/_internal/mypy/typeshed/stdlib/marshal.pyi +51 -0
  1029. package/bundle/_internal/mypy/typeshed/stdlib/math/__init__.pyi +157 -0
  1030. package/bundle/_internal/mypy/typeshed/stdlib/math/integer.pyi +8 -0
  1031. package/bundle/_internal/mypy/typeshed/stdlib/mimetypes.pyi +56 -0
  1032. package/bundle/_internal/mypy/typeshed/stdlib/mmap.pyi +191 -0
  1033. package/bundle/_internal/mypy/typeshed/stdlib/modulefinder.pyi +68 -0
  1034. package/bundle/_internal/mypy/typeshed/stdlib/msilib/__init__.pyi +177 -0
  1035. package/bundle/_internal/mypy/typeshed/stdlib/msilib/schema.pyi +95 -0
  1036. package/bundle/_internal/mypy/typeshed/stdlib/msilib/sequence.pyi +13 -0
  1037. package/bundle/_internal/mypy/typeshed/stdlib/msilib/text.pyi +8 -0
  1038. package/bundle/_internal/mypy/typeshed/stdlib/msvcrt.pyi +31 -0
  1039. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/__init__.pyi +90 -0
  1040. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/connection.pyi +97 -0
  1041. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/context.pyi +220 -0
  1042. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/__init__.pyi +89 -0
  1043. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/dummy/connection.pyi +39 -0
  1044. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/forkserver.pyi +78 -0
  1045. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/heap.pyi +41 -0
  1046. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/managers.pyi +390 -0
  1047. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/pool.pyi +101 -0
  1048. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_fork.pyi +26 -0
  1049. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_forkserver.pyi +16 -0
  1050. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_posix.pyi +20 -0
  1051. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/popen_spawn_win32.pyi +30 -0
  1052. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/process.pyi +57 -0
  1053. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/queues.pyi +46 -0
  1054. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/reduction.pyi +95 -0
  1055. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_sharer.pyi +20 -0
  1056. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi +21 -0
  1057. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/shared_memory.pyi +43 -0
  1058. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/sharedctypes.pyi +140 -0
  1059. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/spawn.pyi +32 -0
  1060. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/synchronize.pyi +63 -0
  1061. package/bundle/_internal/mypy/typeshed/stdlib/multiprocessing/util.pyi +109 -0
  1062. package/bundle/_internal/mypy/typeshed/stdlib/netrc.pyi +23 -0
  1063. package/bundle/_internal/mypy/typeshed/stdlib/nis.pyi +9 -0
  1064. package/bundle/_internal/mypy/typeshed/stdlib/nntplib.pyi +120 -0
  1065. package/bundle/_internal/mypy/typeshed/stdlib/nt.pyi +116 -0
  1066. package/bundle/_internal/mypy/typeshed/stdlib/ntpath.pyi +134 -0
  1067. package/bundle/_internal/mypy/typeshed/stdlib/nturl2path.pyi +6 -0
  1068. package/bundle/_internal/mypy/typeshed/stdlib/numbers.pyi +220 -0
  1069. package/bundle/_internal/mypy/typeshed/stdlib/opcode.pyi +53 -0
  1070. package/bundle/_internal/mypy/typeshed/stdlib/operator.pyi +219 -0
  1071. package/bundle/_internal/mypy/typeshed/stdlib/optparse.pyi +312 -0
  1072. package/bundle/_internal/mypy/typeshed/stdlib/os/__init__.pyi +1878 -0
  1073. package/bundle/_internal/mypy/typeshed/stdlib/os/path.pyi +8 -0
  1074. package/bundle/_internal/mypy/typeshed/stdlib/ossaudiodev.pyi +132 -0
  1075. package/bundle/_internal/mypy/typeshed/stdlib/pathlib/__init__.pyi +358 -0
  1076. package/bundle/_internal/mypy/typeshed/stdlib/pathlib/types.pyi +8 -0
  1077. package/bundle/_internal/mypy/typeshed/stdlib/pdb.pyi +275 -0
  1078. package/bundle/_internal/mypy/typeshed/stdlib/pickle.pyi +240 -0
  1079. package/bundle/_internal/mypy/typeshed/stdlib/pickletools.pyi +176 -0
  1080. package/bundle/_internal/mypy/typeshed/stdlib/pipes.pyi +16 -0
  1081. package/bundle/_internal/mypy/typeshed/stdlib/pkgutil.pyi +60 -0
  1082. package/bundle/_internal/mypy/typeshed/stdlib/platform.pyi +100 -0
  1083. package/bundle/_internal/mypy/typeshed/stdlib/plistlib.pyi +84 -0
  1084. package/bundle/_internal/mypy/typeshed/stdlib/poplib.pyi +93 -0
  1085. package/bundle/_internal/mypy/typeshed/stdlib/posix.pyi +427 -0
  1086. package/bundle/_internal/mypy/typeshed/stdlib/posixpath.pyi +230 -0
  1087. package/bundle/_internal/mypy/typeshed/stdlib/pprint.pyi +170 -0
  1088. package/bundle/_internal/mypy/typeshed/stdlib/profile.pyi +31 -0
  1089. package/bundle/_internal/mypy/typeshed/stdlib/profiling/__init__.pyi +3 -0
  1090. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/__init__.pyi +17 -0
  1091. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/collector.pyi +25 -0
  1092. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/gecko_collector.pyi +111 -0
  1093. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/heatmap_collector.pyi +24 -0
  1094. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/jsonl_collector.pyi +15 -0
  1095. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/pstats_collector.pyi +17 -0
  1096. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/stack_collector.pyi +40 -0
  1097. package/bundle/_internal/mypy/typeshed/stdlib/profiling/sampling/string_table.pyi +5 -0
  1098. package/bundle/_internal/mypy/typeshed/stdlib/profiling/tracing.pyi +9 -0
  1099. package/bundle/_internal/mypy/typeshed/stdlib/pstats.pyi +96 -0
  1100. package/bundle/_internal/mypy/typeshed/stdlib/pty.pyi +24 -0
  1101. package/bundle/_internal/mypy/typeshed/stdlib/pwd.pyi +27 -0
  1102. package/bundle/_internal/mypy/typeshed/stdlib/py_compile.pyi +28 -0
  1103. package/bundle/_internal/mypy/typeshed/stdlib/pyclbr.pyi +57 -0
  1104. package/bundle/_internal/mypy/typeshed/stdlib/pydoc.pyi +348 -0
  1105. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/__init__.pyi +0 -0
  1106. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/module_docs.pyi +3 -0
  1107. package/bundle/_internal/mypy/typeshed/stdlib/pydoc_data/topics.pyi +3 -0
  1108. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/__init__.pyi +88 -0
  1109. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/errors.pyi +53 -0
  1110. package/bundle/_internal/mypy/typeshed/stdlib/pyexpat/model.pyi +13 -0
  1111. package/bundle/_internal/mypy/typeshed/stdlib/queue.pyi +55 -0
  1112. package/bundle/_internal/mypy/typeshed/stdlib/quopri.pyi +12 -0
  1113. package/bundle/_internal/mypy/typeshed/stdlib/random.pyi +135 -0
  1114. package/bundle/_internal/mypy/typeshed/stdlib/re.pyi +347 -0
  1115. package/bundle/_internal/mypy/typeshed/stdlib/readline.pyi +39 -0
  1116. package/bundle/_internal/mypy/typeshed/stdlib/reprlib.pyi +64 -0
  1117. package/bundle/_internal/mypy/typeshed/stdlib/resource.pyi +102 -0
  1118. package/bundle/_internal/mypy/typeshed/stdlib/rlcompleter.pyi +9 -0
  1119. package/bundle/_internal/mypy/typeshed/stdlib/runpy.pyi +24 -0
  1120. package/bundle/_internal/mypy/typeshed/stdlib/sched.pyi +34 -0
  1121. package/bundle/_internal/mypy/typeshed/stdlib/secrets.pyi +17 -0
  1122. package/bundle/_internal/mypy/typeshed/stdlib/select.pyi +171 -0
  1123. package/bundle/_internal/mypy/typeshed/stdlib/selectors.pyi +67 -0
  1124. package/bundle/_internal/mypy/typeshed/stdlib/shelve.pyi +110 -0
  1125. package/bundle/_internal/mypy/typeshed/stdlib/shlex.pyi +63 -0
  1126. package/bundle/_internal/mypy/typeshed/stdlib/shutil.pyi +243 -0
  1127. package/bundle/_internal/mypy/typeshed/stdlib/signal.pyi +174 -0
  1128. package/bundle/_internal/mypy/typeshed/stdlib/site.pyi +46 -0
  1129. package/bundle/_internal/mypy/typeshed/stdlib/smtpd.pyi +92 -0
  1130. package/bundle/_internal/mypy/typeshed/stdlib/smtplib.pyi +223 -0
  1131. package/bundle/_internal/mypy/typeshed/stdlib/sndhdr.pyi +14 -0
  1132. package/bundle/_internal/mypy/typeshed/stdlib/socket.pyi +1587 -0
  1133. package/bundle/_internal/mypy/typeshed/stdlib/socketserver.pyi +170 -0
  1134. package/bundle/_internal/mypy/typeshed/stdlib/spwd.pyi +45 -0
  1135. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/__init__.pyi +510 -0
  1136. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dbapi2.pyi +244 -0
  1137. package/bundle/_internal/mypy/typeshed/stdlib/sqlite3/dump.pyi +2 -0
  1138. package/bundle/_internal/mypy/typeshed/stdlib/sre_compile.pyi +12 -0
  1139. package/bundle/_internal/mypy/typeshed/stdlib/sre_constants.pyi +135 -0
  1140. package/bundle/_internal/mypy/typeshed/stdlib/sre_parse.pyi +102 -0
  1141. package/bundle/_internal/mypy/typeshed/stdlib/ssl.pyi +540 -0
  1142. package/bundle/_internal/mypy/typeshed/stdlib/stat.pyi +126 -0
  1143. package/bundle/_internal/mypy/typeshed/stdlib/statistics.pyi +161 -0
  1144. package/bundle/_internal/mypy/typeshed/stdlib/string/__init__.pyi +81 -0
  1145. package/bundle/_internal/mypy/typeshed/stdlib/string/templatelib.pyi +36 -0
  1146. package/bundle/_internal/mypy/typeshed/stdlib/stringprep.pyi +29 -0
  1147. package/bundle/_internal/mypy/typeshed/stdlib/struct.pyi +5 -0
  1148. package/bundle/_internal/mypy/typeshed/stdlib/subprocess.pyi +1484 -0
  1149. package/bundle/_internal/mypy/typeshed/stdlib/sunau.pyi +82 -0
  1150. package/bundle/_internal/mypy/typeshed/stdlib/symtable.pyi +95 -0
  1151. package/bundle/_internal/mypy/typeshed/stdlib/sys/__init__.pyi +538 -0
  1152. package/bundle/_internal/mypy/typeshed/stdlib/sys/__jit.pyi +11 -0
  1153. package/bundle/_internal/mypy/typeshed/stdlib/sys/_monitoring.pyi +69 -0
  1154. package/bundle/_internal/mypy/typeshed/stdlib/sysconfig.pyi +59 -0
  1155. package/bundle/_internal/mypy/typeshed/stdlib/syslog.pyi +58 -0
  1156. package/bundle/_internal/mypy/typeshed/stdlib/tabnanny.pyi +16 -0
  1157. package/bundle/_internal/mypy/typeshed/stdlib/tarfile.pyi +868 -0
  1158. package/bundle/_internal/mypy/typeshed/stdlib/telnetlib.pyi +123 -0
  1159. package/bundle/_internal/mypy/typeshed/stdlib/tempfile.pyi +474 -0
  1160. package/bundle/_internal/mypy/typeshed/stdlib/termios.pyi +303 -0
  1161. package/bundle/_internal/mypy/typeshed/stdlib/textwrap.pyi +103 -0
  1162. package/bundle/_internal/mypy/typeshed/stdlib/this.pyi +2 -0
  1163. package/bundle/_internal/mypy/typeshed/stdlib/threading.pyi +221 -0
  1164. package/bundle/_internal/mypy/typeshed/stdlib/time.pyi +117 -0
  1165. package/bundle/_internal/mypy/typeshed/stdlib/timeit.pyi +46 -0
  1166. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/__init__.pyi +4376 -0
  1167. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/colorchooser.pyi +12 -0
  1168. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/commondialog.pyi +14 -0
  1169. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/constants.pyi +80 -0
  1170. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dialog.pyi +13 -0
  1171. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/dnd.pyi +19 -0
  1172. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/filedialog.pyi +149 -0
  1173. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/font.pyi +123 -0
  1174. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/messagebox.pyi +98 -0
  1175. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/scrolledtext.pyi +9 -0
  1176. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/simpledialog.pyi +58 -0
  1177. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/tix.pyi +299 -0
  1178. package/bundle/_internal/mypy/typeshed/stdlib/tkinter/ttk.pyi +1434 -0
  1179. package/bundle/_internal/mypy/typeshed/stdlib/token.pyi +166 -0
  1180. package/bundle/_internal/mypy/typeshed/stdlib/tokenize.pyi +201 -0
  1181. package/bundle/_internal/mypy/typeshed/stdlib/tomllib.pyi +27 -0
  1182. package/bundle/_internal/mypy/typeshed/stdlib/trace.pyi +85 -0
  1183. package/bundle/_internal/mypy/typeshed/stdlib/traceback.pyi +293 -0
  1184. package/bundle/_internal/mypy/typeshed/stdlib/tracemalloc.pyi +123 -0
  1185. package/bundle/_internal/mypy/typeshed/stdlib/tty.pyi +29 -0
  1186. package/bundle/_internal/mypy/typeshed/stdlib/turtle.pyi +856 -0
  1187. package/bundle/_internal/mypy/typeshed/stdlib/types.pyi +744 -0
  1188. package/bundle/_internal/mypy/typeshed/stdlib/typing.pyi +1250 -0
  1189. package/bundle/_internal/mypy/typeshed/stdlib/typing_extensions.pyi +749 -0
  1190. package/bundle/_internal/mypy/typeshed/stdlib/unicodedata.pyi +94 -0
  1191. package/bundle/_internal/mypy/typeshed/stdlib/unittest/__init__.pyi +63 -0
  1192. package/bundle/_internal/mypy/typeshed/stdlib/unittest/_log.pyi +29 -0
  1193. package/bundle/_internal/mypy/typeshed/stdlib/unittest/async_case.pyi +24 -0
  1194. package/bundle/_internal/mypy/typeshed/stdlib/unittest/case.pyi +352 -0
  1195. package/bundle/_internal/mypy/typeshed/stdlib/unittest/loader.pyi +55 -0
  1196. package/bundle/_internal/mypy/typeshed/stdlib/unittest/main.pyi +74 -0
  1197. package/bundle/_internal/mypy/typeshed/stdlib/unittest/mock.pyi +555 -0
  1198. package/bundle/_internal/mypy/typeshed/stdlib/unittest/result.pyi +46 -0
  1199. package/bundle/_internal/mypy/typeshed/stdlib/unittest/runner.pyi +93 -0
  1200. package/bundle/_internal/mypy/typeshed/stdlib/unittest/signals.pyi +15 -0
  1201. package/bundle/_internal/mypy/typeshed/stdlib/unittest/suite.pyi +23 -0
  1202. package/bundle/_internal/mypy/typeshed/stdlib/unittest/util.pyi +39 -0
  1203. package/bundle/_internal/mypy/typeshed/stdlib/urllib/__init__.pyi +0 -0
  1204. package/bundle/_internal/mypy/typeshed/stdlib/urllib/error.pyi +29 -0
  1205. package/bundle/_internal/mypy/typeshed/stdlib/urllib/parse.pyi +354 -0
  1206. package/bundle/_internal/mypy/typeshed/stdlib/urllib/request.pyi +447 -0
  1207. package/bundle/_internal/mypy/typeshed/stdlib/urllib/response.pyi +45 -0
  1208. package/bundle/_internal/mypy/typeshed/stdlib/urllib/robotparser.pyi +20 -0
  1209. package/bundle/_internal/mypy/typeshed/stdlib/uu.pyi +12 -0
  1210. package/bundle/_internal/mypy/typeshed/stdlib/uuid.pyi +106 -0
  1211. package/bundle/_internal/mypy/typeshed/stdlib/venv/__init__.pyi +86 -0
  1212. package/bundle/_internal/mypy/typeshed/stdlib/warnings.pyi +146 -0
  1213. package/bundle/_internal/mypy/typeshed/stdlib/wave.pyi +105 -0
  1214. package/bundle/_internal/mypy/typeshed/stdlib/weakref.pyi +217 -0
  1215. package/bundle/_internal/mypy/typeshed/stdlib/webbrowser.pyi +93 -0
  1216. package/bundle/_internal/mypy/typeshed/stdlib/winreg.pyi +137 -0
  1217. package/bundle/_internal/mypy/typeshed/stdlib/winsound.pyi +40 -0
  1218. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/__init__.pyi +0 -0
  1219. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/handlers.pyi +91 -0
  1220. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/headers.pyi +27 -0
  1221. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/simple_server.pyi +37 -0
  1222. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/types.pyi +31 -0
  1223. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/util.pyi +26 -0
  1224. package/bundle/_internal/mypy/typeshed/stdlib/wsgiref/validate.pyi +50 -0
  1225. package/bundle/_internal/mypy/typeshed/stdlib/xdrlib.pyi +57 -0
  1226. package/bundle/_internal/mypy/typeshed/stdlib/xml/__init__.pyi +9 -0
  1227. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/NodeFilter.pyi +22 -0
  1228. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/__init__.pyi +101 -0
  1229. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/domreg.pyi +8 -0
  1230. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/expatbuilder.pyi +126 -0
  1231. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minicompat.pyi +24 -0
  1232. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/minidom.pyi +693 -0
  1233. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/pulldom.pyi +109 -0
  1234. package/bundle/_internal/mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi +82 -0
  1235. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementInclude.pyi +28 -0
  1236. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementPath.pyi +42 -0
  1237. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/ElementTree.pyi +402 -0
  1238. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/__init__.pyi +0 -0
  1239. package/bundle/_internal/mypy/typeshed/stdlib/xml/etree/cElementTree.pyi +1 -0
  1240. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/__init__.pyi +1 -0
  1241. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/__init__.pyi +7 -0
  1242. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/errors.pyi +1 -0
  1243. package/bundle/_internal/mypy/typeshed/stdlib/xml/parsers/expat/model.pyi +1 -0
  1244. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/__init__.pyi +42 -0
  1245. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/_exceptions.pyi +19 -0
  1246. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/expatreader.pyi +72 -0
  1247. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/handler.pyi +85 -0
  1248. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/saxutils.pyi +69 -0
  1249. package/bundle/_internal/mypy/typeshed/stdlib/xml/sax/xmlreader.pyi +94 -0
  1250. package/bundle/_internal/mypy/typeshed/stdlib/xml/utils.pyi +2 -0
  1251. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/__init__.pyi +0 -0
  1252. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/client.pyi +300 -0
  1253. package/bundle/_internal/mypy/typeshed/stdlib/xmlrpc/server.pyi +149 -0
  1254. package/bundle/_internal/mypy/typeshed/stdlib/xxlimited.pyi +15 -0
  1255. package/bundle/_internal/mypy/typeshed/stdlib/zipapp.pyi +19 -0
  1256. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/__init__.pyi +411 -0
  1257. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/__init__.pyi +87 -0
  1258. package/bundle/_internal/mypy/typeshed/stdlib/zipfile/_path/glob.pyi +26 -0
  1259. package/bundle/_internal/mypy/typeshed/stdlib/zipimport.pyi +44 -0
  1260. package/bundle/_internal/mypy/typeshed/stdlib/zlib.pyi +81 -0
  1261. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/__init__.pyi +36 -0
  1262. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_common.pyi +14 -0
  1263. package/bundle/_internal/mypy/typeshed/stdlib/zoneinfo/_tzpath.pyi +13 -0
  1264. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/__init__.pyi +0 -0
  1265. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/base64.pyi +4 -0
  1266. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/internal.pyi +22 -0
  1267. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/random.pyi +22 -0
  1268. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/strings.pyi +61 -0
  1269. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/threading.pyi +16 -0
  1270. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/time.pyi +1 -0
  1271. package/bundle/_internal/mypy/typeshed/stubs/librt/librt/vecs.pyi +24 -0
  1272. package/bundle/_internal/mypy/typeshed/stubs/mypy-extensions/mypy_extensions.pyi +226 -0
  1273. package/bundle/_internal/mypy/typestate.cpython-312-darwin.so +0 -0
  1274. package/bundle/_internal/mypy/typestate.py +334 -0
  1275. package/bundle/_internal/mypy/typetraverser.cpython-312-darwin.so +0 -0
  1276. package/bundle/_internal/mypy/typetraverser.py +166 -0
  1277. package/bundle/_internal/mypy/typevars.cpython-312-darwin.so +0 -0
  1278. package/bundle/_internal/mypy/typevars.py +84 -0
  1279. package/bundle/_internal/mypy/typevartuples.cpython-312-darwin.so +0 -0
  1280. package/bundle/_internal/mypy/typevartuples.py +36 -0
  1281. package/bundle/_internal/mypy/util.cpython-312-darwin.so +0 -0
  1282. package/bundle/_internal/mypy/util.py +1055 -0
  1283. package/bundle/_internal/mypy/version.py +1 -0
  1284. package/bundle/_internal/mypy/visitor.cpython-312-darwin.so +0 -0
  1285. package/bundle/_internal/mypy/visitor.py +639 -0
  1286. package/bundle/_internal/mypy/xml/mypy-html.css +104 -0
  1287. package/bundle/_internal/mypy/xml/mypy-html.xslt +81 -0
  1288. package/bundle/_internal/mypy/xml/mypy-txt.xslt +100 -0
  1289. package/bundle/_internal/mypy/xml/mypy.xsd +50 -0
  1290. package/bundle/_internal/mypy-2.4.1.dist-info/INSTALLER +1 -0
  1291. package/bundle/_internal/mypy-2.4.1.dist-info/METADATA +56 -0
  1292. package/bundle/_internal/mypy-2.4.1.dist-info/RECORD +1814 -0
  1293. package/bundle/_internal/mypy-2.4.1.dist-info/WHEEL +6 -0
  1294. package/bundle/_internal/mypy-2.4.1.dist-info/entry_points.txt +6 -0
  1295. package/bundle/_internal/mypy-2.4.1.dist-info/licenses/LICENSE +264 -0
  1296. package/bundle/_internal/mypy-2.4.1.dist-info/licenses/mypy/typeshed/LICENSE +237 -0
  1297. package/bundle/_internal/mypy-2.4.1.dist-info/top_level.txt +3 -0
  1298. package/bundle/_internal/mypyc/__init__.cpython-312-darwin.so +0 -0
  1299. package/bundle/_internal/python3.12/lib-dynload/_asyncio.cpython-312-darwin.so +0 -0
  1300. package/bundle/_internal/python3.12/lib-dynload/_bisect.cpython-312-darwin.so +0 -0
  1301. package/bundle/_internal/python3.12/lib-dynload/_blake2.cpython-312-darwin.so +0 -0
  1302. package/bundle/_internal/python3.12/lib-dynload/_bz2.cpython-312-darwin.so +0 -0
  1303. package/bundle/_internal/python3.12/lib-dynload/_codecs_cn.cpython-312-darwin.so +0 -0
  1304. package/bundle/_internal/python3.12/lib-dynload/_codecs_hk.cpython-312-darwin.so +0 -0
  1305. package/bundle/_internal/python3.12/lib-dynload/_codecs_iso2022.cpython-312-darwin.so +0 -0
  1306. package/bundle/_internal/python3.12/lib-dynload/_codecs_jp.cpython-312-darwin.so +0 -0
  1307. package/bundle/_internal/python3.12/lib-dynload/_codecs_kr.cpython-312-darwin.so +0 -0
  1308. package/bundle/_internal/python3.12/lib-dynload/_codecs_tw.cpython-312-darwin.so +0 -0
  1309. package/bundle/_internal/python3.12/lib-dynload/_contextvars.cpython-312-darwin.so +0 -0
  1310. package/bundle/_internal/python3.12/lib-dynload/_csv.cpython-312-darwin.so +0 -0
  1311. package/bundle/_internal/python3.12/lib-dynload/_ctypes.cpython-312-darwin.so +0 -0
  1312. package/bundle/_internal/python3.12/lib-dynload/_curses.cpython-312-darwin.so +0 -0
  1313. package/bundle/_internal/python3.12/lib-dynload/_datetime.cpython-312-darwin.so +0 -0
  1314. package/bundle/_internal/python3.12/lib-dynload/_decimal.cpython-312-darwin.so +0 -0
  1315. package/bundle/_internal/python3.12/lib-dynload/_elementtree.cpython-312-darwin.so +0 -0
  1316. package/bundle/_internal/python3.12/lib-dynload/_hashlib.cpython-312-darwin.so +0 -0
  1317. package/bundle/_internal/python3.12/lib-dynload/_heapq.cpython-312-darwin.so +0 -0
  1318. package/bundle/_internal/python3.12/lib-dynload/_json.cpython-312-darwin.so +0 -0
  1319. package/bundle/_internal/python3.12/lib-dynload/_lzma.cpython-312-darwin.so +0 -0
  1320. package/bundle/_internal/python3.12/lib-dynload/_md5.cpython-312-darwin.so +0 -0
  1321. package/bundle/_internal/python3.12/lib-dynload/_multibytecodec.cpython-312-darwin.so +0 -0
  1322. package/bundle/_internal/python3.12/lib-dynload/_multiprocessing.cpython-312-darwin.so +0 -0
  1323. package/bundle/_internal/python3.12/lib-dynload/_opcode.cpython-312-darwin.so +0 -0
  1324. package/bundle/_internal/python3.12/lib-dynload/_pickle.cpython-312-darwin.so +0 -0
  1325. package/bundle/_internal/python3.12/lib-dynload/_posixshmem.cpython-312-darwin.so +0 -0
  1326. package/bundle/_internal/python3.12/lib-dynload/_posixsubprocess.cpython-312-darwin.so +0 -0
  1327. package/bundle/_internal/python3.12/lib-dynload/_queue.cpython-312-darwin.so +0 -0
  1328. package/bundle/_internal/python3.12/lib-dynload/_random.cpython-312-darwin.so +0 -0
  1329. package/bundle/_internal/python3.12/lib-dynload/_scproxy.cpython-312-darwin.so +0 -0
  1330. package/bundle/_internal/python3.12/lib-dynload/_sha1.cpython-312-darwin.so +0 -0
  1331. package/bundle/_internal/python3.12/lib-dynload/_sha2.cpython-312-darwin.so +0 -0
  1332. package/bundle/_internal/python3.12/lib-dynload/_sha3.cpython-312-darwin.so +0 -0
  1333. package/bundle/_internal/python3.12/lib-dynload/_socket.cpython-312-darwin.so +0 -0
  1334. package/bundle/_internal/python3.12/lib-dynload/_sqlite3.cpython-312-darwin.so +0 -0
  1335. package/bundle/_internal/python3.12/lib-dynload/_ssl.cpython-312-darwin.so +0 -0
  1336. package/bundle/_internal/python3.12/lib-dynload/_statistics.cpython-312-darwin.so +0 -0
  1337. package/bundle/_internal/python3.12/lib-dynload/_struct.cpython-312-darwin.so +0 -0
  1338. package/bundle/_internal/python3.12/lib-dynload/_uuid.cpython-312-darwin.so +0 -0
  1339. package/bundle/_internal/python3.12/lib-dynload/array.cpython-312-darwin.so +0 -0
  1340. package/bundle/_internal/python3.12/lib-dynload/binascii.cpython-312-darwin.so +0 -0
  1341. package/bundle/_internal/python3.12/lib-dynload/fcntl.cpython-312-darwin.so +0 -0
  1342. package/bundle/_internal/python3.12/lib-dynload/grp.cpython-312-darwin.so +0 -0
  1343. package/bundle/_internal/python3.12/lib-dynload/math.cpython-312-darwin.so +0 -0
  1344. package/bundle/_internal/python3.12/lib-dynload/mmap.cpython-312-darwin.so +0 -0
  1345. package/bundle/_internal/python3.12/lib-dynload/pyexpat.cpython-312-darwin.so +0 -0
  1346. package/bundle/_internal/python3.12/lib-dynload/readline.cpython-312-darwin.so +0 -0
  1347. package/bundle/_internal/python3.12/lib-dynload/resource.cpython-312-darwin.so +0 -0
  1348. package/bundle/_internal/python3.12/lib-dynload/select.cpython-312-darwin.so +0 -0
  1349. package/bundle/_internal/python3.12/lib-dynload/syslog.cpython-312-darwin.so +0 -0
  1350. package/bundle/_internal/python3.12/lib-dynload/termios.cpython-312-darwin.so +0 -0
  1351. package/bundle/_internal/python3.12/lib-dynload/unicodedata.cpython-312-darwin.so +0 -0
  1352. package/bundle/_internal/python3.12/lib-dynload/zlib.cpython-312-darwin.so +0 -0
  1353. package/bundle/_internal/radon/__init__.py +21 -0
  1354. package/bundle/_internal/radon/__main__.py +4 -0
  1355. package/bundle/_internal/radon/cli/__init__.py +433 -0
  1356. package/bundle/_internal/radon/cli/colors.py +49 -0
  1357. package/bundle/_internal/radon/cli/harvest.py +449 -0
  1358. package/bundle/_internal/radon/cli/tools.py +597 -0
  1359. package/bundle/_internal/radon/complexity.py +108 -0
  1360. package/bundle/_internal/radon/contrib/__init__.py +0 -0
  1361. package/bundle/_internal/radon/contrib/flake8.py +72 -0
  1362. package/bundle/_internal/radon/metrics.py +157 -0
  1363. package/bundle/_internal/radon/raw.py +245 -0
  1364. package/bundle/_internal/radon/tests/__init__.py +0 -0
  1365. package/bundle/_internal/radon/tests/conftest.py +31 -0
  1366. package/bundle/_internal/radon/tests/data/__init__.py +5 -0
  1367. package/bundle/_internal/radon/tests/data/no_encoding.py +2 -0
  1368. package/bundle/_internal/radon/tests/data/py3unicode.py +5 -0
  1369. package/bundle/_internal/radon/tests/run.py +14 -0
  1370. package/bundle/_internal/radon/tests/test_cli.py +282 -0
  1371. package/bundle/_internal/radon/tests/test_cli_colors.py +22 -0
  1372. package/bundle/_internal/radon/tests/test_cli_harvest.py +392 -0
  1373. package/bundle/_internal/radon/tests/test_cli_tools.py +616 -0
  1374. package/bundle/_internal/radon/tests/test_complexity_utils.py +118 -0
  1375. package/bundle/_internal/radon/tests/test_complexity_visitor.py +754 -0
  1376. package/bundle/_internal/radon/tests/test_halstead.py +113 -0
  1377. package/bundle/_internal/radon/tests/test_ipynb.py +141 -0
  1378. package/bundle/_internal/radon/tests/test_other_metrics.py +169 -0
  1379. package/bundle/_internal/radon/tests/test_raw.py +467 -0
  1380. package/bundle/_internal/radon/visitors.py +460 -0
  1381. package/bundle/_internal/radon-6.0.1.dist-info/INSTALLER +1 -0
  1382. package/bundle/_internal/radon-6.0.1.dist-info/LICENSE +22 -0
  1383. package/bundle/_internal/radon-6.0.1.dist-info/METADATA +263 -0
  1384. package/bundle/_internal/radon-6.0.1.dist-info/RECORD +64 -0
  1385. package/bundle/_internal/radon-6.0.1.dist-info/WHEEL +6 -0
  1386. package/bundle/_internal/radon-6.0.1.dist-info/entry_points.txt +8 -0
  1387. package/bundle/_internal/radon-6.0.1.dist-info/top_level.txt +1 -0
  1388. package/bundle/_internal/setuptools/_vendor/jaraco/text/Lorem ipsum.txt +2 -0
  1389. package/bundle/_internal/stevedore-5.10.0.dist-info/INSTALLER +1 -0
  1390. package/bundle/_internal/stevedore-5.10.0.dist-info/METADATA +56 -0
  1391. package/bundle/_internal/stevedore-5.10.0.dist-info/RECORD +84 -0
  1392. package/bundle/_internal/stevedore-5.10.0.dist-info/WHEEL +5 -0
  1393. package/bundle/_internal/stevedore-5.10.0.dist-info/entry_points.txt +10 -0
  1394. package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/AUTHORS +76 -0
  1395. package/bundle/_internal/stevedore-5.10.0.dist-info/licenses/LICENSE +202 -0
  1396. package/bundle/_internal/stevedore-5.10.0.dist-info/pbr.json +1 -0
  1397. package/bundle/_internal/stevedore-5.10.0.dist-info/top_level.txt +1 -0
  1398. package/bundle/_internal/tqdm-4.70.1.dist-info/INSTALLER +1 -0
  1399. package/bundle/_internal/tqdm-4.70.1.dist-info/METADATA +1600 -0
  1400. package/bundle/_internal/tqdm-4.70.1.dist-info/RECORD +72 -0
  1401. package/bundle/_internal/tqdm-4.70.1.dist-info/WHEEL +5 -0
  1402. package/bundle/_internal/tqdm-4.70.1.dist-info/entry_points.txt +2 -0
  1403. package/bundle/_internal/tqdm-4.70.1.dist-info/licenses/LICENCE +49 -0
  1404. package/bundle/_internal/tqdm-4.70.1.dist-info/top_level.txt +1 -0
  1405. package/bundle/_internal/yaml/_yaml.cpython-312-darwin.so +0 -0
  1406. package/bundle/gnost +0 -0
  1407. package/package.json +10 -7
@@ -0,0 +1,2064 @@
1
+ #!/usr/bin/env python3
2
+ """Generator of dynamically typed draft stubs for arbitrary modules.
3
+
4
+ The logic of this script can be split in three steps:
5
+ * parsing options and finding sources:
6
+ - use runtime imports be default (to find also C modules)
7
+ - or use mypy's mechanisms, if importing is prohibited
8
+ * (optionally) semantically analysing the sources using mypy (as a single set)
9
+ * emitting the stubs text:
10
+ - for Python modules: from ASTs using ASTStubGenerator
11
+ - for C modules using runtime introspection and (optionally) Sphinx docs
12
+
13
+ During first and third steps some problematic files can be skipped, but any
14
+ blocking error during second step will cause the whole program to stop.
15
+
16
+ Basic usage:
17
+
18
+ $ stubgen foo.py bar.py some_directory
19
+ => Generate out/foo.pyi, out/bar.pyi, and stubs for some_directory (recursively).
20
+
21
+ $ stubgen -m urllib.parse
22
+ => Generate out/urllib/parse.pyi.
23
+
24
+ $ stubgen -p urllib
25
+ => Generate stubs for whole urllib package (recursively).
26
+
27
+ For C modules, you can get more precise function signatures by parsing .rst (Sphinx)
28
+ documentation for extra information. For this, use the --doc-dir option:
29
+
30
+ $ stubgen --doc-dir <DIR>/Python-3.4.2/Doc/library -m curses
31
+
32
+ Note: The generated stubs should be verified manually.
33
+
34
+ TODO:
35
+ - maybe use .rst docs also for Python modules
36
+ - maybe export more imported names if there is no __all__ (this affects ssl.SSLError, for example)
37
+ - a quick and dirty heuristic would be to turn this on if a module has something like
38
+ 'from x import y as _y'
39
+ - we don't seem to always detect properties ('closed' in 'io', for example)
40
+ """
41
+
42
+ from __future__ import annotations
43
+
44
+ import argparse
45
+ import keyword
46
+ import os
47
+ import os.path
48
+ import sys
49
+ import traceback
50
+ from collections.abc import Iterable, Iterator
51
+ from typing import Final
52
+
53
+ import mypy.build
54
+ import mypy.mixedtraverser
55
+ import mypy.parse
56
+ import mypy.traverser
57
+ import mypy.util
58
+ import mypy.version
59
+ from mypy.build import build
60
+ from mypy.errors import CompileError, Errors
61
+ from mypy.find_sources import InvalidSourceList, create_source_list
62
+ from mypy.modulefinder import (
63
+ BuildSource,
64
+ FindModuleCache,
65
+ ModuleNotFoundReason,
66
+ SearchPaths,
67
+ default_lib_path,
68
+ )
69
+ from mypy.moduleinspect import ModuleInspect, is_pyc_only
70
+ from mypy.nodes import (
71
+ ARG_NAMED,
72
+ ARG_POS,
73
+ ARG_STAR,
74
+ ARG_STAR2,
75
+ IS_ABSTRACT,
76
+ NOT_ABSTRACT,
77
+ AssignmentStmt,
78
+ Block,
79
+ BytesExpr,
80
+ CallExpr,
81
+ CastExpr,
82
+ ClassDef,
83
+ ComparisonExpr,
84
+ ComplexExpr,
85
+ ConditionalExpr,
86
+ Decorator,
87
+ DictExpr,
88
+ DictionaryComprehension,
89
+ EllipsisExpr,
90
+ Expression,
91
+ ExpressionStmt,
92
+ FloatExpr,
93
+ FuncBase,
94
+ FuncDef,
95
+ GeneratorExpr,
96
+ IfStmt,
97
+ Import,
98
+ ImportAll,
99
+ ImportFrom,
100
+ IndexExpr,
101
+ IntExpr,
102
+ LambdaExpr,
103
+ ListComprehension,
104
+ ListExpr,
105
+ MemberExpr,
106
+ MypyFile,
107
+ NameExpr,
108
+ OpExpr,
109
+ OverloadedFuncDef,
110
+ SetComprehension,
111
+ SetExpr,
112
+ SliceExpr,
113
+ StarExpr,
114
+ Statement,
115
+ StrExpr,
116
+ TemplateStrExpr,
117
+ TempNode,
118
+ TupleExpr,
119
+ TypeAliasStmt,
120
+ TypeInfo,
121
+ UnaryExpr,
122
+ Var,
123
+ )
124
+ from mypy.options import Options as MypyOptions
125
+ from mypy.plugins.dataclasses import DATACLASS_FIELD_SPECIFIERS
126
+ from mypy.semanal_shared import find_dataclass_transform_spec
127
+ from mypy.sharedparse import MAGIC_METHODS_POS_ARGS_ONLY
128
+ from mypy.stubdoc import ArgSig, FunctionSig
129
+ from mypy.stubgenc import InspectionStubGenerator, generate_stub_for_c_module
130
+ from mypy.stubutil import (
131
+ TYPING_BUILTIN_REPLACEMENTS,
132
+ BaseStubGenerator,
133
+ CantImport,
134
+ ClassInfo,
135
+ FunctionContext,
136
+ common_dir_prefix,
137
+ fail_missing,
138
+ find_module_path_and_all_py3,
139
+ generate_guarded,
140
+ infer_method_arg_types,
141
+ infer_method_ret_type,
142
+ remove_misplaced_type_comments,
143
+ report_missing,
144
+ walk_packages,
145
+ )
146
+ from mypy.traverser import (
147
+ all_yield_expressions,
148
+ has_return_statement,
149
+ has_yield_expression,
150
+ has_yield_from_expression,
151
+ )
152
+ from mypy.types import (
153
+ DATACLASS_TRANSFORM_NAMES,
154
+ OVERLOAD_NAMES,
155
+ TPDICT_NAMES,
156
+ TYPE_VAR_LIKE_NAMES,
157
+ TYPED_NAMEDTUPLE_NAMES,
158
+ AnyType,
159
+ CallableType,
160
+ Instance,
161
+ TupleType,
162
+ Type,
163
+ UnboundType,
164
+ get_proper_type,
165
+ )
166
+ from mypy.visitor import NodeVisitor
167
+
168
+ # Common ways of naming package containing vendored modules.
169
+ VENDOR_PACKAGES: Final = ["packages", "vendor", "vendored", "_vendor", "_vendored_packages"]
170
+
171
+ # Avoid some file names that are unnecessary or likely to cause trouble (\n for end of path).
172
+ BLACKLIST: Final = [
173
+ "/six.py\n", # Likely vendored six; too dynamic for us to handle
174
+ "/vendored/", # Vendored packages
175
+ "/vendor/", # Vendored packages
176
+ "/_vendor/",
177
+ "/_vendored_packages/",
178
+ ]
179
+
180
+ # These methods are expected to always return a non-trivial value.
181
+ METHODS_WITH_RETURN_VALUE: Final = {
182
+ "__ne__",
183
+ "__eq__",
184
+ "__lt__",
185
+ "__le__",
186
+ "__gt__",
187
+ "__ge__",
188
+ "__hash__",
189
+ "__iter__",
190
+ }
191
+
192
+
193
+ class Options:
194
+ """Represents stubgen options.
195
+
196
+ This class is mutable to simplify testing.
197
+ """
198
+
199
+ def __init__(
200
+ self,
201
+ pyversion: tuple[int, int],
202
+ no_import: bool,
203
+ inspect: bool,
204
+ doc_dir: str,
205
+ search_path: list[str],
206
+ interpreter: str,
207
+ parse_only: bool,
208
+ ignore_errors: bool,
209
+ include_private: bool,
210
+ output_dir: str,
211
+ modules: list[str],
212
+ packages: list[str],
213
+ files: list[str],
214
+ verbose: bool,
215
+ quiet: bool,
216
+ export_less: bool,
217
+ include_docstrings: bool,
218
+ ) -> None:
219
+ # See parse_options for descriptions of the flags.
220
+ self.pyversion = pyversion
221
+ self.no_import = no_import
222
+ self.inspect = inspect
223
+ self.doc_dir = doc_dir
224
+ self.search_path = search_path
225
+ self.interpreter = interpreter
226
+ self.decointerpreter = interpreter
227
+ self.parse_only = parse_only
228
+ self.ignore_errors = ignore_errors
229
+ self.include_private = include_private
230
+ self.output_dir = output_dir
231
+ self.modules = modules
232
+ self.packages = packages
233
+ self.files = files
234
+ self.verbose = verbose
235
+ self.quiet = quiet
236
+ self.export_less = export_less
237
+ self.include_docstrings = include_docstrings
238
+
239
+
240
+ class StubSource:
241
+ """A single source for stub: can be a Python or C module.
242
+
243
+ A simple extension of BuildSource that also carries the AST and
244
+ the value of __all__ detected at runtime.
245
+ """
246
+
247
+ def __init__(
248
+ self, module: str, path: str | None = None, runtime_all: list[str] | None = None
249
+ ) -> None:
250
+ self.source = BuildSource(path, module, None)
251
+ self.runtime_all = runtime_all
252
+ self.ast: MypyFile | None = None
253
+
254
+ def __repr__(self) -> str:
255
+ return f"StubSource({self.source})"
256
+
257
+ @property
258
+ def module(self) -> str:
259
+ return self.source.module
260
+
261
+ @property
262
+ def path(self) -> str | None:
263
+ return self.source.path
264
+
265
+
266
+ # What was generated previously in the stub file. We keep track of these to generate
267
+ # nicely formatted output (add empty line between non-empty classes, for example).
268
+ EMPTY: Final = "EMPTY"
269
+ FUNC: Final = "FUNC"
270
+ CLASS: Final = "CLASS"
271
+ EMPTY_CLASS: Final = "EMPTY_CLASS"
272
+ VAR: Final = "VAR"
273
+ NOT_IN_ALL: Final = "NOT_IN_ALL"
274
+
275
+ # Indicates that we failed to generate a reasonable output
276
+ # for a given node. These should be manually replaced by a user.
277
+
278
+ ERROR_MARKER: Final = "<ERROR>"
279
+
280
+
281
+ class AliasPrinter(NodeVisitor[str]):
282
+ """Visitor used to collect type aliases _and_ type variable definitions.
283
+
284
+ Visit r.h.s of the definition to get the string representation of type alias.
285
+ """
286
+
287
+ def __init__(self, stubgen: ASTStubGenerator) -> None:
288
+ self.stubgen = stubgen
289
+ super().__init__()
290
+
291
+ def visit_call_expr(self, node: CallExpr) -> str:
292
+ # Call expressions are not usually types, but we also treat `X = TypeVar(...)` as a
293
+ # type alias that has to be preserved (even if TypeVar is not the same as an alias)
294
+ callee = node.callee.accept(self)
295
+ args = []
296
+ for name, arg, kind in zip(node.arg_names, node.args, node.arg_kinds):
297
+ if kind == ARG_POS:
298
+ args.append(arg.accept(self))
299
+ elif kind == ARG_STAR:
300
+ args.append("*" + arg.accept(self))
301
+ elif kind == ARG_STAR2:
302
+ args.append("**" + arg.accept(self))
303
+ elif kind == ARG_NAMED:
304
+ args.append(f"{name}={arg.accept(self)}")
305
+ else:
306
+ raise ValueError(f"Unknown argument kind {kind} in call")
307
+ return f"{callee}({', '.join(args)})"
308
+
309
+ def _visit_ref_expr(self, node: NameExpr | MemberExpr) -> str:
310
+ fullname = self.stubgen.get_fullname(node)
311
+ if fullname in TYPING_BUILTIN_REPLACEMENTS:
312
+ return self.stubgen.add_name(TYPING_BUILTIN_REPLACEMENTS[fullname], require=False)
313
+ qualname = get_qualified_name(node)
314
+ self.stubgen.import_tracker.require_name(qualname)
315
+ return qualname
316
+
317
+ def visit_name_expr(self, node: NameExpr) -> str:
318
+ return self._visit_ref_expr(node)
319
+
320
+ def visit_member_expr(self, o: MemberExpr) -> str:
321
+ return self._visit_ref_expr(o)
322
+
323
+ def _visit_literal_node(
324
+ self, node: StrExpr | BytesExpr | IntExpr | FloatExpr | ComplexExpr
325
+ ) -> str:
326
+ return repr(node.value)
327
+
328
+ def visit_str_expr(self, node: StrExpr) -> str:
329
+ return self._visit_literal_node(node)
330
+
331
+ def visit_bytes_expr(self, node: BytesExpr) -> str:
332
+ return f"b{self._visit_literal_node(node)}"
333
+
334
+ def visit_int_expr(self, node: IntExpr) -> str:
335
+ return self._visit_literal_node(node)
336
+
337
+ def visit_float_expr(self, node: FloatExpr) -> str:
338
+ return self._visit_literal_node(node)
339
+
340
+ def visit_complex_expr(self, node: ComplexExpr) -> str:
341
+ return self._visit_literal_node(node)
342
+
343
+ def visit_index_expr(self, node: IndexExpr) -> str:
344
+ base_fullname = self.stubgen.get_fullname(node.base)
345
+ if base_fullname == "typing.Union":
346
+ if isinstance(node.index, TupleExpr):
347
+ return " | ".join([item.accept(self) for item in node.index.items])
348
+ return node.index.accept(self)
349
+ if base_fullname == "typing.Optional":
350
+ if isinstance(node.index, TupleExpr):
351
+ return self.stubgen.add_name("_typeshed.Incomplete")
352
+ return f"{node.index.accept(self)} | None"
353
+ base = node.base.accept(self)
354
+ index = node.index.accept(self)
355
+ if len(index) > 2 and index.startswith("(") and index.endswith(")"):
356
+ index = index[1:-1].rstrip(",")
357
+ return f"{base}[{index}]"
358
+
359
+ def visit_tuple_expr(self, node: TupleExpr) -> str:
360
+ suffix = "," if len(node.items) == 1 else ""
361
+ return f"({', '.join(n.accept(self) for n in node.items)}{suffix})"
362
+
363
+ def visit_list_expr(self, node: ListExpr) -> str:
364
+ return f"[{', '.join(n.accept(self) for n in node.items)}]"
365
+
366
+ def visit_set_expr(self, node: SetExpr) -> str:
367
+ return f"{{{', '.join(n.accept(self) for n in node.items)}}}"
368
+
369
+ def visit_dict_expr(self, o: DictExpr) -> str:
370
+ dict_items = []
371
+ for key, value in o.items:
372
+ # This is currently only used for TypedDict where all keys are strings.
373
+ assert isinstance(key, StrExpr)
374
+ dict_items.append(f"{key.accept(self)}: {value.accept(self)}")
375
+ return f"{{{', '.join(dict_items)}}}"
376
+
377
+ def visit_template_str_expr(self, o: TemplateStrExpr) -> str:
378
+ return self.stubgen.add_name("_typeshed.Incomplete")
379
+
380
+ def visit_ellipsis(self, node: EllipsisExpr) -> str:
381
+ return "..."
382
+
383
+ def visit_op_expr(self, o: OpExpr) -> str:
384
+ return f"{o.left.accept(self)} {o.op} {o.right.accept(self)}"
385
+
386
+ def visit_unary_expr(self, o: UnaryExpr, /) -> str:
387
+ return f"{o.op}{o.expr.accept(self)}"
388
+
389
+ def visit_slice_expr(self, o: SliceExpr, /) -> str:
390
+ blocks = [
391
+ o.begin_index.accept(self) if o.begin_index is not None else "",
392
+ o.end_index.accept(self) if o.end_index is not None else "",
393
+ ]
394
+ if o.stride is not None:
395
+ blocks.append(o.stride.accept(self))
396
+ return ":".join(blocks)
397
+
398
+ def visit_star_expr(self, o: StarExpr) -> str:
399
+ return f"*{o.expr.accept(self)}"
400
+
401
+ def visit_lambda_expr(self, o: LambdaExpr) -> str:
402
+ # TODO: Required for among other things dataclass.field default_factory
403
+ return self.stubgen.add_name("_typeshed.Incomplete")
404
+
405
+ def _visit_unsupported_expr(self, o: object) -> str:
406
+ # Something we do not understand.
407
+ return self.stubgen.add_name("_typeshed.Incomplete")
408
+
409
+ def visit_comparison_expr(self, o: ComparisonExpr) -> str:
410
+ return self._visit_unsupported_expr(o)
411
+
412
+ def visit_cast_expr(self, o: CastExpr) -> str:
413
+ return self._visit_unsupported_expr(o)
414
+
415
+ def visit_conditional_expr(self, o: ConditionalExpr) -> str:
416
+ return self._visit_unsupported_expr(o)
417
+
418
+ def visit_list_comprehension(self, o: ListComprehension) -> str:
419
+ return self._visit_unsupported_expr(o)
420
+
421
+ def visit_set_comprehension(self, o: SetComprehension) -> str:
422
+ return self._visit_unsupported_expr(o)
423
+
424
+ def visit_dictionary_comprehension(self, o: DictionaryComprehension) -> str:
425
+ return self._visit_unsupported_expr(o)
426
+
427
+ def visit_generator_expr(self, o: GeneratorExpr) -> str:
428
+ return self._visit_unsupported_expr(o)
429
+
430
+
431
+ def find_defined_names(file: MypyFile) -> set[str]:
432
+ finder = DefinitionFinder()
433
+ file.accept(finder)
434
+ return finder.names
435
+
436
+
437
+ def get_assigned_names(lvalues: Iterable[Expression]) -> Iterator[str]:
438
+ for lvalue in lvalues:
439
+ if isinstance(lvalue, NameExpr):
440
+ yield lvalue.name
441
+ elif isinstance(lvalue, TupleExpr):
442
+ yield from get_assigned_names(lvalue.items)
443
+
444
+
445
+ class DefinitionFinder(mypy.traverser.TraverserVisitor):
446
+ """Find names of things defined at the top level of a module."""
447
+
448
+ def __init__(self) -> None:
449
+ # Short names of things defined at the top level.
450
+ self.names: set[str] = set()
451
+
452
+ def visit_class_def(self, o: ClassDef) -> None:
453
+ # Don't recurse into classes, as we only keep track of top-level definitions.
454
+ self.names.add(o.name)
455
+
456
+ def visit_func_def(self, o: FuncDef) -> None:
457
+ # Don't recurse, as we only keep track of top-level definitions.
458
+ self.names.add(o.name)
459
+
460
+ def visit_assignment_stmt(self, o: AssignmentStmt) -> None:
461
+ for name in get_assigned_names(o.lvalues):
462
+ self.names.add(name)
463
+
464
+ def visit_type_alias_stmt(self, o: TypeAliasStmt) -> None:
465
+ self.names.add(o.name.name)
466
+
467
+
468
+ def find_referenced_names(file: MypyFile) -> set[str]:
469
+ finder = ReferenceFinder()
470
+ file.accept(finder)
471
+ return finder.refs
472
+
473
+
474
+ def is_none_expr(expr: Expression) -> bool:
475
+ return isinstance(expr, NameExpr) and expr.name == "None"
476
+
477
+
478
+ class ReferenceFinder(mypy.mixedtraverser.MixedTraverserVisitor):
479
+ """Find all name references (both local and global)."""
480
+
481
+ # TODO: Filter out local variable and class attribute references
482
+
483
+ def __init__(self) -> None:
484
+ # Short names of things defined at the top level.
485
+ self.refs: set[str] = set()
486
+
487
+ def visit_block(self, block: Block) -> None:
488
+ if not block.is_unreachable:
489
+ super().visit_block(block)
490
+
491
+ def visit_name_expr(self, e: NameExpr) -> None:
492
+ self.refs.add(e.name)
493
+
494
+ def visit_instance(self, t: Instance) -> None:
495
+ self.add_ref(t.type.name)
496
+ super().visit_instance(t)
497
+
498
+ def visit_unbound_type(self, t: UnboundType) -> None:
499
+ if t.name:
500
+ self.add_ref(t.name)
501
+
502
+ def visit_tuple_type(self, t: TupleType) -> None:
503
+ # Ignore fallback
504
+ for item in t.items:
505
+ item.accept(self)
506
+
507
+ def visit_callable_type(self, t: CallableType) -> None:
508
+ # Ignore fallback
509
+ for arg in t.arg_types:
510
+ arg.accept(self)
511
+ t.ret_type.accept(self)
512
+
513
+ def add_ref(self, fullname: str) -> None:
514
+ self.refs.add(fullname)
515
+ while "." in fullname:
516
+ fullname = fullname.rsplit(".", 1)[0]
517
+ self.refs.add(fullname)
518
+
519
+
520
+ class ASTStubGenerator(BaseStubGenerator, mypy.traverser.TraverserVisitor):
521
+ """Generate stub text from a mypy AST."""
522
+
523
+ def __init__(
524
+ self,
525
+ _all_: list[str] | None = None,
526
+ include_private: bool = False,
527
+ analyzed: bool = False,
528
+ export_less: bool = False,
529
+ include_docstrings: bool = False,
530
+ ) -> None:
531
+ super().__init__(_all_, include_private, export_less, include_docstrings)
532
+ self._decorators: list[str] = []
533
+ # Stack of defined variables (per scope).
534
+ self._vars: list[list[str]] = [[]]
535
+ # What was generated previously in the stub file.
536
+ self._state = EMPTY
537
+ self._class_stack: list[ClassDef] = []
538
+ # Was the tree semantically analysed before?
539
+ self.analyzed = analyzed
540
+ # Short names of methods defined in the body of the current class
541
+ self.method_names: set[str] = set()
542
+ self.processing_enum = False
543
+ self.processing_dataclass = False
544
+ self.dataclass_field_specifier: tuple[str, ...] = ()
545
+
546
+ @property
547
+ def _current_class(self) -> ClassDef | None:
548
+ return self._class_stack[-1] if self._class_stack else None
549
+
550
+ def visit_mypy_file(self, o: MypyFile) -> None:
551
+ self.module_name = o.fullname # Current module being processed
552
+ self.path = o.path
553
+ self.set_defined_names(find_defined_names(o))
554
+ self.referenced_names = find_referenced_names(o)
555
+ super().visit_mypy_file(o)
556
+ self.check_undefined_names()
557
+
558
+ def visit_overloaded_func_def(self, o: OverloadedFuncDef) -> None:
559
+ """@property with setters and getters, @overload chain and some others."""
560
+ overload_chain = False
561
+ for item in o.items:
562
+ if not isinstance(item, Decorator):
563
+ continue
564
+ if self.is_private_name(item.func.name, item.func.fullname):
565
+ continue
566
+
567
+ self.process_decorator(item)
568
+ if not overload_chain:
569
+ self.visit_func_def(item.func)
570
+ if item.func.is_overload:
571
+ overload_chain = True
572
+ elif item.func.is_overload:
573
+ self.visit_func_def(item.func)
574
+ else:
575
+ # skip the overload implementation and clear the decorator we just processed
576
+ self.clear_decorators()
577
+
578
+ def get_default_function_sig(self, func_def: FuncDef, ctx: FunctionContext) -> FunctionSig:
579
+ args = self._get_func_args(func_def, ctx)
580
+ retname = self._get_func_return(func_def, ctx)
581
+ type_args = self.format_type_args(func_def)
582
+ return FunctionSig(func_def.name, args, retname, type_args)
583
+
584
+ def _get_func_args(self, o: FuncDef, ctx: FunctionContext) -> list[ArgSig]:
585
+ args: list[ArgSig] = []
586
+
587
+ # Ignore pos-only status of magic methods whose args names are elided by mypy at parse
588
+ actually_pos_only_args = o.name not in MAGIC_METHODS_POS_ARGS_ONLY
589
+ pos_only_marker_position = 0 # Where to insert "/", if any
590
+ for i, arg_ in enumerate(o.arguments):
591
+ var = arg_.variable
592
+ kind = arg_.kind
593
+ name = var.name
594
+ annotated_type = (
595
+ o.unanalyzed_type.arg_types[i]
596
+ if isinstance(o.unanalyzed_type, CallableType)
597
+ else None
598
+ )
599
+ # I think the name check is incorrect: there are libraries which
600
+ # name their 0th argument other than self/cls
601
+ is_self_arg = i == 0 and name == "self"
602
+ is_cls_arg = i == 0 and name == "cls"
603
+ typename: str | None = None
604
+ if annotated_type and not is_self_arg and not is_cls_arg:
605
+ # Luckily, an argument explicitly annotated with "Any" has
606
+ # type "UnboundType" and will not match.
607
+ if not isinstance(get_proper_type(annotated_type), AnyType):
608
+ typename = self.print_annotation(annotated_type)
609
+
610
+ if actually_pos_only_args and arg_.pos_only:
611
+ pos_only_marker_position += 1
612
+
613
+ if kind.is_named() and not any(arg.name.startswith("*") for arg in args):
614
+ args.append(ArgSig("*"))
615
+
616
+ default = "..."
617
+ if arg_.initializer:
618
+ if not typename:
619
+ typename = self.get_str_type_of_node(arg_.initializer, can_be_incomplete=False)
620
+ potential_default, valid = self.get_str_default_of_node(arg_.initializer)
621
+ if valid and len(potential_default) <= 200:
622
+ default = potential_default
623
+ elif kind == ARG_STAR:
624
+ name = f"*{name}"
625
+ elif kind == ARG_STAR2:
626
+ name = f"**{name}"
627
+
628
+ args.append(
629
+ ArgSig(name, typename, default=bool(arg_.initializer), default_value=default)
630
+ )
631
+ if pos_only_marker_position:
632
+ args.insert(pos_only_marker_position, ArgSig("/"))
633
+
634
+ if ctx.class_info is not None and all(
635
+ arg.type is None and arg.default is False for arg in args
636
+ ):
637
+ new_args = infer_method_arg_types(
638
+ ctx.name, ctx.class_info.self_var, [arg.name for arg in args]
639
+ )
640
+
641
+ if ctx.name == "__exit__":
642
+ self.import_tracker.add_import("types")
643
+ self.import_tracker.require_name("types")
644
+
645
+ if new_args is not None:
646
+ args = new_args
647
+
648
+ return args
649
+
650
+ def _get_func_return(self, o: FuncDef, ctx: FunctionContext) -> str | None:
651
+ if o.name != "__init__" and isinstance(o.unanalyzed_type, CallableType):
652
+ if isinstance(get_proper_type(o.unanalyzed_type.ret_type), AnyType):
653
+ # Luckily, a return type explicitly annotated with "Any" has
654
+ # type "UnboundType" and will enter the else branch.
655
+ return None # implicit Any
656
+ else:
657
+ return self.print_annotation(o.unanalyzed_type.ret_type)
658
+ if o.abstract_status == IS_ABSTRACT or o.name in METHODS_WITH_RETURN_VALUE:
659
+ # Always assume abstract methods return Any unless explicitly annotated. Also
660
+ # some dunder methods should not have a None return type.
661
+ return None # implicit Any
662
+ retname = infer_method_ret_type(o.name)
663
+ if retname is not None:
664
+ return retname
665
+ if has_yield_expression(o) or has_yield_from_expression(o):
666
+ generator_name = self.add_name("collections.abc.Generator")
667
+ yield_name = "None"
668
+ send_name: str | None = None
669
+ return_name: str | None = None
670
+ if has_yield_from_expression(o):
671
+ yield_name = send_name = self.add_name("_typeshed.Incomplete")
672
+ else:
673
+ for expr, in_assignment in all_yield_expressions(o):
674
+ if expr.expr is not None and not is_none_expr(expr.expr):
675
+ yield_name = self.add_name("_typeshed.Incomplete")
676
+ if in_assignment:
677
+ send_name = self.add_name("_typeshed.Incomplete")
678
+ if has_return_statement(o):
679
+ return_name = self.add_name("_typeshed.Incomplete")
680
+ if return_name is not None:
681
+ if send_name is None:
682
+ send_name = "None"
683
+ return f"{generator_name}[{yield_name}, {send_name}, {return_name}]"
684
+ elif send_name is not None:
685
+ return f"{generator_name}[{yield_name}, {send_name}]"
686
+ else:
687
+ return f"{generator_name}[{yield_name}]"
688
+ if not has_return_statement(o) and o.abstract_status == NOT_ABSTRACT:
689
+ return "None"
690
+ return None
691
+
692
+ def _get_func_docstring(self, node: FuncDef) -> str | None:
693
+ if not node.body.body:
694
+ return None
695
+ expr = node.body.body[0]
696
+ if isinstance(expr, ExpressionStmt) and isinstance(expr.expr, StrExpr):
697
+ return expr.expr.value
698
+ return None
699
+
700
+ def visit_func_def(self, o: FuncDef) -> None:
701
+ is_dataclass_generated = (
702
+ self.analyzed and self.processing_dataclass and o.info.names[o.name].plugin_generated
703
+ )
704
+ if is_dataclass_generated:
705
+ # Skip methods generated by the @dataclass decorator
706
+ return
707
+ if (
708
+ self.is_private_name(o.name, o.fullname)
709
+ or self.is_not_in_all(o.name)
710
+ or (self.is_recorded_name(o.name) and not o.is_overload)
711
+ ):
712
+ self.clear_decorators()
713
+ return
714
+ if self.is_top_level() and self._state not in (EMPTY, FUNC):
715
+ self.add("\n")
716
+ if not self.is_top_level():
717
+ self_inits = find_self_initializers(o)
718
+ for init, value, annotation in self_inits:
719
+ if init in self.method_names:
720
+ # Can't have both an attribute and a method/property with the same name.
721
+ continue
722
+ init_code = self.get_init(init, value, annotation)
723
+ if init_code:
724
+ self.add(init_code)
725
+
726
+ if self._class_stack:
727
+ if len(o.arguments):
728
+ self_var = o.arguments[0].variable.name
729
+ else:
730
+ self_var = "self"
731
+ class_info: ClassInfo | None = None
732
+ for class_def in self._class_stack:
733
+ class_info = ClassInfo(class_def.name, self_var, parent=class_info)
734
+ else:
735
+ class_info = None
736
+
737
+ ctx = FunctionContext(
738
+ module_name=self.module_name,
739
+ name=o.name,
740
+ docstring=self._get_func_docstring(o),
741
+ is_abstract=o.abstract_status != NOT_ABSTRACT,
742
+ class_info=class_info,
743
+ )
744
+
745
+ self.record_name(o.name)
746
+
747
+ default_sig = self.get_default_function_sig(o, ctx)
748
+ sigs = self.get_signatures(default_sig, self.sig_generators, ctx)
749
+
750
+ for output in self.format_func_def(
751
+ sigs, is_coroutine=o.is_coroutine, decorators=self._decorators, docstring=ctx.docstring
752
+ ):
753
+ self.add(output + "\n")
754
+
755
+ self.clear_decorators()
756
+ self._state = FUNC
757
+
758
+ def visit_decorator(self, o: Decorator) -> None:
759
+ if self.is_private_name(o.func.name, o.func.fullname):
760
+ return
761
+ self.process_decorator(o)
762
+ self.visit_func_def(o.func)
763
+
764
+ def process_decorator(self, o: Decorator) -> None:
765
+ """Process a series of decorators.
766
+
767
+ Only preserve certain special decorators such as @abstractmethod.
768
+ """
769
+ o.func.is_overload = False
770
+ for decorator in o.original_decorators:
771
+ d = decorator
772
+ if isinstance(d, CallExpr):
773
+ d = d.callee
774
+ if not isinstance(d, (NameExpr, MemberExpr)):
775
+ continue
776
+ qualname = get_qualified_name(d)
777
+ fullname = self.get_fullname(d)
778
+ if fullname in (
779
+ "builtins.property",
780
+ "builtins.staticmethod",
781
+ "builtins.classmethod",
782
+ "functools.cached_property",
783
+ ):
784
+ self.add_decorator(qualname, require_name=True)
785
+ elif fullname in (
786
+ "asyncio.coroutine",
787
+ "asyncio.coroutines.coroutine",
788
+ "types.coroutine",
789
+ ):
790
+ o.func.is_awaitable_coroutine = True
791
+ self.add_decorator(qualname, require_name=True)
792
+ elif fullname == "abc.abstractmethod":
793
+ self.add_decorator(qualname, require_name=True)
794
+ o.func.abstract_status = IS_ABSTRACT
795
+ elif fullname in (
796
+ "abc.abstractproperty",
797
+ "abc.abstractstaticmethod",
798
+ "abc.abstractclassmethod",
799
+ ):
800
+ abc_module = qualname.rpartition(".")[0]
801
+ if not abc_module:
802
+ self.import_tracker.add_import("abc")
803
+ builtin_decorator_replacement = fullname[len("abc.abstract") :]
804
+ self.add_decorator(builtin_decorator_replacement, require_name=False)
805
+ self.add_decorator(f"{abc_module or 'abc'}.abstractmethod", require_name=True)
806
+ o.func.abstract_status = IS_ABSTRACT
807
+ elif fullname in OVERLOAD_NAMES:
808
+ self.add_decorator(qualname, require_name=True)
809
+ o.func.is_overload = True
810
+ elif qualname.endswith((".setter", ".deleter")):
811
+ self.add_decorator(qualname, require_name=False)
812
+ elif fullname in DATACLASS_TRANSFORM_NAMES:
813
+ p = AliasPrinter(self)
814
+ self._decorators.append(f"@{decorator.accept(p)}")
815
+ elif isinstance(decorator, (NameExpr, MemberExpr)):
816
+ p = AliasPrinter(self)
817
+ self._decorators.append(f"@{decorator.accept(p)}")
818
+
819
+ def get_fullname(self, expr: Expression) -> str:
820
+ """Return the expression's full name."""
821
+ if (
822
+ self.analyzed
823
+ and isinstance(expr, (NameExpr, MemberExpr))
824
+ and expr.fullname
825
+ and not (isinstance(expr.node, Var) and expr.node.is_suppressed_import)
826
+ ):
827
+ return expr.fullname
828
+ name = get_qualified_name(expr)
829
+ return self.resolve_name(name)
830
+
831
+ def visit_class_def(self, o: ClassDef) -> None:
832
+ self._class_stack.append(o)
833
+ self.method_names = find_method_names(o.defs.body)
834
+ sep: int | None = None
835
+ if self.is_top_level() and self._state != EMPTY:
836
+ sep = len(self._output)
837
+ self.add("\n")
838
+ decorators = self.get_class_decorators(o)
839
+ for d in decorators:
840
+ self.add(f"{self._indent}@{d}\n")
841
+ self.record_name(o.name)
842
+ base_types = self.get_base_types(o)
843
+ if base_types:
844
+ for base in base_types:
845
+ self.import_tracker.require_name(base)
846
+ if self.analyzed and o.info.is_enum:
847
+ self.processing_enum = True
848
+ if isinstance(o.metaclass, (NameExpr, MemberExpr)):
849
+ meta = o.metaclass.accept(AliasPrinter(self))
850
+ base_types.append("metaclass=" + meta)
851
+ elif self.analyzed and o.info.is_abstract and not o.info.is_protocol:
852
+ base_types.append("metaclass=abc.ABCMeta")
853
+ self.import_tracker.add_import("abc")
854
+ self.import_tracker.require_name("abc")
855
+ bases = f"({', '.join(base_types)})" if base_types else ""
856
+ type_args = self.format_type_args(o)
857
+ self.add(f"{self._indent}class {o.name}{type_args}{bases}:\n")
858
+ self.indent()
859
+ if self._include_docstrings and o.docstring:
860
+ docstring = mypy.util.quote_docstring(o.docstring)
861
+ self.add(f"{self._indent}{docstring}\n")
862
+ n = len(self._output)
863
+ self._vars.append([])
864
+ if self.analyzed and (spec := find_dataclass_transform_spec(o)):
865
+ self.processing_dataclass = True
866
+ self.dataclass_field_specifier = spec.field_specifiers
867
+ super().visit_class_def(o)
868
+ self.dedent()
869
+ self._vars.pop()
870
+ self._vars[-1].append(o.name)
871
+ if len(self._output) == n:
872
+ if self._state == EMPTY_CLASS and sep is not None:
873
+ self._output[sep] = ""
874
+ if not (self._include_docstrings and o.docstring):
875
+ self._output[-1] = self._output[-1][:-1] + " ...\n"
876
+ self._state = EMPTY_CLASS
877
+ else:
878
+ self._state = CLASS
879
+ self.method_names = set()
880
+ self.processing_dataclass = False
881
+ self.dataclass_field_specifier = ()
882
+ self._class_stack.pop(-1)
883
+ self.processing_enum = False
884
+
885
+ def get_base_types(self, cdef: ClassDef) -> list[str]:
886
+ """Get list of base classes for a class."""
887
+ base_types: list[str] = []
888
+ p = AliasPrinter(self)
889
+ for base in cdef.base_type_exprs + cdef.removed_base_type_exprs:
890
+ if isinstance(base, (NameExpr, MemberExpr)):
891
+ if self.get_fullname(base) != "builtins.object":
892
+ base_types.append(get_qualified_name(base))
893
+ elif isinstance(base, IndexExpr):
894
+ base_types.append(base.accept(p))
895
+ elif isinstance(base, CallExpr):
896
+ # namedtuple(typename, fields), NamedTuple(typename, fields) calls can
897
+ # be used as a base class. The first argument is a string literal that
898
+ # is usually the same as the class name.
899
+ #
900
+ # Note:
901
+ # A call-based named tuple as a base class cannot be safely converted to
902
+ # a class-based NamedTuple definition because class attributes defined
903
+ # in the body of the class inheriting from the named tuple call are not
904
+ # namedtuple fields at runtime.
905
+ if self.is_namedtuple(base):
906
+ nt_fields = self._get_namedtuple_fields(base)
907
+ assert isinstance(base.args[0], StrExpr)
908
+ typename = base.args[0].value
909
+ if nt_fields is None:
910
+ # Invalid namedtuple() call, cannot determine fields
911
+ base_types.append(self.add_name("_typeshed.Incomplete"))
912
+ continue
913
+ fields_str = ", ".join(f"({f!r}, {t})" for f, t in nt_fields)
914
+ namedtuple_name = self.add_name("typing.NamedTuple")
915
+ base_types.append(f"{namedtuple_name}({typename!r}, [{fields_str}])")
916
+ elif self.is_typed_namedtuple(base):
917
+ base_types.append(base.accept(p))
918
+ else:
919
+ # At this point, we don't know what the base class is, so we
920
+ # just use Incomplete as the base class.
921
+ base_types.append(self.add_name("_typeshed.Incomplete"))
922
+ for name, value in cdef.keywords.items():
923
+ if name == "metaclass":
924
+ continue # handled separately
925
+ processed_value = value.accept(p) or "..." # at least, don't crash
926
+ base_types.append(f"{name}={processed_value}")
927
+ return base_types
928
+
929
+ def get_class_decorators(self, cdef: ClassDef) -> list[str]:
930
+ decorators: list[str] = []
931
+ p = AliasPrinter(self)
932
+ for d in cdef.decorators:
933
+ if self.is_dataclass(d):
934
+ decorators.append(d.accept(p))
935
+ self.import_tracker.require_name(get_qualified_name(d))
936
+ self.processing_dataclass = True
937
+ if self.is_dataclass_transform(d):
938
+ decorators.append(d.accept(p))
939
+ self.import_tracker.require_name(get_qualified_name(d))
940
+ return decorators
941
+
942
+ def is_dataclass(self, expr: Expression) -> bool:
943
+ if isinstance(expr, CallExpr):
944
+ expr = expr.callee
945
+ return self.get_fullname(expr) == "dataclasses.dataclass"
946
+
947
+ def is_dataclass_transform(self, expr: Expression) -> bool:
948
+ if isinstance(expr, CallExpr):
949
+ expr = expr.callee
950
+ if self.get_fullname(expr) in DATACLASS_TRANSFORM_NAMES:
951
+ return True
952
+ if (spec := find_dataclass_transform_spec(expr)) is not None:
953
+ self.processing_dataclass = True
954
+ self.dataclass_field_specifier = spec.field_specifiers
955
+ return True
956
+ return False
957
+
958
+ def visit_block(self, o: Block) -> None:
959
+ # Unreachable statements may be partially uninitialized and that may
960
+ # cause trouble.
961
+ if not o.is_unreachable:
962
+ super().visit_block(o)
963
+
964
+ def visit_assignment_stmt(self, o: AssignmentStmt) -> None:
965
+ foundl = []
966
+
967
+ for lvalue in o.lvalues:
968
+ if isinstance(lvalue, NameExpr) and isinstance(o.rvalue, CallExpr):
969
+ if self.is_namedtuple(o.rvalue) or self.is_typed_namedtuple(o.rvalue):
970
+ self.process_namedtuple(lvalue, o.rvalue)
971
+ foundl.append(False) # state is updated in process_namedtuple
972
+ continue
973
+ if self.is_typeddict(o.rvalue):
974
+ self.process_typeddict(lvalue, o.rvalue)
975
+ foundl.append(False) # state is updated in process_typeddict
976
+ continue
977
+ if (
978
+ isinstance(lvalue, NameExpr)
979
+ and self.is_alias_expression(o.rvalue)
980
+ and not self.is_private_name(lvalue.name)
981
+ ):
982
+ is_explicit_type_alias = (
983
+ o.unanalyzed_type and getattr(o.type, "name", None) == "TypeAlias"
984
+ )
985
+ if is_explicit_type_alias:
986
+ self.process_typealias(lvalue, o.rvalue, is_explicit_type_alias=True)
987
+ continue
988
+
989
+ if not o.unanalyzed_type:
990
+ self.process_typealias(lvalue, o.rvalue)
991
+ continue
992
+
993
+ if isinstance(lvalue, (TupleExpr, ListExpr)):
994
+ items = lvalue.items
995
+ if isinstance(o.unanalyzed_type, TupleType): # type: ignore[misc]
996
+ annotations: Iterable[Type | None] = o.unanalyzed_type.items
997
+ else:
998
+ annotations = [None] * len(items)
999
+ else:
1000
+ items = [lvalue]
1001
+ annotations = [o.unanalyzed_type]
1002
+ sep = False
1003
+ found = False
1004
+ for item, annotation in zip(items, annotations):
1005
+ if isinstance(item, NameExpr):
1006
+ init = self.get_init(item.name, o.rvalue, annotation)
1007
+ if init:
1008
+ found = True
1009
+ if not sep and self.is_top_level() and self._state not in (EMPTY, VAR):
1010
+ init = "\n" + init
1011
+ sep = True
1012
+ self.add(init)
1013
+ self.record_name(item.name)
1014
+ foundl.append(found)
1015
+
1016
+ if all(foundl):
1017
+ self._state = VAR
1018
+
1019
+ def is_namedtuple(self, expr: CallExpr) -> bool:
1020
+ return self.get_fullname(expr.callee) == "collections.namedtuple"
1021
+
1022
+ def is_typed_namedtuple(self, expr: CallExpr) -> bool:
1023
+ return self.get_fullname(expr.callee) in TYPED_NAMEDTUPLE_NAMES
1024
+
1025
+ def _get_namedtuple_fields(self, call: CallExpr) -> list[tuple[str, str]] | None:
1026
+ if self.is_namedtuple(call):
1027
+ fields_arg = call.args[1]
1028
+ if isinstance(fields_arg, StrExpr):
1029
+ field_names = fields_arg.value.replace(",", " ").split()
1030
+ elif isinstance(fields_arg, (ListExpr, TupleExpr)):
1031
+ field_names = []
1032
+ for field in fields_arg.items:
1033
+ if not isinstance(field, StrExpr):
1034
+ return None
1035
+ field_names.append(field.value)
1036
+ else:
1037
+ return None # Invalid namedtuple fields type
1038
+ if field_names:
1039
+ incomplete = self.add_name("_typeshed.Incomplete")
1040
+ return [(field_name, incomplete) for field_name in field_names]
1041
+ else:
1042
+ return []
1043
+
1044
+ elif self.is_typed_namedtuple(call):
1045
+ fields_arg = call.args[1]
1046
+ if not isinstance(fields_arg, (ListExpr, TupleExpr)):
1047
+ return None
1048
+ fields: list[tuple[str, str]] = []
1049
+ p = AliasPrinter(self)
1050
+ for field in fields_arg.items:
1051
+ if not (isinstance(field, TupleExpr) and len(field.items) == 2):
1052
+ return None
1053
+ field_name, field_type = field.items
1054
+ if not isinstance(field_name, StrExpr):
1055
+ return None
1056
+ fields.append((field_name.value, field_type.accept(p)))
1057
+ return fields
1058
+ else:
1059
+ return None # Not a named tuple call
1060
+
1061
+ def process_namedtuple(self, lvalue: NameExpr, rvalue: CallExpr) -> None:
1062
+ if self._state == CLASS:
1063
+ self.add("\n")
1064
+
1065
+ if not isinstance(rvalue.args[0], StrExpr):
1066
+ self.annotate_as_incomplete(lvalue)
1067
+ return
1068
+
1069
+ fields = self._get_namedtuple_fields(rvalue)
1070
+ if fields is None:
1071
+ self.annotate_as_incomplete(lvalue)
1072
+ return
1073
+ bases = self.add_name("typing.NamedTuple")
1074
+ # TODO: Add support for generic NamedTuples. Requires `Generic` as base class.
1075
+ class_def = f"{self._indent}class {lvalue.name}({bases}):"
1076
+ if len(fields) == 0:
1077
+ self.add(f"{class_def} ...\n")
1078
+ self._state = EMPTY_CLASS
1079
+ else:
1080
+ if self._state not in (EMPTY, CLASS):
1081
+ self.add("\n")
1082
+ self.add(f"{class_def}\n")
1083
+ for f_name, f_type in fields:
1084
+ self.add(f"{self._indent} {f_name}: {f_type}\n")
1085
+ self._state = CLASS
1086
+
1087
+ def is_typeddict(self, expr: CallExpr) -> bool:
1088
+ return self.get_fullname(expr.callee) in TPDICT_NAMES
1089
+
1090
+ def process_typeddict(self, lvalue: NameExpr, rvalue: CallExpr) -> None:
1091
+ if self._state == CLASS:
1092
+ self.add("\n")
1093
+
1094
+ if not isinstance(rvalue.args[0], StrExpr):
1095
+ self.annotate_as_incomplete(lvalue)
1096
+ return
1097
+ if len(rvalue.args) > 2 and rvalue.arg_kinds[2] != ARG_NAMED:
1098
+ self.annotate_as_incomplete(lvalue)
1099
+ return
1100
+
1101
+ items: list[tuple[str, Expression]] = []
1102
+ total: Expression | None = None
1103
+ closed: Expression | None = None
1104
+ if len(rvalue.args) > 1 and rvalue.arg_kinds[1] == ARG_POS:
1105
+ if not isinstance(rvalue.args[1], DictExpr):
1106
+ self.annotate_as_incomplete(lvalue)
1107
+ return
1108
+ for attr_name, attr_type in rvalue.args[1].items:
1109
+ if not isinstance(attr_name, StrExpr):
1110
+ self.annotate_as_incomplete(lvalue)
1111
+ return
1112
+ items.append((attr_name.value, attr_type))
1113
+ for arg_name, arg in zip(rvalue.arg_names[2:], rvalue.args[2:]):
1114
+ if arg_name == "total":
1115
+ total = arg
1116
+ elif arg_name == "closed":
1117
+ closed = arg
1118
+ else:
1119
+ self.annotate_as_incomplete(lvalue)
1120
+ return
1121
+ else:
1122
+ for arg_name, arg in zip(rvalue.arg_names[1:], rvalue.args[1:]):
1123
+ if not isinstance(arg_name, str):
1124
+ self.annotate_as_incomplete(lvalue)
1125
+ return
1126
+ if arg_name == "total":
1127
+ total = arg
1128
+ else:
1129
+ items.append((arg_name, arg))
1130
+ p = AliasPrinter(self)
1131
+ if any(not key.isidentifier() or keyword.iskeyword(key) for key, _ in items):
1132
+ # Keep the call syntax if there are non-identifier or reserved keyword keys.
1133
+ self.add(f"{self._indent}{lvalue.name} = {rvalue.accept(p)}\n")
1134
+ self._state = VAR
1135
+ else:
1136
+ bases = self.add_name("typing_extensions.TypedDict")
1137
+ # TODO: Add support for generic TypedDicts. Requires `Generic` as base class.
1138
+ if total is not None:
1139
+ bases += f", total={total.accept(p)}"
1140
+ if closed is not None:
1141
+ bases += f", closed={closed.accept(p)}"
1142
+ class_def = f"{self._indent}class {lvalue.name}({bases}):"
1143
+ if len(items) == 0:
1144
+ self.add(f"{class_def} ...\n")
1145
+ self._state = EMPTY_CLASS
1146
+ else:
1147
+ if self._state not in (EMPTY, CLASS):
1148
+ self.add("\n")
1149
+ self.add(f"{class_def}\n")
1150
+ for key, key_type in items:
1151
+ self.add(f"{self._indent} {key}: {key_type.accept(p)}\n")
1152
+ self._state = CLASS
1153
+
1154
+ def annotate_as_incomplete(self, lvalue: NameExpr) -> None:
1155
+ incomplete = self.add_name("_typeshed.Incomplete")
1156
+ self.add(f"{self._indent}{lvalue.name}: {incomplete}\n")
1157
+ self._state = VAR
1158
+
1159
+ def is_alias_expression(self, expr: Expression, top_level: bool = True) -> bool:
1160
+ """Return True for things that look like target for an alias.
1161
+
1162
+ Used to know if assignments look like type aliases, function alias,
1163
+ or module alias.
1164
+ """
1165
+ # Assignment of TypeVar(...) and other typevar-likes are passed through
1166
+ if isinstance(expr, CallExpr) and self.get_fullname(expr.callee) in TYPE_VAR_LIKE_NAMES:
1167
+ return True
1168
+ elif isinstance(expr, EllipsisExpr):
1169
+ return not top_level
1170
+ elif isinstance(expr, NameExpr):
1171
+ if expr.name in ("True", "False"):
1172
+ return False
1173
+ elif expr.name == "None":
1174
+ return not top_level
1175
+ else:
1176
+ return not self.is_private_name(expr.name)
1177
+ elif isinstance(expr, MemberExpr) and self.analyzed:
1178
+ # Also add function and module aliases.
1179
+ return (
1180
+ top_level
1181
+ and isinstance(expr.node, (FuncDef, Decorator, MypyFile))
1182
+ or isinstance(expr.node, TypeInfo)
1183
+ ) and not self.is_private_member(expr.node.fullname)
1184
+ elif isinstance(expr, IndexExpr) and (
1185
+ (isinstance(expr.base, NameExpr) and not self.is_private_name(expr.base.name))
1186
+ or ( # Also some known aliases that could be member expression
1187
+ isinstance(expr.base, MemberExpr)
1188
+ and not self.is_private_member(get_qualified_name(expr.base))
1189
+ and self.get_fullname(expr.base).startswith(
1190
+ ("builtins.", "typing.", "typing_extensions.", "collections.abc.")
1191
+ )
1192
+ )
1193
+ ):
1194
+ if isinstance(expr.index, TupleExpr):
1195
+ indices = expr.index.items
1196
+ else:
1197
+ indices = [expr.index]
1198
+ if expr.base.name == "Callable" and len(indices) == 2:
1199
+ args, ret = indices
1200
+ if isinstance(args, EllipsisExpr):
1201
+ indices = [ret]
1202
+ elif isinstance(args, ListExpr):
1203
+ indices = args.items + [ret]
1204
+ else:
1205
+ return False
1206
+ return all(self.is_alias_expression(i, top_level=False) for i in indices)
1207
+ elif isinstance(expr, OpExpr) and expr.op == "|":
1208
+ return self.is_alias_expression(
1209
+ expr.left, top_level=False
1210
+ ) and self.is_alias_expression(expr.right, top_level=False)
1211
+ else:
1212
+ return False
1213
+
1214
+ def process_typealias(
1215
+ self, lvalue: NameExpr, rvalue: Expression, is_explicit_type_alias: bool = False
1216
+ ) -> None:
1217
+ p = AliasPrinter(self)
1218
+ if is_explicit_type_alias:
1219
+ self.import_tracker.require_name("TypeAlias")
1220
+ self.add(f"{self._indent}{lvalue.name}: TypeAlias = {rvalue.accept(p)}\n")
1221
+ else:
1222
+ self.add(f"{self._indent}{lvalue.name} = {rvalue.accept(p)}\n")
1223
+ self.record_name(lvalue.name)
1224
+ self._vars[-1].append(lvalue.name)
1225
+
1226
+ def visit_type_alias_stmt(self, o: TypeAliasStmt) -> None:
1227
+ """Type aliases defined with the `type` keyword (PEP 695)."""
1228
+ p = AliasPrinter(self)
1229
+ name = o.name.name
1230
+ rvalue = o.value.expr()
1231
+ type_args = self.format_type_args(o)
1232
+ self.add(f"{self._indent}type {name}{type_args} = {rvalue.accept(p)}\n")
1233
+ self.record_name(name)
1234
+ self._vars[-1].append(name)
1235
+
1236
+ def visit_if_stmt(self, o: IfStmt) -> None:
1237
+ # Ignore if __name__ == '__main__'.
1238
+ expr = o.expr[0]
1239
+ if (
1240
+ isinstance(expr, ComparisonExpr)
1241
+ and isinstance(expr.operands[0], NameExpr)
1242
+ and isinstance(expr.operands[1], StrExpr)
1243
+ and expr.operands[0].name == "__name__"
1244
+ and "__main__" in expr.operands[1].value
1245
+ ):
1246
+ return
1247
+ super().visit_if_stmt(o)
1248
+
1249
+ def visit_import_all(self, o: ImportAll) -> None:
1250
+ self.add_import_line(f"from {'.' * o.relative}{o.id} import *\n")
1251
+
1252
+ def visit_import_from(self, o: ImportFrom) -> None:
1253
+ exported_names: set[str] = set()
1254
+ import_names = []
1255
+ module, relative = translate_module_name(o.id, o.relative)
1256
+ if self.module_name:
1257
+ full_module, ok = mypy.util.correct_relative_import(
1258
+ self.module_name, relative, module, self.path.endswith(".__init__.py")
1259
+ )
1260
+ if not ok:
1261
+ full_module = module
1262
+ else:
1263
+ full_module = module
1264
+ if module == "__future__":
1265
+ return # Not preserved
1266
+ for name, as_name in o.names:
1267
+ if name == "six":
1268
+ # Vendored six -- translate into plain 'import six'.
1269
+ self.visit_import(Import([("six", None)]))
1270
+ continue
1271
+ if self.should_reexport(name, full_module, as_name is not None):
1272
+ self.import_tracker.reexport(name)
1273
+ as_name = name
1274
+ import_names.append((name, as_name))
1275
+ self.import_tracker.add_import_from("." * relative + module, import_names)
1276
+ self._vars[-1].extend(alias or name for name, alias in import_names)
1277
+ for name, alias in import_names:
1278
+ self.record_name(alias or name)
1279
+
1280
+ if self._all_:
1281
+ # Include "import from"s that import names defined in __all__.
1282
+ names = [
1283
+ name
1284
+ for name, alias in o.names
1285
+ if name in self._all_ and alias is None and name not in self.IGNORED_DUNDERS
1286
+ ]
1287
+ exported_names.update(names)
1288
+
1289
+ def visit_import(self, o: Import) -> None:
1290
+ for id, as_id in o.ids:
1291
+ self.import_tracker.add_import(id, as_id)
1292
+ if as_id is None:
1293
+ target_name = id.split(".")[0]
1294
+ else:
1295
+ target_name = as_id
1296
+ self._vars[-1].append(target_name)
1297
+ self.record_name(target_name)
1298
+
1299
+ def get_init(
1300
+ self, lvalue: str, rvalue: Expression, annotation: Type | None = None
1301
+ ) -> str | None:
1302
+ """Return initializer for a variable.
1303
+
1304
+ Return None if we've generated one already or if the variable is internal.
1305
+ """
1306
+ if lvalue in self._vars[-1]:
1307
+ # We've generated an initializer already for this variable.
1308
+ return None
1309
+ # TODO: Only do this at module top level.
1310
+ if self.is_private_name(lvalue) or self.is_not_in_all(lvalue):
1311
+ return None
1312
+ self._vars[-1].append(lvalue)
1313
+ if annotation is not None:
1314
+ typename = self.print_annotation(annotation)
1315
+ if (
1316
+ isinstance(annotation, UnboundType)
1317
+ and not annotation.args
1318
+ and annotation.name == "Final"
1319
+ and self.import_tracker.module_for.get("Final") in self.TYPING_MODULE_NAMES
1320
+ ):
1321
+ # Final without type argument is invalid in stubs.
1322
+ final_arg = self.get_str_type_of_node(rvalue)
1323
+ typename += f"[{final_arg}]"
1324
+ elif self.processing_enum:
1325
+ initializer, _ = self.get_str_default_of_node(rvalue)
1326
+ return f"{self._indent}{lvalue} = {initializer}\n"
1327
+ elif self.processing_dataclass:
1328
+ # attribute without annotation is not a dataclass field, don't add annotation.
1329
+ return f"{self._indent}{lvalue} = ...\n"
1330
+ else:
1331
+ typename = self.get_str_type_of_node(rvalue)
1332
+ initializer = self.get_assign_initializer(rvalue)
1333
+ return f"{self._indent}{lvalue}: {typename}{initializer}\n"
1334
+
1335
+ def get_assign_initializer(self, rvalue: Expression) -> str:
1336
+ """Does this rvalue need some special initializer value?"""
1337
+ if not self._current_class:
1338
+ return ""
1339
+ # Current rules
1340
+ # 1. Return `...` if we are dealing with `NamedTuple` or `dataclass` field and
1341
+ # it has an existing default value
1342
+ if (
1343
+ self._current_class.info
1344
+ and self._current_class.info.is_named_tuple
1345
+ and not isinstance(rvalue, TempNode)
1346
+ ):
1347
+ return " = ..."
1348
+ if self.processing_dataclass:
1349
+ if isinstance(rvalue, CallExpr):
1350
+ fullname = self.get_fullname(rvalue.callee)
1351
+ if fullname in (self.dataclass_field_specifier or DATACLASS_FIELD_SPECIFIERS):
1352
+ p = AliasPrinter(self)
1353
+ return f" = {rvalue.accept(p)}"
1354
+ if not (isinstance(rvalue, TempNode) and rvalue.no_rhs):
1355
+ return " = ..."
1356
+ # TODO: support other possible cases, where initializer is important
1357
+
1358
+ # By default, no initializer is required:
1359
+ return ""
1360
+
1361
+ def add_decorator(self, name: str, require_name: bool = False) -> None:
1362
+ if require_name:
1363
+ self.import_tracker.require_name(name)
1364
+ self._decorators.append(f"@{name}")
1365
+
1366
+ def clear_decorators(self) -> None:
1367
+ self._decorators.clear()
1368
+
1369
+ def is_private_member(self, fullname: str) -> bool:
1370
+ parts = fullname.split(".")
1371
+ return any(self.is_private_name(part) for part in parts)
1372
+
1373
+ def get_str_type_of_node(self, rvalue: Expression, *, can_be_incomplete: bool = True) -> str:
1374
+ rvalue = self.maybe_unwrap_unary_expr(rvalue)
1375
+
1376
+ if isinstance(rvalue, IntExpr):
1377
+ return "int"
1378
+ if isinstance(rvalue, StrExpr):
1379
+ return "str"
1380
+ if isinstance(rvalue, BytesExpr):
1381
+ return "bytes"
1382
+ if isinstance(rvalue, FloatExpr):
1383
+ return "float"
1384
+ if isinstance(rvalue, ComplexExpr): # 1j
1385
+ return "complex"
1386
+ if isinstance(rvalue, OpExpr) and rvalue.op in ("-", "+"): # -1j + 1
1387
+ if isinstance(self.maybe_unwrap_unary_expr(rvalue.left), ComplexExpr) or isinstance(
1388
+ self.maybe_unwrap_unary_expr(rvalue.right), ComplexExpr
1389
+ ):
1390
+ return "complex"
1391
+ if isinstance(rvalue, NameExpr) and rvalue.name in ("True", "False"):
1392
+ return "bool"
1393
+ if can_be_incomplete:
1394
+ return self.add_name("_typeshed.Incomplete")
1395
+ else:
1396
+ return ""
1397
+
1398
+ def maybe_unwrap_unary_expr(self, expr: Expression) -> Expression:
1399
+ """Unwrap (possibly nested) unary expressions.
1400
+
1401
+ But, some unary expressions can change the type of expression.
1402
+ While we want to preserve it. For example, `~True` is `int`.
1403
+ So, we only allow a subset of unary expressions to be unwrapped.
1404
+ """
1405
+ if not isinstance(expr, UnaryExpr):
1406
+ return expr
1407
+
1408
+ # First, try to unwrap `[+-]+ (int|float|complex)` expr:
1409
+ math_ops = ("+", "-")
1410
+ if expr.op in math_ops:
1411
+ while isinstance(expr, UnaryExpr):
1412
+ if expr.op not in math_ops or not isinstance(
1413
+ expr.expr, (IntExpr, FloatExpr, ComplexExpr, UnaryExpr)
1414
+ ):
1415
+ break
1416
+ expr = expr.expr
1417
+ return expr
1418
+
1419
+ # Next, try `not bool` expr:
1420
+ if expr.op == "not":
1421
+ while isinstance(expr, UnaryExpr):
1422
+ if expr.op != "not" or not isinstance(expr.expr, (NameExpr, UnaryExpr)):
1423
+ break
1424
+ if isinstance(expr.expr, NameExpr) and expr.expr.name not in ("True", "False"):
1425
+ break
1426
+ expr = expr.expr
1427
+ return expr
1428
+
1429
+ # This is some other unary expr, we cannot do anything with it (yet?).
1430
+ return expr
1431
+
1432
+ def get_str_default_of_node(self, rvalue: Expression) -> tuple[str, bool]:
1433
+ """Get a string representation of the default value of a node.
1434
+
1435
+ Returns a 2-tuple of the default and whether or not it is valid.
1436
+ """
1437
+ if isinstance(rvalue, NameExpr):
1438
+ if rvalue.name in ("None", "True", "False"):
1439
+ return rvalue.name, True
1440
+ elif isinstance(rvalue, (IntExpr, FloatExpr)):
1441
+ return f"{rvalue.value}", True
1442
+ elif isinstance(rvalue, UnaryExpr):
1443
+ if isinstance(rvalue.expr, (IntExpr, FloatExpr)):
1444
+ return f"{rvalue.op}{rvalue.expr.value}", True
1445
+ elif isinstance(rvalue, StrExpr):
1446
+ return repr(rvalue.value), True
1447
+ elif isinstance(rvalue, BytesExpr):
1448
+ return "b" + repr(rvalue.value).replace("\\\\", "\\"), True
1449
+ elif isinstance(rvalue, TupleExpr):
1450
+ items_defaults = []
1451
+ for e in rvalue.items:
1452
+ e_default, valid = self.get_str_default_of_node(e)
1453
+ if not valid:
1454
+ break
1455
+ items_defaults.append(e_default)
1456
+ else:
1457
+ closing = ",)" if len(items_defaults) == 1 else ")"
1458
+ default = "(" + ", ".join(items_defaults) + closing
1459
+ return default, True
1460
+ elif isinstance(rvalue, ListExpr):
1461
+ items_defaults = []
1462
+ for e in rvalue.items:
1463
+ e_default, valid = self.get_str_default_of_node(e)
1464
+ if not valid:
1465
+ break
1466
+ items_defaults.append(e_default)
1467
+ else:
1468
+ default = "[" + ", ".join(items_defaults) + "]"
1469
+ return default, True
1470
+ elif isinstance(rvalue, SetExpr):
1471
+ items_defaults = []
1472
+ for e in rvalue.items:
1473
+ e_default, valid = self.get_str_default_of_node(e)
1474
+ if not valid:
1475
+ break
1476
+ items_defaults.append(e_default)
1477
+ else:
1478
+ if items_defaults:
1479
+ default = "{" + ", ".join(items_defaults) + "}"
1480
+ return default, True
1481
+ elif isinstance(rvalue, DictExpr):
1482
+ items_defaults = []
1483
+ for k, v in rvalue.items:
1484
+ if k is None:
1485
+ break
1486
+ k_default, k_valid = self.get_str_default_of_node(k)
1487
+ v_default, v_valid = self.get_str_default_of_node(v)
1488
+ if not (k_valid and v_valid):
1489
+ break
1490
+ items_defaults.append(f"{k_default}: {v_default}")
1491
+ else:
1492
+ default = "{" + ", ".join(items_defaults) + "}"
1493
+ return default, True
1494
+ return "...", False
1495
+
1496
+ def should_reexport(self, name: str, full_module: str, name_is_alias: bool) -> bool:
1497
+ is_private = self.is_private_name(name, full_module + "." + name)
1498
+ if (
1499
+ not name_is_alias
1500
+ and name not in self.referenced_names
1501
+ and (not self._all_ or name in self.IGNORED_DUNDERS)
1502
+ and not is_private
1503
+ and full_module not in ("abc", "asyncio") + self.TYPING_MODULE_NAMES
1504
+ ):
1505
+ # An imported name that is never referenced in the module is assumed to be
1506
+ # exported, unless there is an explicit __all__. Note that we need to special
1507
+ # case 'abc' since some references are deleted during semantic analysis.
1508
+ return True
1509
+ return super().should_reexport(name, full_module, name_is_alias)
1510
+
1511
+
1512
+ def find_method_names(defs: list[Statement]) -> set[str]:
1513
+ # TODO: Traverse into nested definitions
1514
+ result = set()
1515
+ for defn in defs:
1516
+ if isinstance(defn, FuncDef):
1517
+ result.add(defn.name)
1518
+ elif isinstance(defn, Decorator):
1519
+ result.add(defn.func.name)
1520
+ elif isinstance(defn, OverloadedFuncDef):
1521
+ for item in defn.items:
1522
+ result.update(find_method_names([item]))
1523
+ return result
1524
+
1525
+
1526
+ class SelfTraverser(mypy.traverser.TraverserVisitor):
1527
+ def __init__(self) -> None:
1528
+ self.results: list[tuple[str, Expression, Type | None]] = []
1529
+
1530
+ def visit_assignment_stmt(self, o: AssignmentStmt) -> None:
1531
+ lvalue = o.lvalues[0]
1532
+ if (
1533
+ isinstance(lvalue, MemberExpr)
1534
+ and isinstance(lvalue.expr, NameExpr)
1535
+ and lvalue.expr.name == "self"
1536
+ ):
1537
+ self.results.append((lvalue.name, o.rvalue, o.unanalyzed_type))
1538
+
1539
+
1540
+ def find_self_initializers(fdef: FuncBase) -> list[tuple[str, Expression, Type | None]]:
1541
+ """Find attribute initializers in a method.
1542
+
1543
+ Return a list of pairs (attribute name, r.h.s. expression).
1544
+ """
1545
+ traverser = SelfTraverser()
1546
+ fdef.accept(traverser)
1547
+ return traverser.results
1548
+
1549
+
1550
+ def get_qualified_name(o: Expression) -> str:
1551
+ if isinstance(o, NameExpr):
1552
+ return o.name
1553
+ elif isinstance(o, MemberExpr):
1554
+ return f"{get_qualified_name(o.expr)}.{o.name}"
1555
+ else:
1556
+ return ERROR_MARKER
1557
+
1558
+
1559
+ def remove_blacklisted_modules(modules: list[StubSource]) -> list[StubSource]:
1560
+ return [
1561
+ module for module in modules if module.path is None or not is_blacklisted_path(module.path)
1562
+ ]
1563
+
1564
+
1565
+ def split_pyc_from_py(modules: list[StubSource]) -> tuple[list[StubSource], list[StubSource]]:
1566
+ py_modules = []
1567
+ pyc_modules = []
1568
+ for mod in modules:
1569
+ if is_pyc_only(mod.path):
1570
+ pyc_modules.append(mod)
1571
+ else:
1572
+ py_modules.append(mod)
1573
+ return pyc_modules, py_modules
1574
+
1575
+
1576
+ def is_blacklisted_path(path: str) -> bool:
1577
+ return any(substr in (normalize_path_separators(path) + "\n") for substr in BLACKLIST)
1578
+
1579
+
1580
+ def normalize_path_separators(path: str) -> str:
1581
+ return path.replace("\\", "/") if sys.platform == "win32" else path
1582
+
1583
+
1584
+ def collect_build_targets(
1585
+ options: Options, mypy_opts: MypyOptions
1586
+ ) -> tuple[list[StubSource], list[StubSource], list[StubSource]]:
1587
+ """Collect files for which we need to generate stubs.
1588
+
1589
+ Return list of py modules, pyc modules, and C modules.
1590
+ """
1591
+ if options.packages or options.modules:
1592
+ if options.no_import:
1593
+ py_modules = find_module_paths_using_search(
1594
+ options.modules, options.packages, options.search_path, options.pyversion
1595
+ )
1596
+ c_modules: list[StubSource] = []
1597
+ else:
1598
+ # Using imports is the default, since we can also find C modules.
1599
+ py_modules, c_modules = find_module_paths_using_imports(
1600
+ options.modules, options.packages, options.verbose, options.quiet
1601
+ )
1602
+ else:
1603
+ # Use mypy native source collection for files and directories.
1604
+ try:
1605
+ source_list = create_source_list(options.files, mypy_opts)
1606
+ except InvalidSourceList as e:
1607
+ raise SystemExit(str(e)) from e
1608
+ py_modules = [StubSource(m.module, m.path) for m in source_list]
1609
+ c_modules = []
1610
+
1611
+ py_modules = remove_blacklisted_modules(py_modules)
1612
+ pyc_mod, py_mod = split_pyc_from_py(py_modules)
1613
+ return py_mod, pyc_mod, c_modules
1614
+
1615
+
1616
+ def find_module_paths_using_imports(
1617
+ modules: list[str], packages: list[str], verbose: bool, quiet: bool
1618
+ ) -> tuple[list[StubSource], list[StubSource]]:
1619
+ """Find path and runtime value of __all__ (if possible) for modules and packages.
1620
+
1621
+ This function uses runtime Python imports to get the information.
1622
+ """
1623
+ with ModuleInspect() as inspect:
1624
+ py_modules: list[StubSource] = []
1625
+ c_modules: list[StubSource] = []
1626
+ found = list(walk_packages(inspect, packages, verbose))
1627
+ modules = modules + found
1628
+ modules = [
1629
+ mod for mod in modules if not is_non_library_module(mod)
1630
+ ] # We don't want to run any tests or scripts
1631
+ for mod in modules:
1632
+ try:
1633
+ result = find_module_path_and_all_py3(inspect, mod, verbose)
1634
+ except CantImport as e:
1635
+ tb = traceback.format_exc()
1636
+ if verbose:
1637
+ sys.stderr.write(tb)
1638
+ if not quiet:
1639
+ report_missing(mod, e.message, tb)
1640
+ continue
1641
+ if not result:
1642
+ c_modules.append(StubSource(mod))
1643
+ else:
1644
+ path, runtime_all = result
1645
+ py_modules.append(StubSource(mod, path, runtime_all))
1646
+ return py_modules, c_modules
1647
+
1648
+
1649
+ def is_non_library_module(module: str) -> bool:
1650
+ """Does module look like a test module or a script?"""
1651
+ if module.endswith(
1652
+ (
1653
+ ".tests",
1654
+ ".test",
1655
+ ".testing",
1656
+ "_tests",
1657
+ "_test_suite",
1658
+ "test_util",
1659
+ "test_utils",
1660
+ "test_base",
1661
+ ".__main__",
1662
+ ".conftest", # Used by pytest
1663
+ ".setup", # Typically an install script
1664
+ )
1665
+ ):
1666
+ return True
1667
+ if module.split(".")[-1].startswith("test_"):
1668
+ return True
1669
+ if (
1670
+ ".tests." in module
1671
+ or ".test." in module
1672
+ or ".testing." in module
1673
+ or ".SelfTest." in module
1674
+ ):
1675
+ return True
1676
+ return False
1677
+
1678
+
1679
+ def translate_module_name(module: str, relative: int) -> tuple[str, int]:
1680
+ for pkg in VENDOR_PACKAGES:
1681
+ for alt in "six.moves", "six":
1682
+ substr = f"{pkg}.{alt}"
1683
+ if module.endswith("." + substr) or (module == substr and relative):
1684
+ return alt, 0
1685
+ if "." + substr + "." in module:
1686
+ return alt + "." + module.partition("." + substr + ".")[2], 0
1687
+ return module, relative
1688
+
1689
+
1690
+ def find_module_paths_using_search(
1691
+ modules: list[str], packages: list[str], search_path: list[str], pyversion: tuple[int, int]
1692
+ ) -> list[StubSource]:
1693
+ """Find sources for modules and packages requested.
1694
+
1695
+ This function just looks for source files at the file system level.
1696
+ This is used if user passes --no-import, and will not find C modules.
1697
+ Exit if some of the modules or packages can't be found.
1698
+ """
1699
+ result: list[StubSource] = []
1700
+ typeshed_path = default_lib_path(mypy.build.default_data_dir(), pyversion, None)
1701
+ search_paths = SearchPaths((".",) + tuple(search_path), (), (), tuple(typeshed_path))
1702
+ cache = FindModuleCache(search_paths, fscache=None, options=None)
1703
+ for module in modules:
1704
+ m_result = cache.find_module(module)
1705
+ if isinstance(m_result, ModuleNotFoundReason):
1706
+ fail_missing(module, m_result)
1707
+ module_path = None
1708
+ else:
1709
+ module_path = m_result
1710
+ result.append(StubSource(module, module_path))
1711
+ for package in packages:
1712
+ p_result = cache.find_modules_recursive(package)
1713
+ if p_result:
1714
+ fail_missing(package, ModuleNotFoundReason.NOT_FOUND)
1715
+ sources = [StubSource(m.module, m.path) for m in p_result]
1716
+ result.extend(sources)
1717
+
1718
+ result = [m for m in result if not is_non_library_module(m.module)]
1719
+
1720
+ return result
1721
+
1722
+
1723
+ def mypy_options(stubgen_options: Options) -> MypyOptions:
1724
+ """Generate mypy options using the flag passed by user."""
1725
+ options = MypyOptions()
1726
+ options.follow_imports = "skip"
1727
+ options.incremental = False
1728
+ options.ignore_errors = True
1729
+ options.semantic_analysis_only = True
1730
+ options.python_version = stubgen_options.pyversion
1731
+ options.show_traceback = True
1732
+ options.transform_source = remove_misplaced_type_comments
1733
+ options.preserve_asts = True
1734
+ options.include_docstrings = stubgen_options.include_docstrings
1735
+
1736
+ # Override cache_dir if provided in the environment
1737
+ environ_cache_dir = os.getenv("MYPY_CACHE_DIR", "")
1738
+ if environ_cache_dir.strip():
1739
+ options.cache_dir = environ_cache_dir
1740
+ options.cache_dir = os.path.expanduser(options.cache_dir)
1741
+
1742
+ return options
1743
+
1744
+
1745
+ def parse_source_file(mod: StubSource, mypy_options: MypyOptions) -> None:
1746
+ """Parse a source file.
1747
+
1748
+ On success, store AST in the corresponding attribute of the stub source.
1749
+ If there are syntax errors, print them and exit.
1750
+ """
1751
+ assert mod.path is not None, "Not found module was not skipped"
1752
+ with open(mod.path, "rb") as f:
1753
+ data = f.read()
1754
+ source = mypy.util.decode_python_encoding(data)
1755
+ errors = Errors(mypy_options)
1756
+ mod.ast = mypy.parse.parse(
1757
+ source, fnam=mod.path, module=mod.module, errors=errors, options=mypy_options, eager=True
1758
+ )
1759
+ mod.ast._fullname = mod.module
1760
+ if errors.is_blockers():
1761
+ # Syntax error!
1762
+ for m in errors.new_messages():
1763
+ sys.stderr.write(f"{m}\n")
1764
+ sys.exit(1)
1765
+
1766
+
1767
+ def generate_asts_for_modules(
1768
+ py_modules: list[StubSource], parse_only: bool, mypy_options: MypyOptions, verbose: bool
1769
+ ) -> None:
1770
+ """Use mypy to parse (and optionally analyze) source files."""
1771
+ if not py_modules:
1772
+ return # Nothing to do here, but there may be C modules
1773
+ if verbose:
1774
+ print(f"Processing {len(py_modules)} files...")
1775
+ if parse_only:
1776
+ for mod in py_modules:
1777
+ parse_source_file(mod, mypy_options)
1778
+ return
1779
+ # Perform full semantic analysis of the source set.
1780
+ try:
1781
+ res = build([module.source for module in py_modules], mypy_options)
1782
+ except CompileError as e:
1783
+ raise SystemExit(f"Critical error during semantic analysis: {e}") from e
1784
+
1785
+ for mod in py_modules:
1786
+ mod.ast = res.graph[mod.module].tree
1787
+ # Use statically inferred __all__ if there is no runtime one.
1788
+ if mod.runtime_all is None:
1789
+ mod_names = res.manager.semantic_analyzer.modules[mod.module].names
1790
+ if "__all__" in mod_names:
1791
+ mod.runtime_all = [name for name, sym in mod_names.items() if sym.module_public]
1792
+
1793
+
1794
+ def generate_stub_for_py_module(
1795
+ mod: StubSource,
1796
+ target: str,
1797
+ *,
1798
+ parse_only: bool = False,
1799
+ inspect: bool = False,
1800
+ include_private: bool = False,
1801
+ export_less: bool = False,
1802
+ include_docstrings: bool = False,
1803
+ doc_dir: str = "",
1804
+ all_modules: list[str],
1805
+ ) -> None:
1806
+ """Use analysed (or just parsed) AST to generate type stub for single file.
1807
+
1808
+ If directory for target doesn't exist it will created. Existing stub
1809
+ will be overwritten.
1810
+ """
1811
+ if inspect:
1812
+ ngen = InspectionStubGenerator(
1813
+ module_name=mod.module,
1814
+ known_modules=all_modules,
1815
+ _all_=mod.runtime_all,
1816
+ doc_dir=doc_dir,
1817
+ include_private=include_private,
1818
+ export_less=export_less,
1819
+ include_docstrings=include_docstrings,
1820
+ )
1821
+ ngen.generate_module()
1822
+ output = ngen.output()
1823
+
1824
+ else:
1825
+ gen = ASTStubGenerator(
1826
+ mod.runtime_all,
1827
+ include_private=include_private,
1828
+ analyzed=not parse_only,
1829
+ export_less=export_less,
1830
+ include_docstrings=include_docstrings,
1831
+ )
1832
+ assert mod.ast is not None, "This function must be used only with analyzed modules"
1833
+ mod.ast.accept(gen)
1834
+ output = gen.output()
1835
+
1836
+ # Write output to file.
1837
+ subdir = os.path.dirname(target)
1838
+ if subdir and not os.path.isdir(subdir):
1839
+ os.makedirs(subdir)
1840
+ with open(target, "w", encoding="utf-8") as file:
1841
+ file.write(output)
1842
+
1843
+
1844
+ def generate_stubs(options: Options) -> None:
1845
+ """Main entry point for the program."""
1846
+ mypy_opts = mypy_options(options)
1847
+ py_modules, pyc_modules, c_modules = collect_build_targets(options, mypy_opts)
1848
+ all_modules = py_modules + pyc_modules + c_modules
1849
+ all_module_names = sorted(m.module for m in all_modules)
1850
+ # Use parsed sources to generate stubs for Python modules.
1851
+ generate_asts_for_modules(py_modules, options.parse_only, mypy_opts, options.verbose)
1852
+ files = []
1853
+ for mod in py_modules + pyc_modules:
1854
+ assert mod.path is not None, "Not found module was not skipped"
1855
+ target = mod.module.replace(".", "/")
1856
+ if os.path.basename(mod.path) in ["__init__.py", "__init__.pyc"]:
1857
+ target += "/__init__.pyi"
1858
+ else:
1859
+ target += ".pyi"
1860
+ target = os.path.join(options.output_dir, target)
1861
+ files.append(target)
1862
+ with generate_guarded(mod.module, target, options.ignore_errors, options.verbose):
1863
+ generate_stub_for_py_module(
1864
+ mod,
1865
+ target,
1866
+ parse_only=options.parse_only,
1867
+ inspect=options.inspect or mod in pyc_modules,
1868
+ include_private=options.include_private,
1869
+ export_less=options.export_less,
1870
+ include_docstrings=options.include_docstrings,
1871
+ doc_dir=options.doc_dir,
1872
+ all_modules=all_module_names,
1873
+ )
1874
+
1875
+ # Separately analyse C modules using different logic.
1876
+ for mod in c_modules:
1877
+ if any(py_mod.module.startswith(mod.module + ".") for py_mod in all_modules):
1878
+ target = mod.module.replace(".", "/") + "/__init__.pyi"
1879
+ else:
1880
+ target = mod.module.replace(".", "/") + ".pyi"
1881
+ target = os.path.join(options.output_dir, target)
1882
+ files.append(target)
1883
+ with generate_guarded(mod.module, target, options.ignore_errors, options.verbose):
1884
+ generate_stub_for_c_module(
1885
+ mod.module,
1886
+ target,
1887
+ known_modules=all_module_names,
1888
+ doc_dir=options.doc_dir,
1889
+ include_private=options.include_private,
1890
+ export_less=options.export_less,
1891
+ include_docstrings=options.include_docstrings,
1892
+ )
1893
+ num_modules = len(all_modules)
1894
+ if not options.quiet and num_modules > 0:
1895
+ print("Processed %d modules" % num_modules)
1896
+ if len(files) == 1:
1897
+ print(f"Generated {files[0]}")
1898
+ else:
1899
+ print(f"Generated files under {common_dir_prefix(files)}" + os.sep)
1900
+
1901
+
1902
+ HEADER = """%(prog)s [-h] [more options, see -h]
1903
+ [-m MODULE] [-p PACKAGE] [files ...]"""
1904
+
1905
+ DESCRIPTION = """
1906
+ Generate draft stubs for modules.
1907
+
1908
+ Stubs are generated in directory ./out, to avoid overriding files with
1909
+ manual changes. This directory is assumed to exist.
1910
+ """
1911
+
1912
+
1913
+ def parse_options(args: list[str]) -> Options:
1914
+ parser = argparse.ArgumentParser(
1915
+ prog="stubgen", usage=HEADER, description=DESCRIPTION, fromfile_prefix_chars="@"
1916
+ )
1917
+
1918
+ parser.add_argument(
1919
+ "--ignore-errors",
1920
+ action="store_true",
1921
+ help="ignore errors when trying to generate stubs for modules",
1922
+ )
1923
+ parser.add_argument(
1924
+ "--no-import",
1925
+ action="store_true",
1926
+ help="don't import the modules, just parse and analyze them "
1927
+ "(doesn't work with C extension modules and might not "
1928
+ "respect __all__)",
1929
+ )
1930
+ parser.add_argument(
1931
+ "--no-analysis",
1932
+ "--parse-only",
1933
+ dest="parse_only",
1934
+ action="store_true",
1935
+ help="don't perform semantic analysis of sources, just parse them "
1936
+ "(only applies to Python modules, might affect quality of stubs. "
1937
+ "Not compatible with --inspect-mode)",
1938
+ )
1939
+ parser.add_argument(
1940
+ "--inspect-mode",
1941
+ dest="inspect",
1942
+ action="store_true",
1943
+ help="import and inspect modules instead of parsing source code."
1944
+ "This is the default behavior for c modules and pyc-only packages, but "
1945
+ "it is also useful for pure python modules with dynamically generated members.",
1946
+ )
1947
+ parser.add_argument(
1948
+ "--include-private",
1949
+ action="store_true",
1950
+ help="generate stubs for objects and members considered private "
1951
+ "(single leading underscore and no trailing underscores)",
1952
+ )
1953
+ parser.add_argument(
1954
+ "--export-less",
1955
+ action="store_true",
1956
+ help="don't implicitly export all names imported from other modules in the same package",
1957
+ )
1958
+ parser.add_argument(
1959
+ "--include-docstrings",
1960
+ action="store_true",
1961
+ help="include existing docstrings with the stubs",
1962
+ )
1963
+ parser.add_argument("-v", "--verbose", action="store_true", help="show more verbose messages")
1964
+ parser.add_argument("-q", "--quiet", action="store_true", help="show fewer messages")
1965
+ parser.add_argument(
1966
+ "--doc-dir",
1967
+ metavar="PATH",
1968
+ default="",
1969
+ help="use .rst documentation in PATH (this may result in "
1970
+ "better stubs in some cases; consider setting this to "
1971
+ "DIR/Python-X.Y.Z/Doc/library)",
1972
+ )
1973
+ parser.add_argument(
1974
+ "--search-path",
1975
+ metavar="PATH",
1976
+ default="",
1977
+ help="specify module search directories, separated by ':' "
1978
+ "(currently only used if --no-import is given)",
1979
+ )
1980
+ parser.add_argument(
1981
+ "-o",
1982
+ "--output",
1983
+ metavar="PATH",
1984
+ dest="output_dir",
1985
+ default="out",
1986
+ help="change the output directory [default: %(default)s]",
1987
+ )
1988
+ parser.add_argument(
1989
+ "-m",
1990
+ "--module",
1991
+ action="append",
1992
+ metavar="MODULE",
1993
+ dest="modules",
1994
+ default=[],
1995
+ help="generate stub for module; can repeat for more modules",
1996
+ )
1997
+ parser.add_argument(
1998
+ "-p",
1999
+ "--package",
2000
+ action="append",
2001
+ metavar="PACKAGE",
2002
+ dest="packages",
2003
+ default=[],
2004
+ help="generate stubs for package recursively; can be repeated",
2005
+ )
2006
+ parser.add_argument(
2007
+ metavar="files",
2008
+ nargs="*",
2009
+ dest="files",
2010
+ help="generate stubs for given files or directories",
2011
+ )
2012
+ parser.add_argument(
2013
+ "--version", action="version", version="%(prog)s " + mypy.version.__version__
2014
+ )
2015
+
2016
+ ns = parser.parse_args(args)
2017
+
2018
+ pyversion = sys.version_info[:2]
2019
+ ns.interpreter = sys.executable
2020
+
2021
+ if ns.modules + ns.packages and ns.files:
2022
+ parser.error("May only specify one of: modules/packages or files.")
2023
+ if ns.quiet and ns.verbose:
2024
+ parser.error("Cannot specify both quiet and verbose messages")
2025
+ if ns.inspect and ns.parse_only:
2026
+ parser.error("Cannot specify both --parse-only/--no-analysis and --inspect-mode")
2027
+
2028
+ # Create the output folder if it doesn't already exist.
2029
+ os.makedirs(ns.output_dir, exist_ok=True)
2030
+
2031
+ return Options(
2032
+ pyversion=pyversion,
2033
+ no_import=ns.no_import,
2034
+ inspect=ns.inspect,
2035
+ doc_dir=ns.doc_dir,
2036
+ search_path=ns.search_path.split(":"),
2037
+ interpreter=ns.interpreter,
2038
+ ignore_errors=ns.ignore_errors,
2039
+ parse_only=ns.parse_only,
2040
+ include_private=ns.include_private,
2041
+ output_dir=ns.output_dir,
2042
+ modules=ns.modules,
2043
+ packages=ns.packages,
2044
+ files=ns.files,
2045
+ verbose=ns.verbose,
2046
+ quiet=ns.quiet,
2047
+ export_less=ns.export_less,
2048
+ include_docstrings=ns.include_docstrings,
2049
+ )
2050
+
2051
+
2052
+ def main(args: list[str] | None = None) -> None:
2053
+ mypy.util.check_python_version("stubgen")
2054
+ # Make sure that the current directory is in sys.path so that
2055
+ # stubgen can be run on packages in the current directory.
2056
+ if not ("" in sys.path or "." in sys.path):
2057
+ sys.path.insert(0, "")
2058
+
2059
+ options = parse_options(sys.argv[1:] if args is None else args)
2060
+ generate_stubs(options)
2061
+
2062
+
2063
+ if __name__ == "__main__":
2064
+ main()