@pairling/runtime-darwin-x64 0.0.0 → 0.2.0

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 (1238) hide show
  1. package/bin/pairling-connectd +0 -0
  2. package/manifest.json +18 -0
  3. package/package.json +2 -2
  4. package/python/bin/2to3-3.12 +7 -0
  5. package/python/bin/idle3.12 +7 -0
  6. package/python/bin/pip +8 -0
  7. package/python/bin/pip3 +8 -0
  8. package/python/bin/pip3.12 +8 -0
  9. package/python/bin/pydoc3.12 +7 -0
  10. package/python/bin/python3 +0 -0
  11. package/python/bin/python3.12 +0 -0
  12. package/python/bin/python3.12-config +76 -0
  13. package/python/include/python3.12/Python.h +109 -0
  14. package/python/include/python3.12/abstract.h +899 -0
  15. package/python/include/python3.12/bltinmodule.h +14 -0
  16. package/python/include/python3.12/boolobject.h +42 -0
  17. package/python/include/python3.12/bytearrayobject.h +44 -0
  18. package/python/include/python3.12/bytesobject.h +69 -0
  19. package/python/include/python3.12/ceval.h +168 -0
  20. package/python/include/python3.12/codecs.h +248 -0
  21. package/python/include/python3.12/compile.h +22 -0
  22. package/python/include/python3.12/complexobject.h +30 -0
  23. package/python/include/python3.12/cpython/abstract.h +206 -0
  24. package/python/include/python3.12/cpython/bytearrayobject.h +34 -0
  25. package/python/include/python3.12/cpython/bytesobject.h +133 -0
  26. package/python/include/python3.12/cpython/cellobject.h +44 -0
  27. package/python/include/python3.12/cpython/ceval.h +35 -0
  28. package/python/include/python3.12/cpython/classobject.h +71 -0
  29. package/python/include/python3.12/cpython/code.h +389 -0
  30. package/python/include/python3.12/cpython/compile.h +69 -0
  31. package/python/include/python3.12/cpython/complexobject.h +44 -0
  32. package/python/include/python3.12/cpython/context.h +78 -0
  33. package/python/include/python3.12/cpython/descrobject.h +64 -0
  34. package/python/include/python3.12/cpython/dictobject.h +118 -0
  35. package/python/include/python3.12/cpython/fileobject.h +19 -0
  36. package/python/include/python3.12/cpython/fileutils.h +8 -0
  37. package/python/include/python3.12/cpython/floatobject.h +27 -0
  38. package/python/include/python3.12/cpython/frameobject.h +29 -0
  39. package/python/include/python3.12/cpython/funcobject.h +190 -0
  40. package/python/include/python3.12/cpython/genobject.h +89 -0
  41. package/python/include/python3.12/cpython/import.h +46 -0
  42. package/python/include/python3.12/cpython/initconfig.h +256 -0
  43. package/python/include/python3.12/cpython/interpreteridobject.h +11 -0
  44. package/python/include/python3.12/cpython/listobject.h +47 -0
  45. package/python/include/python3.12/cpython/longintrepr.h +133 -0
  46. package/python/include/python3.12/cpython/longobject.h +100 -0
  47. package/python/include/python3.12/cpython/memoryobject.h +52 -0
  48. package/python/include/python3.12/cpython/methodobject.h +66 -0
  49. package/python/include/python3.12/cpython/modsupport.h +109 -0
  50. package/python/include/python3.12/cpython/object.h +575 -0
  51. package/python/include/python3.12/cpython/objimpl.h +95 -0
  52. package/python/include/python3.12/cpython/odictobject.h +43 -0
  53. package/python/include/python3.12/cpython/picklebufobject.h +31 -0
  54. package/python/include/python3.12/cpython/pthread_stubs.h +88 -0
  55. package/python/include/python3.12/cpython/pyctype.h +39 -0
  56. package/python/include/python3.12/cpython/pydebug.h +38 -0
  57. package/python/include/python3.12/cpython/pyerrors.h +178 -0
  58. package/python/include/python3.12/cpython/pyfpe.h +15 -0
  59. package/python/include/python3.12/cpython/pyframe.h +35 -0
  60. package/python/include/python3.12/cpython/pylifecycle.h +111 -0
  61. package/python/include/python3.12/cpython/pymem.h +98 -0
  62. package/python/include/python3.12/cpython/pystate.h +456 -0
  63. package/python/include/python3.12/cpython/pythonrun.h +121 -0
  64. package/python/include/python3.12/cpython/pythread.h +42 -0
  65. package/python/include/python3.12/cpython/pytime.h +331 -0
  66. package/python/include/python3.12/cpython/setobject.h +72 -0
  67. package/python/include/python3.12/cpython/sysmodule.h +16 -0
  68. package/python/include/python3.12/cpython/traceback.h +16 -0
  69. package/python/include/python3.12/cpython/tupleobject.h +39 -0
  70. package/python/include/python3.12/cpython/unicodeobject.h +976 -0
  71. package/python/include/python3.12/cpython/warnings.h +20 -0
  72. package/python/include/python3.12/cpython/weakrefobject.h +56 -0
  73. package/python/include/python3.12/datetime.h +267 -0
  74. package/python/include/python3.12/descrobject.h +100 -0
  75. package/python/include/python3.12/dictobject.h +97 -0
  76. package/python/include/python3.12/dynamic_annotations.h +499 -0
  77. package/python/include/python3.12/enumobject.h +17 -0
  78. package/python/include/python3.12/errcode.h +38 -0
  79. package/python/include/python3.12/exports.h +36 -0
  80. package/python/include/python3.12/fileobject.h +49 -0
  81. package/python/include/python3.12/fileutils.h +26 -0
  82. package/python/include/python3.12/floatobject.h +54 -0
  83. package/python/include/python3.12/frameobject.h +20 -0
  84. package/python/include/python3.12/genericaliasobject.h +14 -0
  85. package/python/include/python3.12/import.h +98 -0
  86. package/python/include/python3.12/internal/pycore_abstract.h +25 -0
  87. package/python/include/python3.12/internal/pycore_asdl.h +112 -0
  88. package/python/include/python3.12/internal/pycore_ast.h +922 -0
  89. package/python/include/python3.12/internal/pycore_ast_state.h +265 -0
  90. package/python/include/python3.12/internal/pycore_atexit.h +57 -0
  91. package/python/include/python3.12/internal/pycore_atomic.h +557 -0
  92. package/python/include/python3.12/internal/pycore_atomic_funcs.h +94 -0
  93. package/python/include/python3.12/internal/pycore_bitutils.h +186 -0
  94. package/python/include/python3.12/internal/pycore_blocks_output_buffer.h +317 -0
  95. package/python/include/python3.12/internal/pycore_bytes_methods.h +73 -0
  96. package/python/include/python3.12/internal/pycore_bytesobject.h +47 -0
  97. package/python/include/python3.12/internal/pycore_call.h +133 -0
  98. package/python/include/python3.12/internal/pycore_ceval.h +164 -0
  99. package/python/include/python3.12/internal/pycore_ceval_state.h +103 -0
  100. package/python/include/python3.12/internal/pycore_code.h +496 -0
  101. package/python/include/python3.12/internal/pycore_compile.h +118 -0
  102. package/python/include/python3.12/internal/pycore_condvar.h +99 -0
  103. package/python/include/python3.12/internal/pycore_context.h +71 -0
  104. package/python/include/python3.12/internal/pycore_descrobject.h +26 -0
  105. package/python/include/python3.12/internal/pycore_dict.h +199 -0
  106. package/python/include/python3.12/internal/pycore_dict_state.h +50 -0
  107. package/python/include/python3.12/internal/pycore_dtoa.h +69 -0
  108. package/python/include/python3.12/internal/pycore_emscripten_signal.h +25 -0
  109. package/python/include/python3.12/internal/pycore_exceptions.h +37 -0
  110. package/python/include/python3.12/internal/pycore_faulthandler.h +99 -0
  111. package/python/include/python3.12/internal/pycore_fileutils.h +292 -0
  112. package/python/include/python3.12/internal/pycore_fileutils_windows.h +98 -0
  113. package/python/include/python3.12/internal/pycore_floatobject.h +71 -0
  114. package/python/include/python3.12/internal/pycore_flowgraph.h +120 -0
  115. package/python/include/python3.12/internal/pycore_format.h +27 -0
  116. package/python/include/python3.12/internal/pycore_frame.h +283 -0
  117. package/python/include/python3.12/internal/pycore_function.h +26 -0
  118. package/python/include/python3.12/internal/pycore_gc.h +211 -0
  119. package/python/include/python3.12/internal/pycore_genobject.h +49 -0
  120. package/python/include/python3.12/internal/pycore_getopt.h +22 -0
  121. package/python/include/python3.12/internal/pycore_gil.h +50 -0
  122. package/python/include/python3.12/internal/pycore_global_objects.h +105 -0
  123. package/python/include/python3.12/internal/pycore_global_objects_fini_generated.h +1517 -0
  124. package/python/include/python3.12/internal/pycore_global_strings.h +777 -0
  125. package/python/include/python3.12/internal/pycore_hamt.h +134 -0
  126. package/python/include/python3.12/internal/pycore_hashtable.h +149 -0
  127. package/python/include/python3.12/internal/pycore_import.h +183 -0
  128. package/python/include/python3.12/internal/pycore_initconfig.h +179 -0
  129. package/python/include/python3.12/internal/pycore_instruments.h +106 -0
  130. package/python/include/python3.12/internal/pycore_interp.h +275 -0
  131. package/python/include/python3.12/internal/pycore_intrinsics.h +32 -0
  132. package/python/include/python3.12/internal/pycore_list.h +83 -0
  133. package/python/include/python3.12/internal/pycore_long.h +258 -0
  134. package/python/include/python3.12/internal/pycore_memoryobject.h +18 -0
  135. package/python/include/python3.12/internal/pycore_moduleobject.h +45 -0
  136. package/python/include/python3.12/internal/pycore_namespace.h +20 -0
  137. package/python/include/python3.12/internal/pycore_object.h +455 -0
  138. package/python/include/python3.12/internal/pycore_object_state.h +42 -0
  139. package/python/include/python3.12/internal/pycore_obmalloc.h +700 -0
  140. package/python/include/python3.12/internal/pycore_obmalloc_init.h +73 -0
  141. package/python/include/python3.12/internal/pycore_opcode.h +587 -0
  142. package/python/include/python3.12/internal/pycore_opcode_utils.h +92 -0
  143. package/python/include/python3.12/internal/pycore_parser.h +66 -0
  144. package/python/include/python3.12/internal/pycore_pathconfig.h +24 -0
  145. package/python/include/python3.12/internal/pycore_pyarena.h +64 -0
  146. package/python/include/python3.12/internal/pycore_pyerrors.h +129 -0
  147. package/python/include/python3.12/internal/pycore_pyhash.h +40 -0
  148. package/python/include/python3.12/internal/pycore_pylifecycle.h +99 -0
  149. package/python/include/python3.12/internal/pycore_pymath.h +205 -0
  150. package/python/include/python3.12/internal/pycore_pymem.h +98 -0
  151. package/python/include/python3.12/internal/pycore_pymem_init.h +85 -0
  152. package/python/include/python3.12/internal/pycore_pystate.h +180 -0
  153. package/python/include/python3.12/internal/pycore_pythread.h +81 -0
  154. package/python/include/python3.12/internal/pycore_range.h +21 -0
  155. package/python/include/python3.12/internal/pycore_runtime.h +235 -0
  156. package/python/include/python3.12/internal/pycore_runtime_init.h +188 -0
  157. package/python/include/python3.12/internal/pycore_runtime_init_generated.h +1511 -0
  158. package/python/include/python3.12/internal/pycore_signal.h +98 -0
  159. package/python/include/python3.12/internal/pycore_sliceobject.h +22 -0
  160. package/python/include/python3.12/internal/pycore_strhex.h +36 -0
  161. package/python/include/python3.12/internal/pycore_structseq.h +39 -0
  162. package/python/include/python3.12/internal/pycore_symtable.h +160 -0
  163. package/python/include/python3.12/internal/pycore_sysmodule.h +34 -0
  164. package/python/include/python3.12/internal/pycore_time.h +25 -0
  165. package/python/include/python3.12/internal/pycore_token.h +108 -0
  166. package/python/include/python3.12/internal/pycore_traceback.h +101 -0
  167. package/python/include/python3.12/internal/pycore_tracemalloc.h +123 -0
  168. package/python/include/python3.12/internal/pycore_tuple.h +79 -0
  169. package/python/include/python3.12/internal/pycore_typeobject.h +151 -0
  170. package/python/include/python3.12/internal/pycore_typevarobject.h +24 -0
  171. package/python/include/python3.12/internal/pycore_ucnhash.h +34 -0
  172. package/python/include/python3.12/internal/pycore_unicodeobject.h +86 -0
  173. package/python/include/python3.12/internal/pycore_unicodeobject_generated.h +2832 -0
  174. package/python/include/python3.12/internal/pycore_unionobject.h +23 -0
  175. package/python/include/python3.12/internal/pycore_warnings.h +29 -0
  176. package/python/include/python3.12/interpreteridobject.h +17 -0
  177. package/python/include/python3.12/intrcheck.h +30 -0
  178. package/python/include/python3.12/iterobject.h +27 -0
  179. package/python/include/python3.12/listobject.h +52 -0
  180. package/python/include/python3.12/longobject.h +108 -0
  181. package/python/include/python3.12/marshal.h +31 -0
  182. package/python/include/python3.12/memoryobject.h +34 -0
  183. package/python/include/python3.12/methodobject.h +132 -0
  184. package/python/include/python3.12/modsupport.h +168 -0
  185. package/python/include/python3.12/moduleobject.h +119 -0
  186. package/python/include/python3.12/object.h +993 -0
  187. package/python/include/python3.12/objimpl.h +234 -0
  188. package/python/include/python3.12/opcode.h +271 -0
  189. package/python/include/python3.12/osdefs.h +51 -0
  190. package/python/include/python3.12/osmodule.h +17 -0
  191. package/python/include/python3.12/patchlevel.h +35 -0
  192. package/python/include/python3.12/py_curses.h +99 -0
  193. package/python/include/python3.12/pybuffer.h +145 -0
  194. package/python/include/python3.12/pycapsule.h +59 -0
  195. package/python/include/python3.12/pyconfig.h +1943 -0
  196. package/python/include/python3.12/pydtrace.h +59 -0
  197. package/python/include/python3.12/pyerrors.h +337 -0
  198. package/python/include/python3.12/pyexpat.h +62 -0
  199. package/python/include/python3.12/pyframe.h +26 -0
  200. package/python/include/python3.12/pyhash.h +144 -0
  201. package/python/include/python3.12/pylifecycle.h +78 -0
  202. package/python/include/python3.12/pymacconfig.h +99 -0
  203. package/python/include/python3.12/pymacro.h +172 -0
  204. package/python/include/python3.12/pymath.h +62 -0
  205. package/python/include/python3.12/pymem.h +104 -0
  206. package/python/include/python3.12/pyport.h +782 -0
  207. package/python/include/python3.12/pystate.h +132 -0
  208. package/python/include/python3.12/pystats.h +110 -0
  209. package/python/include/python3.12/pystrcmp.h +23 -0
  210. package/python/include/python3.12/pystrtod.h +46 -0
  211. package/python/include/python3.12/pythonrun.h +49 -0
  212. package/python/include/python3.12/pythread.h +135 -0
  213. package/python/include/python3.12/pytypedefs.h +30 -0
  214. package/python/include/python3.12/rangeobject.h +27 -0
  215. package/python/include/python3.12/setobject.h +49 -0
  216. package/python/include/python3.12/sliceobject.h +65 -0
  217. package/python/include/python3.12/structmember.h +56 -0
  218. package/python/include/python3.12/structseq.h +49 -0
  219. package/python/include/python3.12/sysmodule.h +54 -0
  220. package/python/include/python3.12/traceback.h +26 -0
  221. package/python/include/python3.12/tracemalloc.h +77 -0
  222. package/python/include/python3.12/tupleobject.h +46 -0
  223. package/python/include/python3.12/typeslots.h +88 -0
  224. package/python/include/python3.12/unicodeobject.h +1020 -0
  225. package/python/include/python3.12/warnings.h +45 -0
  226. package/python/include/python3.12/weakrefobject.h +42 -0
  227. package/python/lib/libpython3.12.dylib +0 -0
  228. package/python/lib/python3.12/LICENSE.txt +279 -0
  229. package/python/lib/python3.12/__future__.py +147 -0
  230. package/python/lib/python3.12/__hello__.py +16 -0
  231. package/python/lib/python3.12/__phello__/__init__.py +7 -0
  232. package/python/lib/python3.12/__phello__/spam.py +7 -0
  233. package/python/lib/python3.12/_aix_support.py +108 -0
  234. package/python/lib/python3.12/_collections_abc.py +1173 -0
  235. package/python/lib/python3.12/_compat_pickle.py +252 -0
  236. package/python/lib/python3.12/_compression.py +162 -0
  237. package/python/lib/python3.12/_markupbase.py +396 -0
  238. package/python/lib/python3.12/_osx_support.py +579 -0
  239. package/python/lib/python3.12/_py_abc.py +147 -0
  240. package/python/lib/python3.12/_pydatetime.py +2643 -0
  241. package/python/lib/python3.12/_pydecimal.py +6339 -0
  242. package/python/lib/python3.12/_pyio.py +2698 -0
  243. package/python/lib/python3.12/_pylong.py +329 -0
  244. package/python/lib/python3.12/_sitebuiltins.py +103 -0
  245. package/python/lib/python3.12/_strptime.py +664 -0
  246. package/python/lib/python3.12/_sysconfigdata__darwin_darwin.py +984 -0
  247. package/python/lib/python3.12/_threading_local.py +242 -0
  248. package/python/lib/python3.12/_weakrefset.py +205 -0
  249. package/python/lib/python3.12/abc.py +188 -0
  250. package/python/lib/python3.12/aifc.py +984 -0
  251. package/python/lib/python3.12/antigravity.py +17 -0
  252. package/python/lib/python3.12/argparse.py +2650 -0
  253. package/python/lib/python3.12/ast.py +1840 -0
  254. package/python/lib/python3.12/asyncio/__init__.py +47 -0
  255. package/python/lib/python3.12/asyncio/__main__.py +128 -0
  256. package/python/lib/python3.12/asyncio/base_events.py +2024 -0
  257. package/python/lib/python3.12/asyncio/base_futures.py +67 -0
  258. package/python/lib/python3.12/asyncio/base_subprocess.py +285 -0
  259. package/python/lib/python3.12/asyncio/base_tasks.py +94 -0
  260. package/python/lib/python3.12/asyncio/constants.py +41 -0
  261. package/python/lib/python3.12/asyncio/coroutines.py +109 -0
  262. package/python/lib/python3.12/asyncio/events.py +868 -0
  263. package/python/lib/python3.12/asyncio/exceptions.py +62 -0
  264. package/python/lib/python3.12/asyncio/format_helpers.py +76 -0
  265. package/python/lib/python3.12/asyncio/futures.py +430 -0
  266. package/python/lib/python3.12/asyncio/locks.py +586 -0
  267. package/python/lib/python3.12/asyncio/log.py +7 -0
  268. package/python/lib/python3.12/asyncio/mixins.py +21 -0
  269. package/python/lib/python3.12/asyncio/proactor_events.py +897 -0
  270. package/python/lib/python3.12/asyncio/protocols.py +216 -0
  271. package/python/lib/python3.12/asyncio/queues.py +244 -0
  272. package/python/lib/python3.12/asyncio/runners.py +216 -0
  273. package/python/lib/python3.12/asyncio/selector_events.py +1324 -0
  274. package/python/lib/python3.12/asyncio/sslproto.py +929 -0
  275. package/python/lib/python3.12/asyncio/staggered.py +174 -0
  276. package/python/lib/python3.12/asyncio/streams.py +770 -0
  277. package/python/lib/python3.12/asyncio/subprocess.py +229 -0
  278. package/python/lib/python3.12/asyncio/taskgroups.py +268 -0
  279. package/python/lib/python3.12/asyncio/tasks.py +1065 -0
  280. package/python/lib/python3.12/asyncio/threads.py +25 -0
  281. package/python/lib/python3.12/asyncio/timeouts.py +168 -0
  282. package/python/lib/python3.12/asyncio/transports.py +335 -0
  283. package/python/lib/python3.12/asyncio/trsock.py +98 -0
  284. package/python/lib/python3.12/asyncio/unix_events.py +1500 -0
  285. package/python/lib/python3.12/asyncio/windows_events.py +901 -0
  286. package/python/lib/python3.12/asyncio/windows_utils.py +173 -0
  287. package/python/lib/python3.12/base64.py +586 -0
  288. package/python/lib/python3.12/bdb.py +920 -0
  289. package/python/lib/python3.12/bisect.py +118 -0
  290. package/python/lib/python3.12/bz2.py +344 -0
  291. package/python/lib/python3.12/cProfile.py +195 -0
  292. package/python/lib/python3.12/calendar.py +808 -0
  293. package/python/lib/python3.12/cgi.py +1014 -0
  294. package/python/lib/python3.12/cgitb.py +332 -0
  295. package/python/lib/python3.12/chunk.py +173 -0
  296. package/python/lib/python3.12/cmd.py +401 -0
  297. package/python/lib/python3.12/code.py +324 -0
  298. package/python/lib/python3.12/codecs.py +1129 -0
  299. package/python/lib/python3.12/codeop.py +161 -0
  300. package/python/lib/python3.12/collections/__init__.py +1592 -0
  301. package/python/lib/python3.12/collections/abc.py +3 -0
  302. package/python/lib/python3.12/colorsys.py +166 -0
  303. package/python/lib/python3.12/compileall.py +469 -0
  304. package/python/lib/python3.12/concurrent/__init__.py +1 -0
  305. package/python/lib/python3.12/concurrent/futures/__init__.py +54 -0
  306. package/python/lib/python3.12/concurrent/futures/_base.py +654 -0
  307. package/python/lib/python3.12/concurrent/futures/process.py +876 -0
  308. package/python/lib/python3.12/concurrent/futures/thread.py +240 -0
  309. package/python/lib/python3.12/config-3.12-darwin/Makefile +3224 -0
  310. package/python/lib/python3.12/config-3.12-darwin/Setup +303 -0
  311. package/python/lib/python3.12/config-3.12-darwin/Setup.bootstrap +36 -0
  312. package/python/lib/python3.12/config-3.12-darwin/Setup.local +90 -0
  313. package/python/lib/python3.12/config-3.12-darwin/Setup.stdlib +183 -0
  314. package/python/lib/python3.12/config-3.12-darwin/config.c +246 -0
  315. package/python/lib/python3.12/config-3.12-darwin/config.c.in +71 -0
  316. package/python/lib/python3.12/config-3.12-darwin/install-sh +541 -0
  317. package/python/lib/python3.12/config-3.12-darwin/makesetup +353 -0
  318. package/python/lib/python3.12/config-3.12-darwin/python-config.py +76 -0
  319. package/python/lib/python3.12/config-3.12-darwin/python.o +0 -0
  320. package/python/lib/python3.12/configparser.py +1333 -0
  321. package/python/lib/python3.12/contextlib.py +800 -0
  322. package/python/lib/python3.12/contextvars.py +4 -0
  323. package/python/lib/python3.12/copy.py +292 -0
  324. package/python/lib/python3.12/copyreg.py +217 -0
  325. package/python/lib/python3.12/crypt.py +124 -0
  326. package/python/lib/python3.12/csv.py +451 -0
  327. package/python/lib/python3.12/ctypes/__init__.py +582 -0
  328. package/python/lib/python3.12/ctypes/_aix.py +327 -0
  329. package/python/lib/python3.12/ctypes/_endian.py +78 -0
  330. package/python/lib/python3.12/ctypes/macholib/README.ctypes +7 -0
  331. package/python/lib/python3.12/ctypes/macholib/__init__.py +9 -0
  332. package/python/lib/python3.12/ctypes/macholib/dyld.py +165 -0
  333. package/python/lib/python3.12/ctypes/macholib/dylib.py +42 -0
  334. package/python/lib/python3.12/ctypes/macholib/fetch_macholib +2 -0
  335. package/python/lib/python3.12/ctypes/macholib/fetch_macholib.bat +1 -0
  336. package/python/lib/python3.12/ctypes/macholib/framework.py +42 -0
  337. package/python/lib/python3.12/ctypes/util.py +379 -0
  338. package/python/lib/python3.12/ctypes/wintypes.py +202 -0
  339. package/python/lib/python3.12/curses/__init__.py +101 -0
  340. package/python/lib/python3.12/curses/ascii.py +99 -0
  341. package/python/lib/python3.12/curses/has_key.py +192 -0
  342. package/python/lib/python3.12/curses/panel.py +6 -0
  343. package/python/lib/python3.12/curses/textpad.py +204 -0
  344. package/python/lib/python3.12/dataclasses.py +1588 -0
  345. package/python/lib/python3.12/datetime.py +9 -0
  346. package/python/lib/python3.12/dbm/__init__.py +190 -0
  347. package/python/lib/python3.12/dbm/dumb.py +317 -0
  348. package/python/lib/python3.12/dbm/gnu.py +3 -0
  349. package/python/lib/python3.12/dbm/ndbm.py +3 -0
  350. package/python/lib/python3.12/decimal.py +108 -0
  351. package/python/lib/python3.12/difflib.py +2056 -0
  352. package/python/lib/python3.12/dis.py +805 -0
  353. package/python/lib/python3.12/doctest.py +2845 -0
  354. package/python/lib/python3.12/email/__init__.py +61 -0
  355. package/python/lib/python3.12/email/_encoded_words.py +233 -0
  356. package/python/lib/python3.12/email/_header_value_parser.py +3108 -0
  357. package/python/lib/python3.12/email/_parseaddr.py +557 -0
  358. package/python/lib/python3.12/email/_policybase.py +382 -0
  359. package/python/lib/python3.12/email/architecture.rst +216 -0
  360. package/python/lib/python3.12/email/base64mime.py +115 -0
  361. package/python/lib/python3.12/email/charset.py +398 -0
  362. package/python/lib/python3.12/email/contentmanager.py +251 -0
  363. package/python/lib/python3.12/email/encoders.py +65 -0
  364. package/python/lib/python3.12/email/errors.py +117 -0
  365. package/python/lib/python3.12/email/feedparser.py +534 -0
  366. package/python/lib/python3.12/email/generator.py +530 -0
  367. package/python/lib/python3.12/email/header.py +573 -0
  368. package/python/lib/python3.12/email/headerregistry.py +604 -0
  369. package/python/lib/python3.12/email/iterators.py +68 -0
  370. package/python/lib/python3.12/email/message.py +1215 -0
  371. package/python/lib/python3.12/email/mime/__init__.py +0 -0
  372. package/python/lib/python3.12/email/mime/application.py +37 -0
  373. package/python/lib/python3.12/email/mime/audio.py +100 -0
  374. package/python/lib/python3.12/email/mime/base.py +29 -0
  375. package/python/lib/python3.12/email/mime/image.py +152 -0
  376. package/python/lib/python3.12/email/mime/message.py +33 -0
  377. package/python/lib/python3.12/email/mime/multipart.py +47 -0
  378. package/python/lib/python3.12/email/mime/nonmultipart.py +21 -0
  379. package/python/lib/python3.12/email/mime/text.py +40 -0
  380. package/python/lib/python3.12/email/parser.py +127 -0
  381. package/python/lib/python3.12/email/policy.py +232 -0
  382. package/python/lib/python3.12/email/quoprimime.py +300 -0
  383. package/python/lib/python3.12/email/utils.py +486 -0
  384. package/python/lib/python3.12/encodings/__init__.py +174 -0
  385. package/python/lib/python3.12/encodings/aliases.py +551 -0
  386. package/python/lib/python3.12/encodings/ascii.py +50 -0
  387. package/python/lib/python3.12/encodings/base64_codec.py +55 -0
  388. package/python/lib/python3.12/encodings/big5.py +39 -0
  389. package/python/lib/python3.12/encodings/big5hkscs.py +39 -0
  390. package/python/lib/python3.12/encodings/bz2_codec.py +78 -0
  391. package/python/lib/python3.12/encodings/charmap.py +69 -0
  392. package/python/lib/python3.12/encodings/cp037.py +307 -0
  393. package/python/lib/python3.12/encodings/cp1006.py +307 -0
  394. package/python/lib/python3.12/encodings/cp1026.py +307 -0
  395. package/python/lib/python3.12/encodings/cp1125.py +698 -0
  396. package/python/lib/python3.12/encodings/cp1140.py +307 -0
  397. package/python/lib/python3.12/encodings/cp1250.py +307 -0
  398. package/python/lib/python3.12/encodings/cp1251.py +307 -0
  399. package/python/lib/python3.12/encodings/cp1252.py +307 -0
  400. package/python/lib/python3.12/encodings/cp1253.py +307 -0
  401. package/python/lib/python3.12/encodings/cp1254.py +307 -0
  402. package/python/lib/python3.12/encodings/cp1255.py +307 -0
  403. package/python/lib/python3.12/encodings/cp1256.py +307 -0
  404. package/python/lib/python3.12/encodings/cp1257.py +307 -0
  405. package/python/lib/python3.12/encodings/cp1258.py +307 -0
  406. package/python/lib/python3.12/encodings/cp273.py +307 -0
  407. package/python/lib/python3.12/encodings/cp424.py +307 -0
  408. package/python/lib/python3.12/encodings/cp437.py +698 -0
  409. package/python/lib/python3.12/encodings/cp500.py +307 -0
  410. package/python/lib/python3.12/encodings/cp720.py +309 -0
  411. package/python/lib/python3.12/encodings/cp737.py +698 -0
  412. package/python/lib/python3.12/encodings/cp775.py +697 -0
  413. package/python/lib/python3.12/encodings/cp850.py +698 -0
  414. package/python/lib/python3.12/encodings/cp852.py +698 -0
  415. package/python/lib/python3.12/encodings/cp855.py +698 -0
  416. package/python/lib/python3.12/encodings/cp856.py +307 -0
  417. package/python/lib/python3.12/encodings/cp857.py +694 -0
  418. package/python/lib/python3.12/encodings/cp858.py +698 -0
  419. package/python/lib/python3.12/encodings/cp860.py +698 -0
  420. package/python/lib/python3.12/encodings/cp861.py +698 -0
  421. package/python/lib/python3.12/encodings/cp862.py +698 -0
  422. package/python/lib/python3.12/encodings/cp863.py +698 -0
  423. package/python/lib/python3.12/encodings/cp864.py +690 -0
  424. package/python/lib/python3.12/encodings/cp865.py +698 -0
  425. package/python/lib/python3.12/encodings/cp866.py +698 -0
  426. package/python/lib/python3.12/encodings/cp869.py +689 -0
  427. package/python/lib/python3.12/encodings/cp874.py +307 -0
  428. package/python/lib/python3.12/encodings/cp875.py +307 -0
  429. package/python/lib/python3.12/encodings/cp932.py +39 -0
  430. package/python/lib/python3.12/encodings/cp949.py +39 -0
  431. package/python/lib/python3.12/encodings/cp950.py +39 -0
  432. package/python/lib/python3.12/encodings/euc_jis_2004.py +39 -0
  433. package/python/lib/python3.12/encodings/euc_jisx0213.py +39 -0
  434. package/python/lib/python3.12/encodings/euc_jp.py +39 -0
  435. package/python/lib/python3.12/encodings/euc_kr.py +39 -0
  436. package/python/lib/python3.12/encodings/gb18030.py +39 -0
  437. package/python/lib/python3.12/encodings/gb2312.py +39 -0
  438. package/python/lib/python3.12/encodings/gbk.py +39 -0
  439. package/python/lib/python3.12/encodings/hex_codec.py +55 -0
  440. package/python/lib/python3.12/encodings/hp_roman8.py +314 -0
  441. package/python/lib/python3.12/encodings/hz.py +39 -0
  442. package/python/lib/python3.12/encodings/idna.py +317 -0
  443. package/python/lib/python3.12/encodings/iso2022_jp.py +39 -0
  444. package/python/lib/python3.12/encodings/iso2022_jp_1.py +39 -0
  445. package/python/lib/python3.12/encodings/iso2022_jp_2.py +39 -0
  446. package/python/lib/python3.12/encodings/iso2022_jp_2004.py +39 -0
  447. package/python/lib/python3.12/encodings/iso2022_jp_3.py +39 -0
  448. package/python/lib/python3.12/encodings/iso2022_jp_ext.py +39 -0
  449. package/python/lib/python3.12/encodings/iso2022_kr.py +39 -0
  450. package/python/lib/python3.12/encodings/iso8859_1.py +307 -0
  451. package/python/lib/python3.12/encodings/iso8859_10.py +307 -0
  452. package/python/lib/python3.12/encodings/iso8859_11.py +307 -0
  453. package/python/lib/python3.12/encodings/iso8859_13.py +307 -0
  454. package/python/lib/python3.12/encodings/iso8859_14.py +307 -0
  455. package/python/lib/python3.12/encodings/iso8859_15.py +307 -0
  456. package/python/lib/python3.12/encodings/iso8859_16.py +307 -0
  457. package/python/lib/python3.12/encodings/iso8859_2.py +307 -0
  458. package/python/lib/python3.12/encodings/iso8859_3.py +307 -0
  459. package/python/lib/python3.12/encodings/iso8859_4.py +307 -0
  460. package/python/lib/python3.12/encodings/iso8859_5.py +307 -0
  461. package/python/lib/python3.12/encodings/iso8859_6.py +307 -0
  462. package/python/lib/python3.12/encodings/iso8859_7.py +307 -0
  463. package/python/lib/python3.12/encodings/iso8859_8.py +307 -0
  464. package/python/lib/python3.12/encodings/iso8859_9.py +307 -0
  465. package/python/lib/python3.12/encodings/johab.py +39 -0
  466. package/python/lib/python3.12/encodings/koi8_r.py +307 -0
  467. package/python/lib/python3.12/encodings/koi8_t.py +308 -0
  468. package/python/lib/python3.12/encodings/koi8_u.py +307 -0
  469. package/python/lib/python3.12/encodings/kz1048.py +307 -0
  470. package/python/lib/python3.12/encodings/latin_1.py +50 -0
  471. package/python/lib/python3.12/encodings/mac_arabic.py +698 -0
  472. package/python/lib/python3.12/encodings/mac_croatian.py +307 -0
  473. package/python/lib/python3.12/encodings/mac_cyrillic.py +307 -0
  474. package/python/lib/python3.12/encodings/mac_farsi.py +307 -0
  475. package/python/lib/python3.12/encodings/mac_greek.py +307 -0
  476. package/python/lib/python3.12/encodings/mac_iceland.py +307 -0
  477. package/python/lib/python3.12/encodings/mac_latin2.py +312 -0
  478. package/python/lib/python3.12/encodings/mac_roman.py +307 -0
  479. package/python/lib/python3.12/encodings/mac_romanian.py +307 -0
  480. package/python/lib/python3.12/encodings/mac_turkish.py +307 -0
  481. package/python/lib/python3.12/encodings/mbcs.py +47 -0
  482. package/python/lib/python3.12/encodings/oem.py +41 -0
  483. package/python/lib/python3.12/encodings/palmos.py +308 -0
  484. package/python/lib/python3.12/encodings/ptcp154.py +312 -0
  485. package/python/lib/python3.12/encodings/punycode.py +237 -0
  486. package/python/lib/python3.12/encodings/quopri_codec.py +56 -0
  487. package/python/lib/python3.12/encodings/raw_unicode_escape.py +46 -0
  488. package/python/lib/python3.12/encodings/rot_13.py +113 -0
  489. package/python/lib/python3.12/encodings/shift_jis.py +39 -0
  490. package/python/lib/python3.12/encodings/shift_jis_2004.py +39 -0
  491. package/python/lib/python3.12/encodings/shift_jisx0213.py +39 -0
  492. package/python/lib/python3.12/encodings/tis_620.py +307 -0
  493. package/python/lib/python3.12/encodings/undefined.py +49 -0
  494. package/python/lib/python3.12/encodings/unicode_escape.py +46 -0
  495. package/python/lib/python3.12/encodings/utf_16.py +155 -0
  496. package/python/lib/python3.12/encodings/utf_16_be.py +42 -0
  497. package/python/lib/python3.12/encodings/utf_16_le.py +42 -0
  498. package/python/lib/python3.12/encodings/utf_32.py +150 -0
  499. package/python/lib/python3.12/encodings/utf_32_be.py +37 -0
  500. package/python/lib/python3.12/encodings/utf_32_le.py +37 -0
  501. package/python/lib/python3.12/encodings/utf_7.py +38 -0
  502. package/python/lib/python3.12/encodings/utf_8.py +42 -0
  503. package/python/lib/python3.12/encodings/utf_8_sig.py +130 -0
  504. package/python/lib/python3.12/encodings/uu_codec.py +103 -0
  505. package/python/lib/python3.12/encodings/zlib_codec.py +77 -0
  506. package/python/lib/python3.12/ensurepip/__init__.py +291 -0
  507. package/python/lib/python3.12/ensurepip/__main__.py +5 -0
  508. package/python/lib/python3.12/ensurepip/_bundled/pip-25.0.1-py3-none-any.whl +0 -0
  509. package/python/lib/python3.12/ensurepip/_uninstall.py +31 -0
  510. package/python/lib/python3.12/enum.py +2108 -0
  511. package/python/lib/python3.12/filecmp.py +315 -0
  512. package/python/lib/python3.12/fileinput.py +442 -0
  513. package/python/lib/python3.12/fnmatch.py +185 -0
  514. package/python/lib/python3.12/fractions.py +990 -0
  515. package/python/lib/python3.12/ftplib.py +966 -0
  516. package/python/lib/python3.12/functools.py +1009 -0
  517. package/python/lib/python3.12/genericpath.py +176 -0
  518. package/python/lib/python3.12/getopt.py +215 -0
  519. package/python/lib/python3.12/getpass.py +185 -0
  520. package/python/lib/python3.12/gettext.py +646 -0
  521. package/python/lib/python3.12/glob.py +252 -0
  522. package/python/lib/python3.12/graphlib.py +250 -0
  523. package/python/lib/python3.12/gzip.py +711 -0
  524. package/python/lib/python3.12/hashlib.py +253 -0
  525. package/python/lib/python3.12/heapq.py +603 -0
  526. package/python/lib/python3.12/hmac.py +219 -0
  527. package/python/lib/python3.12/html/__init__.py +132 -0
  528. package/python/lib/python3.12/html/entities.py +2513 -0
  529. package/python/lib/python3.12/html/parser.py +535 -0
  530. package/python/lib/python3.12/http/__init__.py +200 -0
  531. package/python/lib/python3.12/http/client.py +1570 -0
  532. package/python/lib/python3.12/http/cookiejar.py +2121 -0
  533. package/python/lib/python3.12/http/cookies.py +615 -0
  534. package/python/lib/python3.12/http/server.py +1335 -0
  535. package/python/lib/python3.12/imaplib.py +1641 -0
  536. package/python/lib/python3.12/imghdr.py +180 -0
  537. package/python/lib/python3.12/importlib/__init__.py +138 -0
  538. package/python/lib/python3.12/importlib/_abc.py +39 -0
  539. package/python/lib/python3.12/importlib/_bootstrap.py +1551 -0
  540. package/python/lib/python3.12/importlib/_bootstrap_external.py +1749 -0
  541. package/python/lib/python3.12/importlib/abc.py +239 -0
  542. package/python/lib/python3.12/importlib/machinery.py +20 -0
  543. package/python/lib/python3.12/importlib/metadata/__init__.py +966 -0
  544. package/python/lib/python3.12/importlib/metadata/_adapters.py +89 -0
  545. package/python/lib/python3.12/importlib/metadata/_collections.py +30 -0
  546. package/python/lib/python3.12/importlib/metadata/_functools.py +104 -0
  547. package/python/lib/python3.12/importlib/metadata/_itertools.py +73 -0
  548. package/python/lib/python3.12/importlib/metadata/_meta.py +63 -0
  549. package/python/lib/python3.12/importlib/metadata/_text.py +99 -0
  550. package/python/lib/python3.12/importlib/readers.py +12 -0
  551. package/python/lib/python3.12/importlib/resources/__init__.py +38 -0
  552. package/python/lib/python3.12/importlib/resources/_adapters.py +168 -0
  553. package/python/lib/python3.12/importlib/resources/_common.py +208 -0
  554. package/python/lib/python3.12/importlib/resources/_itertools.py +38 -0
  555. package/python/lib/python3.12/importlib/resources/_legacy.py +98 -0
  556. package/python/lib/python3.12/importlib/resources/abc.py +173 -0
  557. package/python/lib/python3.12/importlib/resources/readers.py +146 -0
  558. package/python/lib/python3.12/importlib/resources/simple.py +106 -0
  559. package/python/lib/python3.12/importlib/simple.py +14 -0
  560. package/python/lib/python3.12/importlib/util.py +270 -0
  561. package/python/lib/python3.12/inspect.py +3433 -0
  562. package/python/lib/python3.12/io.py +99 -0
  563. package/python/lib/python3.12/ipaddress.py +2430 -0
  564. package/python/lib/python3.12/json/__init__.py +359 -0
  565. package/python/lib/python3.12/json/decoder.py +357 -0
  566. package/python/lib/python3.12/json/encoder.py +443 -0
  567. package/python/lib/python3.12/json/scanner.py +73 -0
  568. package/python/lib/python3.12/json/tool.py +85 -0
  569. package/python/lib/python3.12/keyword.py +64 -0
  570. package/python/lib/python3.12/lib-dynload/.empty +0 -0
  571. package/python/lib/python3.12/lib-dynload/_crypt.cpython-312-darwin.so +0 -0
  572. package/python/lib/python3.12/lib-dynload/_dbm.cpython-312-darwin.so +0 -0
  573. package/python/lib/python3.12/linecache.py +185 -0
  574. package/python/lib/python3.12/locale.py +1779 -0
  575. package/python/lib/python3.12/logging/__init__.py +2345 -0
  576. package/python/lib/python3.12/logging/config.py +1078 -0
  577. package/python/lib/python3.12/logging/handlers.py +1624 -0
  578. package/python/lib/python3.12/lzma.py +356 -0
  579. package/python/lib/python3.12/mailbox.py +2153 -0
  580. package/python/lib/python3.12/mailcap.py +302 -0
  581. package/python/lib/python3.12/mimetypes.py +656 -0
  582. package/python/lib/python3.12/modulefinder.py +666 -0
  583. package/python/lib/python3.12/multiprocessing/__init__.py +37 -0
  584. package/python/lib/python3.12/multiprocessing/connection.py +1178 -0
  585. package/python/lib/python3.12/multiprocessing/context.py +377 -0
  586. package/python/lib/python3.12/multiprocessing/dummy/__init__.py +126 -0
  587. package/python/lib/python3.12/multiprocessing/dummy/connection.py +75 -0
  588. package/python/lib/python3.12/multiprocessing/forkserver.py +350 -0
  589. package/python/lib/python3.12/multiprocessing/heap.py +337 -0
  590. package/python/lib/python3.12/multiprocessing/managers.py +1387 -0
  591. package/python/lib/python3.12/multiprocessing/pool.py +957 -0
  592. package/python/lib/python3.12/multiprocessing/popen_fork.py +83 -0
  593. package/python/lib/python3.12/multiprocessing/popen_forkserver.py +74 -0
  594. package/python/lib/python3.12/multiprocessing/popen_spawn_posix.py +72 -0
  595. package/python/lib/python3.12/multiprocessing/popen_spawn_win32.py +145 -0
  596. package/python/lib/python3.12/multiprocessing/process.py +439 -0
  597. package/python/lib/python3.12/multiprocessing/queues.py +401 -0
  598. package/python/lib/python3.12/multiprocessing/reduction.py +281 -0
  599. package/python/lib/python3.12/multiprocessing/resource_sharer.py +154 -0
  600. package/python/lib/python3.12/multiprocessing/resource_tracker.py +294 -0
  601. package/python/lib/python3.12/multiprocessing/shared_memory.py +534 -0
  602. package/python/lib/python3.12/multiprocessing/sharedctypes.py +240 -0
  603. package/python/lib/python3.12/multiprocessing/spawn.py +307 -0
  604. package/python/lib/python3.12/multiprocessing/synchronize.py +404 -0
  605. package/python/lib/python3.12/multiprocessing/util.py +494 -0
  606. package/python/lib/python3.12/netrc.py +192 -0
  607. package/python/lib/python3.12/nntplib.py +1093 -0
  608. package/python/lib/python3.12/ntpath.py +869 -0
  609. package/python/lib/python3.12/nturl2path.py +69 -0
  610. package/python/lib/python3.12/numbers.py +418 -0
  611. package/python/lib/python3.12/opcode.py +493 -0
  612. package/python/lib/python3.12/operator.py +467 -0
  613. package/python/lib/python3.12/optparse.py +1681 -0
  614. package/python/lib/python3.12/os.py +1159 -0
  615. package/python/lib/python3.12/pathlib.py +1435 -0
  616. package/python/lib/python3.12/pdb.py +1987 -0
  617. package/python/lib/python3.12/pickle.py +1866 -0
  618. package/python/lib/python3.12/pickletools.py +2904 -0
  619. package/python/lib/python3.12/pipes.py +250 -0
  620. package/python/lib/python3.12/pkgutil.py +529 -0
  621. package/python/lib/python3.12/platform.py +1359 -0
  622. package/python/lib/python3.12/plistlib.py +920 -0
  623. package/python/lib/python3.12/poplib.py +478 -0
  624. package/python/lib/python3.12/posixpath.py +577 -0
  625. package/python/lib/python3.12/pprint.py +658 -0
  626. package/python/lib/python3.12/profile.py +615 -0
  627. package/python/lib/python3.12/pstats.py +778 -0
  628. package/python/lib/python3.12/pty.py +211 -0
  629. package/python/lib/python3.12/py_compile.py +212 -0
  630. package/python/lib/python3.12/pyclbr.py +314 -0
  631. package/python/lib/python3.12/pydoc.py +2950 -0
  632. package/python/lib/python3.12/pydoc_data/__init__.py +0 -0
  633. package/python/lib/python3.12/pydoc_data/_pydoc.css +112 -0
  634. package/python/lib/python3.12/pydoc_data/topics.py +12500 -0
  635. package/python/lib/python3.12/queue.py +326 -0
  636. package/python/lib/python3.12/quopri.py +237 -0
  637. package/python/lib/python3.12/random.py +996 -0
  638. package/python/lib/python3.12/re/__init__.py +385 -0
  639. package/python/lib/python3.12/re/_casefix.py +106 -0
  640. package/python/lib/python3.12/re/_compiler.py +770 -0
  641. package/python/lib/python3.12/re/_constants.py +220 -0
  642. package/python/lib/python3.12/re/_parser.py +1080 -0
  643. package/python/lib/python3.12/reprlib.py +214 -0
  644. package/python/lib/python3.12/rlcompleter.py +219 -0
  645. package/python/lib/python3.12/runpy.py +319 -0
  646. package/python/lib/python3.12/sched.py +167 -0
  647. package/python/lib/python3.12/secrets.py +71 -0
  648. package/python/lib/python3.12/selectors.py +623 -0
  649. package/python/lib/python3.12/shelve.py +243 -0
  650. package/python/lib/python3.12/shlex.py +345 -0
  651. package/python/lib/python3.12/shutil.py +1566 -0
  652. package/python/lib/python3.12/signal.py +94 -0
  653. package/python/lib/python3.12/site-packages/README.txt +2 -0
  654. package/python/lib/python3.12/site-packages/pip/__init__.py +13 -0
  655. package/python/lib/python3.12/site-packages/pip/__main__.py +24 -0
  656. package/python/lib/python3.12/site-packages/pip/__pip-runner__.py +50 -0
  657. package/python/lib/python3.12/site-packages/pip/_internal/__init__.py +18 -0
  658. package/python/lib/python3.12/site-packages/pip/_internal/build_env.py +606 -0
  659. package/python/lib/python3.12/site-packages/pip/_internal/cache.py +291 -0
  660. package/python/lib/python3.12/site-packages/pip/_internal/cli/__init__.py +3 -0
  661. package/python/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py +184 -0
  662. package/python/lib/python3.12/site-packages/pip/_internal/cli/base_command.py +264 -0
  663. package/python/lib/python3.12/site-packages/pip/_internal/cli/cmdoptions.py +1298 -0
  664. package/python/lib/python3.12/site-packages/pip/_internal/cli/command_context.py +28 -0
  665. package/python/lib/python3.12/site-packages/pip/_internal/cli/index_command.py +212 -0
  666. package/python/lib/python3.12/site-packages/pip/_internal/cli/main.py +85 -0
  667. package/python/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py +136 -0
  668. package/python/lib/python3.12/site-packages/pip/_internal/cli/parser.py +358 -0
  669. package/python/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py +153 -0
  670. package/python/lib/python3.12/site-packages/pip/_internal/cli/req_command.py +472 -0
  671. package/python/lib/python3.12/site-packages/pip/_internal/cli/spinners.py +235 -0
  672. package/python/lib/python3.12/site-packages/pip/_internal/cli/status_codes.py +6 -0
  673. package/python/lib/python3.12/site-packages/pip/_internal/commands/__init__.py +139 -0
  674. package/python/lib/python3.12/site-packages/pip/_internal/commands/cache.py +255 -0
  675. package/python/lib/python3.12/site-packages/pip/_internal/commands/check.py +66 -0
  676. package/python/lib/python3.12/site-packages/pip/_internal/commands/completion.py +136 -0
  677. package/python/lib/python3.12/site-packages/pip/_internal/commands/configuration.py +288 -0
  678. package/python/lib/python3.12/site-packages/pip/_internal/commands/debug.py +196 -0
  679. package/python/lib/python3.12/site-packages/pip/_internal/commands/download.py +146 -0
  680. package/python/lib/python3.12/site-packages/pip/_internal/commands/freeze.py +107 -0
  681. package/python/lib/python3.12/site-packages/pip/_internal/commands/hash.py +58 -0
  682. package/python/lib/python3.12/site-packages/pip/_internal/commands/help.py +40 -0
  683. package/python/lib/python3.12/site-packages/pip/_internal/commands/index.py +166 -0
  684. package/python/lib/python3.12/site-packages/pip/_internal/commands/inspect.py +92 -0
  685. package/python/lib/python3.12/site-packages/pip/_internal/commands/install.py +904 -0
  686. package/python/lib/python3.12/site-packages/pip/_internal/commands/list.py +403 -0
  687. package/python/lib/python3.12/site-packages/pip/_internal/commands/lock.py +175 -0
  688. package/python/lib/python3.12/site-packages/pip/_internal/commands/search.py +178 -0
  689. package/python/lib/python3.12/site-packages/pip/_internal/commands/show.py +231 -0
  690. package/python/lib/python3.12/site-packages/pip/_internal/commands/uninstall.py +113 -0
  691. package/python/lib/python3.12/site-packages/pip/_internal/commands/wheel.py +171 -0
  692. package/python/lib/python3.12/site-packages/pip/_internal/configuration.py +396 -0
  693. package/python/lib/python3.12/site-packages/pip/_internal/distributions/__init__.py +21 -0
  694. package/python/lib/python3.12/site-packages/pip/_internal/distributions/base.py +55 -0
  695. package/python/lib/python3.12/site-packages/pip/_internal/distributions/installed.py +33 -0
  696. package/python/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py +164 -0
  697. package/python/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py +44 -0
  698. package/python/lib/python3.12/site-packages/pip/_internal/exceptions.py +971 -0
  699. package/python/lib/python3.12/site-packages/pip/_internal/index/__init__.py +1 -0
  700. package/python/lib/python3.12/site-packages/pip/_internal/index/collector.py +488 -0
  701. package/python/lib/python3.12/site-packages/pip/_internal/index/package_finder.py +1113 -0
  702. package/python/lib/python3.12/site-packages/pip/_internal/index/sources.py +287 -0
  703. package/python/lib/python3.12/site-packages/pip/_internal/locations/__init__.py +438 -0
  704. package/python/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py +173 -0
  705. package/python/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py +218 -0
  706. package/python/lib/python3.12/site-packages/pip/_internal/locations/base.py +82 -0
  707. package/python/lib/python3.12/site-packages/pip/_internal/main.py +12 -0
  708. package/python/lib/python3.12/site-packages/pip/_internal/metadata/__init__.py +169 -0
  709. package/python/lib/python3.12/site-packages/pip/_internal/metadata/_json.py +87 -0
  710. package/python/lib/python3.12/site-packages/pip/_internal/metadata/base.py +685 -0
  711. package/python/lib/python3.12/site-packages/pip/_internal/metadata/importlib/__init__.py +6 -0
  712. package/python/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_compat.py +87 -0
  713. package/python/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_dists.py +235 -0
  714. package/python/lib/python3.12/site-packages/pip/_internal/metadata/importlib/_envs.py +143 -0
  715. package/python/lib/python3.12/site-packages/pip/_internal/metadata/pkg_resources.py +298 -0
  716. package/python/lib/python3.12/site-packages/pip/_internal/models/__init__.py +1 -0
  717. package/python/lib/python3.12/site-packages/pip/_internal/models/candidate.py +23 -0
  718. package/python/lib/python3.12/site-packages/pip/_internal/models/direct_url.py +42 -0
  719. package/python/lib/python3.12/site-packages/pip/_internal/models/format_control.py +78 -0
  720. package/python/lib/python3.12/site-packages/pip/_internal/models/index.py +28 -0
  721. package/python/lib/python3.12/site-packages/pip/_internal/models/installation_report.py +57 -0
  722. package/python/lib/python3.12/site-packages/pip/_internal/models/link.py +617 -0
  723. package/python/lib/python3.12/site-packages/pip/_internal/models/release_control.py +91 -0
  724. package/python/lib/python3.12/site-packages/pip/_internal/models/scheme.py +23 -0
  725. package/python/lib/python3.12/site-packages/pip/_internal/models/search_scope.py +124 -0
  726. package/python/lib/python3.12/site-packages/pip/_internal/models/selection_prefs.py +36 -0
  727. package/python/lib/python3.12/site-packages/pip/_internal/models/target_python.py +122 -0
  728. package/python/lib/python3.12/site-packages/pip/_internal/models/wheel.py +80 -0
  729. package/python/lib/python3.12/site-packages/pip/_internal/network/__init__.py +1 -0
  730. package/python/lib/python3.12/site-packages/pip/_internal/network/auth.py +570 -0
  731. package/python/lib/python3.12/site-packages/pip/_internal/network/cache.py +128 -0
  732. package/python/lib/python3.12/site-packages/pip/_internal/network/download.py +340 -0
  733. package/python/lib/python3.12/site-packages/pip/_internal/network/lazy_wheel.py +215 -0
  734. package/python/lib/python3.12/site-packages/pip/_internal/network/session.py +537 -0
  735. package/python/lib/python3.12/site-packages/pip/_internal/network/utils.py +98 -0
  736. package/python/lib/python3.12/site-packages/pip/_internal/network/xmlrpc.py +61 -0
  737. package/python/lib/python3.12/site-packages/pip/_internal/operations/__init__.py +0 -0
  738. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  739. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/build_tracker.py +140 -0
  740. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/metadata.py +38 -0
  741. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/metadata_editable.py +41 -0
  742. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/wheel.py +38 -0
  743. package/python/lib/python3.12/site-packages/pip/_internal/operations/build/wheel_editable.py +47 -0
  744. package/python/lib/python3.12/site-packages/pip/_internal/operations/check.py +175 -0
  745. package/python/lib/python3.12/site-packages/pip/_internal/operations/freeze.py +259 -0
  746. package/python/lib/python3.12/site-packages/pip/_internal/operations/install/__init__.py +1 -0
  747. package/python/lib/python3.12/site-packages/pip/_internal/operations/install/wheel.py +759 -0
  748. package/python/lib/python3.12/site-packages/pip/_internal/operations/prepare.py +751 -0
  749. package/python/lib/python3.12/site-packages/pip/_internal/pyproject.py +123 -0
  750. package/python/lib/python3.12/site-packages/pip/_internal/req/__init__.py +103 -0
  751. package/python/lib/python3.12/site-packages/pip/_internal/req/constructors.py +677 -0
  752. package/python/lib/python3.12/site-packages/pip/_internal/req/pep723.py +41 -0
  753. package/python/lib/python3.12/site-packages/pip/_internal/req/req_dependency_group.py +86 -0
  754. package/python/lib/python3.12/site-packages/pip/_internal/req/req_file.py +622 -0
  755. package/python/lib/python3.12/site-packages/pip/_internal/req/req_install.py +838 -0
  756. package/python/lib/python3.12/site-packages/pip/_internal/req/req_set.py +81 -0
  757. package/python/lib/python3.12/site-packages/pip/_internal/req/req_uninstall.py +639 -0
  758. package/python/lib/python3.12/site-packages/pip/_internal/resolution/__init__.py +0 -0
  759. package/python/lib/python3.12/site-packages/pip/_internal/resolution/base.py +20 -0
  760. package/python/lib/python3.12/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  761. package/python/lib/python3.12/site-packages/pip/_internal/resolution/legacy/resolver.py +598 -0
  762. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  763. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/base.py +164 -0
  764. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/candidates.py +599 -0
  765. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/factory.py +914 -0
  766. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +166 -0
  767. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/provider.py +306 -0
  768. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/reporter.py +98 -0
  769. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/requirements.py +251 -0
  770. package/python/lib/python3.12/site-packages/pip/_internal/resolution/resolvelib/resolver.py +332 -0
  771. package/python/lib/python3.12/site-packages/pip/_internal/self_outdated_check.py +246 -0
  772. package/python/lib/python3.12/site-packages/pip/_internal/utils/__init__.py +0 -0
  773. package/python/lib/python3.12/site-packages/pip/_internal/utils/_jaraco_text.py +109 -0
  774. package/python/lib/python3.12/site-packages/pip/_internal/utils/_log.py +38 -0
  775. package/python/lib/python3.12/site-packages/pip/_internal/utils/appdirs.py +52 -0
  776. package/python/lib/python3.12/site-packages/pip/_internal/utils/compat.py +85 -0
  777. package/python/lib/python3.12/site-packages/pip/_internal/utils/compatibility_tags.py +201 -0
  778. package/python/lib/python3.12/site-packages/pip/_internal/utils/datetime.py +28 -0
  779. package/python/lib/python3.12/site-packages/pip/_internal/utils/deprecation.py +139 -0
  780. package/python/lib/python3.12/site-packages/pip/_internal/utils/direct_url_helpers.py +92 -0
  781. package/python/lib/python3.12/site-packages/pip/_internal/utils/egg_link.py +81 -0
  782. package/python/lib/python3.12/site-packages/pip/_internal/utils/entrypoints.py +88 -0
  783. package/python/lib/python3.12/site-packages/pip/_internal/utils/filesystem.py +201 -0
  784. package/python/lib/python3.12/site-packages/pip/_internal/utils/filetypes.py +24 -0
  785. package/python/lib/python3.12/site-packages/pip/_internal/utils/glibc.py +102 -0
  786. package/python/lib/python3.12/site-packages/pip/_internal/utils/hashes.py +150 -0
  787. package/python/lib/python3.12/site-packages/pip/_internal/utils/logging.py +396 -0
  788. package/python/lib/python3.12/site-packages/pip/_internal/utils/misc.py +771 -0
  789. package/python/lib/python3.12/site-packages/pip/_internal/utils/packaging.py +44 -0
  790. package/python/lib/python3.12/site-packages/pip/_internal/utils/pylock.py +283 -0
  791. package/python/lib/python3.12/site-packages/pip/_internal/utils/retry.py +45 -0
  792. package/python/lib/python3.12/site-packages/pip/_internal/utils/subprocess.py +248 -0
  793. package/python/lib/python3.12/site-packages/pip/_internal/utils/temp_dir.py +294 -0
  794. package/python/lib/python3.12/site-packages/pip/_internal/utils/unpacking.py +381 -0
  795. package/python/lib/python3.12/site-packages/pip/_internal/utils/urls.py +55 -0
  796. package/python/lib/python3.12/site-packages/pip/_internal/utils/virtualenv.py +105 -0
  797. package/python/lib/python3.12/site-packages/pip/_internal/utils/wheel.py +132 -0
  798. package/python/lib/python3.12/site-packages/pip/_internal/vcs/__init__.py +15 -0
  799. package/python/lib/python3.12/site-packages/pip/_internal/vcs/bazaar.py +130 -0
  800. package/python/lib/python3.12/site-packages/pip/_internal/vcs/git.py +571 -0
  801. package/python/lib/python3.12/site-packages/pip/_internal/vcs/mercurial.py +186 -0
  802. package/python/lib/python3.12/site-packages/pip/_internal/vcs/subversion.py +335 -0
  803. package/python/lib/python3.12/site-packages/pip/_internal/vcs/versioncontrol.py +695 -0
  804. package/python/lib/python3.12/site-packages/pip/_internal/wheel_builder.py +261 -0
  805. package/python/lib/python3.12/site-packages/pip/_vendor/README.rst +178 -0
  806. package/python/lib/python3.12/site-packages/pip/_vendor/__init__.py +117 -0
  807. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/LICENSE.txt +13 -0
  808. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/__init__.py +32 -0
  809. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/_cmd.py +70 -0
  810. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/adapter.py +167 -0
  811. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/cache.py +75 -0
  812. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +8 -0
  813. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +145 -0
  814. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +48 -0
  815. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/controller.py +511 -0
  816. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/filewrapper.py +121 -0
  817. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/heuristics.py +157 -0
  818. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/py.typed +0 -0
  819. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/serialize.py +146 -0
  820. package/python/lib/python3.12/site-packages/pip/_vendor/cachecontrol/wrapper.py +43 -0
  821. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/LICENSE +20 -0
  822. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/__init__.py +4 -0
  823. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  824. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/cacert.pem +4494 -0
  825. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/core.py +83 -0
  826. package/python/lib/python3.12/site-packages/pip/_vendor/certifi/py.typed +0 -0
  827. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/LICENSE.txt +284 -0
  828. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/__init__.py +33 -0
  829. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/compat.py +1137 -0
  830. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/resources.py +358 -0
  831. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/scripts.py +447 -0
  832. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/t32.exe +0 -0
  833. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/t64-arm.exe +0 -0
  834. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/t64.exe +0 -0
  835. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/util.py +1984 -0
  836. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/w32.exe +0 -0
  837. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/w64-arm.exe +0 -0
  838. package/python/lib/python3.12/site-packages/pip/_vendor/distlib/w64.exe +0 -0
  839. package/python/lib/python3.12/site-packages/pip/_vendor/distro/LICENSE +202 -0
  840. package/python/lib/python3.12/site-packages/pip/_vendor/distro/__init__.py +54 -0
  841. package/python/lib/python3.12/site-packages/pip/_vendor/distro/__main__.py +4 -0
  842. package/python/lib/python3.12/site-packages/pip/_vendor/distro/distro.py +1403 -0
  843. package/python/lib/python3.12/site-packages/pip/_vendor/distro/py.typed +0 -0
  844. package/python/lib/python3.12/site-packages/pip/_vendor/idna/LICENSE.md +31 -0
  845. package/python/lib/python3.12/site-packages/pip/_vendor/idna/__init__.py +45 -0
  846. package/python/lib/python3.12/site-packages/pip/_vendor/idna/codec.py +122 -0
  847. package/python/lib/python3.12/site-packages/pip/_vendor/idna/compat.py +15 -0
  848. package/python/lib/python3.12/site-packages/pip/_vendor/idna/core.py +437 -0
  849. package/python/lib/python3.12/site-packages/pip/_vendor/idna/idnadata.py +4309 -0
  850. package/python/lib/python3.12/site-packages/pip/_vendor/idna/intranges.py +57 -0
  851. package/python/lib/python3.12/site-packages/pip/_vendor/idna/package_data.py +1 -0
  852. package/python/lib/python3.12/site-packages/pip/_vendor/idna/py.typed +0 -0
  853. package/python/lib/python3.12/site-packages/pip/_vendor/idna/uts46data.py +8841 -0
  854. package/python/lib/python3.12/site-packages/pip/_vendor/msgpack/COPYING +14 -0
  855. package/python/lib/python3.12/site-packages/pip/_vendor/msgpack/__init__.py +55 -0
  856. package/python/lib/python3.12/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  857. package/python/lib/python3.12/site-packages/pip/_vendor/msgpack/ext.py +170 -0
  858. package/python/lib/python3.12/site-packages/pip/_vendor/msgpack/fallback.py +929 -0
  859. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/LICENSE +3 -0
  860. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/LICENSE.APACHE +177 -0
  861. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/LICENSE.BSD +23 -0
  862. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/__init__.py +15 -0
  863. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_elffile.py +108 -0
  864. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_manylinux.py +262 -0
  865. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_musllinux.py +85 -0
  866. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_parser.py +393 -0
  867. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_structures.py +33 -0
  868. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/_tokenizer.py +193 -0
  869. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/dependency_groups.py +302 -0
  870. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/direct_url.py +325 -0
  871. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/errors.py +94 -0
  872. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/__init__.py +186 -0
  873. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/licenses/_spdx.py +799 -0
  874. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/markers.py +492 -0
  875. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/metadata.py +964 -0
  876. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/py.typed +0 -0
  877. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/pylock.py +905 -0
  878. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/requirements.py +129 -0
  879. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/specifiers.py +1943 -0
  880. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/tags.py +932 -0
  881. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/utils.py +296 -0
  882. package/python/lib/python3.12/site-packages/pip/_vendor/packaging/version.py +1231 -0
  883. package/python/lib/python3.12/site-packages/pip/_vendor/pkg_resources/LICENSE +17 -0
  884. package/python/lib/python3.12/site-packages/pip/_vendor/pkg_resources/__init__.py +3676 -0
  885. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/LICENSE +21 -0
  886. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/__init__.py +631 -0
  887. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/__main__.py +55 -0
  888. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/android.py +249 -0
  889. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/api.py +299 -0
  890. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/macos.py +146 -0
  891. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/py.typed +0 -0
  892. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/unix.py +272 -0
  893. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/version.py +34 -0
  894. package/python/lib/python3.12/site-packages/pip/_vendor/platformdirs/windows.py +278 -0
  895. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/LICENSE +25 -0
  896. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/__init__.py +82 -0
  897. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/__main__.py +17 -0
  898. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/console.py +70 -0
  899. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/filter.py +70 -0
  900. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/filters/__init__.py +940 -0
  901. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/formatter.py +129 -0
  902. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/__init__.py +157 -0
  903. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/formatters/_mapping.py +23 -0
  904. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/lexer.py +963 -0
  905. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/__init__.py +362 -0
  906. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/_mapping.py +602 -0
  907. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/lexers/python.py +1201 -0
  908. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/modeline.py +43 -0
  909. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/plugin.py +72 -0
  910. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/regexopt.py +91 -0
  911. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/scanner.py +104 -0
  912. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/sphinxext.py +247 -0
  913. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/style.py +203 -0
  914. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/styles/__init__.py +61 -0
  915. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/styles/_mapping.py +54 -0
  916. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/token.py +214 -0
  917. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/unistring.py +153 -0
  918. package/python/lib/python3.12/site-packages/pip/_vendor/pygments/util.py +324 -0
  919. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/LICENSE +21 -0
  920. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/__init__.py +31 -0
  921. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_impl.py +410 -0
  922. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +21 -0
  923. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +389 -0
  924. package/python/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/py.typed +0 -0
  925. package/python/lib/python3.12/site-packages/pip/_vendor/requests/LICENSE +175 -0
  926. package/python/lib/python3.12/site-packages/pip/_vendor/requests/__init__.py +178 -0
  927. package/python/lib/python3.12/site-packages/pip/_vendor/requests/__version__.py +14 -0
  928. package/python/lib/python3.12/site-packages/pip/_vendor/requests/_internal_utils.py +51 -0
  929. package/python/lib/python3.12/site-packages/pip/_vendor/requests/adapters.py +697 -0
  930. package/python/lib/python3.12/site-packages/pip/_vendor/requests/api.py +157 -0
  931. package/python/lib/python3.12/site-packages/pip/_vendor/requests/auth.py +314 -0
  932. package/python/lib/python3.12/site-packages/pip/_vendor/requests/certs.py +18 -0
  933. package/python/lib/python3.12/site-packages/pip/_vendor/requests/compat.py +90 -0
  934. package/python/lib/python3.12/site-packages/pip/_vendor/requests/cookies.py +561 -0
  935. package/python/lib/python3.12/site-packages/pip/_vendor/requests/exceptions.py +152 -0
  936. package/python/lib/python3.12/site-packages/pip/_vendor/requests/help.py +124 -0
  937. package/python/lib/python3.12/site-packages/pip/_vendor/requests/hooks.py +34 -0
  938. package/python/lib/python3.12/site-packages/pip/_vendor/requests/models.py +1041 -0
  939. package/python/lib/python3.12/site-packages/pip/_vendor/requests/packages.py +25 -0
  940. package/python/lib/python3.12/site-packages/pip/_vendor/requests/sessions.py +834 -0
  941. package/python/lib/python3.12/site-packages/pip/_vendor/requests/status_codes.py +128 -0
  942. package/python/lib/python3.12/site-packages/pip/_vendor/requests/structures.py +99 -0
  943. package/python/lib/python3.12/site-packages/pip/_vendor/requests/utils.py +1083 -0
  944. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/LICENSE +13 -0
  945. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/__init__.py +27 -0
  946. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/providers.py +196 -0
  947. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/py.typed +0 -0
  948. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/reporters.py +55 -0
  949. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/__init__.py +27 -0
  950. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/abstract.py +47 -0
  951. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/criterion.py +48 -0
  952. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/exceptions.py +57 -0
  953. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/resolvers/resolution.py +627 -0
  954. package/python/lib/python3.12/site-packages/pip/_vendor/resolvelib/structs.py +209 -0
  955. package/python/lib/python3.12/site-packages/pip/_vendor/rich/LICENSE +19 -0
  956. package/python/lib/python3.12/site-packages/pip/_vendor/rich/__init__.py +177 -0
  957. package/python/lib/python3.12/site-packages/pip/_vendor/rich/__main__.py +245 -0
  958. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_cell_widths.py +454 -0
  959. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_codes.py +3610 -0
  960. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_emoji_replace.py +32 -0
  961. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_export_format.py +76 -0
  962. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_extension.py +10 -0
  963. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_fileno.py +24 -0
  964. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_inspect.py +268 -0
  965. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_log_render.py +94 -0
  966. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_loop.py +43 -0
  967. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_null_file.py +69 -0
  968. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_palettes.py +309 -0
  969. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_pick.py +17 -0
  970. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_ratio.py +153 -0
  971. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_spinners.py +482 -0
  972. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_stack.py +16 -0
  973. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_timer.py +19 -0
  974. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_win32_console.py +661 -0
  975. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_windows.py +71 -0
  976. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_windows_renderer.py +56 -0
  977. package/python/lib/python3.12/site-packages/pip/_vendor/rich/_wrap.py +93 -0
  978. package/python/lib/python3.12/site-packages/pip/_vendor/rich/abc.py +33 -0
  979. package/python/lib/python3.12/site-packages/pip/_vendor/rich/align.py +306 -0
  980. package/python/lib/python3.12/site-packages/pip/_vendor/rich/ansi.py +241 -0
  981. package/python/lib/python3.12/site-packages/pip/_vendor/rich/bar.py +93 -0
  982. package/python/lib/python3.12/site-packages/pip/_vendor/rich/box.py +474 -0
  983. package/python/lib/python3.12/site-packages/pip/_vendor/rich/cells.py +174 -0
  984. package/python/lib/python3.12/site-packages/pip/_vendor/rich/color.py +621 -0
  985. package/python/lib/python3.12/site-packages/pip/_vendor/rich/color_triplet.py +38 -0
  986. package/python/lib/python3.12/site-packages/pip/_vendor/rich/columns.py +187 -0
  987. package/python/lib/python3.12/site-packages/pip/_vendor/rich/console.py +2680 -0
  988. package/python/lib/python3.12/site-packages/pip/_vendor/rich/constrain.py +37 -0
  989. package/python/lib/python3.12/site-packages/pip/_vendor/rich/containers.py +167 -0
  990. package/python/lib/python3.12/site-packages/pip/_vendor/rich/control.py +219 -0
  991. package/python/lib/python3.12/site-packages/pip/_vendor/rich/default_styles.py +193 -0
  992. package/python/lib/python3.12/site-packages/pip/_vendor/rich/diagnose.py +39 -0
  993. package/python/lib/python3.12/site-packages/pip/_vendor/rich/emoji.py +91 -0
  994. package/python/lib/python3.12/site-packages/pip/_vendor/rich/errors.py +34 -0
  995. package/python/lib/python3.12/site-packages/pip/_vendor/rich/file_proxy.py +57 -0
  996. package/python/lib/python3.12/site-packages/pip/_vendor/rich/filesize.py +88 -0
  997. package/python/lib/python3.12/site-packages/pip/_vendor/rich/highlighter.py +232 -0
  998. package/python/lib/python3.12/site-packages/pip/_vendor/rich/json.py +139 -0
  999. package/python/lib/python3.12/site-packages/pip/_vendor/rich/jupyter.py +101 -0
  1000. package/python/lib/python3.12/site-packages/pip/_vendor/rich/layout.py +442 -0
  1001. package/python/lib/python3.12/site-packages/pip/_vendor/rich/live.py +400 -0
  1002. package/python/lib/python3.12/site-packages/pip/_vendor/rich/live_render.py +106 -0
  1003. package/python/lib/python3.12/site-packages/pip/_vendor/rich/logging.py +297 -0
  1004. package/python/lib/python3.12/site-packages/pip/_vendor/rich/markup.py +251 -0
  1005. package/python/lib/python3.12/site-packages/pip/_vendor/rich/measure.py +151 -0
  1006. package/python/lib/python3.12/site-packages/pip/_vendor/rich/padding.py +141 -0
  1007. package/python/lib/python3.12/site-packages/pip/_vendor/rich/pager.py +34 -0
  1008. package/python/lib/python3.12/site-packages/pip/_vendor/rich/palette.py +100 -0
  1009. package/python/lib/python3.12/site-packages/pip/_vendor/rich/panel.py +317 -0
  1010. package/python/lib/python3.12/site-packages/pip/_vendor/rich/pretty.py +1016 -0
  1011. package/python/lib/python3.12/site-packages/pip/_vendor/rich/progress.py +1715 -0
  1012. package/python/lib/python3.12/site-packages/pip/_vendor/rich/progress_bar.py +223 -0
  1013. package/python/lib/python3.12/site-packages/pip/_vendor/rich/prompt.py +400 -0
  1014. package/python/lib/python3.12/site-packages/pip/_vendor/rich/protocol.py +42 -0
  1015. package/python/lib/python3.12/site-packages/pip/_vendor/rich/py.typed +0 -0
  1016. package/python/lib/python3.12/site-packages/pip/_vendor/rich/region.py +10 -0
  1017. package/python/lib/python3.12/site-packages/pip/_vendor/rich/repr.py +149 -0
  1018. package/python/lib/python3.12/site-packages/pip/_vendor/rich/rule.py +130 -0
  1019. package/python/lib/python3.12/site-packages/pip/_vendor/rich/scope.py +86 -0
  1020. package/python/lib/python3.12/site-packages/pip/_vendor/rich/screen.py +54 -0
  1021. package/python/lib/python3.12/site-packages/pip/_vendor/rich/segment.py +752 -0
  1022. package/python/lib/python3.12/site-packages/pip/_vendor/rich/spinner.py +132 -0
  1023. package/python/lib/python3.12/site-packages/pip/_vendor/rich/status.py +131 -0
  1024. package/python/lib/python3.12/site-packages/pip/_vendor/rich/style.py +792 -0
  1025. package/python/lib/python3.12/site-packages/pip/_vendor/rich/styled.py +42 -0
  1026. package/python/lib/python3.12/site-packages/pip/_vendor/rich/syntax.py +985 -0
  1027. package/python/lib/python3.12/site-packages/pip/_vendor/rich/table.py +1006 -0
  1028. package/python/lib/python3.12/site-packages/pip/_vendor/rich/terminal_theme.py +153 -0
  1029. package/python/lib/python3.12/site-packages/pip/_vendor/rich/text.py +1361 -0
  1030. package/python/lib/python3.12/site-packages/pip/_vendor/rich/theme.py +115 -0
  1031. package/python/lib/python3.12/site-packages/pip/_vendor/rich/themes.py +5 -0
  1032. package/python/lib/python3.12/site-packages/pip/_vendor/rich/traceback.py +899 -0
  1033. package/python/lib/python3.12/site-packages/pip/_vendor/rich/tree.py +257 -0
  1034. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/LICENSE +21 -0
  1035. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/__init__.py +8 -0
  1036. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/_parser.py +788 -0
  1037. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/_re.py +115 -0
  1038. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/_types.py +10 -0
  1039. package/python/lib/python3.12/site-packages/pip/_vendor/tomli/py.typed +1 -0
  1040. package/python/lib/python3.12/site-packages/pip/_vendor/tomli_w/LICENSE +21 -0
  1041. package/python/lib/python3.12/site-packages/pip/_vendor/tomli_w/__init__.py +4 -0
  1042. package/python/lib/python3.12/site-packages/pip/_vendor/tomli_w/_writer.py +229 -0
  1043. package/python/lib/python3.12/site-packages/pip/_vendor/tomli_w/py.typed +1 -0
  1044. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/LICENSE +21 -0
  1045. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/__init__.py +36 -0
  1046. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/_api.py +341 -0
  1047. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/_macos.py +571 -0
  1048. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/_openssl.py +68 -0
  1049. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/_ssl_constants.py +31 -0
  1050. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/_windows.py +567 -0
  1051. package/python/lib/python3.12/site-packages/pip/_vendor/truststore/py.typed +0 -0
  1052. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/LICENSE.txt +21 -0
  1053. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/__init__.py +211 -0
  1054. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/_base_connection.py +165 -0
  1055. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/_collections.py +487 -0
  1056. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/_request_methods.py +278 -0
  1057. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/_version.py +34 -0
  1058. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/connection.py +1099 -0
  1059. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/connectionpool.py +1178 -0
  1060. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  1061. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/__init__.py +17 -0
  1062. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/connection.py +260 -0
  1063. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/emscripten_fetch_worker.js +110 -0
  1064. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/fetch.py +726 -0
  1065. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/request.py +22 -0
  1066. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/emscripten/response.py +277 -0
  1067. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +564 -0
  1068. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/contrib/socks.py +228 -0
  1069. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/exceptions.py +335 -0
  1070. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/fields.py +341 -0
  1071. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/filepost.py +89 -0
  1072. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/http2/__init__.py +53 -0
  1073. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/http2/connection.py +356 -0
  1074. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/http2/probe.py +87 -0
  1075. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/poolmanager.py +651 -0
  1076. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/py.typed +2 -0
  1077. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/response.py +1474 -0
  1078. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/__init__.py +42 -0
  1079. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/connection.py +137 -0
  1080. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/proxy.py +43 -0
  1081. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/request.py +254 -0
  1082. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/response.py +101 -0
  1083. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/retry.py +549 -0
  1084. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_.py +527 -0
  1085. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +159 -0
  1086. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/ssltransport.py +271 -0
  1087. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/timeout.py +275 -0
  1088. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/url.py +469 -0
  1089. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/util.py +42 -0
  1090. package/python/lib/python3.12/site-packages/pip/_vendor/urllib3/util/wait.py +124 -0
  1091. package/python/lib/python3.12/site-packages/pip/_vendor/vendor.txt +18 -0
  1092. package/python/lib/python3.12/site-packages/pip/py.typed +4 -0
  1093. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/INSTALLER +1 -0
  1094. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/METADATA +109 -0
  1095. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/RECORD +866 -0
  1096. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/REQUESTED +0 -0
  1097. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/WHEEL +4 -0
  1098. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/direct_url.json +1 -0
  1099. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/entry_points.txt +4 -0
  1100. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/AUTHORS.txt +868 -0
  1101. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/LICENSE.txt +20 -0
  1102. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/cachecontrol/LICENSE.txt +13 -0
  1103. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/certifi/LICENSE +20 -0
  1104. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/distlib/LICENSE.txt +284 -0
  1105. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/distro/LICENSE +202 -0
  1106. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/idna/LICENSE.md +31 -0
  1107. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/msgpack/COPYING +14 -0
  1108. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/packaging/LICENSE +3 -0
  1109. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.APACHE +177 -0
  1110. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/packaging/LICENSE.BSD +23 -0
  1111. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/pkg_resources/LICENSE +17 -0
  1112. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/platformdirs/LICENSE +21 -0
  1113. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/pygments/LICENSE +25 -0
  1114. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/pyproject_hooks/LICENSE +21 -0
  1115. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/requests/LICENSE +175 -0
  1116. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/resolvelib/LICENSE +13 -0
  1117. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/rich/LICENSE +19 -0
  1118. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE +21 -0
  1119. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/tomli_w/LICENSE +21 -0
  1120. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/truststore/LICENSE +21 -0
  1121. package/python/lib/python3.12/site-packages/pip-26.1.2.dist-info/licenses/src/pip/_vendor/urllib3/LICENSE.txt +21 -0
  1122. package/python/lib/python3.12/site.py +693 -0
  1123. package/python/lib/python3.12/smtplib.py +1109 -0
  1124. package/python/lib/python3.12/sndhdr.py +271 -0
  1125. package/python/lib/python3.12/socket.py +983 -0
  1126. package/python/lib/python3.12/socketserver.py +863 -0
  1127. package/python/lib/python3.12/sqlite3/__init__.py +70 -0
  1128. package/python/lib/python3.12/sqlite3/__main__.py +127 -0
  1129. package/python/lib/python3.12/sqlite3/dbapi2.py +108 -0
  1130. package/python/lib/python3.12/sqlite3/dump.py +89 -0
  1131. package/python/lib/python3.12/sre_compile.py +7 -0
  1132. package/python/lib/python3.12/sre_constants.py +7 -0
  1133. package/python/lib/python3.12/sre_parse.py +7 -0
  1134. package/python/lib/python3.12/ssl.py +1488 -0
  1135. package/python/lib/python3.12/stat.py +195 -0
  1136. package/python/lib/python3.12/statistics.py +1454 -0
  1137. package/python/lib/python3.12/string.py +309 -0
  1138. package/python/lib/python3.12/stringprep.py +272 -0
  1139. package/python/lib/python3.12/struct.py +15 -0
  1140. package/python/lib/python3.12/subprocess.py +2216 -0
  1141. package/python/lib/python3.12/sunau.py +533 -0
  1142. package/python/lib/python3.12/symtable.py +362 -0
  1143. package/python/lib/python3.12/sysconfig.py +894 -0
  1144. package/python/lib/python3.12/tabnanny.py +340 -0
  1145. package/python/lib/python3.12/tarfile.py +3031 -0
  1146. package/python/lib/python3.12/telnetlib.py +680 -0
  1147. package/python/lib/python3.12/tempfile.py +956 -0
  1148. package/python/lib/python3.12/textwrap.py +491 -0
  1149. package/python/lib/python3.12/this.py +28 -0
  1150. package/python/lib/python3.12/threading.py +1708 -0
  1151. package/python/lib/python3.12/timeit.py +381 -0
  1152. package/python/lib/python3.12/token.py +143 -0
  1153. package/python/lib/python3.12/tokenize.py +594 -0
  1154. package/python/lib/python3.12/tomllib/__init__.py +10 -0
  1155. package/python/lib/python3.12/tomllib/_parser.py +691 -0
  1156. package/python/lib/python3.12/tomllib/_re.py +107 -0
  1157. package/python/lib/python3.12/tomllib/_types.py +10 -0
  1158. package/python/lib/python3.12/trace.py +748 -0
  1159. package/python/lib/python3.12/traceback.py +1187 -0
  1160. package/python/lib/python3.12/tracemalloc.py +560 -0
  1161. package/python/lib/python3.12/tty.py +73 -0
  1162. package/python/lib/python3.12/turtle.py +4207 -0
  1163. package/python/lib/python3.12/types.py +333 -0
  1164. package/python/lib/python3.12/typing.py +3494 -0
  1165. package/python/lib/python3.12/unittest/__init__.py +85 -0
  1166. package/python/lib/python3.12/unittest/__main__.py +18 -0
  1167. package/python/lib/python3.12/unittest/_log.py +86 -0
  1168. package/python/lib/python3.12/unittest/async_case.py +143 -0
  1169. package/python/lib/python3.12/unittest/case.py +1456 -0
  1170. package/python/lib/python3.12/unittest/loader.py +497 -0
  1171. package/python/lib/python3.12/unittest/main.py +291 -0
  1172. package/python/lib/python3.12/unittest/mock.py +3054 -0
  1173. package/python/lib/python3.12/unittest/result.py +256 -0
  1174. package/python/lib/python3.12/unittest/runner.py +292 -0
  1175. package/python/lib/python3.12/unittest/signals.py +71 -0
  1176. package/python/lib/python3.12/unittest/suite.py +379 -0
  1177. package/python/lib/python3.12/unittest/util.py +170 -0
  1178. package/python/lib/python3.12/urllib/__init__.py +0 -0
  1179. package/python/lib/python3.12/urllib/error.py +74 -0
  1180. package/python/lib/python3.12/urllib/parse.py +1262 -0
  1181. package/python/lib/python3.12/urllib/request.py +2816 -0
  1182. package/python/lib/python3.12/urllib/response.py +84 -0
  1183. package/python/lib/python3.12/urllib/robotparser.py +275 -0
  1184. package/python/lib/python3.12/uu.py +216 -0
  1185. package/python/lib/python3.12/uuid.py +793 -0
  1186. package/python/lib/python3.12/venv/__init__.py +608 -0
  1187. package/python/lib/python3.12/venv/__main__.py +10 -0
  1188. package/python/lib/python3.12/venv/scripts/common/Activate.ps1 +247 -0
  1189. package/python/lib/python3.12/venv/scripts/common/activate +76 -0
  1190. package/python/lib/python3.12/venv/scripts/posix/activate.csh +27 -0
  1191. package/python/lib/python3.12/venv/scripts/posix/activate.fish +69 -0
  1192. package/python/lib/python3.12/warnings.py +598 -0
  1193. package/python/lib/python3.12/wave.py +653 -0
  1194. package/python/lib/python3.12/weakref.py +674 -0
  1195. package/python/lib/python3.12/webbrowser.py +689 -0
  1196. package/python/lib/python3.12/wsgiref/__init__.py +25 -0
  1197. package/python/lib/python3.12/wsgiref/handlers.py +573 -0
  1198. package/python/lib/python3.12/wsgiref/headers.py +192 -0
  1199. package/python/lib/python3.12/wsgiref/simple_server.py +165 -0
  1200. package/python/lib/python3.12/wsgiref/types.py +54 -0
  1201. package/python/lib/python3.12/wsgiref/util.py +159 -0
  1202. package/python/lib/python3.12/wsgiref/validate.py +438 -0
  1203. package/python/lib/python3.12/xdrlib.py +242 -0
  1204. package/python/lib/python3.12/xml/__init__.py +20 -0
  1205. package/python/lib/python3.12/xml/dom/NodeFilter.py +27 -0
  1206. package/python/lib/python3.12/xml/dom/__init__.py +140 -0
  1207. package/python/lib/python3.12/xml/dom/domreg.py +99 -0
  1208. package/python/lib/python3.12/xml/dom/expatbuilder.py +962 -0
  1209. package/python/lib/python3.12/xml/dom/minicompat.py +109 -0
  1210. package/python/lib/python3.12/xml/dom/minidom.py +2008 -0
  1211. package/python/lib/python3.12/xml/dom/pulldom.py +336 -0
  1212. package/python/lib/python3.12/xml/dom/xmlbuilder.py +389 -0
  1213. package/python/lib/python3.12/xml/etree/ElementInclude.py +186 -0
  1214. package/python/lib/python3.12/xml/etree/ElementPath.py +423 -0
  1215. package/python/lib/python3.12/xml/etree/ElementTree.py +2085 -0
  1216. package/python/lib/python3.12/xml/etree/__init__.py +33 -0
  1217. package/python/lib/python3.12/xml/etree/cElementTree.py +3 -0
  1218. package/python/lib/python3.12/xml/parsers/__init__.py +8 -0
  1219. package/python/lib/python3.12/xml/parsers/expat.py +8 -0
  1220. package/python/lib/python3.12/xml/sax/__init__.py +94 -0
  1221. package/python/lib/python3.12/xml/sax/_exceptions.py +127 -0
  1222. package/python/lib/python3.12/xml/sax/expatreader.py +454 -0
  1223. package/python/lib/python3.12/xml/sax/handler.py +387 -0
  1224. package/python/lib/python3.12/xml/sax/saxutils.py +369 -0
  1225. package/python/lib/python3.12/xml/sax/xmlreader.py +378 -0
  1226. package/python/lib/python3.12/xmlrpc/__init__.py +1 -0
  1227. package/python/lib/python3.12/xmlrpc/client.py +1529 -0
  1228. package/python/lib/python3.12/xmlrpc/server.py +1002 -0
  1229. package/python/lib/python3.12/zipapp.py +206 -0
  1230. package/python/lib/python3.12/zipfile/__init__.py +2340 -0
  1231. package/python/lib/python3.12/zipfile/__main__.py +4 -0
  1232. package/python/lib/python3.12/zipfile/_path/__init__.py +412 -0
  1233. package/python/lib/python3.12/zipfile/_path/glob.py +53 -0
  1234. package/python/lib/python3.12/zipimport.py +712 -0
  1235. package/python/lib/python3.12/zoneinfo/__init__.py +31 -0
  1236. package/python/lib/python3.12/zoneinfo/_common.py +164 -0
  1237. package/python/lib/python3.12/zoneinfo/_tzpath.py +181 -0
  1238. package/python/lib/python3.12/zoneinfo/_zoneinfo.py +772 -0
@@ -0,0 +1,2108 @@
1
+ import sys
2
+ import builtins as bltns
3
+ from types import MappingProxyType, DynamicClassAttribute
4
+ from operator import or_ as _or_
5
+ from functools import reduce
6
+
7
+
8
+ __all__ = [
9
+ 'EnumType', 'EnumMeta',
10
+ 'Enum', 'IntEnum', 'StrEnum', 'Flag', 'IntFlag', 'ReprEnum',
11
+ 'auto', 'unique', 'property', 'verify', 'member', 'nonmember',
12
+ 'FlagBoundary', 'STRICT', 'CONFORM', 'EJECT', 'KEEP',
13
+ 'global_flag_repr', 'global_enum_repr', 'global_str', 'global_enum',
14
+ 'EnumCheck', 'CONTINUOUS', 'NAMED_FLAGS', 'UNIQUE',
15
+ 'pickle_by_global_name', 'pickle_by_enum_name',
16
+ ]
17
+
18
+
19
+ # Dummy value for Enum and Flag as there are explicit checks for them
20
+ # before they have been created.
21
+ # This is also why there are checks in EnumType like `if Enum is not None`
22
+ Enum = Flag = EJECT = _stdlib_enums = ReprEnum = None
23
+
24
+ class nonmember(object):
25
+ """
26
+ Protects item from becoming an Enum member during class creation.
27
+ """
28
+ def __init__(self, value):
29
+ self.value = value
30
+
31
+ class member(object):
32
+ """
33
+ Forces item to become an Enum member during class creation.
34
+ """
35
+ def __init__(self, value):
36
+ self.value = value
37
+
38
+ def _is_descriptor(obj):
39
+ """
40
+ Returns True if obj is a descriptor, False otherwise.
41
+ """
42
+ return (
43
+ hasattr(obj, '__get__') or
44
+ hasattr(obj, '__set__') or
45
+ hasattr(obj, '__delete__')
46
+ )
47
+
48
+ def _is_dunder(name):
49
+ """
50
+ Returns True if a __dunder__ name, False otherwise.
51
+ """
52
+ return (
53
+ len(name) > 4 and
54
+ name[:2] == name[-2:] == '__' and
55
+ name[2] != '_' and
56
+ name[-3] != '_'
57
+ )
58
+
59
+ def _is_sunder(name):
60
+ """
61
+ Returns True if a _sunder_ name, False otherwise.
62
+ """
63
+ return (
64
+ len(name) > 2 and
65
+ name[0] == name[-1] == '_' and
66
+ name[1:2] != '_' and
67
+ name[-2:-1] != '_'
68
+ )
69
+
70
+ def _is_internal_class(cls_name, obj):
71
+ # do not use `re` as `re` imports `enum`
72
+ if not isinstance(obj, type):
73
+ return False
74
+ qualname = getattr(obj, '__qualname__', '')
75
+ s_pattern = cls_name + '.' + getattr(obj, '__name__', '')
76
+ e_pattern = '.' + s_pattern
77
+ return qualname == s_pattern or qualname.endswith(e_pattern)
78
+
79
+ def _is_private(cls_name, name):
80
+ # do not use `re` as `re` imports `enum`
81
+ pattern = '_%s__' % (cls_name, )
82
+ pat_len = len(pattern)
83
+ if (
84
+ len(name) > pat_len
85
+ and name.startswith(pattern)
86
+ and name[pat_len:pat_len+1] != ['_']
87
+ and (name[-1] != '_' or name[-2] != '_')
88
+ ):
89
+ return True
90
+ else:
91
+ return False
92
+
93
+ def _is_single_bit(num):
94
+ """
95
+ True if only one bit set in num (should be an int)
96
+ """
97
+ if num == 0:
98
+ return False
99
+ num &= num - 1
100
+ return num == 0
101
+
102
+ def _make_class_unpicklable(obj):
103
+ """
104
+ Make the given obj un-picklable.
105
+
106
+ obj should be either a dictionary, or an Enum
107
+ """
108
+ def _break_on_call_reduce(self, proto):
109
+ raise TypeError('%r cannot be pickled' % self)
110
+ if isinstance(obj, dict):
111
+ obj['__reduce_ex__'] = _break_on_call_reduce
112
+ obj['__module__'] = '<unknown>'
113
+ else:
114
+ setattr(obj, '__reduce_ex__', _break_on_call_reduce)
115
+ setattr(obj, '__module__', '<unknown>')
116
+
117
+ def _iter_bits_lsb(num):
118
+ # num must be a positive integer
119
+ original = num
120
+ if isinstance(num, Enum):
121
+ num = num.value
122
+ if num < 0:
123
+ raise ValueError('%r is not a positive integer' % original)
124
+ while num:
125
+ b = num & (~num + 1)
126
+ yield b
127
+ num ^= b
128
+
129
+ def show_flag_values(value):
130
+ return list(_iter_bits_lsb(value))
131
+
132
+ def bin(num, max_bits=None):
133
+ """
134
+ Like built-in bin(), except negative values are represented in
135
+ twos-compliment, and the leading bit always indicates sign
136
+ (0=positive, 1=negative).
137
+
138
+ >>> bin(10)
139
+ '0b0 1010'
140
+ >>> bin(~10) # ~10 is -11
141
+ '0b1 0101'
142
+ """
143
+
144
+ ceiling = 2 ** (num).bit_length()
145
+ if num >= 0:
146
+ s = bltns.bin(num + ceiling).replace('1', '0', 1)
147
+ else:
148
+ s = bltns.bin(~num ^ (ceiling - 1) + ceiling)
149
+ sign = s[:3]
150
+ digits = s[3:]
151
+ if max_bits is not None:
152
+ if len(digits) < max_bits:
153
+ digits = (sign[-1] * max_bits + digits)[-max_bits:]
154
+ return "%s %s" % (sign, digits)
155
+
156
+ def _dedent(text):
157
+ """
158
+ Like textwrap.dedent. Rewritten because we cannot import textwrap.
159
+ """
160
+ lines = text.split('\n')
161
+ blanks = 0
162
+ for i, ch in enumerate(lines[0]):
163
+ if ch != ' ':
164
+ break
165
+ for j, l in enumerate(lines):
166
+ lines[j] = l[i:]
167
+ return '\n'.join(lines)
168
+
169
+ class _not_given:
170
+ def __repr__(self):
171
+ return('<not given>')
172
+ _not_given = _not_given()
173
+
174
+ class _auto_null:
175
+ def __repr__(self):
176
+ return '_auto_null'
177
+ _auto_null = _auto_null()
178
+
179
+ class auto:
180
+ """
181
+ Instances are replaced with an appropriate value in Enum class suites.
182
+ """
183
+ def __init__(self, value=_auto_null):
184
+ self.value = value
185
+
186
+ def __repr__(self):
187
+ return "auto(%r)" % self.value
188
+
189
+ class property(DynamicClassAttribute):
190
+ """
191
+ This is a descriptor, used to define attributes that act differently
192
+ when accessed through an enum member and through an enum class.
193
+ Instance access is the same as property(), but access to an attribute
194
+ through the enum class will instead look in the class' _member_map_ for
195
+ a corresponding enum member.
196
+ """
197
+
198
+ member = None
199
+ _attr_type = None
200
+ _cls_type = None
201
+
202
+ def __get__(self, instance, ownerclass=None):
203
+ if instance is None:
204
+ if self.member is not None:
205
+ return self.member
206
+ else:
207
+ raise AttributeError(
208
+ '%r has no attribute %r' % (ownerclass, self.name)
209
+ )
210
+ if self.fget is not None:
211
+ # use previous enum.property
212
+ return self.fget(instance)
213
+ elif self._attr_type == 'attr':
214
+ # look up previous attibute
215
+ return getattr(self._cls_type, self.name)
216
+ elif self._attr_type == 'desc':
217
+ # use previous descriptor
218
+ return getattr(instance._value_, self.name)
219
+ # look for a member by this name.
220
+ try:
221
+ return ownerclass._member_map_[self.name]
222
+ except KeyError:
223
+ raise AttributeError(
224
+ '%r has no attribute %r' % (ownerclass, self.name)
225
+ ) from None
226
+
227
+ def __set__(self, instance, value):
228
+ if self.fset is not None:
229
+ return self.fset(instance, value)
230
+ raise AttributeError(
231
+ "<enum %r> cannot set attribute %r" % (self.clsname, self.name)
232
+ )
233
+
234
+ def __delete__(self, instance):
235
+ if self.fdel is not None:
236
+ return self.fdel(instance)
237
+ raise AttributeError(
238
+ "<enum %r> cannot delete attribute %r" % (self.clsname, self.name)
239
+ )
240
+
241
+ def __set_name__(self, ownerclass, name):
242
+ self.name = name
243
+ self.clsname = ownerclass.__name__
244
+
245
+
246
+ class _proto_member:
247
+ """
248
+ intermediate step for enum members between class execution and final creation
249
+ """
250
+
251
+ def __init__(self, value):
252
+ self.value = value
253
+
254
+ def __set_name__(self, enum_class, member_name):
255
+ """
256
+ convert each quasi-member into an instance of the new enum class
257
+ """
258
+ # first step: remove ourself from enum_class
259
+ delattr(enum_class, member_name)
260
+ # second step: create member based on enum_class
261
+ value = self.value
262
+ if not isinstance(value, tuple):
263
+ args = (value, )
264
+ else:
265
+ args = value
266
+ if enum_class._member_type_ is tuple: # special case for tuple enums
267
+ args = (args, ) # wrap it one more time
268
+ if not enum_class._use_args_:
269
+ enum_member = enum_class._new_member_(enum_class)
270
+ else:
271
+ enum_member = enum_class._new_member_(enum_class, *args)
272
+ if not hasattr(enum_member, '_value_'):
273
+ if enum_class._member_type_ is object:
274
+ enum_member._value_ = value
275
+ else:
276
+ try:
277
+ enum_member._value_ = enum_class._member_type_(*args)
278
+ except Exception as exc:
279
+ new_exc = TypeError(
280
+ '_value_ not set in __new__, unable to create it'
281
+ )
282
+ new_exc.__cause__ = exc
283
+ raise new_exc
284
+ value = enum_member._value_
285
+ enum_member._name_ = member_name
286
+ enum_member.__objclass__ = enum_class
287
+ enum_member.__init__(*args)
288
+ enum_member._sort_order_ = len(enum_class._member_names_)
289
+
290
+ if Flag is not None and issubclass(enum_class, Flag):
291
+ if isinstance(value, int):
292
+ enum_class._flag_mask_ |= value
293
+ if _is_single_bit(value):
294
+ enum_class._singles_mask_ |= value
295
+ enum_class._all_bits_ = 2 ** ((enum_class._flag_mask_).bit_length()) - 1
296
+
297
+ # If another member with the same value was already defined, the
298
+ # new member becomes an alias to the existing one.
299
+ try:
300
+ try:
301
+ # try to do a fast lookup to avoid the quadratic loop
302
+ enum_member = enum_class._value2member_map_[value]
303
+ except TypeError:
304
+ for name, canonical_member in enum_class._member_map_.items():
305
+ if canonical_member._value_ == value:
306
+ enum_member = canonical_member
307
+ break
308
+ else:
309
+ raise KeyError
310
+ except KeyError:
311
+ # this could still be an alias if the value is multi-bit and the
312
+ # class is a flag class
313
+ if (
314
+ Flag is None
315
+ or not issubclass(enum_class, Flag)
316
+ ):
317
+ # no other instances found, record this member in _member_names_
318
+ enum_class._member_names_.append(member_name)
319
+ elif (
320
+ Flag is not None
321
+ and issubclass(enum_class, Flag)
322
+ and isinstance(value, int)
323
+ and _is_single_bit(value)
324
+ ):
325
+ # no other instances found, record this member in _member_names_
326
+ enum_class._member_names_.append(member_name)
327
+ # if necessary, get redirect in place and then add it to _member_map_
328
+ found_descriptor = None
329
+ descriptor_type = None
330
+ class_type = None
331
+ for base in enum_class.__mro__[1:]:
332
+ attr = base.__dict__.get(member_name)
333
+ if attr is not None:
334
+ if isinstance(attr, (property, DynamicClassAttribute)):
335
+ found_descriptor = attr
336
+ class_type = base
337
+ descriptor_type = 'enum'
338
+ break
339
+ elif _is_descriptor(attr):
340
+ found_descriptor = attr
341
+ descriptor_type = descriptor_type or 'desc'
342
+ class_type = class_type or base
343
+ continue
344
+ else:
345
+ descriptor_type = 'attr'
346
+ class_type = base
347
+ if found_descriptor:
348
+ redirect = property()
349
+ redirect.member = enum_member
350
+ redirect.__set_name__(enum_class, member_name)
351
+ if descriptor_type in ('enum','desc'):
352
+ # earlier descriptor found; copy fget, fset, fdel to this one.
353
+ redirect.fget = getattr(found_descriptor, 'fget', None)
354
+ redirect._get = getattr(found_descriptor, '__get__', None)
355
+ redirect.fset = getattr(found_descriptor, 'fset', None)
356
+ redirect._set = getattr(found_descriptor, '__set__', None)
357
+ redirect.fdel = getattr(found_descriptor, 'fdel', None)
358
+ redirect._del = getattr(found_descriptor, '__delete__', None)
359
+ redirect._attr_type = descriptor_type
360
+ redirect._cls_type = class_type
361
+ setattr(enum_class, member_name, redirect)
362
+ else:
363
+ setattr(enum_class, member_name, enum_member)
364
+ # now add to _member_map_ (even aliases)
365
+ enum_class._member_map_[member_name] = enum_member
366
+ try:
367
+ # This may fail if value is not hashable. We can't add the value
368
+ # to the map, and by-value lookups for this value will be
369
+ # linear.
370
+ enum_class._value2member_map_.setdefault(value, enum_member)
371
+ except TypeError:
372
+ # keep track of the value in a list so containment checks are quick
373
+ enum_class._unhashable_values_.append(value)
374
+
375
+
376
+ class _EnumDict(dict):
377
+ """
378
+ Track enum member order and ensure member names are not reused.
379
+
380
+ EnumType will use the names found in self._member_names as the
381
+ enumeration member names.
382
+ """
383
+ def __init__(self):
384
+ super().__init__()
385
+ self._member_names = {} # use a dict to keep insertion order
386
+ self._last_values = []
387
+ self._ignore = []
388
+ self._auto_called = False
389
+
390
+ def __setitem__(self, key, value):
391
+ """
392
+ Changes anything not dundered or not a descriptor.
393
+
394
+ If an enum member name is used twice, an error is raised; duplicate
395
+ values are not checked for.
396
+
397
+ Single underscore (sunder) names are reserved.
398
+ """
399
+ if _is_internal_class(self._cls_name, value):
400
+ import warnings
401
+ warnings.warn(
402
+ "In 3.13 classes created inside an enum will not become a member. "
403
+ "Use the `member` decorator to keep the current behavior.",
404
+ DeprecationWarning,
405
+ stacklevel=2,
406
+ )
407
+ if _is_private(self._cls_name, key):
408
+ # also do nothing, name will be a normal attribute
409
+ pass
410
+ elif _is_sunder(key):
411
+ if key not in (
412
+ '_order_',
413
+ '_generate_next_value_', '_numeric_repr_', '_missing_', '_ignore_',
414
+ '_iter_member_', '_iter_member_by_value_', '_iter_member_by_def_',
415
+ ):
416
+ raise ValueError(
417
+ '_sunder_ names, such as %r, are reserved for future Enum use'
418
+ % (key, )
419
+ )
420
+ if key == '_generate_next_value_':
421
+ # check if members already defined as auto()
422
+ if self._auto_called:
423
+ raise TypeError("_generate_next_value_ must be defined before members")
424
+ _gnv = value.__func__ if isinstance(value, staticmethod) else value
425
+ setattr(self, '_generate_next_value', _gnv)
426
+ elif key == '_ignore_':
427
+ if isinstance(value, str):
428
+ value = value.replace(',',' ').split()
429
+ else:
430
+ value = list(value)
431
+ self._ignore = value
432
+ already = set(value) & set(self._member_names)
433
+ if already:
434
+ raise ValueError(
435
+ '_ignore_ cannot specify already set names: %r'
436
+ % (already, )
437
+ )
438
+ elif _is_dunder(key):
439
+ if key == '__order__':
440
+ key = '_order_'
441
+ elif key in self._member_names:
442
+ # descriptor overwriting an enum?
443
+ raise TypeError('%r already defined as %r' % (key, self[key]))
444
+ elif key in self._ignore:
445
+ pass
446
+ elif isinstance(value, nonmember):
447
+ # unwrap value here; it won't be processed by the below `else`
448
+ value = value.value
449
+ elif _is_descriptor(value):
450
+ pass
451
+ # TODO: uncomment next three lines in 3.13
452
+ # elif _is_internal_class(self._cls_name, value):
453
+ # # do nothing, name will be a normal attribute
454
+ # pass
455
+ else:
456
+ if key in self:
457
+ # enum overwriting a descriptor?
458
+ raise TypeError('%r already defined as %r' % (key, self[key]))
459
+ elif isinstance(value, member):
460
+ # unwrap value here -- it will become a member
461
+ value = value.value
462
+ non_auto_store = True
463
+ single = False
464
+ if isinstance(value, auto):
465
+ single = True
466
+ value = (value, )
467
+ if isinstance(value, tuple) and any(isinstance(v, auto) for v in value):
468
+ # insist on an actual tuple, no subclasses, in keeping with only supporting
469
+ # top-level auto() usage (not contained in any other data structure)
470
+ auto_valued = []
471
+ t = type(value)
472
+ for v in value:
473
+ if isinstance(v, auto):
474
+ non_auto_store = False
475
+ if v.value == _auto_null:
476
+ v.value = self._generate_next_value(
477
+ key, 1, len(self._member_names), self._last_values[:],
478
+ )
479
+ self._auto_called = True
480
+ v = v.value
481
+ self._last_values.append(v)
482
+ auto_valued.append(v)
483
+ if single:
484
+ value = auto_valued[0]
485
+ else:
486
+ try:
487
+ # accepts iterable as multiple arguments?
488
+ value = t(auto_valued)
489
+ except TypeError:
490
+ # then pass them in singly
491
+ value = t(*auto_valued)
492
+ self._member_names[key] = None
493
+ if non_auto_store:
494
+ self._last_values.append(value)
495
+ super().__setitem__(key, value)
496
+
497
+ def update(self, members, **more_members):
498
+ try:
499
+ for name in members.keys():
500
+ self[name] = members[name]
501
+ except AttributeError:
502
+ for name, value in members:
503
+ self[name] = value
504
+ for name, value in more_members.items():
505
+ self[name] = value
506
+
507
+
508
+ class EnumType(type):
509
+ """
510
+ Metaclass for Enum
511
+ """
512
+
513
+ @classmethod
514
+ def __prepare__(metacls, cls, bases, **kwds):
515
+ # check that previous enum members do not exist
516
+ metacls._check_for_existing_members_(cls, bases)
517
+ # create the namespace dict
518
+ enum_dict = _EnumDict()
519
+ enum_dict._cls_name = cls
520
+ # inherit previous flags and _generate_next_value_ function
521
+ member_type, first_enum = metacls._get_mixins_(cls, bases)
522
+ if first_enum is not None:
523
+ enum_dict['_generate_next_value_'] = getattr(
524
+ first_enum, '_generate_next_value_', None,
525
+ )
526
+ return enum_dict
527
+
528
+ def __new__(metacls, cls, bases, classdict, *, boundary=None, _simple=False, **kwds):
529
+ # an Enum class is final once enumeration items have been defined; it
530
+ # cannot be mixed with other types (int, float, etc.) if it has an
531
+ # inherited __new__ unless a new __new__ is defined (or the resulting
532
+ # class will fail).
533
+ #
534
+ if _simple:
535
+ return super().__new__(metacls, cls, bases, classdict, **kwds)
536
+ #
537
+ # remove any keys listed in _ignore_
538
+ classdict.setdefault('_ignore_', []).append('_ignore_')
539
+ ignore = classdict['_ignore_']
540
+ for key in ignore:
541
+ classdict.pop(key, None)
542
+ #
543
+ # grab member names
544
+ member_names = classdict._member_names
545
+ #
546
+ # check for illegal enum names (any others?)
547
+ invalid_names = set(member_names) & {'mro', ''}
548
+ if invalid_names:
549
+ raise ValueError('invalid enum member name(s) %s' % (
550
+ ','.join(repr(n) for n in invalid_names)
551
+ ))
552
+ #
553
+ # adjust the sunders
554
+ _order_ = classdict.pop('_order_', None)
555
+ _gnv = classdict.get('_generate_next_value_')
556
+ if _gnv is not None and type(_gnv) is not staticmethod:
557
+ _gnv = staticmethod(_gnv)
558
+ # convert to normal dict
559
+ classdict = dict(classdict.items())
560
+ if _gnv is not None:
561
+ classdict['_generate_next_value_'] = _gnv
562
+ #
563
+ # data type of member and the controlling Enum class
564
+ member_type, first_enum = metacls._get_mixins_(cls, bases)
565
+ __new__, save_new, use_args = metacls._find_new_(
566
+ classdict, member_type, first_enum,
567
+ )
568
+ classdict['_new_member_'] = __new__
569
+ classdict['_use_args_'] = use_args
570
+ #
571
+ # convert future enum members into temporary _proto_members
572
+ for name in member_names:
573
+ value = classdict[name]
574
+ classdict[name] = _proto_member(value)
575
+ #
576
+ # house-keeping structures
577
+ classdict['_member_names_'] = []
578
+ classdict['_member_map_'] = {}
579
+ classdict['_value2member_map_'] = {}
580
+ classdict['_unhashable_values_'] = []
581
+ classdict['_member_type_'] = member_type
582
+ # now set the __repr__ for the value
583
+ classdict['_value_repr_'] = metacls._find_data_repr_(cls, bases)
584
+ #
585
+ # Flag structures (will be removed if final class is not a Flag
586
+ classdict['_boundary_'] = (
587
+ boundary
588
+ or getattr(first_enum, '_boundary_', None)
589
+ )
590
+ classdict['_flag_mask_'] = 0
591
+ classdict['_singles_mask_'] = 0
592
+ classdict['_all_bits_'] = 0
593
+ classdict['_inverted_'] = None
594
+ try:
595
+ enum_class = super().__new__(metacls, cls, bases, classdict, **kwds)
596
+ except Exception as e:
597
+ # since 3.12 the note "Error calling __set_name__ on '_proto_member' instance ..."
598
+ # is tacked on to the error instead of raising a RuntimeError, so discard it
599
+ if hasattr(e, '__notes__'):
600
+ del e.__notes__
601
+ raise
602
+ # update classdict with any changes made by __init_subclass__
603
+ classdict.update(enum_class.__dict__)
604
+ #
605
+ # double check that repr and friends are not the mixin's or various
606
+ # things break (such as pickle)
607
+ # however, if the method is defined in the Enum itself, don't replace
608
+ # it
609
+ #
610
+ # Also, special handling for ReprEnum
611
+ if ReprEnum is not None and ReprEnum in bases:
612
+ if member_type is object:
613
+ raise TypeError(
614
+ 'ReprEnum subclasses must be mixed with a data type (i.e.'
615
+ ' int, str, float, etc.)'
616
+ )
617
+ if '__format__' not in classdict:
618
+ enum_class.__format__ = member_type.__format__
619
+ classdict['__format__'] = enum_class.__format__
620
+ if '__str__' not in classdict:
621
+ method = member_type.__str__
622
+ if method is object.__str__:
623
+ # if member_type does not define __str__, object.__str__ will use
624
+ # its __repr__ instead, so we'll also use its __repr__
625
+ method = member_type.__repr__
626
+ enum_class.__str__ = method
627
+ classdict['__str__'] = enum_class.__str__
628
+ for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
629
+ if name not in classdict:
630
+ # check for mixin overrides before replacing
631
+ enum_method = getattr(first_enum, name)
632
+ found_method = getattr(enum_class, name)
633
+ object_method = getattr(object, name)
634
+ data_type_method = getattr(member_type, name)
635
+ if found_method in (data_type_method, object_method):
636
+ setattr(enum_class, name, enum_method)
637
+ #
638
+ # for Flag, add __or__, __and__, __xor__, and __invert__
639
+ if Flag is not None and issubclass(enum_class, Flag):
640
+ for name in (
641
+ '__or__', '__and__', '__xor__',
642
+ '__ror__', '__rand__', '__rxor__',
643
+ '__invert__'
644
+ ):
645
+ if name not in classdict:
646
+ enum_method = getattr(Flag, name)
647
+ setattr(enum_class, name, enum_method)
648
+ classdict[name] = enum_method
649
+ #
650
+ # replace any other __new__ with our own (as long as Enum is not None,
651
+ # anyway) -- again, this is to support pickle
652
+ if Enum is not None:
653
+ # if the user defined their own __new__, save it before it gets
654
+ # clobbered in case they subclass later
655
+ if save_new:
656
+ enum_class.__new_member__ = __new__
657
+ enum_class.__new__ = Enum.__new__
658
+ #
659
+ # py3 support for definition order (helps keep py2/py3 code in sync)
660
+ #
661
+ # _order_ checking is spread out into three/four steps
662
+ # - if enum_class is a Flag:
663
+ # - remove any non-single-bit flags from _order_
664
+ # - remove any aliases from _order_
665
+ # - check that _order_ and _member_names_ match
666
+ #
667
+ # step 1: ensure we have a list
668
+ if _order_ is not None:
669
+ if isinstance(_order_, str):
670
+ _order_ = _order_.replace(',', ' ').split()
671
+ #
672
+ # remove Flag structures if final class is not a Flag
673
+ if (
674
+ Flag is None and cls != 'Flag'
675
+ or Flag is not None and not issubclass(enum_class, Flag)
676
+ ):
677
+ delattr(enum_class, '_boundary_')
678
+ delattr(enum_class, '_flag_mask_')
679
+ delattr(enum_class, '_singles_mask_')
680
+ delattr(enum_class, '_all_bits_')
681
+ delattr(enum_class, '_inverted_')
682
+ elif Flag is not None and issubclass(enum_class, Flag):
683
+ # set correct __iter__
684
+ member_list = [m._value_ for m in enum_class]
685
+ if member_list != sorted(member_list):
686
+ enum_class._iter_member_ = enum_class._iter_member_by_def_
687
+ if _order_:
688
+ # _order_ step 2: remove any items from _order_ that are not single-bit
689
+ _order_ = [
690
+ o
691
+ for o in _order_
692
+ if o not in enum_class._member_map_ or _is_single_bit(enum_class[o]._value_)
693
+ ]
694
+ #
695
+ if _order_:
696
+ # _order_ step 3: remove aliases from _order_
697
+ _order_ = [
698
+ o
699
+ for o in _order_
700
+ if (
701
+ o not in enum_class._member_map_
702
+ or
703
+ (o in enum_class._member_map_ and o in enum_class._member_names_)
704
+ )]
705
+ # _order_ step 4: verify that _order_ and _member_names_ match
706
+ if _order_ != enum_class._member_names_:
707
+ raise TypeError(
708
+ 'member order does not match _order_:\n %r\n %r'
709
+ % (enum_class._member_names_, _order_)
710
+ )
711
+ #
712
+ return enum_class
713
+
714
+ def __bool__(cls):
715
+ """
716
+ classes/types should always be True.
717
+ """
718
+ return True
719
+
720
+ def __call__(cls, value, names=_not_given, *values, module=None, qualname=None, type=None, start=1, boundary=None):
721
+ """
722
+ Either returns an existing member, or creates a new enum class.
723
+
724
+ This method is used both when an enum class is given a value to match
725
+ to an enumeration member (i.e. Color(3)) and for the functional API
726
+ (i.e. Color = Enum('Color', names='RED GREEN BLUE')).
727
+
728
+ The value lookup branch is chosen if the enum is final.
729
+
730
+ When used for the functional API:
731
+
732
+ `value` will be the name of the new class.
733
+
734
+ `names` should be either a string of white-space/comma delimited names
735
+ (values will start at `start`), or an iterator/mapping of name, value pairs.
736
+
737
+ `module` should be set to the module this class is being created in;
738
+ if it is not set, an attempt to find that module will be made, but if
739
+ it fails the class will not be picklable.
740
+
741
+ `qualname` should be set to the actual location this class can be found
742
+ at in its module; by default it is set to the global scope. If this is
743
+ not correct, unpickling will fail in some circumstances.
744
+
745
+ `type`, if set, will be mixed in as the first base class.
746
+ """
747
+ if cls._member_map_:
748
+ # simple value lookup if members exist
749
+ if names is not _not_given:
750
+ value = (value, names) + values
751
+ return cls.__new__(cls, value)
752
+ # otherwise, functional API: we're creating a new Enum type
753
+ if names is _not_given and type is None:
754
+ # no body? no data-type? possibly wrong usage
755
+ raise TypeError(
756
+ f"{cls} has no members; specify `names=()` if you meant to create a new, empty, enum"
757
+ )
758
+ return cls._create_(
759
+ class_name=value,
760
+ names=None if names is _not_given else names,
761
+ module=module,
762
+ qualname=qualname,
763
+ type=type,
764
+ start=start,
765
+ boundary=boundary,
766
+ )
767
+
768
+ def __contains__(cls, value):
769
+ """Return True if `value` is in `cls`.
770
+
771
+ `value` is in `cls` if:
772
+ 1) `value` is a member of `cls`, or
773
+ 2) `value` is the value of one of the `cls`'s members.
774
+ 3) `value` is a pseudo-member (flags)
775
+ """
776
+ if isinstance(value, cls):
777
+ return True
778
+ try:
779
+ cls(value)
780
+ return True
781
+ except ValueError:
782
+ return value in cls._unhashable_values_
783
+
784
+ def __delattr__(cls, attr):
785
+ # nicer error message when someone tries to delete an attribute
786
+ # (see issue19025).
787
+ if attr in cls._member_map_:
788
+ raise AttributeError("%r cannot delete member %r." % (cls.__name__, attr))
789
+ super().__delattr__(attr)
790
+
791
+ def __dir__(cls):
792
+ interesting = set([
793
+ '__class__', '__contains__', '__doc__', '__getitem__',
794
+ '__iter__', '__len__', '__members__', '__module__',
795
+ '__name__', '__qualname__',
796
+ ]
797
+ + cls._member_names_
798
+ )
799
+ if cls._new_member_ is not object.__new__:
800
+ interesting.add('__new__')
801
+ if cls.__init_subclass__ is not object.__init_subclass__:
802
+ interesting.add('__init_subclass__')
803
+ if cls._member_type_ is object:
804
+ return sorted(interesting)
805
+ else:
806
+ # return whatever mixed-in data type has
807
+ return sorted(set(dir(cls._member_type_)) | interesting)
808
+
809
+ def __getitem__(cls, name):
810
+ """
811
+ Return the member matching `name`.
812
+ """
813
+ return cls._member_map_[name]
814
+
815
+ def __iter__(cls):
816
+ """
817
+ Return members in definition order.
818
+ """
819
+ return (cls._member_map_[name] for name in cls._member_names_)
820
+
821
+ def __len__(cls):
822
+ """
823
+ Return the number of members (no aliases)
824
+ """
825
+ return len(cls._member_names_)
826
+
827
+ @bltns.property
828
+ def __members__(cls):
829
+ """
830
+ Returns a mapping of member name->value.
831
+
832
+ This mapping lists all enum members, including aliases. Note that this
833
+ is a read-only view of the internal mapping.
834
+ """
835
+ return MappingProxyType(cls._member_map_)
836
+
837
+ def __repr__(cls):
838
+ if Flag is not None and issubclass(cls, Flag):
839
+ return "<flag %r>" % cls.__name__
840
+ else:
841
+ return "<enum %r>" % cls.__name__
842
+
843
+ def __reversed__(cls):
844
+ """
845
+ Return members in reverse definition order.
846
+ """
847
+ return (cls._member_map_[name] for name in reversed(cls._member_names_))
848
+
849
+ def __setattr__(cls, name, value):
850
+ """
851
+ Block attempts to reassign Enum members.
852
+
853
+ A simple assignment to the class namespace only changes one of the
854
+ several possible ways to get an Enum member from the Enum class,
855
+ resulting in an inconsistent Enumeration.
856
+ """
857
+ member_map = cls.__dict__.get('_member_map_', {})
858
+ if name in member_map:
859
+ raise AttributeError('cannot reassign member %r' % (name, ))
860
+ super().__setattr__(name, value)
861
+
862
+ def _create_(cls, class_name, names, *, module=None, qualname=None, type=None, start=1, boundary=None):
863
+ """
864
+ Convenience method to create a new Enum class.
865
+
866
+ `names` can be:
867
+
868
+ * A string containing member names, separated either with spaces or
869
+ commas. Values are incremented by 1 from `start`.
870
+ * An iterable of member names. Values are incremented by 1 from `start`.
871
+ * An iterable of (member name, value) pairs.
872
+ * A mapping of member name -> value pairs.
873
+ """
874
+ metacls = cls.__class__
875
+ bases = (cls, ) if type is None else (type, cls)
876
+ _, first_enum = cls._get_mixins_(class_name, bases)
877
+ classdict = metacls.__prepare__(class_name, bases)
878
+
879
+ # special processing needed for names?
880
+ if isinstance(names, str):
881
+ names = names.replace(',', ' ').split()
882
+ if isinstance(names, (tuple, list)) and names and isinstance(names[0], str):
883
+ original_names, names = names, []
884
+ last_values = []
885
+ for count, name in enumerate(original_names):
886
+ value = first_enum._generate_next_value_(name, start, count, last_values[:])
887
+ last_values.append(value)
888
+ names.append((name, value))
889
+ if names is None:
890
+ names = ()
891
+
892
+ # Here, names is either an iterable of (name, value) or a mapping.
893
+ for item in names:
894
+ if isinstance(item, str):
895
+ member_name, member_value = item, names[item]
896
+ else:
897
+ member_name, member_value = item
898
+ classdict[member_name] = member_value
899
+
900
+ if module is None:
901
+ try:
902
+ module = sys._getframemodulename(2)
903
+ except AttributeError:
904
+ # Fall back on _getframe if _getframemodulename is missing
905
+ try:
906
+ module = sys._getframe(2).f_globals['__name__']
907
+ except (AttributeError, ValueError, KeyError):
908
+ pass
909
+ if module is None:
910
+ _make_class_unpicklable(classdict)
911
+ else:
912
+ classdict['__module__'] = module
913
+ if qualname is not None:
914
+ classdict['__qualname__'] = qualname
915
+
916
+ return metacls.__new__(metacls, class_name, bases, classdict, boundary=boundary)
917
+
918
+ def _convert_(cls, name, module, filter, source=None, *, boundary=None, as_global=False):
919
+ """
920
+ Create a new Enum subclass that replaces a collection of global constants
921
+ """
922
+ # convert all constants from source (or module) that pass filter() to
923
+ # a new Enum called name, and export the enum and its members back to
924
+ # module;
925
+ # also, replace the __reduce_ex__ method so unpickling works in
926
+ # previous Python versions
927
+ module_globals = sys.modules[module].__dict__
928
+ if source:
929
+ source = source.__dict__
930
+ else:
931
+ source = module_globals
932
+ # _value2member_map_ is populated in the same order every time
933
+ # for a consistent reverse mapping of number to name when there
934
+ # are multiple names for the same number.
935
+ members = [
936
+ (name, value)
937
+ for name, value in source.items()
938
+ if filter(name)]
939
+ try:
940
+ # sort by value
941
+ members.sort(key=lambda t: (t[1], t[0]))
942
+ except TypeError:
943
+ # unless some values aren't comparable, in which case sort by name
944
+ members.sort(key=lambda t: t[0])
945
+ body = {t[0]: t[1] for t in members}
946
+ body['__module__'] = module
947
+ tmp_cls = type(name, (object, ), body)
948
+ cls = _simple_enum(etype=cls, boundary=boundary or KEEP)(tmp_cls)
949
+ if as_global:
950
+ global_enum(cls)
951
+ else:
952
+ sys.modules[cls.__module__].__dict__.update(cls.__members__)
953
+ module_globals[name] = cls
954
+ return cls
955
+
956
+ @classmethod
957
+ def _check_for_existing_members_(mcls, class_name, bases):
958
+ for chain in bases:
959
+ for base in chain.__mro__:
960
+ if isinstance(base, EnumType) and base._member_names_:
961
+ raise TypeError(
962
+ "<enum %r> cannot extend %r"
963
+ % (class_name, base)
964
+ )
965
+
966
+ @classmethod
967
+ def _get_mixins_(mcls, class_name, bases):
968
+ """
969
+ Returns the type for creating enum members, and the first inherited
970
+ enum class.
971
+
972
+ bases: the tuple of bases that was given to __new__
973
+ """
974
+ if not bases:
975
+ return object, Enum
976
+ # ensure final parent class is an Enum derivative, find any concrete
977
+ # data type, and check that Enum has no members
978
+ first_enum = bases[-1]
979
+ if not isinstance(first_enum, EnumType):
980
+ raise TypeError("new enumerations should be created as "
981
+ "`EnumName([mixin_type, ...] [data_type,] enum_type)`")
982
+ member_type = mcls._find_data_type_(class_name, bases) or object
983
+ return member_type, first_enum
984
+
985
+ @classmethod
986
+ def _find_data_repr_(mcls, class_name, bases):
987
+ for chain in bases:
988
+ for base in chain.__mro__:
989
+ if base is object:
990
+ continue
991
+ elif isinstance(base, EnumType):
992
+ # if we hit an Enum, use it's _value_repr_
993
+ return base._value_repr_
994
+ elif '__repr__' in base.__dict__:
995
+ # this is our data repr
996
+ # double-check if a dataclass with a default __repr__
997
+ if (
998
+ '__dataclass_fields__' in base.__dict__
999
+ and '__dataclass_params__' in base.__dict__
1000
+ and base.__dict__['__dataclass_params__'].repr
1001
+ ):
1002
+ return _dataclass_repr
1003
+ else:
1004
+ return base.__dict__['__repr__']
1005
+ return None
1006
+
1007
+ @classmethod
1008
+ def _find_data_type_(mcls, class_name, bases):
1009
+ # a datatype has a __new__ method, or a __dataclass_fields__ attribute
1010
+ data_types = set()
1011
+ base_chain = set()
1012
+ for chain in bases:
1013
+ candidate = None
1014
+ for base in chain.__mro__:
1015
+ base_chain.add(base)
1016
+ if base is object:
1017
+ continue
1018
+ elif isinstance(base, EnumType):
1019
+ if base._member_type_ is not object:
1020
+ data_types.add(base._member_type_)
1021
+ break
1022
+ elif '__new__' in base.__dict__ or '__dataclass_fields__' in base.__dict__:
1023
+ data_types.add(candidate or base)
1024
+ break
1025
+ else:
1026
+ candidate = candidate or base
1027
+ if len(data_types) > 1:
1028
+ raise TypeError('too many data types for %r: %r' % (class_name, data_types))
1029
+ elif data_types:
1030
+ return data_types.pop()
1031
+ else:
1032
+ return None
1033
+
1034
+ @classmethod
1035
+ def _find_new_(mcls, classdict, member_type, first_enum):
1036
+ """
1037
+ Returns the __new__ to be used for creating the enum members.
1038
+
1039
+ classdict: the class dictionary given to __new__
1040
+ member_type: the data type whose __new__ will be used by default
1041
+ first_enum: enumeration to check for an overriding __new__
1042
+ """
1043
+ # now find the correct __new__, checking to see of one was defined
1044
+ # by the user; also check earlier enum classes in case a __new__ was
1045
+ # saved as __new_member__
1046
+ __new__ = classdict.get('__new__', None)
1047
+
1048
+ # should __new__ be saved as __new_member__ later?
1049
+ save_new = first_enum is not None and __new__ is not None
1050
+
1051
+ if __new__ is None:
1052
+ # check all possibles for __new_member__ before falling back to
1053
+ # __new__
1054
+ for method in ('__new_member__', '__new__'):
1055
+ for possible in (member_type, first_enum):
1056
+ target = getattr(possible, method, None)
1057
+ if target not in {
1058
+ None,
1059
+ None.__new__,
1060
+ object.__new__,
1061
+ Enum.__new__,
1062
+ }:
1063
+ __new__ = target
1064
+ break
1065
+ if __new__ is not None:
1066
+ break
1067
+ else:
1068
+ __new__ = object.__new__
1069
+
1070
+ # if a non-object.__new__ is used then whatever value/tuple was
1071
+ # assigned to the enum member name will be passed to __new__ and to the
1072
+ # new enum member's __init__
1073
+ if first_enum is None or __new__ in (Enum.__new__, object.__new__):
1074
+ use_args = False
1075
+ else:
1076
+ use_args = True
1077
+ return __new__, save_new, use_args
1078
+ EnumMeta = EnumType
1079
+
1080
+
1081
+ class Enum(metaclass=EnumType):
1082
+ """
1083
+ Create a collection of name/value pairs.
1084
+
1085
+ Example enumeration:
1086
+
1087
+ >>> class Color(Enum):
1088
+ ... RED = 1
1089
+ ... BLUE = 2
1090
+ ... GREEN = 3
1091
+
1092
+ Access them by:
1093
+
1094
+ - attribute access:
1095
+
1096
+ >>> Color.RED
1097
+ <Color.RED: 1>
1098
+
1099
+ - value lookup:
1100
+
1101
+ >>> Color(1)
1102
+ <Color.RED: 1>
1103
+
1104
+ - name lookup:
1105
+
1106
+ >>> Color['RED']
1107
+ <Color.RED: 1>
1108
+
1109
+ Enumerations can be iterated over, and know how many members they have:
1110
+
1111
+ >>> len(Color)
1112
+ 3
1113
+
1114
+ >>> list(Color)
1115
+ [<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]
1116
+
1117
+ Methods can be added to enumerations, and members can have their own
1118
+ attributes -- see the documentation for details.
1119
+ """
1120
+
1121
+ @classmethod
1122
+ def __signature__(cls):
1123
+ if cls._member_names_:
1124
+ return '(*values)'
1125
+ else:
1126
+ return '(new_class_name, /, names, *, module=None, qualname=None, type=None, start=1, boundary=None)'
1127
+
1128
+ def __new__(cls, value):
1129
+ # all enum instances are actually created during class construction
1130
+ # without calling this method; this method is called by the metaclass'
1131
+ # __call__ (i.e. Color(3) ), and by pickle
1132
+ if type(value) is cls:
1133
+ # For lookups like Color(Color.RED)
1134
+ return value
1135
+ # by-value search for a matching enum member
1136
+ # see if it's in the reverse mapping (for hashable values)
1137
+ try:
1138
+ return cls._value2member_map_[value]
1139
+ except KeyError:
1140
+ # Not found, no need to do long O(n) search
1141
+ pass
1142
+ except TypeError:
1143
+ # not there, now do long search -- O(n) behavior
1144
+ for member in cls._member_map_.values():
1145
+ if member._value_ == value:
1146
+ return member
1147
+ # still not found -- verify that members exist, in-case somebody got here mistakenly
1148
+ # (such as via super when trying to override __new__)
1149
+ if not cls._member_map_:
1150
+ raise TypeError("%r has no members defined" % cls)
1151
+ #
1152
+ # still not found -- try _missing_ hook
1153
+ try:
1154
+ exc = None
1155
+ result = cls._missing_(value)
1156
+ except Exception as e:
1157
+ exc = e
1158
+ result = None
1159
+ try:
1160
+ if isinstance(result, cls):
1161
+ return result
1162
+ elif (
1163
+ Flag is not None and issubclass(cls, Flag)
1164
+ and cls._boundary_ is EJECT and isinstance(result, int)
1165
+ ):
1166
+ return result
1167
+ else:
1168
+ ve_exc = ValueError("%r is not a valid %s" % (value, cls.__qualname__))
1169
+ if result is None and exc is None:
1170
+ raise ve_exc
1171
+ elif exc is None:
1172
+ exc = TypeError(
1173
+ 'error in %s._missing_: returned %r instead of None or a valid member'
1174
+ % (cls.__name__, result)
1175
+ )
1176
+ if not isinstance(exc, ValueError):
1177
+ exc.__context__ = ve_exc
1178
+ raise exc
1179
+ finally:
1180
+ # ensure all variables that could hold an exception are destroyed
1181
+ exc = None
1182
+ ve_exc = None
1183
+
1184
+ def __init__(self, *args, **kwds):
1185
+ pass
1186
+
1187
+ @staticmethod
1188
+ def _generate_next_value_(name, start, count, last_values):
1189
+ """
1190
+ Generate the next value when not given.
1191
+
1192
+ name: the name of the member
1193
+ start: the initial start value or None
1194
+ count: the number of existing members
1195
+ last_values: the list of values assigned
1196
+ """
1197
+ if not last_values:
1198
+ return start
1199
+ try:
1200
+ last = last_values[-1]
1201
+ last_values.sort()
1202
+ if last == last_values[-1]:
1203
+ # no difference between old and new methods
1204
+ return last + 1
1205
+ else:
1206
+ # trigger old method (with warning)
1207
+ raise TypeError
1208
+ except TypeError:
1209
+ import warnings
1210
+ warnings.warn(
1211
+ "In 3.13 the default `auto()`/`_generate_next_value_` will require all values to be sortable and support adding +1\n"
1212
+ "and the value returned will be the largest value in the enum incremented by 1",
1213
+ DeprecationWarning,
1214
+ stacklevel=3,
1215
+ )
1216
+ for v in reversed(last_values):
1217
+ try:
1218
+ return v + 1
1219
+ except TypeError:
1220
+ pass
1221
+ return start
1222
+
1223
+ @classmethod
1224
+ def _missing_(cls, value):
1225
+ return None
1226
+
1227
+ def __repr__(self):
1228
+ v_repr = self.__class__._value_repr_ or repr
1229
+ return "<%s.%s: %s>" % (self.__class__.__name__, self._name_, v_repr(self._value_))
1230
+
1231
+ def __str__(self):
1232
+ return "%s.%s" % (self.__class__.__name__, self._name_, )
1233
+
1234
+ def __dir__(self):
1235
+ """
1236
+ Returns public methods and other interesting attributes.
1237
+ """
1238
+ interesting = set()
1239
+ if self.__class__._member_type_ is not object:
1240
+ interesting = set(object.__dir__(self))
1241
+ for name in getattr(self, '__dict__', []):
1242
+ if name[0] != '_' and name not in self._member_map_:
1243
+ interesting.add(name)
1244
+ for cls in self.__class__.mro():
1245
+ for name, obj in cls.__dict__.items():
1246
+ if name[0] == '_':
1247
+ continue
1248
+ if isinstance(obj, property):
1249
+ # that's an enum.property
1250
+ if obj.fget is not None or name not in self._member_map_:
1251
+ interesting.add(name)
1252
+ else:
1253
+ # in case it was added by `dir(self)`
1254
+ interesting.discard(name)
1255
+ elif name not in self._member_map_:
1256
+ interesting.add(name)
1257
+ names = sorted(
1258
+ set(['__class__', '__doc__', '__eq__', '__hash__', '__module__'])
1259
+ | interesting
1260
+ )
1261
+ return names
1262
+
1263
+ def __format__(self, format_spec):
1264
+ return str.__format__(str(self), format_spec)
1265
+
1266
+ def __hash__(self):
1267
+ return hash(self._name_)
1268
+
1269
+ def __reduce_ex__(self, proto):
1270
+ return self.__class__, (self._value_, )
1271
+
1272
+ def __deepcopy__(self,memo):
1273
+ return self
1274
+
1275
+ def __copy__(self):
1276
+ return self
1277
+
1278
+ # enum.property is used to provide access to the `name` and
1279
+ # `value` attributes of enum members while keeping some measure of
1280
+ # protection from modification, while still allowing for an enumeration
1281
+ # to have members named `name` and `value`. This works because each
1282
+ # instance of enum.property saves its companion member, which it returns
1283
+ # on class lookup; on instance lookup it either executes a provided function
1284
+ # or raises an AttributeError.
1285
+
1286
+ @property
1287
+ def name(self):
1288
+ """The name of the Enum member."""
1289
+ return self._name_
1290
+
1291
+ @property
1292
+ def value(self):
1293
+ """The value of the Enum member."""
1294
+ return self._value_
1295
+
1296
+
1297
+ class ReprEnum(Enum):
1298
+ """
1299
+ Only changes the repr(), leaving str() and format() to the mixed-in type.
1300
+ """
1301
+
1302
+
1303
+ class IntEnum(int, ReprEnum):
1304
+ """
1305
+ Enum where members are also (and must be) ints
1306
+ """
1307
+
1308
+
1309
+ class StrEnum(str, ReprEnum):
1310
+ """
1311
+ Enum where members are also (and must be) strings
1312
+ """
1313
+
1314
+ def __new__(cls, *values):
1315
+ "values must already be of type `str`"
1316
+ if len(values) > 3:
1317
+ raise TypeError('too many arguments for str(): %r' % (values, ))
1318
+ if len(values) == 1:
1319
+ # it must be a string
1320
+ if not isinstance(values[0], str):
1321
+ raise TypeError('%r is not a string' % (values[0], ))
1322
+ if len(values) >= 2:
1323
+ # check that encoding argument is a string
1324
+ if not isinstance(values[1], str):
1325
+ raise TypeError('encoding must be a string, not %r' % (values[1], ))
1326
+ if len(values) == 3:
1327
+ # check that errors argument is a string
1328
+ if not isinstance(values[2], str):
1329
+ raise TypeError('errors must be a string, not %r' % (values[2]))
1330
+ value = str(*values)
1331
+ member = str.__new__(cls, value)
1332
+ member._value_ = value
1333
+ return member
1334
+
1335
+ @staticmethod
1336
+ def _generate_next_value_(name, start, count, last_values):
1337
+ """
1338
+ Return the lower-cased version of the member name.
1339
+ """
1340
+ return name.lower()
1341
+
1342
+
1343
+ def pickle_by_global_name(self, proto):
1344
+ # should not be used with Flag-type enums
1345
+ return self.name
1346
+ _reduce_ex_by_global_name = pickle_by_global_name
1347
+
1348
+ def pickle_by_enum_name(self, proto):
1349
+ # should not be used with Flag-type enums
1350
+ return getattr, (self.__class__, self._name_)
1351
+
1352
+ class FlagBoundary(StrEnum):
1353
+ """
1354
+ control how out of range values are handled
1355
+ "strict" -> error is raised [default for Flag]
1356
+ "conform" -> extra bits are discarded
1357
+ "eject" -> lose flag status
1358
+ "keep" -> keep flag status and all bits [default for IntFlag]
1359
+ """
1360
+ STRICT = auto()
1361
+ CONFORM = auto()
1362
+ EJECT = auto()
1363
+ KEEP = auto()
1364
+ STRICT, CONFORM, EJECT, KEEP = FlagBoundary
1365
+
1366
+
1367
+ class Flag(Enum, boundary=STRICT):
1368
+ """
1369
+ Support for flags
1370
+ """
1371
+
1372
+ _numeric_repr_ = repr
1373
+
1374
+ @staticmethod
1375
+ def _generate_next_value_(name, start, count, last_values):
1376
+ """
1377
+ Generate the next value when not given.
1378
+
1379
+ name: the name of the member
1380
+ start: the initial start value or None
1381
+ count: the number of existing members
1382
+ last_values: the last value assigned or None
1383
+ """
1384
+ if not count:
1385
+ return start if start is not None else 1
1386
+ last_value = max(last_values)
1387
+ try:
1388
+ high_bit = _high_bit(last_value)
1389
+ except Exception:
1390
+ raise TypeError('invalid flag value %r' % last_value) from None
1391
+ return 2 ** (high_bit+1)
1392
+
1393
+ @classmethod
1394
+ def _iter_member_by_value_(cls, value):
1395
+ """
1396
+ Extract all members from the value in definition (i.e. increasing value) order.
1397
+ """
1398
+ for val in _iter_bits_lsb(value & cls._flag_mask_):
1399
+ yield cls._value2member_map_.get(val)
1400
+
1401
+ _iter_member_ = _iter_member_by_value_
1402
+
1403
+ @classmethod
1404
+ def _iter_member_by_def_(cls, value):
1405
+ """
1406
+ Extract all members from the value in definition order.
1407
+ """
1408
+ yield from sorted(
1409
+ cls._iter_member_by_value_(value),
1410
+ key=lambda m: m._sort_order_,
1411
+ )
1412
+
1413
+ @classmethod
1414
+ def _missing_(cls, value):
1415
+ """
1416
+ Create a composite member containing all canonical members present in `value`.
1417
+
1418
+ If non-member values are present, result depends on `_boundary_` setting.
1419
+ """
1420
+ if not isinstance(value, int):
1421
+ raise ValueError(
1422
+ "%r is not a valid %s" % (value, cls.__qualname__)
1423
+ )
1424
+ # check boundaries
1425
+ # - value must be in range (e.g. -16 <-> +15, i.e. ~15 <-> 15)
1426
+ # - value must not include any skipped flags (e.g. if bit 2 is not
1427
+ # defined, then 0d10 is invalid)
1428
+ flag_mask = cls._flag_mask_
1429
+ singles_mask = cls._singles_mask_
1430
+ all_bits = cls._all_bits_
1431
+ neg_value = None
1432
+ if (
1433
+ not ~all_bits <= value <= all_bits
1434
+ or value & (all_bits ^ flag_mask)
1435
+ ):
1436
+ if cls._boundary_ is STRICT:
1437
+ max_bits = max(value.bit_length(), flag_mask.bit_length())
1438
+ raise ValueError(
1439
+ "%r invalid value %r\n given %s\n allowed %s" % (
1440
+ cls, value, bin(value, max_bits), bin(flag_mask, max_bits),
1441
+ ))
1442
+ elif cls._boundary_ is CONFORM:
1443
+ value = value & flag_mask
1444
+ elif cls._boundary_ is EJECT:
1445
+ return value
1446
+ elif cls._boundary_ is KEEP:
1447
+ if value < 0:
1448
+ value = (
1449
+ max(all_bits+1, 2**(value.bit_length()))
1450
+ + value
1451
+ )
1452
+ else:
1453
+ raise ValueError(
1454
+ '%r unknown flag boundary %r' % (cls, cls._boundary_, )
1455
+ )
1456
+ if value < 0:
1457
+ neg_value = value
1458
+ value = all_bits + 1 + value
1459
+ # get members and unknown
1460
+ unknown = value & ~flag_mask
1461
+ aliases = value & ~singles_mask
1462
+ member_value = value & singles_mask
1463
+ if unknown and cls._boundary_ is not KEEP:
1464
+ raise ValueError(
1465
+ '%s(%r) --> unknown values %r [%s]'
1466
+ % (cls.__name__, value, unknown, bin(unknown))
1467
+ )
1468
+ # normal Flag?
1469
+ if cls._member_type_ is object:
1470
+ # construct a singleton enum pseudo-member
1471
+ pseudo_member = object.__new__(cls)
1472
+ else:
1473
+ pseudo_member = cls._member_type_.__new__(cls, value)
1474
+ if not hasattr(pseudo_member, '_value_'):
1475
+ pseudo_member._value_ = value
1476
+ if member_value or aliases:
1477
+ members = []
1478
+ combined_value = 0
1479
+ for m in cls._iter_member_(member_value):
1480
+ members.append(m)
1481
+ combined_value |= m._value_
1482
+ if aliases:
1483
+ value = member_value | aliases
1484
+ for n, pm in cls._member_map_.items():
1485
+ if pm not in members and pm._value_ and pm._value_ & value == pm._value_:
1486
+ members.append(pm)
1487
+ combined_value |= pm._value_
1488
+ unknown = value ^ combined_value
1489
+ pseudo_member._name_ = '|'.join([m._name_ for m in members])
1490
+ if not combined_value:
1491
+ pseudo_member._name_ = None
1492
+ elif unknown and cls._boundary_ is STRICT:
1493
+ raise ValueError('%r: no members with value %r' % (cls, unknown))
1494
+ elif unknown:
1495
+ pseudo_member._name_ += '|%s' % cls._numeric_repr_(unknown)
1496
+ else:
1497
+ pseudo_member._name_ = None
1498
+ # use setdefault in case another thread already created a composite
1499
+ # with this value
1500
+ # note: zero is a special case -- always add it
1501
+ pseudo_member = cls._value2member_map_.setdefault(value, pseudo_member)
1502
+ if neg_value is not None:
1503
+ cls._value2member_map_[neg_value] = pseudo_member
1504
+ return pseudo_member
1505
+
1506
+ def __contains__(self, other):
1507
+ """
1508
+ Returns True if self has at least the same flags set as other.
1509
+ """
1510
+ if not isinstance(other, self.__class__):
1511
+ raise TypeError(
1512
+ "unsupported operand type(s) for 'in': %r and %r" % (
1513
+ type(other).__qualname__, self.__class__.__qualname__))
1514
+ return other._value_ & self._value_ == other._value_
1515
+
1516
+ def __iter__(self):
1517
+ """
1518
+ Returns flags in definition order.
1519
+ """
1520
+ yield from self._iter_member_(self._value_)
1521
+
1522
+ def __len__(self):
1523
+ return self._value_.bit_count()
1524
+
1525
+ def __repr__(self):
1526
+ cls_name = self.__class__.__name__
1527
+ v_repr = self.__class__._value_repr_ or repr
1528
+ if self._name_ is None:
1529
+ return "<%s: %s>" % (cls_name, v_repr(self._value_))
1530
+ else:
1531
+ return "<%s.%s: %s>" % (cls_name, self._name_, v_repr(self._value_))
1532
+
1533
+ def __str__(self):
1534
+ cls_name = self.__class__.__name__
1535
+ if self._name_ is None:
1536
+ return '%s(%r)' % (cls_name, self._value_)
1537
+ else:
1538
+ return "%s.%s" % (cls_name, self._name_)
1539
+
1540
+ def __bool__(self):
1541
+ return bool(self._value_)
1542
+
1543
+ def _get_value(self, flag):
1544
+ if isinstance(flag, self.__class__):
1545
+ return flag._value_
1546
+ elif self._member_type_ is not object and isinstance(flag, self._member_type_):
1547
+ return flag
1548
+ return NotImplemented
1549
+
1550
+ def __or__(self, other):
1551
+ other_value = self._get_value(other)
1552
+ if other_value is NotImplemented:
1553
+ return NotImplemented
1554
+
1555
+ for flag in self, other:
1556
+ if self._get_value(flag) is None:
1557
+ raise TypeError(f"'{flag}' cannot be combined with other flags with |")
1558
+ value = self._value_
1559
+ return self.__class__(value | other_value)
1560
+
1561
+ def __and__(self, other):
1562
+ other_value = self._get_value(other)
1563
+ if other_value is NotImplemented:
1564
+ return NotImplemented
1565
+
1566
+ for flag in self, other:
1567
+ if self._get_value(flag) is None:
1568
+ raise TypeError(f"'{flag}' cannot be combined with other flags with &")
1569
+ value = self._value_
1570
+ return self.__class__(value & other_value)
1571
+
1572
+ def __xor__(self, other):
1573
+ other_value = self._get_value(other)
1574
+ if other_value is NotImplemented:
1575
+ return NotImplemented
1576
+
1577
+ for flag in self, other:
1578
+ if self._get_value(flag) is None:
1579
+ raise TypeError(f"'{flag}' cannot be combined with other flags with ^")
1580
+ value = self._value_
1581
+ return self.__class__(value ^ other_value)
1582
+
1583
+ def __invert__(self):
1584
+ if self._get_value(self) is None:
1585
+ raise TypeError(f"'{self}' cannot be inverted")
1586
+
1587
+ if self._inverted_ is None:
1588
+ if self._boundary_ in (EJECT, KEEP):
1589
+ self._inverted_ = self.__class__(~self._value_)
1590
+ else:
1591
+ self._inverted_ = self.__class__(self._singles_mask_ & ~self._value_)
1592
+ return self._inverted_
1593
+
1594
+ __rand__ = __and__
1595
+ __ror__ = __or__
1596
+ __rxor__ = __xor__
1597
+
1598
+
1599
+ class IntFlag(int, ReprEnum, Flag, boundary=KEEP):
1600
+ """
1601
+ Support for integer-based Flags
1602
+ """
1603
+
1604
+
1605
+ def _high_bit(value):
1606
+ """
1607
+ returns index of highest bit, or -1 if value is zero or negative
1608
+ """
1609
+ return value.bit_length() - 1
1610
+
1611
+ def unique(enumeration):
1612
+ """
1613
+ Class decorator for enumerations ensuring unique member values.
1614
+ """
1615
+ duplicates = []
1616
+ for name, member in enumeration.__members__.items():
1617
+ if name != member.name:
1618
+ duplicates.append((name, member.name))
1619
+ if duplicates:
1620
+ alias_details = ', '.join(
1621
+ ["%s -> %s" % (alias, name) for (alias, name) in duplicates])
1622
+ raise ValueError('duplicate values found in %r: %s' %
1623
+ (enumeration, alias_details))
1624
+ return enumeration
1625
+
1626
+ def _dataclass_repr(self):
1627
+ dcf = self.__dataclass_fields__
1628
+ return ', '.join(
1629
+ '%s=%r' % (k, getattr(self, k))
1630
+ for k in dcf.keys()
1631
+ if dcf[k].repr
1632
+ )
1633
+
1634
+ def global_enum_repr(self):
1635
+ """
1636
+ use module.enum_name instead of class.enum_name
1637
+
1638
+ the module is the last module in case of a multi-module name
1639
+ """
1640
+ module = self.__class__.__module__.split('.')[-1]
1641
+ return '%s.%s' % (module, self._name_)
1642
+
1643
+ def global_flag_repr(self):
1644
+ """
1645
+ use module.flag_name instead of class.flag_name
1646
+
1647
+ the module is the last module in case of a multi-module name
1648
+ """
1649
+ module = self.__class__.__module__.split('.')[-1]
1650
+ cls_name = self.__class__.__name__
1651
+ if self._name_ is None:
1652
+ return "%s.%s(%r)" % (module, cls_name, self._value_)
1653
+ if _is_single_bit(self._value_):
1654
+ return '%s.%s' % (module, self._name_)
1655
+ if self._boundary_ is not FlagBoundary.KEEP:
1656
+ return '|'.join(['%s.%s' % (module, name) for name in self.name.split('|')])
1657
+ else:
1658
+ name = []
1659
+ for n in self._name_.split('|'):
1660
+ if n[0].isdigit():
1661
+ name.append(n)
1662
+ else:
1663
+ name.append('%s.%s' % (module, n))
1664
+ return '|'.join(name)
1665
+
1666
+ def global_str(self):
1667
+ """
1668
+ use enum_name instead of class.enum_name
1669
+ """
1670
+ if self._name_ is None:
1671
+ cls_name = self.__class__.__name__
1672
+ return "%s(%r)" % (cls_name, self._value_)
1673
+ else:
1674
+ return self._name_
1675
+
1676
+ def global_enum(cls, update_str=False):
1677
+ """
1678
+ decorator that makes the repr() of an enum member reference its module
1679
+ instead of its class; also exports all members to the enum's module's
1680
+ global namespace
1681
+ """
1682
+ if issubclass(cls, Flag):
1683
+ cls.__repr__ = global_flag_repr
1684
+ else:
1685
+ cls.__repr__ = global_enum_repr
1686
+ if not issubclass(cls, ReprEnum) or update_str:
1687
+ cls.__str__ = global_str
1688
+ sys.modules[cls.__module__].__dict__.update(cls.__members__)
1689
+ return cls
1690
+
1691
+ def _simple_enum(etype=Enum, *, boundary=None, use_args=None):
1692
+ """
1693
+ Class decorator that converts a normal class into an :class:`Enum`. No
1694
+ safety checks are done, and some advanced behavior (such as
1695
+ :func:`__init_subclass__`) is not available. Enum creation can be faster
1696
+ using :func:`simple_enum`.
1697
+
1698
+ >>> from enum import Enum, _simple_enum
1699
+ >>> @_simple_enum(Enum)
1700
+ ... class Color:
1701
+ ... RED = auto()
1702
+ ... GREEN = auto()
1703
+ ... BLUE = auto()
1704
+ >>> Color
1705
+ <enum 'Color'>
1706
+ """
1707
+ def convert_class(cls):
1708
+ nonlocal use_args
1709
+ cls_name = cls.__name__
1710
+ if use_args is None:
1711
+ use_args = etype._use_args_
1712
+ __new__ = cls.__dict__.get('__new__')
1713
+ if __new__ is not None:
1714
+ new_member = __new__.__func__
1715
+ else:
1716
+ new_member = etype._member_type_.__new__
1717
+ attrs = {}
1718
+ body = {}
1719
+ if __new__ is not None:
1720
+ body['__new_member__'] = new_member
1721
+ body['_new_member_'] = new_member
1722
+ body['_use_args_'] = use_args
1723
+ body['_generate_next_value_'] = gnv = etype._generate_next_value_
1724
+ body['_member_names_'] = member_names = []
1725
+ body['_member_map_'] = member_map = {}
1726
+ body['_value2member_map_'] = value2member_map = {}
1727
+ body['_unhashable_values_'] = []
1728
+ body['_member_type_'] = member_type = etype._member_type_
1729
+ body['_value_repr_'] = etype._value_repr_
1730
+ if issubclass(etype, Flag):
1731
+ body['_boundary_'] = boundary or etype._boundary_
1732
+ body['_flag_mask_'] = None
1733
+ body['_all_bits_'] = None
1734
+ body['_singles_mask_'] = None
1735
+ body['_inverted_'] = None
1736
+ body['__or__'] = Flag.__or__
1737
+ body['__xor__'] = Flag.__xor__
1738
+ body['__and__'] = Flag.__and__
1739
+ body['__ror__'] = Flag.__ror__
1740
+ body['__rxor__'] = Flag.__rxor__
1741
+ body['__rand__'] = Flag.__rand__
1742
+ body['__invert__'] = Flag.__invert__
1743
+ for name, obj in cls.__dict__.items():
1744
+ if name in ('__dict__', '__weakref__'):
1745
+ continue
1746
+ if _is_dunder(name) or _is_private(cls_name, name) or _is_sunder(name) or _is_descriptor(obj):
1747
+ body[name] = obj
1748
+ else:
1749
+ attrs[name] = obj
1750
+ if cls.__dict__.get('__doc__') is None:
1751
+ body['__doc__'] = 'An enumeration.'
1752
+ #
1753
+ # double check that repr and friends are not the mixin's or various
1754
+ # things break (such as pickle)
1755
+ # however, if the method is defined in the Enum itself, don't replace
1756
+ # it
1757
+ enum_class = type(cls_name, (etype, ), body, boundary=boundary, _simple=True)
1758
+ for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
1759
+ if name not in body:
1760
+ # check for mixin overrides before replacing
1761
+ enum_method = getattr(etype, name)
1762
+ found_method = getattr(enum_class, name)
1763
+ object_method = getattr(object, name)
1764
+ data_type_method = getattr(member_type, name)
1765
+ if found_method in (data_type_method, object_method):
1766
+ setattr(enum_class, name, enum_method)
1767
+ gnv_last_values = []
1768
+ if issubclass(enum_class, Flag):
1769
+ # Flag / IntFlag
1770
+ single_bits = multi_bits = 0
1771
+ for name, value in attrs.items():
1772
+ if isinstance(value, auto) and auto.value is _auto_null:
1773
+ value = gnv(name, 1, len(member_names), gnv_last_values)
1774
+ if value in value2member_map:
1775
+ # an alias to an existing member
1776
+ member = value2member_map[value]
1777
+ redirect = property()
1778
+ redirect.member = member
1779
+ redirect.__set_name__(enum_class, name)
1780
+ setattr(enum_class, name, redirect)
1781
+ member_map[name] = member
1782
+ else:
1783
+ # create the member
1784
+ if use_args:
1785
+ if not isinstance(value, tuple):
1786
+ value = (value, )
1787
+ member = new_member(enum_class, *value)
1788
+ value = value[0]
1789
+ else:
1790
+ member = new_member(enum_class)
1791
+ if __new__ is None:
1792
+ member._value_ = value
1793
+ member._name_ = name
1794
+ member.__objclass__ = enum_class
1795
+ member.__init__(value)
1796
+ redirect = property()
1797
+ redirect.member = member
1798
+ redirect.__set_name__(enum_class, name)
1799
+ setattr(enum_class, name, redirect)
1800
+ member_map[name] = member
1801
+ member._sort_order_ = len(member_names)
1802
+ value2member_map[value] = member
1803
+ if _is_single_bit(value):
1804
+ # not a multi-bit alias, record in _member_names_ and _flag_mask_
1805
+ member_names.append(name)
1806
+ single_bits |= value
1807
+ else:
1808
+ multi_bits |= value
1809
+ gnv_last_values.append(value)
1810
+ enum_class._flag_mask_ = single_bits | multi_bits
1811
+ enum_class._singles_mask_ = single_bits
1812
+ enum_class._all_bits_ = 2 ** ((single_bits|multi_bits).bit_length()) - 1
1813
+ # set correct __iter__
1814
+ member_list = [m._value_ for m in enum_class]
1815
+ if member_list != sorted(member_list):
1816
+ enum_class._iter_member_ = enum_class._iter_member_by_def_
1817
+ else:
1818
+ # Enum / IntEnum / StrEnum
1819
+ for name, value in attrs.items():
1820
+ if isinstance(value, auto):
1821
+ if value.value is _auto_null:
1822
+ value.value = gnv(name, 1, len(member_names), gnv_last_values)
1823
+ value = value.value
1824
+ if value in value2member_map:
1825
+ # an alias to an existing member
1826
+ member = value2member_map[value]
1827
+ redirect = property()
1828
+ redirect.member = member
1829
+ redirect.__set_name__(enum_class, name)
1830
+ setattr(enum_class, name, redirect)
1831
+ member_map[name] = member
1832
+ else:
1833
+ # create the member
1834
+ if use_args:
1835
+ if not isinstance(value, tuple):
1836
+ value = (value, )
1837
+ member = new_member(enum_class, *value)
1838
+ value = value[0]
1839
+ else:
1840
+ member = new_member(enum_class)
1841
+ if __new__ is None:
1842
+ member._value_ = value
1843
+ member._name_ = name
1844
+ member.__objclass__ = enum_class
1845
+ member.__init__(value)
1846
+ member._sort_order_ = len(member_names)
1847
+ redirect = property()
1848
+ redirect.member = member
1849
+ redirect.__set_name__(enum_class, name)
1850
+ setattr(enum_class, name, redirect)
1851
+ member_map[name] = member
1852
+ value2member_map[value] = member
1853
+ member_names.append(name)
1854
+ gnv_last_values.append(value)
1855
+ if '__new__' in body:
1856
+ enum_class.__new_member__ = enum_class.__new__
1857
+ enum_class.__new__ = Enum.__new__
1858
+ return enum_class
1859
+ return convert_class
1860
+
1861
+ @_simple_enum(StrEnum)
1862
+ class EnumCheck:
1863
+ """
1864
+ various conditions to check an enumeration for
1865
+ """
1866
+ CONTINUOUS = "no skipped integer values"
1867
+ NAMED_FLAGS = "multi-flag aliases may not contain unnamed flags"
1868
+ UNIQUE = "one name per value"
1869
+ CONTINUOUS, NAMED_FLAGS, UNIQUE = EnumCheck
1870
+
1871
+
1872
+ class verify:
1873
+ """
1874
+ Check an enumeration for various constraints. (see EnumCheck)
1875
+ """
1876
+ def __init__(self, *checks):
1877
+ self.checks = checks
1878
+ def __call__(self, enumeration):
1879
+ checks = self.checks
1880
+ cls_name = enumeration.__name__
1881
+ if Flag is not None and issubclass(enumeration, Flag):
1882
+ enum_type = 'flag'
1883
+ elif issubclass(enumeration, Enum):
1884
+ enum_type = 'enum'
1885
+ else:
1886
+ raise TypeError("the 'verify' decorator only works with Enum and Flag")
1887
+ for check in checks:
1888
+ if check is UNIQUE:
1889
+ # check for duplicate names
1890
+ duplicates = []
1891
+ for name, member in enumeration.__members__.items():
1892
+ if name != member.name:
1893
+ duplicates.append((name, member.name))
1894
+ if duplicates:
1895
+ alias_details = ', '.join(
1896
+ ["%s -> %s" % (alias, name) for (alias, name) in duplicates])
1897
+ raise ValueError('aliases found in %r: %s' %
1898
+ (enumeration, alias_details))
1899
+ elif check is CONTINUOUS:
1900
+ values = set(e.value for e in enumeration)
1901
+ if len(values) < 2:
1902
+ continue
1903
+ low, high = min(values), max(values)
1904
+ missing = []
1905
+ if enum_type == 'flag':
1906
+ # check for powers of two
1907
+ for i in range(_high_bit(low)+1, _high_bit(high)):
1908
+ if 2**i not in values:
1909
+ missing.append(2**i)
1910
+ elif enum_type == 'enum':
1911
+ # check for powers of one
1912
+ for i in range(low+1, high):
1913
+ if i not in values:
1914
+ missing.append(i)
1915
+ else:
1916
+ raise Exception('verify: unknown type %r' % enum_type)
1917
+ if missing:
1918
+ raise ValueError(('invalid %s %r: missing values %s' % (
1919
+ enum_type, cls_name, ', '.join((str(m) for m in missing)))
1920
+ )[:256])
1921
+ # limit max length to protect against DOS attacks
1922
+ elif check is NAMED_FLAGS:
1923
+ # examine each alias and check for unnamed flags
1924
+ member_names = enumeration._member_names_
1925
+ member_values = [m.value for m in enumeration]
1926
+ missing_names = []
1927
+ missing_value = 0
1928
+ for name, alias in enumeration._member_map_.items():
1929
+ if name in member_names:
1930
+ # not an alias
1931
+ continue
1932
+ if alias.value < 0:
1933
+ # negative numbers are not checked
1934
+ continue
1935
+ values = list(_iter_bits_lsb(alias.value))
1936
+ missed = [v for v in values if v not in member_values]
1937
+ if missed:
1938
+ missing_names.append(name)
1939
+ missing_value |= reduce(_or_, missed)
1940
+ if missing_names:
1941
+ if len(missing_names) == 1:
1942
+ alias = 'alias %s is missing' % missing_names[0]
1943
+ else:
1944
+ alias = 'aliases %s and %s are missing' % (
1945
+ ', '.join(missing_names[:-1]), missing_names[-1]
1946
+ )
1947
+ if _is_single_bit(missing_value):
1948
+ value = 'value 0x%x' % missing_value
1949
+ else:
1950
+ value = 'combined values of 0x%x' % missing_value
1951
+ raise ValueError(
1952
+ 'invalid Flag %r: %s %s [use enum.show_flag_values(value) for details]'
1953
+ % (cls_name, alias, value)
1954
+ )
1955
+ return enumeration
1956
+
1957
+ def _test_simple_enum(checked_enum, simple_enum):
1958
+ """
1959
+ A function that can be used to test an enum created with :func:`_simple_enum`
1960
+ against the version created by subclassing :class:`Enum`::
1961
+
1962
+ >>> from enum import Enum, _simple_enum, _test_simple_enum
1963
+ >>> @_simple_enum(Enum)
1964
+ ... class Color:
1965
+ ... RED = auto()
1966
+ ... GREEN = auto()
1967
+ ... BLUE = auto()
1968
+ >>> class CheckedColor(Enum):
1969
+ ... RED = auto()
1970
+ ... GREEN = auto()
1971
+ ... BLUE = auto()
1972
+ >>> _test_simple_enum(CheckedColor, Color)
1973
+
1974
+ If differences are found, a :exc:`TypeError` is raised.
1975
+ """
1976
+ failed = []
1977
+ if checked_enum.__dict__ != simple_enum.__dict__:
1978
+ checked_dict = checked_enum.__dict__
1979
+ checked_keys = list(checked_dict.keys())
1980
+ simple_dict = simple_enum.__dict__
1981
+ simple_keys = list(simple_dict.keys())
1982
+ member_names = set(
1983
+ list(checked_enum._member_map_.keys())
1984
+ + list(simple_enum._member_map_.keys())
1985
+ )
1986
+ for key in set(checked_keys + simple_keys):
1987
+ if key in ('__module__', '_member_map_', '_value2member_map_', '__doc__'):
1988
+ # keys known to be different, or very long
1989
+ continue
1990
+ elif key in member_names:
1991
+ # members are checked below
1992
+ continue
1993
+ elif key not in simple_keys:
1994
+ failed.append("missing key: %r" % (key, ))
1995
+ elif key not in checked_keys:
1996
+ failed.append("extra key: %r" % (key, ))
1997
+ else:
1998
+ checked_value = checked_dict[key]
1999
+ simple_value = simple_dict[key]
2000
+ if callable(checked_value) or isinstance(checked_value, bltns.property):
2001
+ continue
2002
+ if key == '__doc__':
2003
+ # remove all spaces/tabs
2004
+ compressed_checked_value = checked_value.replace(' ','').replace('\t','')
2005
+ compressed_simple_value = simple_value.replace(' ','').replace('\t','')
2006
+ if compressed_checked_value != compressed_simple_value:
2007
+ failed.append("%r:\n %s\n %s" % (
2008
+ key,
2009
+ "checked -> %r" % (checked_value, ),
2010
+ "simple -> %r" % (simple_value, ),
2011
+ ))
2012
+ elif checked_value != simple_value:
2013
+ failed.append("%r:\n %s\n %s" % (
2014
+ key,
2015
+ "checked -> %r" % (checked_value, ),
2016
+ "simple -> %r" % (simple_value, ),
2017
+ ))
2018
+ failed.sort()
2019
+ for name in member_names:
2020
+ failed_member = []
2021
+ if name not in simple_keys:
2022
+ failed.append('missing member from simple enum: %r' % name)
2023
+ elif name not in checked_keys:
2024
+ failed.append('extra member in simple enum: %r' % name)
2025
+ else:
2026
+ checked_member_dict = checked_enum[name].__dict__
2027
+ checked_member_keys = list(checked_member_dict.keys())
2028
+ simple_member_dict = simple_enum[name].__dict__
2029
+ simple_member_keys = list(simple_member_dict.keys())
2030
+ for key in set(checked_member_keys + simple_member_keys):
2031
+ if key in ('__module__', '__objclass__', '_inverted_'):
2032
+ # keys known to be different or absent
2033
+ continue
2034
+ elif key not in simple_member_keys:
2035
+ failed_member.append("missing key %r not in the simple enum member %r" % (key, name))
2036
+ elif key not in checked_member_keys:
2037
+ failed_member.append("extra key %r in simple enum member %r" % (key, name))
2038
+ else:
2039
+ checked_value = checked_member_dict[key]
2040
+ simple_value = simple_member_dict[key]
2041
+ if checked_value != simple_value:
2042
+ failed_member.append("%r:\n %s\n %s" % (
2043
+ key,
2044
+ "checked member -> %r" % (checked_value, ),
2045
+ "simple member -> %r" % (simple_value, ),
2046
+ ))
2047
+ if failed_member:
2048
+ failed.append('%r member mismatch:\n %s' % (
2049
+ name, '\n '.join(failed_member),
2050
+ ))
2051
+ for method in (
2052
+ '__str__', '__repr__', '__reduce_ex__', '__format__',
2053
+ '__getnewargs_ex__', '__getnewargs__', '__reduce_ex__', '__reduce__'
2054
+ ):
2055
+ if method in simple_keys and method in checked_keys:
2056
+ # cannot compare functions, and it exists in both, so we're good
2057
+ continue
2058
+ elif method not in simple_keys and method not in checked_keys:
2059
+ # method is inherited -- check it out
2060
+ checked_method = getattr(checked_enum, method, None)
2061
+ simple_method = getattr(simple_enum, method, None)
2062
+ if hasattr(checked_method, '__func__'):
2063
+ checked_method = checked_method.__func__
2064
+ simple_method = simple_method.__func__
2065
+ if checked_method != simple_method:
2066
+ failed.append("%r: %-30s %s" % (
2067
+ method,
2068
+ "checked -> %r" % (checked_method, ),
2069
+ "simple -> %r" % (simple_method, ),
2070
+ ))
2071
+ else:
2072
+ # if the method existed in only one of the enums, it will have been caught
2073
+ # in the first checks above
2074
+ pass
2075
+ if failed:
2076
+ raise TypeError('enum mismatch:\n %s' % '\n '.join(failed))
2077
+
2078
+ def _old_convert_(etype, name, module, filter, source=None, *, boundary=None):
2079
+ """
2080
+ Create a new Enum subclass that replaces a collection of global constants
2081
+ """
2082
+ # convert all constants from source (or module) that pass filter() to
2083
+ # a new Enum called name, and export the enum and its members back to
2084
+ # module;
2085
+ # also, replace the __reduce_ex__ method so unpickling works in
2086
+ # previous Python versions
2087
+ module_globals = sys.modules[module].__dict__
2088
+ if source:
2089
+ source = source.__dict__
2090
+ else:
2091
+ source = module_globals
2092
+ # _value2member_map_ is populated in the same order every time
2093
+ # for a consistent reverse mapping of number to name when there
2094
+ # are multiple names for the same number.
2095
+ members = [
2096
+ (name, value)
2097
+ for name, value in source.items()
2098
+ if filter(name)]
2099
+ try:
2100
+ # sort by value
2101
+ members.sort(key=lambda t: (t[1], t[0]))
2102
+ except TypeError:
2103
+ # unless some values aren't comparable, in which case sort by name
2104
+ members.sort(key=lambda t: t[0])
2105
+ cls = etype(name, members, module=module, boundary=boundary or KEEP)
2106
+ return cls
2107
+
2108
+ _stdlib_enums = IntEnum, StrEnum, IntFlag