xplia 1.0.1__py3-none-any.whl

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 (870) hide show
  1. venv/Lib/site-packages/_distutils_hack/__init__.py +222 -0
  2. venv/Lib/site-packages/_distutils_hack/override.py +1 -0
  3. venv/Lib/site-packages/pip/__init__.py +13 -0
  4. venv/Lib/site-packages/pip/__main__.py +24 -0
  5. venv/Lib/site-packages/pip/__pip-runner__.py +50 -0
  6. venv/Lib/site-packages/pip/_internal/__init__.py +19 -0
  7. venv/Lib/site-packages/pip/_internal/build_env.py +311 -0
  8. venv/Lib/site-packages/pip/_internal/cache.py +292 -0
  9. venv/Lib/site-packages/pip/_internal/cli/__init__.py +4 -0
  10. venv/Lib/site-packages/pip/_internal/cli/autocompletion.py +171 -0
  11. venv/Lib/site-packages/pip/_internal/cli/base_command.py +236 -0
  12. venv/Lib/site-packages/pip/_internal/cli/cmdoptions.py +1074 -0
  13. venv/Lib/site-packages/pip/_internal/cli/command_context.py +27 -0
  14. venv/Lib/site-packages/pip/_internal/cli/main.py +79 -0
  15. venv/Lib/site-packages/pip/_internal/cli/main_parser.py +134 -0
  16. venv/Lib/site-packages/pip/_internal/cli/parser.py +294 -0
  17. venv/Lib/site-packages/pip/_internal/cli/progress_bars.py +68 -0
  18. venv/Lib/site-packages/pip/_internal/cli/req_command.py +508 -0
  19. venv/Lib/site-packages/pip/_internal/cli/spinners.py +159 -0
  20. venv/Lib/site-packages/pip/_internal/cli/status_codes.py +6 -0
  21. venv/Lib/site-packages/pip/_internal/commands/__init__.py +132 -0
  22. venv/Lib/site-packages/pip/_internal/commands/cache.py +222 -0
  23. venv/Lib/site-packages/pip/_internal/commands/check.py +54 -0
  24. venv/Lib/site-packages/pip/_internal/commands/completion.py +121 -0
  25. venv/Lib/site-packages/pip/_internal/commands/configuration.py +282 -0
  26. venv/Lib/site-packages/pip/_internal/commands/debug.py +199 -0
  27. venv/Lib/site-packages/pip/_internal/commands/download.py +147 -0
  28. venv/Lib/site-packages/pip/_internal/commands/freeze.py +108 -0
  29. venv/Lib/site-packages/pip/_internal/commands/hash.py +59 -0
  30. venv/Lib/site-packages/pip/_internal/commands/help.py +41 -0
  31. venv/Lib/site-packages/pip/_internal/commands/index.py +139 -0
  32. venv/Lib/site-packages/pip/_internal/commands/inspect.py +92 -0
  33. venv/Lib/site-packages/pip/_internal/commands/install.py +778 -0
  34. venv/Lib/site-packages/pip/_internal/commands/list.py +368 -0
  35. venv/Lib/site-packages/pip/_internal/commands/search.py +174 -0
  36. venv/Lib/site-packages/pip/_internal/commands/show.py +189 -0
  37. venv/Lib/site-packages/pip/_internal/commands/uninstall.py +113 -0
  38. venv/Lib/site-packages/pip/_internal/commands/wheel.py +183 -0
  39. venv/Lib/site-packages/pip/_internal/configuration.py +381 -0
  40. venv/Lib/site-packages/pip/_internal/distributions/__init__.py +21 -0
  41. venv/Lib/site-packages/pip/_internal/distributions/base.py +39 -0
  42. venv/Lib/site-packages/pip/_internal/distributions/installed.py +23 -0
  43. venv/Lib/site-packages/pip/_internal/distributions/sdist.py +150 -0
  44. venv/Lib/site-packages/pip/_internal/distributions/wheel.py +34 -0
  45. venv/Lib/site-packages/pip/_internal/exceptions.py +733 -0
  46. venv/Lib/site-packages/pip/_internal/index/__init__.py +2 -0
  47. venv/Lib/site-packages/pip/_internal/index/collector.py +505 -0
  48. venv/Lib/site-packages/pip/_internal/index/package_finder.py +1029 -0
  49. venv/Lib/site-packages/pip/_internal/index/sources.py +223 -0
  50. venv/Lib/site-packages/pip/_internal/locations/__init__.py +467 -0
  51. venv/Lib/site-packages/pip/_internal/locations/_distutils.py +173 -0
  52. venv/Lib/site-packages/pip/_internal/locations/_sysconfig.py +213 -0
  53. venv/Lib/site-packages/pip/_internal/locations/base.py +81 -0
  54. venv/Lib/site-packages/pip/_internal/main.py +12 -0
  55. venv/Lib/site-packages/pip/_internal/metadata/__init__.py +127 -0
  56. venv/Lib/site-packages/pip/_internal/metadata/_json.py +84 -0
  57. venv/Lib/site-packages/pip/_internal/metadata/base.py +688 -0
  58. venv/Lib/site-packages/pip/_internal/metadata/importlib/__init__.py +4 -0
  59. venv/Lib/site-packages/pip/_internal/metadata/importlib/_compat.py +55 -0
  60. venv/Lib/site-packages/pip/_internal/metadata/importlib/_dists.py +224 -0
  61. venv/Lib/site-packages/pip/_internal/metadata/importlib/_envs.py +188 -0
  62. venv/Lib/site-packages/pip/_internal/metadata/pkg_resources.py +270 -0
  63. venv/Lib/site-packages/pip/_internal/models/__init__.py +2 -0
  64. venv/Lib/site-packages/pip/_internal/models/candidate.py +34 -0
  65. venv/Lib/site-packages/pip/_internal/models/direct_url.py +237 -0
  66. venv/Lib/site-packages/pip/_internal/models/format_control.py +80 -0
  67. venv/Lib/site-packages/pip/_internal/models/index.py +28 -0
  68. venv/Lib/site-packages/pip/_internal/models/installation_report.py +53 -0
  69. venv/Lib/site-packages/pip/_internal/models/link.py +581 -0
  70. venv/Lib/site-packages/pip/_internal/models/scheme.py +31 -0
  71. venv/Lib/site-packages/pip/_internal/models/search_scope.py +132 -0
  72. venv/Lib/site-packages/pip/_internal/models/selection_prefs.py +51 -0
  73. venv/Lib/site-packages/pip/_internal/models/target_python.py +110 -0
  74. venv/Lib/site-packages/pip/_internal/models/wheel.py +92 -0
  75. venv/Lib/site-packages/pip/_internal/network/__init__.py +2 -0
  76. venv/Lib/site-packages/pip/_internal/network/auth.py +561 -0
  77. venv/Lib/site-packages/pip/_internal/network/cache.py +69 -0
  78. venv/Lib/site-packages/pip/_internal/network/download.py +186 -0
  79. venv/Lib/site-packages/pip/_internal/network/lazy_wheel.py +210 -0
  80. venv/Lib/site-packages/pip/_internal/network/session.py +519 -0
  81. venv/Lib/site-packages/pip/_internal/network/utils.py +96 -0
  82. venv/Lib/site-packages/pip/_internal/network/xmlrpc.py +60 -0
  83. venv/Lib/site-packages/pip/_internal/operations/__init__.py +0 -0
  84. venv/Lib/site-packages/pip/_internal/operations/build/__init__.py +0 -0
  85. venv/Lib/site-packages/pip/_internal/operations/build/build_tracker.py +124 -0
  86. venv/Lib/site-packages/pip/_internal/operations/build/metadata.py +39 -0
  87. venv/Lib/site-packages/pip/_internal/operations/build/metadata_editable.py +41 -0
  88. venv/Lib/site-packages/pip/_internal/operations/build/metadata_legacy.py +74 -0
  89. venv/Lib/site-packages/pip/_internal/operations/build/wheel.py +37 -0
  90. venv/Lib/site-packages/pip/_internal/operations/build/wheel_editable.py +46 -0
  91. venv/Lib/site-packages/pip/_internal/operations/build/wheel_legacy.py +102 -0
  92. venv/Lib/site-packages/pip/_internal/operations/check.py +187 -0
  93. venv/Lib/site-packages/pip/_internal/operations/freeze.py +255 -0
  94. venv/Lib/site-packages/pip/_internal/operations/install/__init__.py +2 -0
  95. venv/Lib/site-packages/pip/_internal/operations/install/editable_legacy.py +46 -0
  96. venv/Lib/site-packages/pip/_internal/operations/install/wheel.py +740 -0
  97. venv/Lib/site-packages/pip/_internal/operations/prepare.py +743 -0
  98. venv/Lib/site-packages/pip/_internal/pyproject.py +179 -0
  99. venv/Lib/site-packages/pip/_internal/req/__init__.py +92 -0
  100. venv/Lib/site-packages/pip/_internal/req/constructors.py +506 -0
  101. venv/Lib/site-packages/pip/_internal/req/req_file.py +552 -0
  102. venv/Lib/site-packages/pip/_internal/req/req_install.py +874 -0
  103. venv/Lib/site-packages/pip/_internal/req/req_set.py +119 -0
  104. venv/Lib/site-packages/pip/_internal/req/req_uninstall.py +650 -0
  105. venv/Lib/site-packages/pip/_internal/resolution/__init__.py +0 -0
  106. venv/Lib/site-packages/pip/_internal/resolution/base.py +20 -0
  107. venv/Lib/site-packages/pip/_internal/resolution/legacy/__init__.py +0 -0
  108. venv/Lib/site-packages/pip/_internal/resolution/legacy/resolver.py +600 -0
  109. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/__init__.py +0 -0
  110. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/base.py +141 -0
  111. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/candidates.py +555 -0
  112. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/factory.py +730 -0
  113. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py +155 -0
  114. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/provider.py +255 -0
  115. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/reporter.py +80 -0
  116. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/requirements.py +165 -0
  117. venv/Lib/site-packages/pip/_internal/resolution/resolvelib/resolver.py +299 -0
  118. venv/Lib/site-packages/pip/_internal/self_outdated_check.py +242 -0
  119. venv/Lib/site-packages/pip/_internal/utils/__init__.py +0 -0
  120. venv/Lib/site-packages/pip/_internal/utils/_jaraco_text.py +109 -0
  121. venv/Lib/site-packages/pip/_internal/utils/_log.py +38 -0
  122. venv/Lib/site-packages/pip/_internal/utils/appdirs.py +52 -0
  123. venv/Lib/site-packages/pip/_internal/utils/compat.py +63 -0
  124. venv/Lib/site-packages/pip/_internal/utils/compatibility_tags.py +165 -0
  125. venv/Lib/site-packages/pip/_internal/utils/datetime.py +11 -0
  126. venv/Lib/site-packages/pip/_internal/utils/deprecation.py +120 -0
  127. venv/Lib/site-packages/pip/_internal/utils/direct_url_helpers.py +87 -0
  128. venv/Lib/site-packages/pip/_internal/utils/egg_link.py +72 -0
  129. venv/Lib/site-packages/pip/_internal/utils/encoding.py +36 -0
  130. venv/Lib/site-packages/pip/_internal/utils/entrypoints.py +84 -0
  131. venv/Lib/site-packages/pip/_internal/utils/filesystem.py +153 -0
  132. venv/Lib/site-packages/pip/_internal/utils/filetypes.py +27 -0
  133. venv/Lib/site-packages/pip/_internal/utils/glibc.py +88 -0
  134. venv/Lib/site-packages/pip/_internal/utils/hashes.py +151 -0
  135. venv/Lib/site-packages/pip/_internal/utils/inject_securetransport.py +35 -0
  136. venv/Lib/site-packages/pip/_internal/utils/logging.py +348 -0
  137. venv/Lib/site-packages/pip/_internal/utils/misc.py +735 -0
  138. venv/Lib/site-packages/pip/_internal/utils/models.py +39 -0
  139. venv/Lib/site-packages/pip/_internal/utils/packaging.py +57 -0
  140. venv/Lib/site-packages/pip/_internal/utils/setuptools_build.py +146 -0
  141. venv/Lib/site-packages/pip/_internal/utils/subprocess.py +260 -0
  142. venv/Lib/site-packages/pip/_internal/utils/temp_dir.py +246 -0
  143. venv/Lib/site-packages/pip/_internal/utils/unpacking.py +257 -0
  144. venv/Lib/site-packages/pip/_internal/utils/urls.py +62 -0
  145. venv/Lib/site-packages/pip/_internal/utils/virtualenv.py +104 -0
  146. venv/Lib/site-packages/pip/_internal/utils/wheel.py +136 -0
  147. venv/Lib/site-packages/pip/_internal/vcs/__init__.py +15 -0
  148. venv/Lib/site-packages/pip/_internal/vcs/bazaar.py +112 -0
  149. venv/Lib/site-packages/pip/_internal/vcs/git.py +526 -0
  150. venv/Lib/site-packages/pip/_internal/vcs/mercurial.py +163 -0
  151. venv/Lib/site-packages/pip/_internal/vcs/subversion.py +324 -0
  152. venv/Lib/site-packages/pip/_internal/vcs/versioncontrol.py +705 -0
  153. venv/Lib/site-packages/pip/_internal/wheel_builder.py +355 -0
  154. venv/Lib/site-packages/pip/_vendor/__init__.py +120 -0
  155. venv/Lib/site-packages/pip/_vendor/cachecontrol/__init__.py +18 -0
  156. venv/Lib/site-packages/pip/_vendor/cachecontrol/_cmd.py +61 -0
  157. venv/Lib/site-packages/pip/_vendor/cachecontrol/adapter.py +137 -0
  158. venv/Lib/site-packages/pip/_vendor/cachecontrol/cache.py +65 -0
  159. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/__init__.py +9 -0
  160. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/file_cache.py +188 -0
  161. venv/Lib/site-packages/pip/_vendor/cachecontrol/caches/redis_cache.py +39 -0
  162. venv/Lib/site-packages/pip/_vendor/cachecontrol/compat.py +32 -0
  163. venv/Lib/site-packages/pip/_vendor/cachecontrol/controller.py +439 -0
  164. venv/Lib/site-packages/pip/_vendor/cachecontrol/filewrapper.py +111 -0
  165. venv/Lib/site-packages/pip/_vendor/cachecontrol/heuristics.py +139 -0
  166. venv/Lib/site-packages/pip/_vendor/cachecontrol/serialize.py +190 -0
  167. venv/Lib/site-packages/pip/_vendor/cachecontrol/wrapper.py +33 -0
  168. venv/Lib/site-packages/pip/_vendor/certifi/__init__.py +4 -0
  169. venv/Lib/site-packages/pip/_vendor/certifi/__main__.py +12 -0
  170. venv/Lib/site-packages/pip/_vendor/certifi/core.py +108 -0
  171. venv/Lib/site-packages/pip/_vendor/chardet/__init__.py +115 -0
  172. venv/Lib/site-packages/pip/_vendor/chardet/big5freq.py +386 -0
  173. venv/Lib/site-packages/pip/_vendor/chardet/big5prober.py +47 -0
  174. venv/Lib/site-packages/pip/_vendor/chardet/chardistribution.py +261 -0
  175. venv/Lib/site-packages/pip/_vendor/chardet/charsetgroupprober.py +106 -0
  176. venv/Lib/site-packages/pip/_vendor/chardet/charsetprober.py +147 -0
  177. venv/Lib/site-packages/pip/_vendor/chardet/cli/__init__.py +0 -0
  178. venv/Lib/site-packages/pip/_vendor/chardet/cli/chardetect.py +112 -0
  179. venv/Lib/site-packages/pip/_vendor/chardet/codingstatemachine.py +90 -0
  180. venv/Lib/site-packages/pip/_vendor/chardet/codingstatemachinedict.py +19 -0
  181. venv/Lib/site-packages/pip/_vendor/chardet/cp949prober.py +49 -0
  182. venv/Lib/site-packages/pip/_vendor/chardet/enums.py +85 -0
  183. venv/Lib/site-packages/pip/_vendor/chardet/escprober.py +102 -0
  184. venv/Lib/site-packages/pip/_vendor/chardet/escsm.py +261 -0
  185. venv/Lib/site-packages/pip/_vendor/chardet/eucjpprober.py +102 -0
  186. venv/Lib/site-packages/pip/_vendor/chardet/euckrfreq.py +196 -0
  187. venv/Lib/site-packages/pip/_vendor/chardet/euckrprober.py +47 -0
  188. venv/Lib/site-packages/pip/_vendor/chardet/euctwfreq.py +388 -0
  189. venv/Lib/site-packages/pip/_vendor/chardet/euctwprober.py +47 -0
  190. venv/Lib/site-packages/pip/_vendor/chardet/gb2312freq.py +284 -0
  191. venv/Lib/site-packages/pip/_vendor/chardet/gb2312prober.py +47 -0
  192. venv/Lib/site-packages/pip/_vendor/chardet/hebrewprober.py +316 -0
  193. venv/Lib/site-packages/pip/_vendor/chardet/jisfreq.py +325 -0
  194. venv/Lib/site-packages/pip/_vendor/chardet/johabfreq.py +2382 -0
  195. venv/Lib/site-packages/pip/_vendor/chardet/johabprober.py +47 -0
  196. venv/Lib/site-packages/pip/_vendor/chardet/jpcntx.py +238 -0
  197. venv/Lib/site-packages/pip/_vendor/chardet/langbulgarianmodel.py +4649 -0
  198. venv/Lib/site-packages/pip/_vendor/chardet/langgreekmodel.py +4397 -0
  199. venv/Lib/site-packages/pip/_vendor/chardet/langhebrewmodel.py +4380 -0
  200. venv/Lib/site-packages/pip/_vendor/chardet/langhungarianmodel.py +4649 -0
  201. venv/Lib/site-packages/pip/_vendor/chardet/langrussianmodel.py +5725 -0
  202. venv/Lib/site-packages/pip/_vendor/chardet/langthaimodel.py +4380 -0
  203. venv/Lib/site-packages/pip/_vendor/chardet/langturkishmodel.py +4380 -0
  204. venv/Lib/site-packages/pip/_vendor/chardet/latin1prober.py +147 -0
  205. venv/Lib/site-packages/pip/_vendor/chardet/macromanprober.py +162 -0
  206. venv/Lib/site-packages/pip/_vendor/chardet/mbcharsetprober.py +95 -0
  207. venv/Lib/site-packages/pip/_vendor/chardet/mbcsgroupprober.py +57 -0
  208. venv/Lib/site-packages/pip/_vendor/chardet/mbcssm.py +661 -0
  209. venv/Lib/site-packages/pip/_vendor/chardet/metadata/__init__.py +0 -0
  210. venv/Lib/site-packages/pip/_vendor/chardet/metadata/languages.py +352 -0
  211. venv/Lib/site-packages/pip/_vendor/chardet/resultdict.py +16 -0
  212. venv/Lib/site-packages/pip/_vendor/chardet/sbcharsetprober.py +162 -0
  213. venv/Lib/site-packages/pip/_vendor/chardet/sbcsgroupprober.py +88 -0
  214. venv/Lib/site-packages/pip/_vendor/chardet/sjisprober.py +105 -0
  215. venv/Lib/site-packages/pip/_vendor/chardet/universaldetector.py +362 -0
  216. venv/Lib/site-packages/pip/_vendor/chardet/utf1632prober.py +225 -0
  217. venv/Lib/site-packages/pip/_vendor/chardet/utf8prober.py +82 -0
  218. venv/Lib/site-packages/pip/_vendor/chardet/version.py +9 -0
  219. venv/Lib/site-packages/pip/_vendor/colorama/__init__.py +7 -0
  220. venv/Lib/site-packages/pip/_vendor/colorama/ansi.py +102 -0
  221. venv/Lib/site-packages/pip/_vendor/colorama/ansitowin32.py +277 -0
  222. venv/Lib/site-packages/pip/_vendor/colorama/initialise.py +121 -0
  223. venv/Lib/site-packages/pip/_vendor/colorama/tests/__init__.py +1 -0
  224. venv/Lib/site-packages/pip/_vendor/colorama/tests/ansi_test.py +76 -0
  225. venv/Lib/site-packages/pip/_vendor/colorama/tests/ansitowin32_test.py +294 -0
  226. venv/Lib/site-packages/pip/_vendor/colorama/tests/initialise_test.py +189 -0
  227. venv/Lib/site-packages/pip/_vendor/colorama/tests/isatty_test.py +57 -0
  228. venv/Lib/site-packages/pip/_vendor/colorama/tests/utils.py +49 -0
  229. venv/Lib/site-packages/pip/_vendor/colorama/tests/winterm_test.py +131 -0
  230. venv/Lib/site-packages/pip/_vendor/colorama/win32.py +180 -0
  231. venv/Lib/site-packages/pip/_vendor/colorama/winterm.py +195 -0
  232. venv/Lib/site-packages/pip/_vendor/distlib/__init__.py +23 -0
  233. venv/Lib/site-packages/pip/_vendor/distlib/compat.py +1116 -0
  234. venv/Lib/site-packages/pip/_vendor/distlib/database.py +1350 -0
  235. venv/Lib/site-packages/pip/_vendor/distlib/index.py +508 -0
  236. venv/Lib/site-packages/pip/_vendor/distlib/locators.py +1300 -0
  237. venv/Lib/site-packages/pip/_vendor/distlib/manifest.py +393 -0
  238. venv/Lib/site-packages/pip/_vendor/distlib/markers.py +152 -0
  239. venv/Lib/site-packages/pip/_vendor/distlib/metadata.py +1076 -0
  240. venv/Lib/site-packages/pip/_vendor/distlib/resources.py +358 -0
  241. venv/Lib/site-packages/pip/_vendor/distlib/scripts.py +437 -0
  242. venv/Lib/site-packages/pip/_vendor/distlib/util.py +1932 -0
  243. venv/Lib/site-packages/pip/_vendor/distlib/version.py +739 -0
  244. venv/Lib/site-packages/pip/_vendor/distlib/wheel.py +1082 -0
  245. venv/Lib/site-packages/pip/_vendor/distro/__init__.py +54 -0
  246. venv/Lib/site-packages/pip/_vendor/distro/__main__.py +4 -0
  247. venv/Lib/site-packages/pip/_vendor/distro/distro.py +1399 -0
  248. venv/Lib/site-packages/pip/_vendor/idna/__init__.py +44 -0
  249. venv/Lib/site-packages/pip/_vendor/idna/codec.py +112 -0
  250. venv/Lib/site-packages/pip/_vendor/idna/compat.py +13 -0
  251. venv/Lib/site-packages/pip/_vendor/idna/core.py +400 -0
  252. venv/Lib/site-packages/pip/_vendor/idna/idnadata.py +2151 -0
  253. venv/Lib/site-packages/pip/_vendor/idna/intranges.py +54 -0
  254. venv/Lib/site-packages/pip/_vendor/idna/package_data.py +2 -0
  255. venv/Lib/site-packages/pip/_vendor/idna/uts46data.py +8600 -0
  256. venv/Lib/site-packages/pip/_vendor/msgpack/__init__.py +57 -0
  257. venv/Lib/site-packages/pip/_vendor/msgpack/exceptions.py +48 -0
  258. venv/Lib/site-packages/pip/_vendor/msgpack/ext.py +193 -0
  259. venv/Lib/site-packages/pip/_vendor/msgpack/fallback.py +1010 -0
  260. venv/Lib/site-packages/pip/_vendor/packaging/__about__.py +26 -0
  261. venv/Lib/site-packages/pip/_vendor/packaging/__init__.py +25 -0
  262. venv/Lib/site-packages/pip/_vendor/packaging/_manylinux.py +301 -0
  263. venv/Lib/site-packages/pip/_vendor/packaging/_musllinux.py +136 -0
  264. venv/Lib/site-packages/pip/_vendor/packaging/_structures.py +61 -0
  265. venv/Lib/site-packages/pip/_vendor/packaging/markers.py +304 -0
  266. venv/Lib/site-packages/pip/_vendor/packaging/requirements.py +146 -0
  267. venv/Lib/site-packages/pip/_vendor/packaging/specifiers.py +802 -0
  268. venv/Lib/site-packages/pip/_vendor/packaging/tags.py +487 -0
  269. venv/Lib/site-packages/pip/_vendor/packaging/utils.py +136 -0
  270. venv/Lib/site-packages/pip/_vendor/packaging/version.py +504 -0
  271. venv/Lib/site-packages/pip/_vendor/pkg_resources/__init__.py +3361 -0
  272. venv/Lib/site-packages/pip/_vendor/platformdirs/__init__.py +566 -0
  273. venv/Lib/site-packages/pip/_vendor/platformdirs/__main__.py +53 -0
  274. venv/Lib/site-packages/pip/_vendor/platformdirs/android.py +210 -0
  275. venv/Lib/site-packages/pip/_vendor/platformdirs/api.py +223 -0
  276. venv/Lib/site-packages/pip/_vendor/platformdirs/macos.py +91 -0
  277. venv/Lib/site-packages/pip/_vendor/platformdirs/unix.py +223 -0
  278. venv/Lib/site-packages/pip/_vendor/platformdirs/version.py +4 -0
  279. venv/Lib/site-packages/pip/_vendor/platformdirs/windows.py +255 -0
  280. venv/Lib/site-packages/pip/_vendor/pygments/__init__.py +82 -0
  281. venv/Lib/site-packages/pip/_vendor/pygments/__main__.py +17 -0
  282. venv/Lib/site-packages/pip/_vendor/pygments/cmdline.py +668 -0
  283. venv/Lib/site-packages/pip/_vendor/pygments/console.py +70 -0
  284. venv/Lib/site-packages/pip/_vendor/pygments/filter.py +71 -0
  285. venv/Lib/site-packages/pip/_vendor/pygments/filters/__init__.py +940 -0
  286. venv/Lib/site-packages/pip/_vendor/pygments/formatter.py +124 -0
  287. venv/Lib/site-packages/pip/_vendor/pygments/formatters/__init__.py +158 -0
  288. venv/Lib/site-packages/pip/_vendor/pygments/formatters/_mapping.py +23 -0
  289. venv/Lib/site-packages/pip/_vendor/pygments/formatters/bbcode.py +108 -0
  290. venv/Lib/site-packages/pip/_vendor/pygments/formatters/groff.py +170 -0
  291. venv/Lib/site-packages/pip/_vendor/pygments/formatters/html.py +989 -0
  292. venv/Lib/site-packages/pip/_vendor/pygments/formatters/img.py +645 -0
  293. venv/Lib/site-packages/pip/_vendor/pygments/formatters/irc.py +154 -0
  294. venv/Lib/site-packages/pip/_vendor/pygments/formatters/latex.py +521 -0
  295. venv/Lib/site-packages/pip/_vendor/pygments/formatters/other.py +161 -0
  296. venv/Lib/site-packages/pip/_vendor/pygments/formatters/pangomarkup.py +83 -0
  297. venv/Lib/site-packages/pip/_vendor/pygments/formatters/rtf.py +146 -0
  298. venv/Lib/site-packages/pip/_vendor/pygments/formatters/svg.py +188 -0
  299. venv/Lib/site-packages/pip/_vendor/pygments/formatters/terminal.py +127 -0
  300. venv/Lib/site-packages/pip/_vendor/pygments/formatters/terminal256.py +338 -0
  301. venv/Lib/site-packages/pip/_vendor/pygments/lexer.py +943 -0
  302. venv/Lib/site-packages/pip/_vendor/pygments/lexers/__init__.py +362 -0
  303. venv/Lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py +559 -0
  304. venv/Lib/site-packages/pip/_vendor/pygments/lexers/python.py +1198 -0
  305. venv/Lib/site-packages/pip/_vendor/pygments/modeline.py +43 -0
  306. venv/Lib/site-packages/pip/_vendor/pygments/plugin.py +88 -0
  307. venv/Lib/site-packages/pip/_vendor/pygments/regexopt.py +91 -0
  308. venv/Lib/site-packages/pip/_vendor/pygments/scanner.py +104 -0
  309. venv/Lib/site-packages/pip/_vendor/pygments/sphinxext.py +217 -0
  310. venv/Lib/site-packages/pip/_vendor/pygments/style.py +197 -0
  311. venv/Lib/site-packages/pip/_vendor/pygments/styles/__init__.py +103 -0
  312. venv/Lib/site-packages/pip/_vendor/pygments/token.py +213 -0
  313. venv/Lib/site-packages/pip/_vendor/pygments/unistring.py +153 -0
  314. venv/Lib/site-packages/pip/_vendor/pygments/util.py +330 -0
  315. venv/Lib/site-packages/pip/_vendor/pyparsing/__init__.py +322 -0
  316. venv/Lib/site-packages/pip/_vendor/pyparsing/actions.py +217 -0
  317. venv/Lib/site-packages/pip/_vendor/pyparsing/common.py +432 -0
  318. venv/Lib/site-packages/pip/_vendor/pyparsing/core.py +6115 -0
  319. venv/Lib/site-packages/pip/_vendor/pyparsing/diagram/__init__.py +656 -0
  320. venv/Lib/site-packages/pip/_vendor/pyparsing/exceptions.py +299 -0
  321. venv/Lib/site-packages/pip/_vendor/pyparsing/helpers.py +1100 -0
  322. venv/Lib/site-packages/pip/_vendor/pyparsing/results.py +796 -0
  323. venv/Lib/site-packages/pip/_vendor/pyparsing/testing.py +331 -0
  324. venv/Lib/site-packages/pip/_vendor/pyparsing/unicode.py +361 -0
  325. venv/Lib/site-packages/pip/_vendor/pyparsing/util.py +284 -0
  326. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/__init__.py +23 -0
  327. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_compat.py +8 -0
  328. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_impl.py +330 -0
  329. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/__init__.py +18 -0
  330. venv/Lib/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py +353 -0
  331. venv/Lib/site-packages/pip/_vendor/requests/__init__.py +182 -0
  332. venv/Lib/site-packages/pip/_vendor/requests/__version__.py +14 -0
  333. venv/Lib/site-packages/pip/_vendor/requests/_internal_utils.py +50 -0
  334. venv/Lib/site-packages/pip/_vendor/requests/adapters.py +538 -0
  335. venv/Lib/site-packages/pip/_vendor/requests/api.py +157 -0
  336. venv/Lib/site-packages/pip/_vendor/requests/auth.py +315 -0
  337. venv/Lib/site-packages/pip/_vendor/requests/certs.py +24 -0
  338. venv/Lib/site-packages/pip/_vendor/requests/compat.py +67 -0
  339. venv/Lib/site-packages/pip/_vendor/requests/cookies.py +561 -0
  340. venv/Lib/site-packages/pip/_vendor/requests/exceptions.py +141 -0
  341. venv/Lib/site-packages/pip/_vendor/requests/help.py +131 -0
  342. venv/Lib/site-packages/pip/_vendor/requests/hooks.py +33 -0
  343. venv/Lib/site-packages/pip/_vendor/requests/models.py +1034 -0
  344. venv/Lib/site-packages/pip/_vendor/requests/packages.py +16 -0
  345. venv/Lib/site-packages/pip/_vendor/requests/sessions.py +833 -0
  346. venv/Lib/site-packages/pip/_vendor/requests/status_codes.py +128 -0
  347. venv/Lib/site-packages/pip/_vendor/requests/structures.py +99 -0
  348. venv/Lib/site-packages/pip/_vendor/requests/utils.py +1094 -0
  349. venv/Lib/site-packages/pip/_vendor/resolvelib/__init__.py +26 -0
  350. venv/Lib/site-packages/pip/_vendor/resolvelib/compat/__init__.py +0 -0
  351. venv/Lib/site-packages/pip/_vendor/resolvelib/compat/collections_abc.py +6 -0
  352. venv/Lib/site-packages/pip/_vendor/resolvelib/providers.py +133 -0
  353. venv/Lib/site-packages/pip/_vendor/resolvelib/reporters.py +43 -0
  354. venv/Lib/site-packages/pip/_vendor/resolvelib/resolvers.py +547 -0
  355. venv/Lib/site-packages/pip/_vendor/resolvelib/structs.py +170 -0
  356. venv/Lib/site-packages/pip/_vendor/rich/__init__.py +177 -0
  357. venv/Lib/site-packages/pip/_vendor/rich/__main__.py +274 -0
  358. venv/Lib/site-packages/pip/_vendor/rich/_cell_widths.py +451 -0
  359. venv/Lib/site-packages/pip/_vendor/rich/_emoji_codes.py +3610 -0
  360. venv/Lib/site-packages/pip/_vendor/rich/_emoji_replace.py +32 -0
  361. venv/Lib/site-packages/pip/_vendor/rich/_export_format.py +76 -0
  362. venv/Lib/site-packages/pip/_vendor/rich/_extension.py +10 -0
  363. venv/Lib/site-packages/pip/_vendor/rich/_fileno.py +24 -0
  364. venv/Lib/site-packages/pip/_vendor/rich/_inspect.py +270 -0
  365. venv/Lib/site-packages/pip/_vendor/rich/_log_render.py +94 -0
  366. venv/Lib/site-packages/pip/_vendor/rich/_loop.py +43 -0
  367. venv/Lib/site-packages/pip/_vendor/rich/_null_file.py +69 -0
  368. venv/Lib/site-packages/pip/_vendor/rich/_palettes.py +309 -0
  369. venv/Lib/site-packages/pip/_vendor/rich/_pick.py +17 -0
  370. venv/Lib/site-packages/pip/_vendor/rich/_ratio.py +160 -0
  371. venv/Lib/site-packages/pip/_vendor/rich/_spinners.py +482 -0
  372. venv/Lib/site-packages/pip/_vendor/rich/_stack.py +16 -0
  373. venv/Lib/site-packages/pip/_vendor/rich/_timer.py +19 -0
  374. venv/Lib/site-packages/pip/_vendor/rich/_win32_console.py +662 -0
  375. venv/Lib/site-packages/pip/_vendor/rich/_windows.py +72 -0
  376. venv/Lib/site-packages/pip/_vendor/rich/_windows_renderer.py +56 -0
  377. venv/Lib/site-packages/pip/_vendor/rich/_wrap.py +56 -0
  378. venv/Lib/site-packages/pip/_vendor/rich/abc.py +33 -0
  379. venv/Lib/site-packages/pip/_vendor/rich/align.py +311 -0
  380. venv/Lib/site-packages/pip/_vendor/rich/ansi.py +240 -0
  381. venv/Lib/site-packages/pip/_vendor/rich/bar.py +94 -0
  382. venv/Lib/site-packages/pip/_vendor/rich/box.py +517 -0
  383. venv/Lib/site-packages/pip/_vendor/rich/cells.py +154 -0
  384. venv/Lib/site-packages/pip/_vendor/rich/color.py +622 -0
  385. venv/Lib/site-packages/pip/_vendor/rich/color_triplet.py +38 -0
  386. venv/Lib/site-packages/pip/_vendor/rich/columns.py +187 -0
  387. venv/Lib/site-packages/pip/_vendor/rich/console.py +2633 -0
  388. venv/Lib/site-packages/pip/_vendor/rich/constrain.py +37 -0
  389. venv/Lib/site-packages/pip/_vendor/rich/containers.py +167 -0
  390. venv/Lib/site-packages/pip/_vendor/rich/control.py +225 -0
  391. venv/Lib/site-packages/pip/_vendor/rich/default_styles.py +190 -0
  392. venv/Lib/site-packages/pip/_vendor/rich/diagnose.py +37 -0
  393. venv/Lib/site-packages/pip/_vendor/rich/emoji.py +96 -0
  394. venv/Lib/site-packages/pip/_vendor/rich/errors.py +34 -0
  395. venv/Lib/site-packages/pip/_vendor/rich/file_proxy.py +57 -0
  396. venv/Lib/site-packages/pip/_vendor/rich/filesize.py +89 -0
  397. venv/Lib/site-packages/pip/_vendor/rich/highlighter.py +232 -0
  398. venv/Lib/site-packages/pip/_vendor/rich/json.py +140 -0
  399. venv/Lib/site-packages/pip/_vendor/rich/jupyter.py +101 -0
  400. venv/Lib/site-packages/pip/_vendor/rich/layout.py +443 -0
  401. venv/Lib/site-packages/pip/_vendor/rich/live.py +375 -0
  402. venv/Lib/site-packages/pip/_vendor/rich/live_render.py +113 -0
  403. venv/Lib/site-packages/pip/_vendor/rich/logging.py +289 -0
  404. venv/Lib/site-packages/pip/_vendor/rich/markup.py +246 -0
  405. venv/Lib/site-packages/pip/_vendor/rich/measure.py +151 -0
  406. venv/Lib/site-packages/pip/_vendor/rich/padding.py +141 -0
  407. venv/Lib/site-packages/pip/_vendor/rich/pager.py +34 -0
  408. venv/Lib/site-packages/pip/_vendor/rich/palette.py +100 -0
  409. venv/Lib/site-packages/pip/_vendor/rich/panel.py +308 -0
  410. venv/Lib/site-packages/pip/_vendor/rich/pretty.py +994 -0
  411. venv/Lib/site-packages/pip/_vendor/rich/progress.py +1702 -0
  412. venv/Lib/site-packages/pip/_vendor/rich/progress_bar.py +224 -0
  413. venv/Lib/site-packages/pip/_vendor/rich/prompt.py +376 -0
  414. venv/Lib/site-packages/pip/_vendor/rich/protocol.py +42 -0
  415. venv/Lib/site-packages/pip/_vendor/rich/region.py +10 -0
  416. venv/Lib/site-packages/pip/_vendor/rich/repr.py +149 -0
  417. venv/Lib/site-packages/pip/_vendor/rich/rule.py +130 -0
  418. venv/Lib/site-packages/pip/_vendor/rich/scope.py +86 -0
  419. venv/Lib/site-packages/pip/_vendor/rich/screen.py +54 -0
  420. venv/Lib/site-packages/pip/_vendor/rich/segment.py +739 -0
  421. venv/Lib/site-packages/pip/_vendor/rich/spinner.py +137 -0
  422. venv/Lib/site-packages/pip/_vendor/rich/status.py +132 -0
  423. venv/Lib/site-packages/pip/_vendor/rich/style.py +796 -0
  424. venv/Lib/site-packages/pip/_vendor/rich/styled.py +42 -0
  425. venv/Lib/site-packages/pip/_vendor/rich/syntax.py +948 -0
  426. venv/Lib/site-packages/pip/_vendor/rich/table.py +1002 -0
  427. venv/Lib/site-packages/pip/_vendor/rich/terminal_theme.py +153 -0
  428. venv/Lib/site-packages/pip/_vendor/rich/text.py +1307 -0
  429. venv/Lib/site-packages/pip/_vendor/rich/theme.py +115 -0
  430. venv/Lib/site-packages/pip/_vendor/rich/themes.py +5 -0
  431. venv/Lib/site-packages/pip/_vendor/rich/traceback.py +756 -0
  432. venv/Lib/site-packages/pip/_vendor/rich/tree.py +251 -0
  433. venv/Lib/site-packages/pip/_vendor/six.py +998 -0
  434. venv/Lib/site-packages/pip/_vendor/tenacity/__init__.py +608 -0
  435. venv/Lib/site-packages/pip/_vendor/tenacity/_asyncio.py +94 -0
  436. venv/Lib/site-packages/pip/_vendor/tenacity/_utils.py +76 -0
  437. venv/Lib/site-packages/pip/_vendor/tenacity/after.py +51 -0
  438. venv/Lib/site-packages/pip/_vendor/tenacity/before.py +46 -0
  439. venv/Lib/site-packages/pip/_vendor/tenacity/before_sleep.py +71 -0
  440. venv/Lib/site-packages/pip/_vendor/tenacity/nap.py +43 -0
  441. venv/Lib/site-packages/pip/_vendor/tenacity/retry.py +272 -0
  442. venv/Lib/site-packages/pip/_vendor/tenacity/stop.py +103 -0
  443. venv/Lib/site-packages/pip/_vendor/tenacity/tornadoweb.py +59 -0
  444. venv/Lib/site-packages/pip/_vendor/tenacity/wait.py +228 -0
  445. venv/Lib/site-packages/pip/_vendor/tomli/__init__.py +11 -0
  446. venv/Lib/site-packages/pip/_vendor/tomli/_parser.py +691 -0
  447. venv/Lib/site-packages/pip/_vendor/tomli/_re.py +107 -0
  448. venv/Lib/site-packages/pip/_vendor/tomli/_types.py +10 -0
  449. venv/Lib/site-packages/pip/_vendor/typing_extensions.py +3072 -0
  450. venv/Lib/site-packages/pip/_vendor/urllib3/__init__.py +102 -0
  451. venv/Lib/site-packages/pip/_vendor/urllib3/_collections.py +337 -0
  452. venv/Lib/site-packages/pip/_vendor/urllib3/_version.py +2 -0
  453. venv/Lib/site-packages/pip/_vendor/urllib3/connection.py +572 -0
  454. venv/Lib/site-packages/pip/_vendor/urllib3/connectionpool.py +1132 -0
  455. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/__init__.py +0 -0
  456. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_appengine_environ.py +36 -0
  457. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/__init__.py +0 -0
  458. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/bindings.py +519 -0
  459. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/_securetransport/low_level.py +397 -0
  460. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/appengine.py +314 -0
  461. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/ntlmpool.py +130 -0
  462. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/pyopenssl.py +518 -0
  463. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/securetransport.py +921 -0
  464. venv/Lib/site-packages/pip/_vendor/urllib3/contrib/socks.py +216 -0
  465. venv/Lib/site-packages/pip/_vendor/urllib3/exceptions.py +323 -0
  466. venv/Lib/site-packages/pip/_vendor/urllib3/fields.py +274 -0
  467. venv/Lib/site-packages/pip/_vendor/urllib3/filepost.py +98 -0
  468. venv/Lib/site-packages/pip/_vendor/urllib3/packages/__init__.py +0 -0
  469. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/__init__.py +0 -0
  470. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/makefile.py +51 -0
  471. venv/Lib/site-packages/pip/_vendor/urllib3/packages/backports/weakref_finalize.py +155 -0
  472. venv/Lib/site-packages/pip/_vendor/urllib3/packages/six.py +1076 -0
  473. venv/Lib/site-packages/pip/_vendor/urllib3/poolmanager.py +537 -0
  474. venv/Lib/site-packages/pip/_vendor/urllib3/request.py +170 -0
  475. venv/Lib/site-packages/pip/_vendor/urllib3/response.py +879 -0
  476. venv/Lib/site-packages/pip/_vendor/urllib3/util/__init__.py +49 -0
  477. venv/Lib/site-packages/pip/_vendor/urllib3/util/connection.py +149 -0
  478. venv/Lib/site-packages/pip/_vendor/urllib3/util/proxy.py +57 -0
  479. venv/Lib/site-packages/pip/_vendor/urllib3/util/queue.py +22 -0
  480. venv/Lib/site-packages/pip/_vendor/urllib3/util/request.py +137 -0
  481. venv/Lib/site-packages/pip/_vendor/urllib3/util/response.py +107 -0
  482. venv/Lib/site-packages/pip/_vendor/urllib3/util/retry.py +620 -0
  483. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_.py +495 -0
  484. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssl_match_hostname.py +159 -0
  485. venv/Lib/site-packages/pip/_vendor/urllib3/util/ssltransport.py +221 -0
  486. venv/Lib/site-packages/pip/_vendor/urllib3/util/timeout.py +271 -0
  487. venv/Lib/site-packages/pip/_vendor/urllib3/util/url.py +435 -0
  488. venv/Lib/site-packages/pip/_vendor/urllib3/util/wait.py +152 -0
  489. venv/Lib/site-packages/pip/_vendor/webencodings/__init__.py +342 -0
  490. venv/Lib/site-packages/pip/_vendor/webencodings/labels.py +231 -0
  491. venv/Lib/site-packages/pip/_vendor/webencodings/mklabels.py +59 -0
  492. venv/Lib/site-packages/pip/_vendor/webencodings/tests.py +153 -0
  493. venv/Lib/site-packages/pip/_vendor/webencodings/x_user_defined.py +325 -0
  494. venv/Lib/site-packages/pip/py.typed +4 -0
  495. venv/Lib/site-packages/pkg_resources/__init__.py +3296 -0
  496. venv/Lib/site-packages/pkg_resources/_vendor/__init__.py +0 -0
  497. venv/Lib/site-packages/pkg_resources/_vendor/appdirs.py +608 -0
  498. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/__init__.py +36 -0
  499. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_adapters.py +170 -0
  500. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_common.py +104 -0
  501. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_compat.py +98 -0
  502. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_itertools.py +35 -0
  503. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/_legacy.py +121 -0
  504. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/abc.py +137 -0
  505. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/readers.py +122 -0
  506. venv/Lib/site-packages/pkg_resources/_vendor/importlib_resources/simple.py +116 -0
  507. venv/Lib/site-packages/pkg_resources/_vendor/jaraco/__init__.py +0 -0
  508. venv/Lib/site-packages/pkg_resources/_vendor/jaraco/context.py +213 -0
  509. venv/Lib/site-packages/pkg_resources/_vendor/jaraco/functools.py +525 -0
  510. venv/Lib/site-packages/pkg_resources/_vendor/jaraco/text/__init__.py +599 -0
  511. venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/__init__.py +4 -0
  512. venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/more.py +4316 -0
  513. venv/Lib/site-packages/pkg_resources/_vendor/more_itertools/recipes.py +698 -0
  514. venv/Lib/site-packages/pkg_resources/_vendor/packaging/__about__.py +26 -0
  515. venv/Lib/site-packages/pkg_resources/_vendor/packaging/__init__.py +25 -0
  516. venv/Lib/site-packages/pkg_resources/_vendor/packaging/_manylinux.py +301 -0
  517. venv/Lib/site-packages/pkg_resources/_vendor/packaging/_musllinux.py +136 -0
  518. venv/Lib/site-packages/pkg_resources/_vendor/packaging/_structures.py +61 -0
  519. venv/Lib/site-packages/pkg_resources/_vendor/packaging/markers.py +304 -0
  520. venv/Lib/site-packages/pkg_resources/_vendor/packaging/requirements.py +146 -0
  521. venv/Lib/site-packages/pkg_resources/_vendor/packaging/specifiers.py +802 -0
  522. venv/Lib/site-packages/pkg_resources/_vendor/packaging/tags.py +487 -0
  523. venv/Lib/site-packages/pkg_resources/_vendor/packaging/utils.py +136 -0
  524. venv/Lib/site-packages/pkg_resources/_vendor/packaging/version.py +504 -0
  525. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/__init__.py +331 -0
  526. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/actions.py +207 -0
  527. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/common.py +424 -0
  528. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/core.py +5814 -0
  529. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/diagram/__init__.py +642 -0
  530. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/exceptions.py +267 -0
  531. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/helpers.py +1088 -0
  532. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/results.py +760 -0
  533. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/testing.py +331 -0
  534. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/unicode.py +352 -0
  535. venv/Lib/site-packages/pkg_resources/_vendor/pyparsing/util.py +235 -0
  536. venv/Lib/site-packages/pkg_resources/_vendor/zipp.py +329 -0
  537. venv/Lib/site-packages/pkg_resources/extern/__init__.py +76 -0
  538. venv/Lib/site-packages/setuptools/__init__.py +247 -0
  539. venv/Lib/site-packages/setuptools/_deprecation_warning.py +7 -0
  540. venv/Lib/site-packages/setuptools/_distutils/__init__.py +24 -0
  541. venv/Lib/site-packages/setuptools/_distutils/_collections.py +56 -0
  542. venv/Lib/site-packages/setuptools/_distutils/_functools.py +20 -0
  543. venv/Lib/site-packages/setuptools/_distutils/_macos_compat.py +12 -0
  544. venv/Lib/site-packages/setuptools/_distutils/_msvccompiler.py +572 -0
  545. venv/Lib/site-packages/setuptools/_distutils/archive_util.py +280 -0
  546. venv/Lib/site-packages/setuptools/_distutils/bcppcompiler.py +408 -0
  547. venv/Lib/site-packages/setuptools/_distutils/ccompiler.py +1220 -0
  548. venv/Lib/site-packages/setuptools/_distutils/cmd.py +436 -0
  549. venv/Lib/site-packages/setuptools/_distutils/command/__init__.py +25 -0
  550. venv/Lib/site-packages/setuptools/_distutils/command/_framework_compat.py +55 -0
  551. venv/Lib/site-packages/setuptools/_distutils/command/bdist.py +157 -0
  552. venv/Lib/site-packages/setuptools/_distutils/command/bdist_dumb.py +144 -0
  553. venv/Lib/site-packages/setuptools/_distutils/command/bdist_rpm.py +615 -0
  554. venv/Lib/site-packages/setuptools/_distutils/command/build.py +153 -0
  555. venv/Lib/site-packages/setuptools/_distutils/command/build_clib.py +208 -0
  556. venv/Lib/site-packages/setuptools/_distutils/command/build_ext.py +787 -0
  557. venv/Lib/site-packages/setuptools/_distutils/command/build_py.py +407 -0
  558. venv/Lib/site-packages/setuptools/_distutils/command/build_scripts.py +173 -0
  559. venv/Lib/site-packages/setuptools/_distutils/command/check.py +151 -0
  560. venv/Lib/site-packages/setuptools/_distutils/command/clean.py +76 -0
  561. venv/Lib/site-packages/setuptools/_distutils/command/config.py +377 -0
  562. venv/Lib/site-packages/setuptools/_distutils/command/install.py +814 -0
  563. venv/Lib/site-packages/setuptools/_distutils/command/install_data.py +84 -0
  564. venv/Lib/site-packages/setuptools/_distutils/command/install_egg_info.py +91 -0
  565. venv/Lib/site-packages/setuptools/_distutils/command/install_headers.py +45 -0
  566. venv/Lib/site-packages/setuptools/_distutils/command/install_lib.py +238 -0
  567. venv/Lib/site-packages/setuptools/_distutils/command/install_scripts.py +61 -0
  568. venv/Lib/site-packages/setuptools/_distutils/command/py37compat.py +31 -0
  569. venv/Lib/site-packages/setuptools/_distutils/command/register.py +319 -0
  570. venv/Lib/site-packages/setuptools/_distutils/command/sdist.py +531 -0
  571. venv/Lib/site-packages/setuptools/_distutils/command/upload.py +205 -0
  572. venv/Lib/site-packages/setuptools/_distutils/config.py +139 -0
  573. venv/Lib/site-packages/setuptools/_distutils/core.py +291 -0
  574. venv/Lib/site-packages/setuptools/_distutils/cygwinccompiler.py +364 -0
  575. venv/Lib/site-packages/setuptools/_distutils/debug.py +5 -0
  576. venv/Lib/site-packages/setuptools/_distutils/dep_util.py +96 -0
  577. venv/Lib/site-packages/setuptools/_distutils/dir_util.py +243 -0
  578. venv/Lib/site-packages/setuptools/_distutils/dist.py +1286 -0
  579. venv/Lib/site-packages/setuptools/_distutils/errors.py +127 -0
  580. venv/Lib/site-packages/setuptools/_distutils/extension.py +248 -0
  581. venv/Lib/site-packages/setuptools/_distutils/fancy_getopt.py +470 -0
  582. venv/Lib/site-packages/setuptools/_distutils/file_util.py +249 -0
  583. venv/Lib/site-packages/setuptools/_distutils/filelist.py +371 -0
  584. venv/Lib/site-packages/setuptools/_distutils/log.py +80 -0
  585. venv/Lib/site-packages/setuptools/_distutils/msvc9compiler.py +832 -0
  586. venv/Lib/site-packages/setuptools/_distutils/msvccompiler.py +695 -0
  587. venv/Lib/site-packages/setuptools/_distutils/py38compat.py +8 -0
  588. venv/Lib/site-packages/setuptools/_distutils/py39compat.py +22 -0
  589. venv/Lib/site-packages/setuptools/_distutils/spawn.py +109 -0
  590. venv/Lib/site-packages/setuptools/_distutils/sysconfig.py +558 -0
  591. venv/Lib/site-packages/setuptools/_distutils/text_file.py +287 -0
  592. venv/Lib/site-packages/setuptools/_distutils/unixccompiler.py +401 -0
  593. venv/Lib/site-packages/setuptools/_distutils/util.py +513 -0
  594. venv/Lib/site-packages/setuptools/_distutils/version.py +358 -0
  595. venv/Lib/site-packages/setuptools/_distutils/versionpredicate.py +175 -0
  596. venv/Lib/site-packages/setuptools/_entry_points.py +86 -0
  597. venv/Lib/site-packages/setuptools/_imp.py +82 -0
  598. venv/Lib/site-packages/setuptools/_importlib.py +47 -0
  599. venv/Lib/site-packages/setuptools/_itertools.py +23 -0
  600. venv/Lib/site-packages/setuptools/_path.py +29 -0
  601. venv/Lib/site-packages/setuptools/_reqs.py +19 -0
  602. venv/Lib/site-packages/setuptools/_vendor/__init__.py +0 -0
  603. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/__init__.py +1047 -0
  604. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_adapters.py +68 -0
  605. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_collections.py +30 -0
  606. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_compat.py +71 -0
  607. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_functools.py +104 -0
  608. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_itertools.py +73 -0
  609. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_meta.py +48 -0
  610. venv/Lib/site-packages/setuptools/_vendor/importlib_metadata/_text.py +99 -0
  611. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/__init__.py +36 -0
  612. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/_adapters.py +170 -0
  613. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/_common.py +104 -0
  614. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/_compat.py +98 -0
  615. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/_itertools.py +35 -0
  616. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/_legacy.py +121 -0
  617. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/abc.py +137 -0
  618. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/readers.py +122 -0
  619. venv/Lib/site-packages/setuptools/_vendor/importlib_resources/simple.py +116 -0
  620. venv/Lib/site-packages/setuptools/_vendor/jaraco/__init__.py +0 -0
  621. venv/Lib/site-packages/setuptools/_vendor/jaraco/context.py +213 -0
  622. venv/Lib/site-packages/setuptools/_vendor/jaraco/functools.py +525 -0
  623. venv/Lib/site-packages/setuptools/_vendor/jaraco/text/__init__.py +599 -0
  624. venv/Lib/site-packages/setuptools/_vendor/more_itertools/__init__.py +4 -0
  625. venv/Lib/site-packages/setuptools/_vendor/more_itertools/more.py +3824 -0
  626. venv/Lib/site-packages/setuptools/_vendor/more_itertools/recipes.py +620 -0
  627. venv/Lib/site-packages/setuptools/_vendor/ordered_set.py +488 -0
  628. venv/Lib/site-packages/setuptools/_vendor/packaging/__about__.py +26 -0
  629. venv/Lib/site-packages/setuptools/_vendor/packaging/__init__.py +25 -0
  630. venv/Lib/site-packages/setuptools/_vendor/packaging/_manylinux.py +301 -0
  631. venv/Lib/site-packages/setuptools/_vendor/packaging/_musllinux.py +136 -0
  632. venv/Lib/site-packages/setuptools/_vendor/packaging/_structures.py +61 -0
  633. venv/Lib/site-packages/setuptools/_vendor/packaging/markers.py +304 -0
  634. venv/Lib/site-packages/setuptools/_vendor/packaging/requirements.py +146 -0
  635. venv/Lib/site-packages/setuptools/_vendor/packaging/specifiers.py +802 -0
  636. venv/Lib/site-packages/setuptools/_vendor/packaging/tags.py +487 -0
  637. venv/Lib/site-packages/setuptools/_vendor/packaging/utils.py +136 -0
  638. venv/Lib/site-packages/setuptools/_vendor/packaging/version.py +504 -0
  639. venv/Lib/site-packages/setuptools/_vendor/pyparsing/__init__.py +331 -0
  640. venv/Lib/site-packages/setuptools/_vendor/pyparsing/actions.py +207 -0
  641. venv/Lib/site-packages/setuptools/_vendor/pyparsing/common.py +424 -0
  642. venv/Lib/site-packages/setuptools/_vendor/pyparsing/core.py +5814 -0
  643. venv/Lib/site-packages/setuptools/_vendor/pyparsing/diagram/__init__.py +642 -0
  644. venv/Lib/site-packages/setuptools/_vendor/pyparsing/exceptions.py +267 -0
  645. venv/Lib/site-packages/setuptools/_vendor/pyparsing/helpers.py +1088 -0
  646. venv/Lib/site-packages/setuptools/_vendor/pyparsing/results.py +760 -0
  647. venv/Lib/site-packages/setuptools/_vendor/pyparsing/testing.py +331 -0
  648. venv/Lib/site-packages/setuptools/_vendor/pyparsing/unicode.py +352 -0
  649. venv/Lib/site-packages/setuptools/_vendor/pyparsing/util.py +235 -0
  650. venv/Lib/site-packages/setuptools/_vendor/tomli/__init__.py +11 -0
  651. venv/Lib/site-packages/setuptools/_vendor/tomli/_parser.py +691 -0
  652. venv/Lib/site-packages/setuptools/_vendor/tomli/_re.py +107 -0
  653. venv/Lib/site-packages/setuptools/_vendor/tomli/_types.py +10 -0
  654. venv/Lib/site-packages/setuptools/_vendor/typing_extensions.py +2296 -0
  655. venv/Lib/site-packages/setuptools/_vendor/zipp.py +329 -0
  656. venv/Lib/site-packages/setuptools/archive_util.py +213 -0
  657. venv/Lib/site-packages/setuptools/build_meta.py +511 -0
  658. venv/Lib/site-packages/setuptools/command/__init__.py +12 -0
  659. venv/Lib/site-packages/setuptools/command/alias.py +78 -0
  660. venv/Lib/site-packages/setuptools/command/bdist_egg.py +457 -0
  661. venv/Lib/site-packages/setuptools/command/bdist_rpm.py +40 -0
  662. venv/Lib/site-packages/setuptools/command/build.py +146 -0
  663. venv/Lib/site-packages/setuptools/command/build_clib.py +101 -0
  664. venv/Lib/site-packages/setuptools/command/build_ext.py +383 -0
  665. venv/Lib/site-packages/setuptools/command/build_py.py +368 -0
  666. venv/Lib/site-packages/setuptools/command/develop.py +193 -0
  667. venv/Lib/site-packages/setuptools/command/dist_info.py +142 -0
  668. venv/Lib/site-packages/setuptools/command/easy_install.py +2312 -0
  669. venv/Lib/site-packages/setuptools/command/editable_wheel.py +844 -0
  670. venv/Lib/site-packages/setuptools/command/egg_info.py +763 -0
  671. venv/Lib/site-packages/setuptools/command/install.py +139 -0
  672. venv/Lib/site-packages/setuptools/command/install_egg_info.py +63 -0
  673. venv/Lib/site-packages/setuptools/command/install_lib.py +122 -0
  674. venv/Lib/site-packages/setuptools/command/install_scripts.py +70 -0
  675. venv/Lib/site-packages/setuptools/command/py36compat.py +134 -0
  676. venv/Lib/site-packages/setuptools/command/register.py +18 -0
  677. venv/Lib/site-packages/setuptools/command/rotate.py +64 -0
  678. venv/Lib/site-packages/setuptools/command/saveopts.py +22 -0
  679. venv/Lib/site-packages/setuptools/command/sdist.py +210 -0
  680. venv/Lib/site-packages/setuptools/command/setopt.py +149 -0
  681. venv/Lib/site-packages/setuptools/command/test.py +251 -0
  682. venv/Lib/site-packages/setuptools/command/upload.py +17 -0
  683. venv/Lib/site-packages/setuptools/command/upload_docs.py +213 -0
  684. venv/Lib/site-packages/setuptools/config/__init__.py +35 -0
  685. venv/Lib/site-packages/setuptools/config/_apply_pyprojecttoml.py +377 -0
  686. venv/Lib/site-packages/setuptools/config/_validate_pyproject/__init__.py +34 -0
  687. venv/Lib/site-packages/setuptools/config/_validate_pyproject/error_reporting.py +318 -0
  688. venv/Lib/site-packages/setuptools/config/_validate_pyproject/extra_validations.py +36 -0
  689. venv/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_exceptions.py +51 -0
  690. venv/Lib/site-packages/setuptools/config/_validate_pyproject/fastjsonschema_validations.py +1035 -0
  691. venv/Lib/site-packages/setuptools/config/_validate_pyproject/formats.py +259 -0
  692. venv/Lib/site-packages/setuptools/config/expand.py +462 -0
  693. venv/Lib/site-packages/setuptools/config/pyprojecttoml.py +493 -0
  694. venv/Lib/site-packages/setuptools/config/setupcfg.py +762 -0
  695. venv/Lib/site-packages/setuptools/dep_util.py +25 -0
  696. venv/Lib/site-packages/setuptools/depends.py +176 -0
  697. venv/Lib/site-packages/setuptools/discovery.py +600 -0
  698. venv/Lib/site-packages/setuptools/dist.py +1222 -0
  699. venv/Lib/site-packages/setuptools/errors.py +58 -0
  700. venv/Lib/site-packages/setuptools/extension.py +148 -0
  701. venv/Lib/site-packages/setuptools/extern/__init__.py +76 -0
  702. venv/Lib/site-packages/setuptools/glob.py +167 -0
  703. venv/Lib/site-packages/setuptools/installer.py +104 -0
  704. venv/Lib/site-packages/setuptools/launch.py +36 -0
  705. venv/Lib/site-packages/setuptools/logging.py +36 -0
  706. venv/Lib/site-packages/setuptools/monkey.py +165 -0
  707. venv/Lib/site-packages/setuptools/msvc.py +1703 -0
  708. venv/Lib/site-packages/setuptools/namespaces.py +107 -0
  709. venv/Lib/site-packages/setuptools/package_index.py +1126 -0
  710. venv/Lib/site-packages/setuptools/py34compat.py +13 -0
  711. venv/Lib/site-packages/setuptools/sandbox.py +530 -0
  712. venv/Lib/site-packages/setuptools/unicode_utils.py +42 -0
  713. venv/Lib/site-packages/setuptools/version.py +6 -0
  714. venv/Lib/site-packages/setuptools/wheel.py +222 -0
  715. venv/Lib/site-packages/setuptools/windows_support.py +29 -0
  716. xplia/__init__.py +72 -0
  717. xplia/api/__init__.py +432 -0
  718. xplia/api/fastapi_app.py +453 -0
  719. xplia/cli.py +321 -0
  720. xplia/compliance/__init__.py +39 -0
  721. xplia/compliance/ai_act.py +538 -0
  722. xplia/compliance/compliance_checker.py +511 -0
  723. xplia/compliance/compliance_report.py +236 -0
  724. xplia/compliance/expert_review/__init__.py +18 -0
  725. xplia/compliance/expert_review/evaluation_criteria.py +209 -0
  726. xplia/compliance/expert_review/integration.py +270 -0
  727. xplia/compliance/expert_review/trust_expert_evaluator.py +379 -0
  728. xplia/compliance/explanation_rights.py +45 -0
  729. xplia/compliance/formatters/__init__.py +35 -0
  730. xplia/compliance/formatters/csv_formatter.py +179 -0
  731. xplia/compliance/formatters/html_formatter.py +689 -0
  732. xplia/compliance/formatters/html_trust_formatter.py +147 -0
  733. xplia/compliance/formatters/json_formatter.py +107 -0
  734. xplia/compliance/formatters/pdf_formatter.py +641 -0
  735. xplia/compliance/formatters/pdf_trust_formatter.py +309 -0
  736. xplia/compliance/formatters/trust_formatter_mixin.py +267 -0
  737. xplia/compliance/formatters/xml_formatter.py +173 -0
  738. xplia/compliance/gdpr.py +803 -0
  739. xplia/compliance/hipaa.py +134 -0
  740. xplia/compliance/report_base.py +205 -0
  741. xplia/compliance/report_generator.py +820 -0
  742. xplia/compliance/translations.py +299 -0
  743. xplia/core/__init__.py +98 -0
  744. xplia/core/base.py +391 -0
  745. xplia/core/config.py +297 -0
  746. xplia/core/factory.py +416 -0
  747. xplia/core/model_adapters/__init__.py +47 -0
  748. xplia/core/model_adapters/base.py +160 -0
  749. xplia/core/model_adapters/pytorch_adapter.py +339 -0
  750. xplia/core/model_adapters/sklearn_adapter.py +215 -0
  751. xplia/core/model_adapters/tensorflow_adapter.py +280 -0
  752. xplia/core/model_adapters/xgboost_adapter.py +295 -0
  753. xplia/core/optimizations.py +322 -0
  754. xplia/core/performance/__init__.py +57 -0
  755. xplia/core/performance/cache_manager.py +502 -0
  756. xplia/core/performance/memory_optimizer.py +465 -0
  757. xplia/core/performance/parallel_executor.py +327 -0
  758. xplia/core/registry.py +1234 -0
  759. xplia/explainers/__init__.py +70 -0
  760. xplia/explainers/__init__updated.py +62 -0
  761. xplia/explainers/adaptive/__init__.py +24 -0
  762. xplia/explainers/adaptive/explainer_selector.py +405 -0
  763. xplia/explainers/adaptive/explanation_quality.py +395 -0
  764. xplia/explainers/adaptive/fusion_strategies.py +297 -0
  765. xplia/explainers/adaptive/meta_explainer.py +320 -0
  766. xplia/explainers/adversarial/__init__.py +21 -0
  767. xplia/explainers/adversarial/adversarial_xai.py +678 -0
  768. xplia/explainers/anchor_explainer.py +1769 -0
  769. xplia/explainers/attention_explainer.py +996 -0
  770. xplia/explainers/bayesian/__init__.py +8 -0
  771. xplia/explainers/bayesian/bayesian_explainer.py +127 -0
  772. xplia/explainers/bias/__init__.py +17 -0
  773. xplia/explainers/bias/advanced_bias_detection.py +934 -0
  774. xplia/explainers/calibration/__init__.py +26 -0
  775. xplia/explainers/calibration/audience_adapter.py +376 -0
  776. xplia/explainers/calibration/audience_profiles.py +372 -0
  777. xplia/explainers/calibration/calibration_metrics.py +299 -0
  778. xplia/explainers/calibration/explanation_calibrator.py +460 -0
  779. xplia/explainers/causal/__init__.py +19 -0
  780. xplia/explainers/causal/causal_inference.py +669 -0
  781. xplia/explainers/certified/__init__.py +21 -0
  782. xplia/explainers/certified/certified_explanations.py +619 -0
  783. xplia/explainers/continual/__init__.py +8 -0
  784. xplia/explainers/continual/continual_explainer.py +102 -0
  785. xplia/explainers/counterfactual_explainer.py +804 -0
  786. xplia/explainers/counterfactuals/__init__.py +17 -0
  787. xplia/explainers/counterfactuals/advanced_counterfactuals.py +259 -0
  788. xplia/explainers/expert_evaluator.py +538 -0
  789. xplia/explainers/feature_importance_explainer.py +376 -0
  790. xplia/explainers/federated/__init__.py +17 -0
  791. xplia/explainers/federated/federated_xai.py +664 -0
  792. xplia/explainers/generative/__init__.py +15 -0
  793. xplia/explainers/generative/generative_explainer.py +243 -0
  794. xplia/explainers/gradient_explainer.py +3590 -0
  795. xplia/explainers/graph/__init__.py +26 -0
  796. xplia/explainers/graph/gnn_explainer.py +638 -0
  797. xplia/explainers/graph/molecular_explainer.py +438 -0
  798. xplia/explainers/lime_explainer.py +1580 -0
  799. xplia/explainers/llm/__init__.py +23 -0
  800. xplia/explainers/llm/llm_explainability.py +737 -0
  801. xplia/explainers/metalearning/__init__.py +15 -0
  802. xplia/explainers/metalearning/metalearning_explainer.py +276 -0
  803. xplia/explainers/moe/__init__.py +8 -0
  804. xplia/explainers/moe/moe_explainer.py +108 -0
  805. xplia/explainers/multimodal/__init__.py +30 -0
  806. xplia/explainers/multimodal/base.py +262 -0
  807. xplia/explainers/multimodal/diffusion_explainer.py +608 -0
  808. xplia/explainers/multimodal/foundation_model_explainer.py +323 -0
  809. xplia/explainers/multimodal/registry.py +139 -0
  810. xplia/explainers/multimodal/text_image_explainer.py +381 -0
  811. xplia/explainers/multimodal/vision_language_explainer.py +608 -0
  812. xplia/explainers/nas/__init__.py +5 -0
  813. xplia/explainers/nas/nas_explainer.py +65 -0
  814. xplia/explainers/neuralodes/__init__.py +5 -0
  815. xplia/explainers/neuralodes/neuralode_explainer.py +64 -0
  816. xplia/explainers/neurosymbolic/__init__.py +8 -0
  817. xplia/explainers/neurosymbolic/neurosymbolic_explainer.py +97 -0
  818. xplia/explainers/partial_dependence_explainer.py +509 -0
  819. xplia/explainers/privacy/__init__.py +21 -0
  820. xplia/explainers/privacy/differential_privacy_xai.py +624 -0
  821. xplia/explainers/quantum/__init__.py +5 -0
  822. xplia/explainers/quantum/quantum_explainer.py +79 -0
  823. xplia/explainers/recommender/__init__.py +8 -0
  824. xplia/explainers/recommender/recsys_explainer.py +124 -0
  825. xplia/explainers/reinforcement/__init__.py +15 -0
  826. xplia/explainers/reinforcement/rl_explainer.py +173 -0
  827. xplia/explainers/shap_explainer.py +2238 -0
  828. xplia/explainers/streaming/__init__.py +19 -0
  829. xplia/explainers/streaming/streaming_xai.py +703 -0
  830. xplia/explainers/timeseries/__init__.py +15 -0
  831. xplia/explainers/timeseries/timeseries_explainer.py +252 -0
  832. xplia/explainers/trust/__init__.py +24 -0
  833. xplia/explainers/trust/confidence_report.py +368 -0
  834. xplia/explainers/trust/fairwashing.py +489 -0
  835. xplia/explainers/trust/uncertainty.py +453 -0
  836. xplia/explainers/unified_explainer.py +566 -0
  837. xplia/explainers/unified_explainer_utils.py +309 -0
  838. xplia/integrations/__init__.py +3 -0
  839. xplia/integrations/mlflow_integration.py +331 -0
  840. xplia/integrations/wandb_integration.py +375 -0
  841. xplia/plugins/__init__.py +36 -0
  842. xplia/plugins/example_visualizer.py +11 -0
  843. xplia/utils/__init__.py +18 -0
  844. xplia/utils/performance.py +119 -0
  845. xplia/utils/validation.py +109 -0
  846. xplia/visualizations/__init__.py +31 -0
  847. xplia/visualizations/base.py +256 -0
  848. xplia/visualizations/boxplot_chart.py +224 -0
  849. xplia/visualizations/charts_impl.py +65 -0
  850. xplia/visualizations/gauge_chart.py +211 -0
  851. xplia/visualizations/gradient_viz.py +117 -0
  852. xplia/visualizations/heatmap_chart.py +173 -0
  853. xplia/visualizations/histogram_chart.py +176 -0
  854. xplia/visualizations/line_chart.py +100 -0
  855. xplia/visualizations/pie_chart.py +134 -0
  856. xplia/visualizations/radar_chart.py +154 -0
  857. xplia/visualizations/registry.py +76 -0
  858. xplia/visualizations/sankey_chart.py +190 -0
  859. xplia/visualizations/scatter_chart.py +252 -0
  860. xplia/visualizations/table_chart.py +263 -0
  861. xplia/visualizations/treemap_chart.py +216 -0
  862. xplia/visualizations.py +535 -0
  863. xplia/visualizers/__init__.py +87 -0
  864. xplia/visualizers/base_visualizer.py +294 -0
  865. xplia-1.0.1.dist-info/METADATA +685 -0
  866. xplia-1.0.1.dist-info/RECORD +870 -0
  867. xplia-1.0.1.dist-info/WHEEL +5 -0
  868. xplia-1.0.1.dist-info/entry_points.txt +2 -0
  869. xplia-1.0.1.dist-info/licenses/LICENSE +21 -0
  870. xplia-1.0.1.dist-info/top_level.txt +2 -0
@@ -0,0 +1,1702 @@
1
+ import io
2
+ import sys
3
+ import typing
4
+ import warnings
5
+ from abc import ABC, abstractmethod
6
+ from collections import deque
7
+ from dataclasses import dataclass, field
8
+ from datetime import timedelta
9
+ from io import RawIOBase, UnsupportedOperation
10
+ from math import ceil
11
+ from mmap import mmap
12
+ from operator import length_hint
13
+ from os import PathLike, stat
14
+ from threading import Event, RLock, Thread
15
+ from types import TracebackType
16
+ from typing import (
17
+ Any,
18
+ BinaryIO,
19
+ Callable,
20
+ ContextManager,
21
+ Deque,
22
+ Dict,
23
+ Generic,
24
+ Iterable,
25
+ List,
26
+ NamedTuple,
27
+ NewType,
28
+ Optional,
29
+ Sequence,
30
+ TextIO,
31
+ Tuple,
32
+ Type,
33
+ TypeVar,
34
+ Union,
35
+ )
36
+
37
+ if sys.version_info >= (3, 8):
38
+ from typing import Literal
39
+ else:
40
+ from pip._vendor.typing_extensions import Literal # pragma: no cover
41
+
42
+ from . import filesize, get_console
43
+ from .console import Console, Group, JustifyMethod, RenderableType
44
+ from .highlighter import Highlighter
45
+ from .jupyter import JupyterMixin
46
+ from .live import Live
47
+ from .progress_bar import ProgressBar
48
+ from .spinner import Spinner
49
+ from .style import StyleType
50
+ from .table import Column, Table
51
+ from .text import Text, TextType
52
+
53
+ TaskID = NewType("TaskID", int)
54
+
55
+ ProgressType = TypeVar("ProgressType")
56
+
57
+ GetTimeCallable = Callable[[], float]
58
+
59
+
60
+ _I = typing.TypeVar("_I", TextIO, BinaryIO)
61
+
62
+
63
+ class _TrackThread(Thread):
64
+ """A thread to periodically update progress."""
65
+
66
+ def __init__(self, progress: "Progress", task_id: "TaskID", update_period: float):
67
+ self.progress = progress
68
+ self.task_id = task_id
69
+ self.update_period = update_period
70
+ self.done = Event()
71
+
72
+ self.completed = 0
73
+ super().__init__()
74
+
75
+ def run(self) -> None:
76
+ task_id = self.task_id
77
+ advance = self.progress.advance
78
+ update_period = self.update_period
79
+ last_completed = 0
80
+ wait = self.done.wait
81
+ while not wait(update_period):
82
+ completed = self.completed
83
+ if last_completed != completed:
84
+ advance(task_id, completed - last_completed)
85
+ last_completed = completed
86
+
87
+ self.progress.update(self.task_id, completed=self.completed, refresh=True)
88
+
89
+ def __enter__(self) -> "_TrackThread":
90
+ self.start()
91
+ return self
92
+
93
+ def __exit__(
94
+ self,
95
+ exc_type: Optional[Type[BaseException]],
96
+ exc_val: Optional[BaseException],
97
+ exc_tb: Optional[TracebackType],
98
+ ) -> None:
99
+ self.done.set()
100
+ self.join()
101
+
102
+
103
+ def track(
104
+ sequence: Union[Sequence[ProgressType], Iterable[ProgressType]],
105
+ description: str = "Working...",
106
+ total: Optional[float] = None,
107
+ auto_refresh: bool = True,
108
+ console: Optional[Console] = None,
109
+ transient: bool = False,
110
+ get_time: Optional[Callable[[], float]] = None,
111
+ refresh_per_second: float = 10,
112
+ style: StyleType = "bar.back",
113
+ complete_style: StyleType = "bar.complete",
114
+ finished_style: StyleType = "bar.finished",
115
+ pulse_style: StyleType = "bar.pulse",
116
+ update_period: float = 0.1,
117
+ disable: bool = False,
118
+ show_speed: bool = True,
119
+ ) -> Iterable[ProgressType]:
120
+ """Track progress by iterating over a sequence.
121
+
122
+ Args:
123
+ sequence (Iterable[ProgressType]): A sequence (must support "len") you wish to iterate over.
124
+ description (str, optional): Description of task show next to progress bar. Defaults to "Working".
125
+ total: (float, optional): Total number of steps. Default is len(sequence).
126
+ auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
127
+ transient: (bool, optional): Clear the progress on exit. Defaults to False.
128
+ console (Console, optional): Console to write to. Default creates internal Console instance.
129
+ refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
130
+ style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
131
+ complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
132
+ finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
133
+ pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
134
+ update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.
135
+ disable (bool, optional): Disable display of progress.
136
+ show_speed (bool, optional): Show speed if total isn't known. Defaults to True.
137
+ Returns:
138
+ Iterable[ProgressType]: An iterable of the values in the sequence.
139
+
140
+ """
141
+
142
+ columns: List["ProgressColumn"] = (
143
+ [TextColumn("[progress.description]{task.description}")] if description else []
144
+ )
145
+ columns.extend(
146
+ (
147
+ BarColumn(
148
+ style=style,
149
+ complete_style=complete_style,
150
+ finished_style=finished_style,
151
+ pulse_style=pulse_style,
152
+ ),
153
+ TaskProgressColumn(show_speed=show_speed),
154
+ TimeRemainingColumn(elapsed_when_finished=True),
155
+ )
156
+ )
157
+ progress = Progress(
158
+ *columns,
159
+ auto_refresh=auto_refresh,
160
+ console=console,
161
+ transient=transient,
162
+ get_time=get_time,
163
+ refresh_per_second=refresh_per_second or 10,
164
+ disable=disable,
165
+ )
166
+
167
+ with progress:
168
+ yield from progress.track(
169
+ sequence, total=total, description=description, update_period=update_period
170
+ )
171
+
172
+
173
+ class _Reader(RawIOBase, BinaryIO):
174
+ """A reader that tracks progress while it's being read from."""
175
+
176
+ def __init__(
177
+ self,
178
+ handle: BinaryIO,
179
+ progress: "Progress",
180
+ task: TaskID,
181
+ close_handle: bool = True,
182
+ ) -> None:
183
+ self.handle = handle
184
+ self.progress = progress
185
+ self.task = task
186
+ self.close_handle = close_handle
187
+ self._closed = False
188
+
189
+ def __enter__(self) -> "_Reader":
190
+ self.handle.__enter__()
191
+ return self
192
+
193
+ def __exit__(
194
+ self,
195
+ exc_type: Optional[Type[BaseException]],
196
+ exc_val: Optional[BaseException],
197
+ exc_tb: Optional[TracebackType],
198
+ ) -> None:
199
+ self.close()
200
+
201
+ def __iter__(self) -> BinaryIO:
202
+ return self
203
+
204
+ def __next__(self) -> bytes:
205
+ line = next(self.handle)
206
+ self.progress.advance(self.task, advance=len(line))
207
+ return line
208
+
209
+ @property
210
+ def closed(self) -> bool:
211
+ return self._closed
212
+
213
+ def fileno(self) -> int:
214
+ return self.handle.fileno()
215
+
216
+ def isatty(self) -> bool:
217
+ return self.handle.isatty()
218
+
219
+ @property
220
+ def mode(self) -> str:
221
+ return self.handle.mode
222
+
223
+ @property
224
+ def name(self) -> str:
225
+ return self.handle.name
226
+
227
+ def readable(self) -> bool:
228
+ return self.handle.readable()
229
+
230
+ def seekable(self) -> bool:
231
+ return self.handle.seekable()
232
+
233
+ def writable(self) -> bool:
234
+ return False
235
+
236
+ def read(self, size: int = -1) -> bytes:
237
+ block = self.handle.read(size)
238
+ self.progress.advance(self.task, advance=len(block))
239
+ return block
240
+
241
+ def readinto(self, b: Union[bytearray, memoryview, mmap]): # type: ignore[no-untyped-def, override]
242
+ n = self.handle.readinto(b) # type: ignore[attr-defined]
243
+ self.progress.advance(self.task, advance=n)
244
+ return n
245
+
246
+ def readline(self, size: int = -1) -> bytes: # type: ignore[override]
247
+ line = self.handle.readline(size)
248
+ self.progress.advance(self.task, advance=len(line))
249
+ return line
250
+
251
+ def readlines(self, hint: int = -1) -> List[bytes]:
252
+ lines = self.handle.readlines(hint)
253
+ self.progress.advance(self.task, advance=sum(map(len, lines)))
254
+ return lines
255
+
256
+ def close(self) -> None:
257
+ if self.close_handle:
258
+ self.handle.close()
259
+ self._closed = True
260
+
261
+ def seek(self, offset: int, whence: int = 0) -> int:
262
+ pos = self.handle.seek(offset, whence)
263
+ self.progress.update(self.task, completed=pos)
264
+ return pos
265
+
266
+ def tell(self) -> int:
267
+ return self.handle.tell()
268
+
269
+ def write(self, s: Any) -> int:
270
+ raise UnsupportedOperation("write")
271
+
272
+
273
+ class _ReadContext(ContextManager[_I], Generic[_I]):
274
+ """A utility class to handle a context for both a reader and a progress."""
275
+
276
+ def __init__(self, progress: "Progress", reader: _I) -> None:
277
+ self.progress = progress
278
+ self.reader: _I = reader
279
+
280
+ def __enter__(self) -> _I:
281
+ self.progress.start()
282
+ return self.reader.__enter__()
283
+
284
+ def __exit__(
285
+ self,
286
+ exc_type: Optional[Type[BaseException]],
287
+ exc_val: Optional[BaseException],
288
+ exc_tb: Optional[TracebackType],
289
+ ) -> None:
290
+ self.progress.stop()
291
+ self.reader.__exit__(exc_type, exc_val, exc_tb)
292
+
293
+
294
+ def wrap_file(
295
+ file: BinaryIO,
296
+ total: int,
297
+ *,
298
+ description: str = "Reading...",
299
+ auto_refresh: bool = True,
300
+ console: Optional[Console] = None,
301
+ transient: bool = False,
302
+ get_time: Optional[Callable[[], float]] = None,
303
+ refresh_per_second: float = 10,
304
+ style: StyleType = "bar.back",
305
+ complete_style: StyleType = "bar.complete",
306
+ finished_style: StyleType = "bar.finished",
307
+ pulse_style: StyleType = "bar.pulse",
308
+ disable: bool = False,
309
+ ) -> ContextManager[BinaryIO]:
310
+ """Read bytes from a file while tracking progress.
311
+
312
+ Args:
313
+ file (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
314
+ total (int): Total number of bytes to read.
315
+ description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
316
+ auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
317
+ transient: (bool, optional): Clear the progress on exit. Defaults to False.
318
+ console (Console, optional): Console to write to. Default creates internal Console instance.
319
+ refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
320
+ style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
321
+ complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
322
+ finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
323
+ pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
324
+ disable (bool, optional): Disable display of progress.
325
+ Returns:
326
+ ContextManager[BinaryIO]: A context manager yielding a progress reader.
327
+
328
+ """
329
+
330
+ columns: List["ProgressColumn"] = (
331
+ [TextColumn("[progress.description]{task.description}")] if description else []
332
+ )
333
+ columns.extend(
334
+ (
335
+ BarColumn(
336
+ style=style,
337
+ complete_style=complete_style,
338
+ finished_style=finished_style,
339
+ pulse_style=pulse_style,
340
+ ),
341
+ DownloadColumn(),
342
+ TimeRemainingColumn(),
343
+ )
344
+ )
345
+ progress = Progress(
346
+ *columns,
347
+ auto_refresh=auto_refresh,
348
+ console=console,
349
+ transient=transient,
350
+ get_time=get_time,
351
+ refresh_per_second=refresh_per_second or 10,
352
+ disable=disable,
353
+ )
354
+
355
+ reader = progress.wrap_file(file, total=total, description=description)
356
+ return _ReadContext(progress, reader)
357
+
358
+
359
+ @typing.overload
360
+ def open(
361
+ file: Union[str, "PathLike[str]", bytes],
362
+ mode: Union[Literal["rt"], Literal["r"]],
363
+ buffering: int = -1,
364
+ encoding: Optional[str] = None,
365
+ errors: Optional[str] = None,
366
+ newline: Optional[str] = None,
367
+ *,
368
+ total: Optional[int] = None,
369
+ description: str = "Reading...",
370
+ auto_refresh: bool = True,
371
+ console: Optional[Console] = None,
372
+ transient: bool = False,
373
+ get_time: Optional[Callable[[], float]] = None,
374
+ refresh_per_second: float = 10,
375
+ style: StyleType = "bar.back",
376
+ complete_style: StyleType = "bar.complete",
377
+ finished_style: StyleType = "bar.finished",
378
+ pulse_style: StyleType = "bar.pulse",
379
+ disable: bool = False,
380
+ ) -> ContextManager[TextIO]:
381
+ pass
382
+
383
+
384
+ @typing.overload
385
+ def open(
386
+ file: Union[str, "PathLike[str]", bytes],
387
+ mode: Literal["rb"],
388
+ buffering: int = -1,
389
+ encoding: Optional[str] = None,
390
+ errors: Optional[str] = None,
391
+ newline: Optional[str] = None,
392
+ *,
393
+ total: Optional[int] = None,
394
+ description: str = "Reading...",
395
+ auto_refresh: bool = True,
396
+ console: Optional[Console] = None,
397
+ transient: bool = False,
398
+ get_time: Optional[Callable[[], float]] = None,
399
+ refresh_per_second: float = 10,
400
+ style: StyleType = "bar.back",
401
+ complete_style: StyleType = "bar.complete",
402
+ finished_style: StyleType = "bar.finished",
403
+ pulse_style: StyleType = "bar.pulse",
404
+ disable: bool = False,
405
+ ) -> ContextManager[BinaryIO]:
406
+ pass
407
+
408
+
409
+ def open(
410
+ file: Union[str, "PathLike[str]", bytes],
411
+ mode: Union[Literal["rb"], Literal["rt"], Literal["r"]] = "r",
412
+ buffering: int = -1,
413
+ encoding: Optional[str] = None,
414
+ errors: Optional[str] = None,
415
+ newline: Optional[str] = None,
416
+ *,
417
+ total: Optional[int] = None,
418
+ description: str = "Reading...",
419
+ auto_refresh: bool = True,
420
+ console: Optional[Console] = None,
421
+ transient: bool = False,
422
+ get_time: Optional[Callable[[], float]] = None,
423
+ refresh_per_second: float = 10,
424
+ style: StyleType = "bar.back",
425
+ complete_style: StyleType = "bar.complete",
426
+ finished_style: StyleType = "bar.finished",
427
+ pulse_style: StyleType = "bar.pulse",
428
+ disable: bool = False,
429
+ ) -> Union[ContextManager[BinaryIO], ContextManager[TextIO]]:
430
+ """Read bytes from a file while tracking progress.
431
+
432
+ Args:
433
+ path (Union[str, PathLike[str], BinaryIO]): The path to the file to read, or a file-like object in binary mode.
434
+ mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
435
+ buffering (int): The buffering strategy to use, see :func:`io.open`.
436
+ encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
437
+ errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
438
+ newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`
439
+ total: (int, optional): Total number of bytes to read. Must be provided if reading from a file handle. Default for a path is os.stat(file).st_size.
440
+ description (str, optional): Description of task show next to progress bar. Defaults to "Reading".
441
+ auto_refresh (bool, optional): Automatic refresh, disable to force a refresh after each iteration. Default is True.
442
+ transient: (bool, optional): Clear the progress on exit. Defaults to False.
443
+ console (Console, optional): Console to write to. Default creates internal Console instance.
444
+ refresh_per_second (float): Number of times per second to refresh the progress information. Defaults to 10.
445
+ style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
446
+ complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
447
+ finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
448
+ pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
449
+ disable (bool, optional): Disable display of progress.
450
+ encoding (str, optional): The encoding to use when reading in text mode.
451
+
452
+ Returns:
453
+ ContextManager[BinaryIO]: A context manager yielding a progress reader.
454
+
455
+ """
456
+
457
+ columns: List["ProgressColumn"] = (
458
+ [TextColumn("[progress.description]{task.description}")] if description else []
459
+ )
460
+ columns.extend(
461
+ (
462
+ BarColumn(
463
+ style=style,
464
+ complete_style=complete_style,
465
+ finished_style=finished_style,
466
+ pulse_style=pulse_style,
467
+ ),
468
+ DownloadColumn(),
469
+ TimeRemainingColumn(),
470
+ )
471
+ )
472
+ progress = Progress(
473
+ *columns,
474
+ auto_refresh=auto_refresh,
475
+ console=console,
476
+ transient=transient,
477
+ get_time=get_time,
478
+ refresh_per_second=refresh_per_second or 10,
479
+ disable=disable,
480
+ )
481
+
482
+ reader = progress.open(
483
+ file,
484
+ mode=mode,
485
+ buffering=buffering,
486
+ encoding=encoding,
487
+ errors=errors,
488
+ newline=newline,
489
+ total=total,
490
+ description=description,
491
+ )
492
+ return _ReadContext(progress, reader) # type: ignore[return-value, type-var]
493
+
494
+
495
+ class ProgressColumn(ABC):
496
+ """Base class for a widget to use in progress display."""
497
+
498
+ max_refresh: Optional[float] = None
499
+
500
+ def __init__(self, table_column: Optional[Column] = None) -> None:
501
+ self._table_column = table_column
502
+ self._renderable_cache: Dict[TaskID, Tuple[float, RenderableType]] = {}
503
+ self._update_time: Optional[float] = None
504
+
505
+ def get_table_column(self) -> Column:
506
+ """Get a table column, used to build tasks table."""
507
+ return self._table_column or Column()
508
+
509
+ def __call__(self, task: "Task") -> RenderableType:
510
+ """Called by the Progress object to return a renderable for the given task.
511
+
512
+ Args:
513
+ task (Task): An object containing information regarding the task.
514
+
515
+ Returns:
516
+ RenderableType: Anything renderable (including str).
517
+ """
518
+ current_time = task.get_time()
519
+ if self.max_refresh is not None and not task.completed:
520
+ try:
521
+ timestamp, renderable = self._renderable_cache[task.id]
522
+ except KeyError:
523
+ pass
524
+ else:
525
+ if timestamp + self.max_refresh > current_time:
526
+ return renderable
527
+
528
+ renderable = self.render(task)
529
+ self._renderable_cache[task.id] = (current_time, renderable)
530
+ return renderable
531
+
532
+ @abstractmethod
533
+ def render(self, task: "Task") -> RenderableType:
534
+ """Should return a renderable object."""
535
+
536
+
537
+ class RenderableColumn(ProgressColumn):
538
+ """A column to insert an arbitrary column.
539
+
540
+ Args:
541
+ renderable (RenderableType, optional): Any renderable. Defaults to empty string.
542
+ """
543
+
544
+ def __init__(
545
+ self, renderable: RenderableType = "", *, table_column: Optional[Column] = None
546
+ ):
547
+ self.renderable = renderable
548
+ super().__init__(table_column=table_column)
549
+
550
+ def render(self, task: "Task") -> RenderableType:
551
+ return self.renderable
552
+
553
+
554
+ class SpinnerColumn(ProgressColumn):
555
+ """A column with a 'spinner' animation.
556
+
557
+ Args:
558
+ spinner_name (str, optional): Name of spinner animation. Defaults to "dots".
559
+ style (StyleType, optional): Style of spinner. Defaults to "progress.spinner".
560
+ speed (float, optional): Speed factor of spinner. Defaults to 1.0.
561
+ finished_text (TextType, optional): Text used when task is finished. Defaults to " ".
562
+ """
563
+
564
+ def __init__(
565
+ self,
566
+ spinner_name: str = "dots",
567
+ style: Optional[StyleType] = "progress.spinner",
568
+ speed: float = 1.0,
569
+ finished_text: TextType = " ",
570
+ table_column: Optional[Column] = None,
571
+ ):
572
+ self.spinner = Spinner(spinner_name, style=style, speed=speed)
573
+ self.finished_text = (
574
+ Text.from_markup(finished_text)
575
+ if isinstance(finished_text, str)
576
+ else finished_text
577
+ )
578
+ super().__init__(table_column=table_column)
579
+
580
+ def set_spinner(
581
+ self,
582
+ spinner_name: str,
583
+ spinner_style: Optional[StyleType] = "progress.spinner",
584
+ speed: float = 1.0,
585
+ ) -> None:
586
+ """Set a new spinner.
587
+
588
+ Args:
589
+ spinner_name (str): Spinner name, see python -m rich.spinner.
590
+ spinner_style (Optional[StyleType], optional): Spinner style. Defaults to "progress.spinner".
591
+ speed (float, optional): Speed factor of spinner. Defaults to 1.0.
592
+ """
593
+ self.spinner = Spinner(spinner_name, style=spinner_style, speed=speed)
594
+
595
+ def render(self, task: "Task") -> RenderableType:
596
+ text = (
597
+ self.finished_text
598
+ if task.finished
599
+ else self.spinner.render(task.get_time())
600
+ )
601
+ return text
602
+
603
+
604
+ class TextColumn(ProgressColumn):
605
+ """A column containing text."""
606
+
607
+ def __init__(
608
+ self,
609
+ text_format: str,
610
+ style: StyleType = "none",
611
+ justify: JustifyMethod = "left",
612
+ markup: bool = True,
613
+ highlighter: Optional[Highlighter] = None,
614
+ table_column: Optional[Column] = None,
615
+ ) -> None:
616
+ self.text_format = text_format
617
+ self.justify: JustifyMethod = justify
618
+ self.style = style
619
+ self.markup = markup
620
+ self.highlighter = highlighter
621
+ super().__init__(table_column=table_column or Column(no_wrap=True))
622
+
623
+ def render(self, task: "Task") -> Text:
624
+ _text = self.text_format.format(task=task)
625
+ if self.markup:
626
+ text = Text.from_markup(_text, style=self.style, justify=self.justify)
627
+ else:
628
+ text = Text(_text, style=self.style, justify=self.justify)
629
+ if self.highlighter:
630
+ self.highlighter.highlight(text)
631
+ return text
632
+
633
+
634
+ class BarColumn(ProgressColumn):
635
+ """Renders a visual progress bar.
636
+
637
+ Args:
638
+ bar_width (Optional[int], optional): Width of bar or None for full width. Defaults to 40.
639
+ style (StyleType, optional): Style for the bar background. Defaults to "bar.back".
640
+ complete_style (StyleType, optional): Style for the completed bar. Defaults to "bar.complete".
641
+ finished_style (StyleType, optional): Style for a finished bar. Defaults to "bar.finished".
642
+ pulse_style (StyleType, optional): Style for pulsing bars. Defaults to "bar.pulse".
643
+ """
644
+
645
+ def __init__(
646
+ self,
647
+ bar_width: Optional[int] = 40,
648
+ style: StyleType = "bar.back",
649
+ complete_style: StyleType = "bar.complete",
650
+ finished_style: StyleType = "bar.finished",
651
+ pulse_style: StyleType = "bar.pulse",
652
+ table_column: Optional[Column] = None,
653
+ ) -> None:
654
+ self.bar_width = bar_width
655
+ self.style = style
656
+ self.complete_style = complete_style
657
+ self.finished_style = finished_style
658
+ self.pulse_style = pulse_style
659
+ super().__init__(table_column=table_column)
660
+
661
+ def render(self, task: "Task") -> ProgressBar:
662
+ """Gets a progress bar widget for a task."""
663
+ return ProgressBar(
664
+ total=max(0, task.total) if task.total is not None else None,
665
+ completed=max(0, task.completed),
666
+ width=None if self.bar_width is None else max(1, self.bar_width),
667
+ pulse=not task.started,
668
+ animation_time=task.get_time(),
669
+ style=self.style,
670
+ complete_style=self.complete_style,
671
+ finished_style=self.finished_style,
672
+ pulse_style=self.pulse_style,
673
+ )
674
+
675
+
676
+ class TimeElapsedColumn(ProgressColumn):
677
+ """Renders time elapsed."""
678
+
679
+ def render(self, task: "Task") -> Text:
680
+ """Show time elapsed."""
681
+ elapsed = task.finished_time if task.finished else task.elapsed
682
+ if elapsed is None:
683
+ return Text("-:--:--", style="progress.elapsed")
684
+ delta = timedelta(seconds=int(elapsed))
685
+ return Text(str(delta), style="progress.elapsed")
686
+
687
+
688
+ class TaskProgressColumn(TextColumn):
689
+ """Show task progress as a percentage.
690
+
691
+ Args:
692
+ text_format (str, optional): Format for percentage display. Defaults to "[progress.percentage]{task.percentage:>3.0f}%".
693
+ text_format_no_percentage (str, optional): Format if percentage is unknown. Defaults to "".
694
+ style (StyleType, optional): Style of output. Defaults to "none".
695
+ justify (JustifyMethod, optional): Text justification. Defaults to "left".
696
+ markup (bool, optional): Enable markup. Defaults to True.
697
+ highlighter (Optional[Highlighter], optional): Highlighter to apply to output. Defaults to None.
698
+ table_column (Optional[Column], optional): Table Column to use. Defaults to None.
699
+ show_speed (bool, optional): Show speed if total is unknown. Defaults to False.
700
+ """
701
+
702
+ def __init__(
703
+ self,
704
+ text_format: str = "[progress.percentage]{task.percentage:>3.0f}%",
705
+ text_format_no_percentage: str = "",
706
+ style: StyleType = "none",
707
+ justify: JustifyMethod = "left",
708
+ markup: bool = True,
709
+ highlighter: Optional[Highlighter] = None,
710
+ table_column: Optional[Column] = None,
711
+ show_speed: bool = False,
712
+ ) -> None:
713
+
714
+ self.text_format_no_percentage = text_format_no_percentage
715
+ self.show_speed = show_speed
716
+ super().__init__(
717
+ text_format=text_format,
718
+ style=style,
719
+ justify=justify,
720
+ markup=markup,
721
+ highlighter=highlighter,
722
+ table_column=table_column,
723
+ )
724
+
725
+ @classmethod
726
+ def render_speed(cls, speed: Optional[float]) -> Text:
727
+ """Render the speed in iterations per second.
728
+
729
+ Args:
730
+ task (Task): A Task object.
731
+
732
+ Returns:
733
+ Text: Text object containing the task speed.
734
+ """
735
+ if speed is None:
736
+ return Text("", style="progress.percentage")
737
+ unit, suffix = filesize.pick_unit_and_suffix(
738
+ int(speed),
739
+ ["", "×10³", "×10⁶", "×10⁹", "×10¹²"],
740
+ 1000,
741
+ )
742
+ data_speed = speed / unit
743
+ return Text(f"{data_speed:.1f}{suffix} it/s", style="progress.percentage")
744
+
745
+ def render(self, task: "Task") -> Text:
746
+ if task.total is None and self.show_speed:
747
+ return self.render_speed(task.finished_speed or task.speed)
748
+ text_format = (
749
+ self.text_format_no_percentage if task.total is None else self.text_format
750
+ )
751
+ _text = text_format.format(task=task)
752
+ if self.markup:
753
+ text = Text.from_markup(_text, style=self.style, justify=self.justify)
754
+ else:
755
+ text = Text(_text, style=self.style, justify=self.justify)
756
+ if self.highlighter:
757
+ self.highlighter.highlight(text)
758
+ return text
759
+
760
+
761
+ class TimeRemainingColumn(ProgressColumn):
762
+ """Renders estimated time remaining.
763
+
764
+ Args:
765
+ compact (bool, optional): Render MM:SS when time remaining is less than an hour. Defaults to False.
766
+ elapsed_when_finished (bool, optional): Render time elapsed when the task is finished. Defaults to False.
767
+ """
768
+
769
+ # Only refresh twice a second to prevent jitter
770
+ max_refresh = 0.5
771
+
772
+ def __init__(
773
+ self,
774
+ compact: bool = False,
775
+ elapsed_when_finished: bool = False,
776
+ table_column: Optional[Column] = None,
777
+ ):
778
+ self.compact = compact
779
+ self.elapsed_when_finished = elapsed_when_finished
780
+ super().__init__(table_column=table_column)
781
+
782
+ def render(self, task: "Task") -> Text:
783
+ """Show time remaining."""
784
+ if self.elapsed_when_finished and task.finished:
785
+ task_time = task.finished_time
786
+ style = "progress.elapsed"
787
+ else:
788
+ task_time = task.time_remaining
789
+ style = "progress.remaining"
790
+
791
+ if task.total is None:
792
+ return Text("", style=style)
793
+
794
+ if task_time is None:
795
+ return Text("--:--" if self.compact else "-:--:--", style=style)
796
+
797
+ # Based on https://github.com/tqdm/tqdm/blob/master/tqdm/std.py
798
+ minutes, seconds = divmod(int(task_time), 60)
799
+ hours, minutes = divmod(minutes, 60)
800
+
801
+ if self.compact and not hours:
802
+ formatted = f"{minutes:02d}:{seconds:02d}"
803
+ else:
804
+ formatted = f"{hours:d}:{minutes:02d}:{seconds:02d}"
805
+
806
+ return Text(formatted, style=style)
807
+
808
+
809
+ class FileSizeColumn(ProgressColumn):
810
+ """Renders completed filesize."""
811
+
812
+ def render(self, task: "Task") -> Text:
813
+ """Show data completed."""
814
+ data_size = filesize.decimal(int(task.completed))
815
+ return Text(data_size, style="progress.filesize")
816
+
817
+
818
+ class TotalFileSizeColumn(ProgressColumn):
819
+ """Renders total filesize."""
820
+
821
+ def render(self, task: "Task") -> Text:
822
+ """Show data completed."""
823
+ data_size = filesize.decimal(int(task.total)) if task.total is not None else ""
824
+ return Text(data_size, style="progress.filesize.total")
825
+
826
+
827
+ class MofNCompleteColumn(ProgressColumn):
828
+ """Renders completed count/total, e.g. ' 10/1000'.
829
+
830
+ Best for bounded tasks with int quantities.
831
+
832
+ Space pads the completed count so that progress length does not change as task progresses
833
+ past powers of 10.
834
+
835
+ Args:
836
+ separator (str, optional): Text to separate completed and total values. Defaults to "/".
837
+ """
838
+
839
+ def __init__(self, separator: str = "/", table_column: Optional[Column] = None):
840
+ self.separator = separator
841
+ super().__init__(table_column=table_column)
842
+
843
+ def render(self, task: "Task") -> Text:
844
+ """Show completed/total."""
845
+ completed = int(task.completed)
846
+ total = int(task.total) if task.total is not None else "?"
847
+ total_width = len(str(total))
848
+ return Text(
849
+ f"{completed:{total_width}d}{self.separator}{total}",
850
+ style="progress.download",
851
+ )
852
+
853
+
854
+ class DownloadColumn(ProgressColumn):
855
+ """Renders file size downloaded and total, e.g. '0.5/2.3 GB'.
856
+
857
+ Args:
858
+ binary_units (bool, optional): Use binary units, KiB, MiB etc. Defaults to False.
859
+ """
860
+
861
+ def __init__(
862
+ self, binary_units: bool = False, table_column: Optional[Column] = None
863
+ ) -> None:
864
+ self.binary_units = binary_units
865
+ super().__init__(table_column=table_column)
866
+
867
+ def render(self, task: "Task") -> Text:
868
+ """Calculate common unit for completed and total."""
869
+ completed = int(task.completed)
870
+
871
+ unit_and_suffix_calculation_base = (
872
+ int(task.total) if task.total is not None else completed
873
+ )
874
+ if self.binary_units:
875
+ unit, suffix = filesize.pick_unit_and_suffix(
876
+ unit_and_suffix_calculation_base,
877
+ ["bytes", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB"],
878
+ 1024,
879
+ )
880
+ else:
881
+ unit, suffix = filesize.pick_unit_and_suffix(
882
+ unit_and_suffix_calculation_base,
883
+ ["bytes", "kB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"],
884
+ 1000,
885
+ )
886
+ precision = 0 if unit == 1 else 1
887
+
888
+ completed_ratio = completed / unit
889
+ completed_str = f"{completed_ratio:,.{precision}f}"
890
+
891
+ if task.total is not None:
892
+ total = int(task.total)
893
+ total_ratio = total / unit
894
+ total_str = f"{total_ratio:,.{precision}f}"
895
+ else:
896
+ total_str = "?"
897
+
898
+ download_status = f"{completed_str}/{total_str} {suffix}"
899
+ download_text = Text(download_status, style="progress.download")
900
+ return download_text
901
+
902
+
903
+ class TransferSpeedColumn(ProgressColumn):
904
+ """Renders human readable transfer speed."""
905
+
906
+ def render(self, task: "Task") -> Text:
907
+ """Show data transfer speed."""
908
+ speed = task.finished_speed or task.speed
909
+ if speed is None:
910
+ return Text("?", style="progress.data.speed")
911
+ data_speed = filesize.decimal(int(speed))
912
+ return Text(f"{data_speed}/s", style="progress.data.speed")
913
+
914
+
915
+ class ProgressSample(NamedTuple):
916
+ """Sample of progress for a given time."""
917
+
918
+ timestamp: float
919
+ """Timestamp of sample."""
920
+ completed: float
921
+ """Number of steps completed."""
922
+
923
+
924
+ @dataclass
925
+ class Task:
926
+ """Information regarding a progress task.
927
+
928
+ This object should be considered read-only outside of the :class:`~Progress` class.
929
+
930
+ """
931
+
932
+ id: TaskID
933
+ """Task ID associated with this task (used in Progress methods)."""
934
+
935
+ description: str
936
+ """str: Description of the task."""
937
+
938
+ total: Optional[float]
939
+ """Optional[float]: Total number of steps in this task."""
940
+
941
+ completed: float
942
+ """float: Number of steps completed"""
943
+
944
+ _get_time: GetTimeCallable
945
+ """Callable to get the current time."""
946
+
947
+ finished_time: Optional[float] = None
948
+ """float: Time task was finished."""
949
+
950
+ visible: bool = True
951
+ """bool: Indicates if this task is visible in the progress display."""
952
+
953
+ fields: Dict[str, Any] = field(default_factory=dict)
954
+ """dict: Arbitrary fields passed in via Progress.update."""
955
+
956
+ start_time: Optional[float] = field(default=None, init=False, repr=False)
957
+ """Optional[float]: Time this task was started, or None if not started."""
958
+
959
+ stop_time: Optional[float] = field(default=None, init=False, repr=False)
960
+ """Optional[float]: Time this task was stopped, or None if not stopped."""
961
+
962
+ finished_speed: Optional[float] = None
963
+ """Optional[float]: The last speed for a finished task."""
964
+
965
+ _progress: Deque[ProgressSample] = field(
966
+ default_factory=lambda: deque(maxlen=1000), init=False, repr=False
967
+ )
968
+
969
+ _lock: RLock = field(repr=False, default_factory=RLock)
970
+ """Thread lock."""
971
+
972
+ def get_time(self) -> float:
973
+ """float: Get the current time, in seconds."""
974
+ return self._get_time()
975
+
976
+ @property
977
+ def started(self) -> bool:
978
+ """bool: Check if the task as started."""
979
+ return self.start_time is not None
980
+
981
+ @property
982
+ def remaining(self) -> Optional[float]:
983
+ """Optional[float]: Get the number of steps remaining, if a non-None total was set."""
984
+ if self.total is None:
985
+ return None
986
+ return self.total - self.completed
987
+
988
+ @property
989
+ def elapsed(self) -> Optional[float]:
990
+ """Optional[float]: Time elapsed since task was started, or ``None`` if the task hasn't started."""
991
+ if self.start_time is None:
992
+ return None
993
+ if self.stop_time is not None:
994
+ return self.stop_time - self.start_time
995
+ return self.get_time() - self.start_time
996
+
997
+ @property
998
+ def finished(self) -> bool:
999
+ """Check if the task has finished."""
1000
+ return self.finished_time is not None
1001
+
1002
+ @property
1003
+ def percentage(self) -> float:
1004
+ """float: Get progress of task as a percentage. If a None total was set, returns 0"""
1005
+ if not self.total:
1006
+ return 0.0
1007
+ completed = (self.completed / self.total) * 100.0
1008
+ completed = min(100.0, max(0.0, completed))
1009
+ return completed
1010
+
1011
+ @property
1012
+ def speed(self) -> Optional[float]:
1013
+ """Optional[float]: Get the estimated speed in steps per second."""
1014
+ if self.start_time is None:
1015
+ return None
1016
+ with self._lock:
1017
+ progress = self._progress
1018
+ if not progress:
1019
+ return None
1020
+ total_time = progress[-1].timestamp - progress[0].timestamp
1021
+ if total_time == 0:
1022
+ return None
1023
+ iter_progress = iter(progress)
1024
+ next(iter_progress)
1025
+ total_completed = sum(sample.completed for sample in iter_progress)
1026
+ speed = total_completed / total_time
1027
+ return speed
1028
+
1029
+ @property
1030
+ def time_remaining(self) -> Optional[float]:
1031
+ """Optional[float]: Get estimated time to completion, or ``None`` if no data."""
1032
+ if self.finished:
1033
+ return 0.0
1034
+ speed = self.speed
1035
+ if not speed:
1036
+ return None
1037
+ remaining = self.remaining
1038
+ if remaining is None:
1039
+ return None
1040
+ estimate = ceil(remaining / speed)
1041
+ return estimate
1042
+
1043
+ def _reset(self) -> None:
1044
+ """Reset progress."""
1045
+ self._progress.clear()
1046
+ self.finished_time = None
1047
+ self.finished_speed = None
1048
+
1049
+
1050
+ class Progress(JupyterMixin):
1051
+ """Renders an auto-updating progress bar(s).
1052
+
1053
+ Args:
1054
+ console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout.
1055
+ auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`.
1056
+ refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information or None to use default (10). Defaults to None.
1057
+ speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30.
1058
+ transient: (bool, optional): Clear the progress on exit. Defaults to False.
1059
+ redirect_stdout: (bool, optional): Enable redirection of stdout, so ``print`` may be used. Defaults to True.
1060
+ redirect_stderr: (bool, optional): Enable redirection of stderr. Defaults to True.
1061
+ get_time: (Callable, optional): A callable that gets the current time, or None to use Console.get_time. Defaults to None.
1062
+ disable (bool, optional): Disable progress display. Defaults to False
1063
+ expand (bool, optional): Expand tasks table to fit width. Defaults to False.
1064
+ """
1065
+
1066
+ def __init__(
1067
+ self,
1068
+ *columns: Union[str, ProgressColumn],
1069
+ console: Optional[Console] = None,
1070
+ auto_refresh: bool = True,
1071
+ refresh_per_second: float = 10,
1072
+ speed_estimate_period: float = 30.0,
1073
+ transient: bool = False,
1074
+ redirect_stdout: bool = True,
1075
+ redirect_stderr: bool = True,
1076
+ get_time: Optional[GetTimeCallable] = None,
1077
+ disable: bool = False,
1078
+ expand: bool = False,
1079
+ ) -> None:
1080
+ assert refresh_per_second > 0, "refresh_per_second must be > 0"
1081
+ self._lock = RLock()
1082
+ self.columns = columns or self.get_default_columns()
1083
+ self.speed_estimate_period = speed_estimate_period
1084
+
1085
+ self.disable = disable
1086
+ self.expand = expand
1087
+ self._tasks: Dict[TaskID, Task] = {}
1088
+ self._task_index: TaskID = TaskID(0)
1089
+ self.live = Live(
1090
+ console=console or get_console(),
1091
+ auto_refresh=auto_refresh,
1092
+ refresh_per_second=refresh_per_second,
1093
+ transient=transient,
1094
+ redirect_stdout=redirect_stdout,
1095
+ redirect_stderr=redirect_stderr,
1096
+ get_renderable=self.get_renderable,
1097
+ )
1098
+ self.get_time = get_time or self.console.get_time
1099
+ self.print = self.console.print
1100
+ self.log = self.console.log
1101
+
1102
+ @classmethod
1103
+ def get_default_columns(cls) -> Tuple[ProgressColumn, ...]:
1104
+ """Get the default columns used for a new Progress instance:
1105
+ - a text column for the description (TextColumn)
1106
+ - the bar itself (BarColumn)
1107
+ - a text column showing completion percentage (TextColumn)
1108
+ - an estimated-time-remaining column (TimeRemainingColumn)
1109
+ If the Progress instance is created without passing a columns argument,
1110
+ the default columns defined here will be used.
1111
+
1112
+ You can also create a Progress instance using custom columns before
1113
+ and/or after the defaults, as in this example:
1114
+
1115
+ progress = Progress(
1116
+ SpinnerColumn(),
1117
+ *Progress.default_columns(),
1118
+ "Elapsed:",
1119
+ TimeElapsedColumn(),
1120
+ )
1121
+
1122
+ This code shows the creation of a Progress display, containing
1123
+ a spinner to the left, the default columns, and a labeled elapsed
1124
+ time column.
1125
+ """
1126
+ return (
1127
+ TextColumn("[progress.description]{task.description}"),
1128
+ BarColumn(),
1129
+ TaskProgressColumn(),
1130
+ TimeRemainingColumn(),
1131
+ )
1132
+
1133
+ @property
1134
+ def console(self) -> Console:
1135
+ return self.live.console
1136
+
1137
+ @property
1138
+ def tasks(self) -> List[Task]:
1139
+ """Get a list of Task instances."""
1140
+ with self._lock:
1141
+ return list(self._tasks.values())
1142
+
1143
+ @property
1144
+ def task_ids(self) -> List[TaskID]:
1145
+ """A list of task IDs."""
1146
+ with self._lock:
1147
+ return list(self._tasks.keys())
1148
+
1149
+ @property
1150
+ def finished(self) -> bool:
1151
+ """Check if all tasks have been completed."""
1152
+ with self._lock:
1153
+ if not self._tasks:
1154
+ return True
1155
+ return all(task.finished for task in self._tasks.values())
1156
+
1157
+ def start(self) -> None:
1158
+ """Start the progress display."""
1159
+ if not self.disable:
1160
+ self.live.start(refresh=True)
1161
+
1162
+ def stop(self) -> None:
1163
+ """Stop the progress display."""
1164
+ self.live.stop()
1165
+ if not self.console.is_interactive:
1166
+ self.console.print()
1167
+
1168
+ def __enter__(self) -> "Progress":
1169
+ self.start()
1170
+ return self
1171
+
1172
+ def __exit__(
1173
+ self,
1174
+ exc_type: Optional[Type[BaseException]],
1175
+ exc_val: Optional[BaseException],
1176
+ exc_tb: Optional[TracebackType],
1177
+ ) -> None:
1178
+ self.stop()
1179
+
1180
+ def track(
1181
+ self,
1182
+ sequence: Union[Iterable[ProgressType], Sequence[ProgressType]],
1183
+ total: Optional[float] = None,
1184
+ task_id: Optional[TaskID] = None,
1185
+ description: str = "Working...",
1186
+ update_period: float = 0.1,
1187
+ ) -> Iterable[ProgressType]:
1188
+ """Track progress by iterating over a sequence.
1189
+
1190
+ Args:
1191
+ sequence (Sequence[ProgressType]): A sequence of values you want to iterate over and track progress.
1192
+ total: (float, optional): Total number of steps. Default is len(sequence).
1193
+ task_id: (TaskID): Task to track. Default is new task.
1194
+ description: (str, optional): Description of task, if new task is created.
1195
+ update_period (float, optional): Minimum time (in seconds) between calls to update(). Defaults to 0.1.
1196
+
1197
+ Returns:
1198
+ Iterable[ProgressType]: An iterable of values taken from the provided sequence.
1199
+ """
1200
+ if total is None:
1201
+ total = float(length_hint(sequence)) or None
1202
+
1203
+ if task_id is None:
1204
+ task_id = self.add_task(description, total=total)
1205
+ else:
1206
+ self.update(task_id, total=total)
1207
+
1208
+ if self.live.auto_refresh:
1209
+ with _TrackThread(self, task_id, update_period) as track_thread:
1210
+ for value in sequence:
1211
+ yield value
1212
+ track_thread.completed += 1
1213
+ else:
1214
+ advance = self.advance
1215
+ refresh = self.refresh
1216
+ for value in sequence:
1217
+ yield value
1218
+ advance(task_id, 1)
1219
+ refresh()
1220
+
1221
+ def wrap_file(
1222
+ self,
1223
+ file: BinaryIO,
1224
+ total: Optional[int] = None,
1225
+ *,
1226
+ task_id: Optional[TaskID] = None,
1227
+ description: str = "Reading...",
1228
+ ) -> BinaryIO:
1229
+ """Track progress file reading from a binary file.
1230
+
1231
+ Args:
1232
+ file (BinaryIO): A file-like object opened in binary mode.
1233
+ total (int, optional): Total number of bytes to read. This must be provided unless a task with a total is also given.
1234
+ task_id (TaskID): Task to track. Default is new task.
1235
+ description (str, optional): Description of task, if new task is created.
1236
+
1237
+ Returns:
1238
+ BinaryIO: A readable file-like object in binary mode.
1239
+
1240
+ Raises:
1241
+ ValueError: When no total value can be extracted from the arguments or the task.
1242
+ """
1243
+ # attempt to recover the total from the task
1244
+ total_bytes: Optional[float] = None
1245
+ if total is not None:
1246
+ total_bytes = total
1247
+ elif task_id is not None:
1248
+ with self._lock:
1249
+ total_bytes = self._tasks[task_id].total
1250
+ if total_bytes is None:
1251
+ raise ValueError(
1252
+ f"unable to get the total number of bytes, please specify 'total'"
1253
+ )
1254
+
1255
+ # update total of task or create new task
1256
+ if task_id is None:
1257
+ task_id = self.add_task(description, total=total_bytes)
1258
+ else:
1259
+ self.update(task_id, total=total_bytes)
1260
+
1261
+ return _Reader(file, self, task_id, close_handle=False)
1262
+
1263
+ @typing.overload
1264
+ def open(
1265
+ self,
1266
+ file: Union[str, "PathLike[str]", bytes],
1267
+ mode: Literal["rb"],
1268
+ buffering: int = -1,
1269
+ encoding: Optional[str] = None,
1270
+ errors: Optional[str] = None,
1271
+ newline: Optional[str] = None,
1272
+ *,
1273
+ total: Optional[int] = None,
1274
+ task_id: Optional[TaskID] = None,
1275
+ description: str = "Reading...",
1276
+ ) -> BinaryIO:
1277
+ pass
1278
+
1279
+ @typing.overload
1280
+ def open(
1281
+ self,
1282
+ file: Union[str, "PathLike[str]", bytes],
1283
+ mode: Union[Literal["r"], Literal["rt"]],
1284
+ buffering: int = -1,
1285
+ encoding: Optional[str] = None,
1286
+ errors: Optional[str] = None,
1287
+ newline: Optional[str] = None,
1288
+ *,
1289
+ total: Optional[int] = None,
1290
+ task_id: Optional[TaskID] = None,
1291
+ description: str = "Reading...",
1292
+ ) -> TextIO:
1293
+ pass
1294
+
1295
+ def open(
1296
+ self,
1297
+ file: Union[str, "PathLike[str]", bytes],
1298
+ mode: Union[Literal["rb"], Literal["rt"], Literal["r"]] = "r",
1299
+ buffering: int = -1,
1300
+ encoding: Optional[str] = None,
1301
+ errors: Optional[str] = None,
1302
+ newline: Optional[str] = None,
1303
+ *,
1304
+ total: Optional[int] = None,
1305
+ task_id: Optional[TaskID] = None,
1306
+ description: str = "Reading...",
1307
+ ) -> Union[BinaryIO, TextIO]:
1308
+ """Track progress while reading from a binary file.
1309
+
1310
+ Args:
1311
+ path (Union[str, PathLike[str]]): The path to the file to read.
1312
+ mode (str): The mode to use to open the file. Only supports "r", "rb" or "rt".
1313
+ buffering (int): The buffering strategy to use, see :func:`io.open`.
1314
+ encoding (str, optional): The encoding to use when reading in text mode, see :func:`io.open`.
1315
+ errors (str, optional): The error handling strategy for decoding errors, see :func:`io.open`.
1316
+ newline (str, optional): The strategy for handling newlines in text mode, see :func:`io.open`.
1317
+ total (int, optional): Total number of bytes to read. If none given, os.stat(path).st_size is used.
1318
+ task_id (TaskID): Task to track. Default is new task.
1319
+ description (str, optional): Description of task, if new task is created.
1320
+
1321
+ Returns:
1322
+ BinaryIO: A readable file-like object in binary mode.
1323
+
1324
+ Raises:
1325
+ ValueError: When an invalid mode is given.
1326
+ """
1327
+ # normalize the mode (always rb, rt)
1328
+ _mode = "".join(sorted(mode, reverse=False))
1329
+ if _mode not in ("br", "rt", "r"):
1330
+ raise ValueError("invalid mode {!r}".format(mode))
1331
+
1332
+ # patch buffering to provide the same behaviour as the builtin `open`
1333
+ line_buffering = buffering == 1
1334
+ if _mode == "br" and buffering == 1:
1335
+ warnings.warn(
1336
+ "line buffering (buffering=1) isn't supported in binary mode, the default buffer size will be used",
1337
+ RuntimeWarning,
1338
+ )
1339
+ buffering = -1
1340
+ elif _mode in ("rt", "r"):
1341
+ if buffering == 0:
1342
+ raise ValueError("can't have unbuffered text I/O")
1343
+ elif buffering == 1:
1344
+ buffering = -1
1345
+
1346
+ # attempt to get the total with `os.stat`
1347
+ if total is None:
1348
+ total = stat(file).st_size
1349
+
1350
+ # update total of task or create new task
1351
+ if task_id is None:
1352
+ task_id = self.add_task(description, total=total)
1353
+ else:
1354
+ self.update(task_id, total=total)
1355
+
1356
+ # open the file in binary mode,
1357
+ handle = io.open(file, "rb", buffering=buffering)
1358
+ reader = _Reader(handle, self, task_id, close_handle=True)
1359
+
1360
+ # wrap the reader in a `TextIOWrapper` if text mode
1361
+ if mode in ("r", "rt"):
1362
+ return io.TextIOWrapper(
1363
+ reader,
1364
+ encoding=encoding,
1365
+ errors=errors,
1366
+ newline=newline,
1367
+ line_buffering=line_buffering,
1368
+ )
1369
+
1370
+ return reader
1371
+
1372
+ def start_task(self, task_id: TaskID) -> None:
1373
+ """Start a task.
1374
+
1375
+ Starts a task (used when calculating elapsed time). You may need to call this manually,
1376
+ if you called ``add_task`` with ``start=False``.
1377
+
1378
+ Args:
1379
+ task_id (TaskID): ID of task.
1380
+ """
1381
+ with self._lock:
1382
+ task = self._tasks[task_id]
1383
+ if task.start_time is None:
1384
+ task.start_time = self.get_time()
1385
+
1386
+ def stop_task(self, task_id: TaskID) -> None:
1387
+ """Stop a task.
1388
+
1389
+ This will freeze the elapsed time on the task.
1390
+
1391
+ Args:
1392
+ task_id (TaskID): ID of task.
1393
+ """
1394
+ with self._lock:
1395
+ task = self._tasks[task_id]
1396
+ current_time = self.get_time()
1397
+ if task.start_time is None:
1398
+ task.start_time = current_time
1399
+ task.stop_time = current_time
1400
+
1401
+ def update(
1402
+ self,
1403
+ task_id: TaskID,
1404
+ *,
1405
+ total: Optional[float] = None,
1406
+ completed: Optional[float] = None,
1407
+ advance: Optional[float] = None,
1408
+ description: Optional[str] = None,
1409
+ visible: Optional[bool] = None,
1410
+ refresh: bool = False,
1411
+ **fields: Any,
1412
+ ) -> None:
1413
+ """Update information associated with a task.
1414
+
1415
+ Args:
1416
+ task_id (TaskID): Task id (returned by add_task).
1417
+ total (float, optional): Updates task.total if not None.
1418
+ completed (float, optional): Updates task.completed if not None.
1419
+ advance (float, optional): Add a value to task.completed if not None.
1420
+ description (str, optional): Change task description if not None.
1421
+ visible (bool, optional): Set visible flag if not None.
1422
+ refresh (bool): Force a refresh of progress information. Default is False.
1423
+ **fields (Any): Additional data fields required for rendering.
1424
+ """
1425
+ with self._lock:
1426
+ task = self._tasks[task_id]
1427
+ completed_start = task.completed
1428
+
1429
+ if total is not None and total != task.total:
1430
+ task.total = total
1431
+ task._reset()
1432
+ if advance is not None:
1433
+ task.completed += advance
1434
+ if completed is not None:
1435
+ task.completed = completed
1436
+ if description is not None:
1437
+ task.description = description
1438
+ if visible is not None:
1439
+ task.visible = visible
1440
+ task.fields.update(fields)
1441
+ update_completed = task.completed - completed_start
1442
+
1443
+ current_time = self.get_time()
1444
+ old_sample_time = current_time - self.speed_estimate_period
1445
+ _progress = task._progress
1446
+
1447
+ popleft = _progress.popleft
1448
+ while _progress and _progress[0].timestamp < old_sample_time:
1449
+ popleft()
1450
+ if update_completed > 0:
1451
+ _progress.append(ProgressSample(current_time, update_completed))
1452
+ if (
1453
+ task.total is not None
1454
+ and task.completed >= task.total
1455
+ and task.finished_time is None
1456
+ ):
1457
+ task.finished_time = task.elapsed
1458
+
1459
+ if refresh:
1460
+ self.refresh()
1461
+
1462
+ def reset(
1463
+ self,
1464
+ task_id: TaskID,
1465
+ *,
1466
+ start: bool = True,
1467
+ total: Optional[float] = None,
1468
+ completed: int = 0,
1469
+ visible: Optional[bool] = None,
1470
+ description: Optional[str] = None,
1471
+ **fields: Any,
1472
+ ) -> None:
1473
+ """Reset a task so completed is 0 and the clock is reset.
1474
+
1475
+ Args:
1476
+ task_id (TaskID): ID of task.
1477
+ start (bool, optional): Start the task after reset. Defaults to True.
1478
+ total (float, optional): New total steps in task, or None to use current total. Defaults to None.
1479
+ completed (int, optional): Number of steps completed. Defaults to 0.
1480
+ visible (bool, optional): Enable display of the task. Defaults to True.
1481
+ description (str, optional): Change task description if not None. Defaults to None.
1482
+ **fields (str): Additional data fields required for rendering.
1483
+ """
1484
+ current_time = self.get_time()
1485
+ with self._lock:
1486
+ task = self._tasks[task_id]
1487
+ task._reset()
1488
+ task.start_time = current_time if start else None
1489
+ if total is not None:
1490
+ task.total = total
1491
+ task.completed = completed
1492
+ if visible is not None:
1493
+ task.visible = visible
1494
+ if fields:
1495
+ task.fields = fields
1496
+ if description is not None:
1497
+ task.description = description
1498
+ task.finished_time = None
1499
+ self.refresh()
1500
+
1501
+ def advance(self, task_id: TaskID, advance: float = 1) -> None:
1502
+ """Advance task by a number of steps.
1503
+
1504
+ Args:
1505
+ task_id (TaskID): ID of task.
1506
+ advance (float): Number of steps to advance. Default is 1.
1507
+ """
1508
+ current_time = self.get_time()
1509
+ with self._lock:
1510
+ task = self._tasks[task_id]
1511
+ completed_start = task.completed
1512
+ task.completed += advance
1513
+ update_completed = task.completed - completed_start
1514
+ old_sample_time = current_time - self.speed_estimate_period
1515
+ _progress = task._progress
1516
+
1517
+ popleft = _progress.popleft
1518
+ while _progress and _progress[0].timestamp < old_sample_time:
1519
+ popleft()
1520
+ while len(_progress) > 1000:
1521
+ popleft()
1522
+ _progress.append(ProgressSample(current_time, update_completed))
1523
+ if (
1524
+ task.total is not None
1525
+ and task.completed >= task.total
1526
+ and task.finished_time is None
1527
+ ):
1528
+ task.finished_time = task.elapsed
1529
+ task.finished_speed = task.speed
1530
+
1531
+ def refresh(self) -> None:
1532
+ """Refresh (render) the progress information."""
1533
+ if not self.disable and self.live.is_started:
1534
+ self.live.refresh()
1535
+
1536
+ def get_renderable(self) -> RenderableType:
1537
+ """Get a renderable for the progress display."""
1538
+ renderable = Group(*self.get_renderables())
1539
+ return renderable
1540
+
1541
+ def get_renderables(self) -> Iterable[RenderableType]:
1542
+ """Get a number of renderables for the progress display."""
1543
+ table = self.make_tasks_table(self.tasks)
1544
+ yield table
1545
+
1546
+ def make_tasks_table(self, tasks: Iterable[Task]) -> Table:
1547
+ """Get a table to render the Progress display.
1548
+
1549
+ Args:
1550
+ tasks (Iterable[Task]): An iterable of Task instances, one per row of the table.
1551
+
1552
+ Returns:
1553
+ Table: A table instance.
1554
+ """
1555
+ table_columns = (
1556
+ (
1557
+ Column(no_wrap=True)
1558
+ if isinstance(_column, str)
1559
+ else _column.get_table_column().copy()
1560
+ )
1561
+ for _column in self.columns
1562
+ )
1563
+ table = Table.grid(*table_columns, padding=(0, 1), expand=self.expand)
1564
+
1565
+ for task in tasks:
1566
+ if task.visible:
1567
+ table.add_row(
1568
+ *(
1569
+ (
1570
+ column.format(task=task)
1571
+ if isinstance(column, str)
1572
+ else column(task)
1573
+ )
1574
+ for column in self.columns
1575
+ )
1576
+ )
1577
+ return table
1578
+
1579
+ def __rich__(self) -> RenderableType:
1580
+ """Makes the Progress class itself renderable."""
1581
+ with self._lock:
1582
+ return self.get_renderable()
1583
+
1584
+ def add_task(
1585
+ self,
1586
+ description: str,
1587
+ start: bool = True,
1588
+ total: Optional[float] = 100.0,
1589
+ completed: int = 0,
1590
+ visible: bool = True,
1591
+ **fields: Any,
1592
+ ) -> TaskID:
1593
+ """Add a new 'task' to the Progress display.
1594
+
1595
+ Args:
1596
+ description (str): A description of the task.
1597
+ start (bool, optional): Start the task immediately (to calculate elapsed time). If set to False,
1598
+ you will need to call `start` manually. Defaults to True.
1599
+ total (float, optional): Number of total steps in the progress if known.
1600
+ Set to None to render a pulsing animation. Defaults to 100.
1601
+ completed (int, optional): Number of steps completed so far. Defaults to 0.
1602
+ visible (bool, optional): Enable display of the task. Defaults to True.
1603
+ **fields (str): Additional data fields required for rendering.
1604
+
1605
+ Returns:
1606
+ TaskID: An ID you can use when calling `update`.
1607
+ """
1608
+ with self._lock:
1609
+ task = Task(
1610
+ self._task_index,
1611
+ description,
1612
+ total,
1613
+ completed,
1614
+ visible=visible,
1615
+ fields=fields,
1616
+ _get_time=self.get_time,
1617
+ _lock=self._lock,
1618
+ )
1619
+ self._tasks[self._task_index] = task
1620
+ if start:
1621
+ self.start_task(self._task_index)
1622
+ new_task_index = self._task_index
1623
+ self._task_index = TaskID(int(self._task_index) + 1)
1624
+ self.refresh()
1625
+ return new_task_index
1626
+
1627
+ def remove_task(self, task_id: TaskID) -> None:
1628
+ """Delete a task if it exists.
1629
+
1630
+ Args:
1631
+ task_id (TaskID): A task ID.
1632
+
1633
+ """
1634
+ with self._lock:
1635
+ del self._tasks[task_id]
1636
+
1637
+
1638
+ if __name__ == "__main__": # pragma: no coverage
1639
+
1640
+ import random
1641
+ import time
1642
+
1643
+ from .panel import Panel
1644
+ from .rule import Rule
1645
+ from .syntax import Syntax
1646
+ from .table import Table
1647
+
1648
+ syntax = Syntax(
1649
+ '''def loop_last(values: Iterable[T]) -> Iterable[Tuple[bool, T]]:
1650
+ """Iterate and generate a tuple with a flag for last value."""
1651
+ iter_values = iter(values)
1652
+ try:
1653
+ previous_value = next(iter_values)
1654
+ except StopIteration:
1655
+ return
1656
+ for value in iter_values:
1657
+ yield False, previous_value
1658
+ previous_value = value
1659
+ yield True, previous_value''',
1660
+ "python",
1661
+ line_numbers=True,
1662
+ )
1663
+
1664
+ table = Table("foo", "bar", "baz")
1665
+ table.add_row("1", "2", "3")
1666
+
1667
+ progress_renderables = [
1668
+ "Text may be printed while the progress bars are rendering.",
1669
+ Panel("In fact, [i]any[/i] renderable will work"),
1670
+ "Such as [magenta]tables[/]...",
1671
+ table,
1672
+ "Pretty printed structures...",
1673
+ {"type": "example", "text": "Pretty printed"},
1674
+ "Syntax...",
1675
+ syntax,
1676
+ Rule("Give it a try!"),
1677
+ ]
1678
+
1679
+ from itertools import cycle
1680
+
1681
+ examples = cycle(progress_renderables)
1682
+
1683
+ console = Console(record=True)
1684
+
1685
+ with Progress(
1686
+ SpinnerColumn(),
1687
+ *Progress.get_default_columns(),
1688
+ TimeElapsedColumn(),
1689
+ console=console,
1690
+ transient=False,
1691
+ ) as progress:
1692
+
1693
+ task1 = progress.add_task("[red]Downloading", total=1000)
1694
+ task2 = progress.add_task("[green]Processing", total=1000)
1695
+ task3 = progress.add_task("[yellow]Thinking", total=None)
1696
+
1697
+ while not progress.finished:
1698
+ progress.update(task1, advance=0.5)
1699
+ progress.update(task2, advance=0.3)
1700
+ time.sleep(0.01)
1701
+ if random.randint(0, 100) < 1:
1702
+ progress.log(next(examples))