@debugmcp/codelldb-linux-arm64 0.0.0-stage → 1.12.3

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