@djlint/linux-s390x-gnu 0.0.0 → 1.54.2

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 (1693) hide show
  1. package/LICENSE +675 -0
  2. package/README.md +3 -1
  3. package/package.json +1 -8
  4. package/python/bin/python3 +0 -0
  5. package/python/lib/python3.15/LICENSE.txt +277 -0
  6. package/python/lib/python3.15/__future__.py +147 -0
  7. package/python/lib/python3.15/__hello__.py +16 -0
  8. package/python/lib/python3.15/__phello__/__init__.py +7 -0
  9. package/python/lib/python3.15/__phello__/__pycache__/__init__.cpython-315.pyc +0 -0
  10. package/python/lib/python3.15/__phello__/__pycache__/spam.cpython-315.pyc +0 -0
  11. package/python/lib/python3.15/__phello__/spam.py +7 -0
  12. package/python/lib/python3.15/__pycache__/__future__.cpython-315.pyc +0 -0
  13. package/python/lib/python3.15/__pycache__/__hello__.cpython-315.pyc +0 -0
  14. package/python/lib/python3.15/__pycache__/_aix_support.cpython-315.pyc +0 -0
  15. package/python/lib/python3.15/__pycache__/_android_support.cpython-315.pyc +0 -0
  16. package/python/lib/python3.15/__pycache__/_apple_support.cpython-315.pyc +0 -0
  17. package/python/lib/python3.15/__pycache__/_ast_unparse.cpython-315.pyc +0 -0
  18. package/python/lib/python3.15/__pycache__/_collections_abc.cpython-315.pyc +0 -0
  19. package/python/lib/python3.15/__pycache__/_colorize.cpython-315.pyc +0 -0
  20. package/python/lib/python3.15/__pycache__/_compat_pickle.cpython-315.pyc +0 -0
  21. package/python/lib/python3.15/__pycache__/_ios_support.cpython-315.pyc +0 -0
  22. package/python/lib/python3.15/__pycache__/_markupbase.cpython-315.pyc +0 -0
  23. package/python/lib/python3.15/__pycache__/_missing_stdlib_info.cpython-315.pyc +0 -0
  24. package/python/lib/python3.15/__pycache__/_opcode_metadata.cpython-315.pyc +0 -0
  25. package/python/lib/python3.15/__pycache__/_osx_support.cpython-315.pyc +0 -0
  26. package/python/lib/python3.15/__pycache__/_py_abc.cpython-315.pyc +0 -0
  27. package/python/lib/python3.15/__pycache__/_py_warnings.cpython-315.pyc +0 -0
  28. package/python/lib/python3.15/__pycache__/_pydatetime.cpython-315.pyc +0 -0
  29. package/python/lib/python3.15/__pycache__/_pydecimal.cpython-315.pyc +0 -0
  30. package/python/lib/python3.15/__pycache__/_pyio.cpython-315.pyc +0 -0
  31. package/python/lib/python3.15/__pycache__/_pylong.cpython-315.pyc +0 -0
  32. package/python/lib/python3.15/__pycache__/_sitebuiltins.cpython-315.pyc +0 -0
  33. package/python/lib/python3.15/__pycache__/_strptime.cpython-315.pyc +0 -0
  34. package/python/lib/python3.15/__pycache__/_sysconfigdata__linux_s390x-linux-gnu.cpython-315.pyc +0 -0
  35. package/python/lib/python3.15/__pycache__/_threading_local.cpython-315.pyc +0 -0
  36. package/python/lib/python3.15/__pycache__/_weakrefset.cpython-315.pyc +0 -0
  37. package/python/lib/python3.15/__pycache__/abc.cpython-315.pyc +0 -0
  38. package/python/lib/python3.15/__pycache__/annotationlib.cpython-315.pyc +0 -0
  39. package/python/lib/python3.15/__pycache__/antigravity.cpython-315.pyc +0 -0
  40. package/python/lib/python3.15/__pycache__/argparse.cpython-315.pyc +0 -0
  41. package/python/lib/python3.15/__pycache__/ast.cpython-315.pyc +0 -0
  42. package/python/lib/python3.15/__pycache__/base64.cpython-315.pyc +0 -0
  43. package/python/lib/python3.15/__pycache__/bdb.cpython-315.pyc +0 -0
  44. package/python/lib/python3.15/__pycache__/bisect.cpython-315.pyc +0 -0
  45. package/python/lib/python3.15/__pycache__/bz2.cpython-315.pyc +0 -0
  46. package/python/lib/python3.15/__pycache__/cProfile.cpython-315.pyc +0 -0
  47. package/python/lib/python3.15/__pycache__/calendar.cpython-315.pyc +0 -0
  48. package/python/lib/python3.15/__pycache__/cmd.cpython-315.pyc +0 -0
  49. package/python/lib/python3.15/__pycache__/code.cpython-315.pyc +0 -0
  50. package/python/lib/python3.15/__pycache__/codecs.cpython-315.pyc +0 -0
  51. package/python/lib/python3.15/__pycache__/codeop.cpython-315.pyc +0 -0
  52. package/python/lib/python3.15/__pycache__/colorsys.cpython-315.pyc +0 -0
  53. package/python/lib/python3.15/__pycache__/compileall.cpython-315.pyc +0 -0
  54. package/python/lib/python3.15/__pycache__/configparser.cpython-315.pyc +0 -0
  55. package/python/lib/python3.15/__pycache__/contextlib.cpython-315.pyc +0 -0
  56. package/python/lib/python3.15/__pycache__/contextvars.cpython-315.pyc +0 -0
  57. package/python/lib/python3.15/__pycache__/copy.cpython-315.pyc +0 -0
  58. package/python/lib/python3.15/__pycache__/copyreg.cpython-315.pyc +0 -0
  59. package/python/lib/python3.15/__pycache__/csv.cpython-315.pyc +0 -0
  60. package/python/lib/python3.15/__pycache__/dataclasses.cpython-315.pyc +0 -0
  61. package/python/lib/python3.15/__pycache__/datetime.cpython-315.pyc +0 -0
  62. package/python/lib/python3.15/__pycache__/decimal.cpython-315.pyc +0 -0
  63. package/python/lib/python3.15/__pycache__/difflib.cpython-315.pyc +0 -0
  64. package/python/lib/python3.15/__pycache__/dis.cpython-315.pyc +0 -0
  65. package/python/lib/python3.15/__pycache__/doctest.cpython-315.pyc +0 -0
  66. package/python/lib/python3.15/__pycache__/enum.cpython-315.pyc +0 -0
  67. package/python/lib/python3.15/__pycache__/filecmp.cpython-315.pyc +0 -0
  68. package/python/lib/python3.15/__pycache__/fileinput.cpython-315.pyc +0 -0
  69. package/python/lib/python3.15/__pycache__/fnmatch.cpython-315.pyc +0 -0
  70. package/python/lib/python3.15/__pycache__/fractions.cpython-315.pyc +0 -0
  71. package/python/lib/python3.15/__pycache__/ftplib.cpython-315.pyc +0 -0
  72. package/python/lib/python3.15/__pycache__/functools.cpython-315.pyc +0 -0
  73. package/python/lib/python3.15/__pycache__/genericpath.cpython-315.pyc +0 -0
  74. package/python/lib/python3.15/__pycache__/getopt.cpython-315.pyc +0 -0
  75. package/python/lib/python3.15/__pycache__/getpass.cpython-315.pyc +0 -0
  76. package/python/lib/python3.15/__pycache__/gettext.cpython-315.pyc +0 -0
  77. package/python/lib/python3.15/__pycache__/glob.cpython-315.pyc +0 -0
  78. package/python/lib/python3.15/__pycache__/graphlib.cpython-315.pyc +0 -0
  79. package/python/lib/python3.15/__pycache__/gzip.cpython-315.pyc +0 -0
  80. package/python/lib/python3.15/__pycache__/hashlib.cpython-315.pyc +0 -0
  81. package/python/lib/python3.15/__pycache__/heapq.cpython-315.pyc +0 -0
  82. package/python/lib/python3.15/__pycache__/hmac.cpython-315.pyc +0 -0
  83. package/python/lib/python3.15/__pycache__/imaplib.cpython-315.pyc +0 -0
  84. package/python/lib/python3.15/__pycache__/inspect.cpython-315.pyc +0 -0
  85. package/python/lib/python3.15/__pycache__/io.cpython-315.pyc +0 -0
  86. package/python/lib/python3.15/__pycache__/ipaddress.cpython-315.pyc +0 -0
  87. package/python/lib/python3.15/__pycache__/keyword.cpython-315.pyc +0 -0
  88. package/python/lib/python3.15/__pycache__/linecache.cpython-315.pyc +0 -0
  89. package/python/lib/python3.15/__pycache__/locale.cpython-315.pyc +0 -0
  90. package/python/lib/python3.15/__pycache__/lzma.cpython-315.pyc +0 -0
  91. package/python/lib/python3.15/__pycache__/mailbox.cpython-315.pyc +0 -0
  92. package/python/lib/python3.15/__pycache__/mimetypes.cpython-315.pyc +0 -0
  93. package/python/lib/python3.15/__pycache__/modulefinder.cpython-315.pyc +0 -0
  94. package/python/lib/python3.15/__pycache__/netrc.cpython-315.pyc +0 -0
  95. package/python/lib/python3.15/__pycache__/ntpath.cpython-315.pyc +0 -0
  96. package/python/lib/python3.15/__pycache__/nturl2path.cpython-315.pyc +0 -0
  97. package/python/lib/python3.15/__pycache__/numbers.cpython-315.pyc +0 -0
  98. package/python/lib/python3.15/__pycache__/opcode.cpython-315.pyc +0 -0
  99. package/python/lib/python3.15/__pycache__/operator.cpython-315.pyc +0 -0
  100. package/python/lib/python3.15/__pycache__/optparse.cpython-315.pyc +0 -0
  101. package/python/lib/python3.15/__pycache__/os.cpython-315.pyc +0 -0
  102. package/python/lib/python3.15/__pycache__/pdb.cpython-315.pyc +0 -0
  103. package/python/lib/python3.15/__pycache__/pickle.cpython-315.pyc +0 -0
  104. package/python/lib/python3.15/__pycache__/pickletools.cpython-315.pyc +0 -0
  105. package/python/lib/python3.15/__pycache__/pkgutil.cpython-315.pyc +0 -0
  106. package/python/lib/python3.15/__pycache__/platform.cpython-315.pyc +0 -0
  107. package/python/lib/python3.15/__pycache__/plistlib.cpython-315.pyc +0 -0
  108. package/python/lib/python3.15/__pycache__/poplib.cpython-315.pyc +0 -0
  109. package/python/lib/python3.15/__pycache__/posixpath.cpython-315.pyc +0 -0
  110. package/python/lib/python3.15/__pycache__/pprint.cpython-315.pyc +0 -0
  111. package/python/lib/python3.15/__pycache__/profile.cpython-315.pyc +0 -0
  112. package/python/lib/python3.15/__pycache__/pstats.cpython-315.pyc +0 -0
  113. package/python/lib/python3.15/__pycache__/pty.cpython-315.pyc +0 -0
  114. package/python/lib/python3.15/__pycache__/py_compile.cpython-315.pyc +0 -0
  115. package/python/lib/python3.15/__pycache__/pyclbr.cpython-315.pyc +0 -0
  116. package/python/lib/python3.15/__pycache__/pydoc.cpython-315.pyc +0 -0
  117. package/python/lib/python3.15/__pycache__/queue.cpython-315.pyc +0 -0
  118. package/python/lib/python3.15/__pycache__/quopri.cpython-315.pyc +0 -0
  119. package/python/lib/python3.15/__pycache__/random.cpython-315.pyc +0 -0
  120. package/python/lib/python3.15/__pycache__/reprlib.cpython-315.pyc +0 -0
  121. package/python/lib/python3.15/__pycache__/rlcompleter.cpython-315.pyc +0 -0
  122. package/python/lib/python3.15/__pycache__/runpy.cpython-315.pyc +0 -0
  123. package/python/lib/python3.15/__pycache__/sched.cpython-315.pyc +0 -0
  124. package/python/lib/python3.15/__pycache__/secrets.cpython-315.pyc +0 -0
  125. package/python/lib/python3.15/__pycache__/selectors.cpython-315.pyc +0 -0
  126. package/python/lib/python3.15/__pycache__/shelve.cpython-315.pyc +0 -0
  127. package/python/lib/python3.15/__pycache__/shlex.cpython-315.pyc +0 -0
  128. package/python/lib/python3.15/__pycache__/shutil.cpython-315.pyc +0 -0
  129. package/python/lib/python3.15/__pycache__/signal.cpython-315.pyc +0 -0
  130. package/python/lib/python3.15/__pycache__/site.cpython-315.pyc +0 -0
  131. package/python/lib/python3.15/__pycache__/smtplib.cpython-315.pyc +0 -0
  132. package/python/lib/python3.15/__pycache__/socket.cpython-315.pyc +0 -0
  133. package/python/lib/python3.15/__pycache__/socketserver.cpython-315.pyc +0 -0
  134. package/python/lib/python3.15/__pycache__/ssl.cpython-315.pyc +0 -0
  135. package/python/lib/python3.15/__pycache__/stat.cpython-315.pyc +0 -0
  136. package/python/lib/python3.15/__pycache__/statistics.cpython-315.pyc +0 -0
  137. package/python/lib/python3.15/__pycache__/stringprep.cpython-315.pyc +0 -0
  138. package/python/lib/python3.15/__pycache__/struct.cpython-315.pyc +0 -0
  139. package/python/lib/python3.15/__pycache__/subprocess.cpython-315.pyc +0 -0
  140. package/python/lib/python3.15/__pycache__/symtable.cpython-315.pyc +0 -0
  141. package/python/lib/python3.15/__pycache__/tabnanny.cpython-315.pyc +0 -0
  142. package/python/lib/python3.15/__pycache__/tarfile.cpython-315.pyc +0 -0
  143. package/python/lib/python3.15/__pycache__/tempfile.cpython-315.pyc +0 -0
  144. package/python/lib/python3.15/__pycache__/textwrap.cpython-315.pyc +0 -0
  145. package/python/lib/python3.15/__pycache__/this.cpython-315.pyc +0 -0
  146. package/python/lib/python3.15/__pycache__/threading.cpython-315.pyc +0 -0
  147. package/python/lib/python3.15/__pycache__/timeit.cpython-315.pyc +0 -0
  148. package/python/lib/python3.15/__pycache__/token.cpython-315.pyc +0 -0
  149. package/python/lib/python3.15/__pycache__/tokenize.cpython-315.pyc +0 -0
  150. package/python/lib/python3.15/__pycache__/trace.cpython-315.pyc +0 -0
  151. package/python/lib/python3.15/__pycache__/traceback.cpython-315.pyc +0 -0
  152. package/python/lib/python3.15/__pycache__/tracemalloc.cpython-315.pyc +0 -0
  153. package/python/lib/python3.15/__pycache__/tty.cpython-315.pyc +0 -0
  154. package/python/lib/python3.15/__pycache__/types.cpython-315.pyc +0 -0
  155. package/python/lib/python3.15/__pycache__/typing.cpython-315.pyc +0 -0
  156. package/python/lib/python3.15/__pycache__/uuid.cpython-315.pyc +0 -0
  157. package/python/lib/python3.15/__pycache__/warnings.cpython-315.pyc +0 -0
  158. package/python/lib/python3.15/__pycache__/wave.cpython-315.pyc +0 -0
  159. package/python/lib/python3.15/__pycache__/weakref.cpython-315.pyc +0 -0
  160. package/python/lib/python3.15/__pycache__/webbrowser.cpython-315.pyc +0 -0
  161. package/python/lib/python3.15/__pycache__/zipapp.cpython-315.pyc +0 -0
  162. package/python/lib/python3.15/__pycache__/zipimport.cpython-315.pyc +0 -0
  163. package/python/lib/python3.15/_aix_support.py +108 -0
  164. package/python/lib/python3.15/_android_support.py +192 -0
  165. package/python/lib/python3.15/_apple_support.py +66 -0
  166. package/python/lib/python3.15/_ast_unparse.py +1165 -0
  167. package/python/lib/python3.15/_collections_abc.py +1183 -0
  168. package/python/lib/python3.15/_colorize.py +647 -0
  169. package/python/lib/python3.15/_compat_pickle.py +249 -0
  170. package/python/lib/python3.15/_ios_support.py +74 -0
  171. package/python/lib/python3.15/_markupbase.py +396 -0
  172. package/python/lib/python3.15/_missing_stdlib_info.py +32 -0
  173. package/python/lib/python3.15/_opcode_metadata.py +387 -0
  174. package/python/lib/python3.15/_osx_support.py +580 -0
  175. package/python/lib/python3.15/_py_abc.py +152 -0
  176. package/python/lib/python3.15/_py_warnings.py +928 -0
  177. package/python/lib/python3.15/_pydatetime.py +2779 -0
  178. package/python/lib/python3.15/_pydecimal.py +6514 -0
  179. package/python/lib/python3.15/_pyio.py +2788 -0
  180. package/python/lib/python3.15/_pylong.py +729 -0
  181. package/python/lib/python3.15/_pyrepl/__init__.py +19 -0
  182. package/python/lib/python3.15/_pyrepl/__main__.py +10 -0
  183. package/python/lib/python3.15/_pyrepl/__pycache__/__init__.cpython-315.pyc +0 -0
  184. package/python/lib/python3.15/_pyrepl/__pycache__/__main__.cpython-315.pyc +0 -0
  185. package/python/lib/python3.15/_pyrepl/__pycache__/_module_completer.cpython-315.pyc +0 -0
  186. package/python/lib/python3.15/_pyrepl/__pycache__/_threading_handler.cpython-315.pyc +0 -0
  187. package/python/lib/python3.15/_pyrepl/__pycache__/base_eventqueue.cpython-315.pyc +0 -0
  188. package/python/lib/python3.15/_pyrepl/__pycache__/commands.cpython-315.pyc +0 -0
  189. package/python/lib/python3.15/_pyrepl/__pycache__/completing_reader.cpython-315.pyc +0 -0
  190. package/python/lib/python3.15/_pyrepl/__pycache__/console.cpython-315.pyc +0 -0
  191. package/python/lib/python3.15/_pyrepl/__pycache__/content.cpython-315.pyc +0 -0
  192. package/python/lib/python3.15/_pyrepl/__pycache__/fancy_termios.cpython-315.pyc +0 -0
  193. package/python/lib/python3.15/_pyrepl/__pycache__/fancycompleter.cpython-315.pyc +0 -0
  194. package/python/lib/python3.15/_pyrepl/__pycache__/historical_reader.cpython-315.pyc +0 -0
  195. package/python/lib/python3.15/_pyrepl/__pycache__/input.cpython-315.pyc +0 -0
  196. package/python/lib/python3.15/_pyrepl/__pycache__/keymap.cpython-315.pyc +0 -0
  197. package/python/lib/python3.15/_pyrepl/__pycache__/layout.cpython-315.pyc +0 -0
  198. package/python/lib/python3.15/_pyrepl/__pycache__/main.cpython-315.pyc +0 -0
  199. package/python/lib/python3.15/_pyrepl/__pycache__/pager.cpython-315.pyc +0 -0
  200. package/python/lib/python3.15/_pyrepl/__pycache__/reader.cpython-315.pyc +0 -0
  201. package/python/lib/python3.15/_pyrepl/__pycache__/readline.cpython-315.pyc +0 -0
  202. package/python/lib/python3.15/_pyrepl/__pycache__/render.cpython-315.pyc +0 -0
  203. package/python/lib/python3.15/_pyrepl/__pycache__/simple_interact.cpython-315.pyc +0 -0
  204. package/python/lib/python3.15/_pyrepl/__pycache__/terminfo.cpython-315.pyc +0 -0
  205. package/python/lib/python3.15/_pyrepl/__pycache__/trace.cpython-315.pyc +0 -0
  206. package/python/lib/python3.15/_pyrepl/__pycache__/types.cpython-315.pyc +0 -0
  207. package/python/lib/python3.15/_pyrepl/__pycache__/unix_console.cpython-315.pyc +0 -0
  208. package/python/lib/python3.15/_pyrepl/__pycache__/unix_eventqueue.cpython-315.pyc +0 -0
  209. package/python/lib/python3.15/_pyrepl/__pycache__/utils.cpython-315.pyc +0 -0
  210. package/python/lib/python3.15/_pyrepl/__pycache__/windows_console.cpython-315.pyc +0 -0
  211. package/python/lib/python3.15/_pyrepl/__pycache__/windows_eventqueue.cpython-315.pyc +0 -0
  212. package/python/lib/python3.15/_pyrepl/_module_completer.py +580 -0
  213. package/python/lib/python3.15/_pyrepl/_threading_handler.py +74 -0
  214. package/python/lib/python3.15/_pyrepl/base_eventqueue.py +110 -0
  215. package/python/lib/python3.15/_pyrepl/commands.py +521 -0
  216. package/python/lib/python3.15/_pyrepl/completing_reader.py +332 -0
  217. package/python/lib/python3.15/_pyrepl/console.py +295 -0
  218. package/python/lib/python3.15/_pyrepl/content.py +136 -0
  219. package/python/lib/python3.15/_pyrepl/fancy_termios.py +82 -0
  220. package/python/lib/python3.15/_pyrepl/fancycompleter.py +213 -0
  221. package/python/lib/python3.15/_pyrepl/historical_reader.py +423 -0
  222. package/python/lib/python3.15/_pyrepl/input.py +115 -0
  223. package/python/lib/python3.15/_pyrepl/keymap.py +213 -0
  224. package/python/lib/python3.15/_pyrepl/layout.py +268 -0
  225. package/python/lib/python3.15/_pyrepl/main.py +58 -0
  226. package/python/lib/python3.15/_pyrepl/mypy.ini +25 -0
  227. package/python/lib/python3.15/_pyrepl/pager.py +175 -0
  228. package/python/lib/python3.15/_pyrepl/reader.py +1035 -0
  229. package/python/lib/python3.15/_pyrepl/readline.py +650 -0
  230. package/python/lib/python3.15/_pyrepl/render.py +399 -0
  231. package/python/lib/python3.15/_pyrepl/simple_interact.py +185 -0
  232. package/python/lib/python3.15/_pyrepl/terminfo.py +488 -0
  233. package/python/lib/python3.15/_pyrepl/trace.py +40 -0
  234. package/python/lib/python3.15/_pyrepl/types.py +16 -0
  235. package/python/lib/python3.15/_pyrepl/unix_console.py +1085 -0
  236. package/python/lib/python3.15/_pyrepl/unix_eventqueue.py +77 -0
  237. package/python/lib/python3.15/_pyrepl/utils.py +456 -0
  238. package/python/lib/python3.15/_pyrepl/windows_console.py +864 -0
  239. package/python/lib/python3.15/_pyrepl/windows_eventqueue.py +42 -0
  240. package/python/lib/python3.15/_sitebuiltins.py +101 -0
  241. package/python/lib/python3.15/_strptime.py +851 -0
  242. package/python/lib/python3.15/_sysconfig_vars__linux_s390x-linux-gnu.json +1196 -0
  243. package/python/lib/python3.15/_sysconfigdata__linux_s390x-linux-gnu.py +1182 -0
  244. package/python/lib/python3.15/_threading_local.py +120 -0
  245. package/python/lib/python3.15/_weakrefset.py +147 -0
  246. package/python/lib/python3.15/abc.py +188 -0
  247. package/python/lib/python3.15/annotationlib.py +1220 -0
  248. package/python/lib/python3.15/antigravity.py +17 -0
  249. package/python/lib/python3.15/argparse.py +2974 -0
  250. package/python/lib/python3.15/ast.py +718 -0
  251. package/python/lib/python3.15/asyncio/__init__.py +74 -0
  252. package/python/lib/python3.15/asyncio/__main__.py +269 -0
  253. package/python/lib/python3.15/asyncio/__pycache__/__init__.cpython-315.pyc +0 -0
  254. package/python/lib/python3.15/asyncio/__pycache__/__main__.cpython-315.pyc +0 -0
  255. package/python/lib/python3.15/asyncio/__pycache__/base_events.cpython-315.pyc +0 -0
  256. package/python/lib/python3.15/asyncio/__pycache__/base_futures.cpython-315.pyc +0 -0
  257. package/python/lib/python3.15/asyncio/__pycache__/base_subprocess.cpython-315.pyc +0 -0
  258. package/python/lib/python3.15/asyncio/__pycache__/base_tasks.cpython-315.pyc +0 -0
  259. package/python/lib/python3.15/asyncio/__pycache__/constants.cpython-315.pyc +0 -0
  260. package/python/lib/python3.15/asyncio/__pycache__/coroutines.cpython-315.pyc +0 -0
  261. package/python/lib/python3.15/asyncio/__pycache__/events.cpython-315.pyc +0 -0
  262. package/python/lib/python3.15/asyncio/__pycache__/exceptions.cpython-315.pyc +0 -0
  263. package/python/lib/python3.15/asyncio/__pycache__/format_helpers.cpython-315.pyc +0 -0
  264. package/python/lib/python3.15/asyncio/__pycache__/futures.cpython-315.pyc +0 -0
  265. package/python/lib/python3.15/asyncio/__pycache__/graph.cpython-315.pyc +0 -0
  266. package/python/lib/python3.15/asyncio/__pycache__/locks.cpython-315.pyc +0 -0
  267. package/python/lib/python3.15/asyncio/__pycache__/log.cpython-315.pyc +0 -0
  268. package/python/lib/python3.15/asyncio/__pycache__/mixins.cpython-315.pyc +0 -0
  269. package/python/lib/python3.15/asyncio/__pycache__/proactor_events.cpython-315.pyc +0 -0
  270. package/python/lib/python3.15/asyncio/__pycache__/protocols.cpython-315.pyc +0 -0
  271. package/python/lib/python3.15/asyncio/__pycache__/queues.cpython-315.pyc +0 -0
  272. package/python/lib/python3.15/asyncio/__pycache__/runners.cpython-315.pyc +0 -0
  273. package/python/lib/python3.15/asyncio/__pycache__/selector_events.cpython-315.pyc +0 -0
  274. package/python/lib/python3.15/asyncio/__pycache__/sslproto.cpython-315.pyc +0 -0
  275. package/python/lib/python3.15/asyncio/__pycache__/staggered.cpython-315.pyc +0 -0
  276. package/python/lib/python3.15/asyncio/__pycache__/streams.cpython-315.pyc +0 -0
  277. package/python/lib/python3.15/asyncio/__pycache__/subprocess.cpython-315.pyc +0 -0
  278. package/python/lib/python3.15/asyncio/__pycache__/taskgroups.cpython-315.pyc +0 -0
  279. package/python/lib/python3.15/asyncio/__pycache__/tasks.cpython-315.pyc +0 -0
  280. package/python/lib/python3.15/asyncio/__pycache__/threads.cpython-315.pyc +0 -0
  281. package/python/lib/python3.15/asyncio/__pycache__/timeouts.cpython-315.pyc +0 -0
  282. package/python/lib/python3.15/asyncio/__pycache__/tools.cpython-315.pyc +0 -0
  283. package/python/lib/python3.15/asyncio/__pycache__/transports.cpython-315.pyc +0 -0
  284. package/python/lib/python3.15/asyncio/__pycache__/trsock.cpython-315.pyc +0 -0
  285. package/python/lib/python3.15/asyncio/__pycache__/unix_events.cpython-315.pyc +0 -0
  286. package/python/lib/python3.15/asyncio/__pycache__/windows_events.cpython-315.pyc +0 -0
  287. package/python/lib/python3.15/asyncio/__pycache__/windows_utils.cpython-315.pyc +0 -0
  288. package/python/lib/python3.15/asyncio/base_events.py +2098 -0
  289. package/python/lib/python3.15/asyncio/base_futures.py +67 -0
  290. package/python/lib/python3.15/asyncio/base_subprocess.py +327 -0
  291. package/python/lib/python3.15/asyncio/base_tasks.py +94 -0
  292. package/python/lib/python3.15/asyncio/constants.py +41 -0
  293. package/python/lib/python3.15/asyncio/coroutines.py +118 -0
  294. package/python/lib/python3.15/asyncio/events.py +881 -0
  295. package/python/lib/python3.15/asyncio/exceptions.py +62 -0
  296. package/python/lib/python3.15/asyncio/format_helpers.py +84 -0
  297. package/python/lib/python3.15/asyncio/futures.py +482 -0
  298. package/python/lib/python3.15/asyncio/graph.py +279 -0
  299. package/python/lib/python3.15/asyncio/locks.py +617 -0
  300. package/python/lib/python3.15/asyncio/log.py +7 -0
  301. package/python/lib/python3.15/asyncio/mixins.py +21 -0
  302. package/python/lib/python3.15/asyncio/proactor_events.py +923 -0
  303. package/python/lib/python3.15/asyncio/protocols.py +216 -0
  304. package/python/lib/python3.15/asyncio/queues.py +309 -0
  305. package/python/lib/python3.15/asyncio/runners.py +226 -0
  306. package/python/lib/python3.15/asyncio/selector_events.py +1351 -0
  307. package/python/lib/python3.15/asyncio/sslproto.py +937 -0
  308. package/python/lib/python3.15/asyncio/staggered.py +178 -0
  309. package/python/lib/python3.15/asyncio/streams.py +790 -0
  310. package/python/lib/python3.15/asyncio/subprocess.py +229 -0
  311. package/python/lib/python3.15/asyncio/taskgroups.py +334 -0
  312. package/python/lib/python3.15/asyncio/tasks.py +1154 -0
  313. package/python/lib/python3.15/asyncio/threads.py +26 -0
  314. package/python/lib/python3.15/asyncio/timeouts.py +183 -0
  315. package/python/lib/python3.15/asyncio/tools.py +289 -0
  316. package/python/lib/python3.15/asyncio/transports.py +337 -0
  317. package/python/lib/python3.15/asyncio/trsock.py +98 -0
  318. package/python/lib/python3.15/asyncio/unix_events.py +1031 -0
  319. package/python/lib/python3.15/asyncio/windows_events.py +899 -0
  320. package/python/lib/python3.15/asyncio/windows_utils.py +181 -0
  321. package/python/lib/python3.15/base64.py +498 -0
  322. package/python/lib/python3.15/bdb.py +1205 -0
  323. package/python/lib/python3.15/bisect.py +118 -0
  324. package/python/lib/python3.15/build-details.json +61 -0
  325. package/python/lib/python3.15/bz2.py +352 -0
  326. package/python/lib/python3.15/cProfile.py +13 -0
  327. package/python/lib/python3.15/calendar.py +997 -0
  328. package/python/lib/python3.15/cmd.py +414 -0
  329. package/python/lib/python3.15/code.py +396 -0
  330. package/python/lib/python3.15/codecs.py +1125 -0
  331. package/python/lib/python3.15/codeop.py +154 -0
  332. package/python/lib/python3.15/collections/__init__.py +1667 -0
  333. package/python/lib/python3.15/collections/__pycache__/__init__.cpython-315.pyc +0 -0
  334. package/python/lib/python3.15/colorsys.py +166 -0
  335. package/python/lib/python3.15/compileall.py +479 -0
  336. package/python/lib/python3.15/compression/__init__.py +0 -0
  337. package/python/lib/python3.15/compression/__pycache__/__init__.cpython-315.pyc +0 -0
  338. package/python/lib/python3.15/compression/__pycache__/bz2.cpython-315.pyc +0 -0
  339. package/python/lib/python3.15/compression/__pycache__/gzip.cpython-315.pyc +0 -0
  340. package/python/lib/python3.15/compression/__pycache__/lzma.cpython-315.pyc +0 -0
  341. package/python/lib/python3.15/compression/__pycache__/zlib.cpython-315.pyc +0 -0
  342. package/python/lib/python3.15/compression/_common/__init__.py +0 -0
  343. package/python/lib/python3.15/compression/_common/__pycache__/__init__.cpython-315.pyc +0 -0
  344. package/python/lib/python3.15/compression/_common/__pycache__/_streams.cpython-315.pyc +0 -0
  345. package/python/lib/python3.15/compression/_common/_streams.py +162 -0
  346. package/python/lib/python3.15/compression/bz2.py +5 -0
  347. package/python/lib/python3.15/compression/gzip.py +5 -0
  348. package/python/lib/python3.15/compression/lzma.py +5 -0
  349. package/python/lib/python3.15/compression/zlib.py +5 -0
  350. package/python/lib/python3.15/compression/zstd/__init__.py +244 -0
  351. package/python/lib/python3.15/compression/zstd/__pycache__/__init__.cpython-315.pyc +0 -0
  352. package/python/lib/python3.15/compression/zstd/__pycache__/_zstdfile.cpython-315.pyc +0 -0
  353. package/python/lib/python3.15/compression/zstd/_zstdfile.py +347 -0
  354. package/python/lib/python3.15/concurrent/__init__.py +1 -0
  355. package/python/lib/python3.15/concurrent/__pycache__/__init__.cpython-315.pyc +0 -0
  356. package/python/lib/python3.15/concurrent/futures/__init__.py +51 -0
  357. package/python/lib/python3.15/concurrent/futures/__pycache__/__init__.cpython-315.pyc +0 -0
  358. package/python/lib/python3.15/concurrent/futures/__pycache__/_base.cpython-315.pyc +0 -0
  359. package/python/lib/python3.15/concurrent/futures/__pycache__/interpreter.cpython-315.pyc +0 -0
  360. package/python/lib/python3.15/concurrent/futures/__pycache__/process.cpython-315.pyc +0 -0
  361. package/python/lib/python3.15/concurrent/futures/__pycache__/thread.cpython-315.pyc +0 -0
  362. package/python/lib/python3.15/concurrent/futures/_base.py +707 -0
  363. package/python/lib/python3.15/concurrent/futures/interpreter.py +123 -0
  364. package/python/lib/python3.15/concurrent/futures/process.py +1060 -0
  365. package/python/lib/python3.15/concurrent/futures/thread.py +274 -0
  366. package/python/lib/python3.15/concurrent/interpreters/__init__.py +253 -0
  367. package/python/lib/python3.15/concurrent/interpreters/__pycache__/__init__.cpython-315.pyc +0 -0
  368. package/python/lib/python3.15/concurrent/interpreters/__pycache__/_crossinterp.cpython-315.pyc +0 -0
  369. package/python/lib/python3.15/concurrent/interpreters/__pycache__/_queues.cpython-315.pyc +0 -0
  370. package/python/lib/python3.15/concurrent/interpreters/_crossinterp.py +107 -0
  371. package/python/lib/python3.15/concurrent/interpreters/_queues.py +289 -0
  372. package/python/lib/python3.15/configparser.py +1426 -0
  373. package/python/lib/python3.15/contextlib.py +859 -0
  374. package/python/lib/python3.15/contextvars.py +8 -0
  375. package/python/lib/python3.15/copy.py +300 -0
  376. package/python/lib/python3.15/copyreg.py +222 -0
  377. package/python/lib/python3.15/csv.py +536 -0
  378. package/python/lib/python3.15/ctypes/__init__.py +684 -0
  379. package/python/lib/python3.15/ctypes/__pycache__/__init__.cpython-315.pyc +0 -0
  380. package/python/lib/python3.15/ctypes/__pycache__/_aix.cpython-315.pyc +0 -0
  381. package/python/lib/python3.15/ctypes/__pycache__/_endian.cpython-315.pyc +0 -0
  382. package/python/lib/python3.15/ctypes/__pycache__/_layout.cpython-315.pyc +0 -0
  383. package/python/lib/python3.15/ctypes/__pycache__/util.cpython-315.pyc +0 -0
  384. package/python/lib/python3.15/ctypes/__pycache__/wintypes.cpython-315.pyc +0 -0
  385. package/python/lib/python3.15/ctypes/_aix.py +327 -0
  386. package/python/lib/python3.15/ctypes/_endian.py +78 -0
  387. package/python/lib/python3.15/ctypes/_layout.py +331 -0
  388. package/python/lib/python3.15/ctypes/macholib/README.ctypes +7 -0
  389. package/python/lib/python3.15/ctypes/macholib/__init__.py +15 -0
  390. package/python/lib/python3.15/ctypes/macholib/__pycache__/__init__.cpython-315.pyc +0 -0
  391. package/python/lib/python3.15/ctypes/macholib/__pycache__/dyld.cpython-315.pyc +0 -0
  392. package/python/lib/python3.15/ctypes/macholib/__pycache__/dylib.cpython-315.pyc +0 -0
  393. package/python/lib/python3.15/ctypes/macholib/__pycache__/framework.cpython-315.pyc +0 -0
  394. package/python/lib/python3.15/ctypes/macholib/dyld.py +165 -0
  395. package/python/lib/python3.15/ctypes/macholib/dylib.py +42 -0
  396. package/python/lib/python3.15/ctypes/macholib/fetch_macholib +2 -0
  397. package/python/lib/python3.15/ctypes/macholib/fetch_macholib.bat +1 -0
  398. package/python/lib/python3.15/ctypes/macholib/framework.py +42 -0
  399. package/python/lib/python3.15/ctypes/util.py +503 -0
  400. package/python/lib/python3.15/ctypes/wintypes.py +210 -0
  401. package/python/lib/python3.15/curses/__init__.py +101 -0
  402. package/python/lib/python3.15/curses/__pycache__/__init__.cpython-315.pyc +0 -0
  403. package/python/lib/python3.15/curses/__pycache__/ascii.cpython-315.pyc +0 -0
  404. package/python/lib/python3.15/curses/__pycache__/has_key.cpython-315.pyc +0 -0
  405. package/python/lib/python3.15/curses/__pycache__/panel.cpython-315.pyc +0 -0
  406. package/python/lib/python3.15/curses/__pycache__/textpad.cpython-315.pyc +0 -0
  407. package/python/lib/python3.15/curses/ascii.py +99 -0
  408. package/python/lib/python3.15/curses/has_key.py +192 -0
  409. package/python/lib/python3.15/curses/panel.py +6 -0
  410. package/python/lib/python3.15/curses/textpad.py +236 -0
  411. package/python/lib/python3.15/dataclasses.py +1826 -0
  412. package/python/lib/python3.15/datetime.py +13 -0
  413. package/python/lib/python3.15/dbm/__init__.py +194 -0
  414. package/python/lib/python3.15/dbm/__pycache__/__init__.cpython-315.pyc +0 -0
  415. package/python/lib/python3.15/dbm/__pycache__/dumb.cpython-315.pyc +0 -0
  416. package/python/lib/python3.15/dbm/__pycache__/gnu.cpython-315.pyc +0 -0
  417. package/python/lib/python3.15/dbm/__pycache__/ndbm.cpython-315.pyc +0 -0
  418. package/python/lib/python3.15/dbm/__pycache__/sqlite3.cpython-315.pyc +0 -0
  419. package/python/lib/python3.15/dbm/dumb.py +346 -0
  420. package/python/lib/python3.15/dbm/gnu.py +3 -0
  421. package/python/lib/python3.15/dbm/ndbm.py +3 -0
  422. package/python/lib/python3.15/dbm/sqlite3.py +148 -0
  423. package/python/lib/python3.15/decimal.py +109 -0
  424. package/python/lib/python3.15/difflib.py +2105 -0
  425. package/python/lib/python3.15/dis.py +1172 -0
  426. package/python/lib/python3.15/doctest.py +2998 -0
  427. package/python/lib/python3.15/email/__init__.py +61 -0
  428. package/python/lib/python3.15/email/__pycache__/__init__.cpython-315.pyc +0 -0
  429. package/python/lib/python3.15/email/__pycache__/_encoded_words.cpython-315.pyc +0 -0
  430. package/python/lib/python3.15/email/__pycache__/_header_value_parser.cpython-315.pyc +0 -0
  431. package/python/lib/python3.15/email/__pycache__/_parseaddr.cpython-315.pyc +0 -0
  432. package/python/lib/python3.15/email/__pycache__/_policybase.cpython-315.pyc +0 -0
  433. package/python/lib/python3.15/email/__pycache__/base64mime.cpython-315.pyc +0 -0
  434. package/python/lib/python3.15/email/__pycache__/charset.cpython-315.pyc +0 -0
  435. package/python/lib/python3.15/email/__pycache__/contentmanager.cpython-315.pyc +0 -0
  436. package/python/lib/python3.15/email/__pycache__/encoders.cpython-315.pyc +0 -0
  437. package/python/lib/python3.15/email/__pycache__/errors.cpython-315.pyc +0 -0
  438. package/python/lib/python3.15/email/__pycache__/feedparser.cpython-315.pyc +0 -0
  439. package/python/lib/python3.15/email/__pycache__/generator.cpython-315.pyc +0 -0
  440. package/python/lib/python3.15/email/__pycache__/header.cpython-315.pyc +0 -0
  441. package/python/lib/python3.15/email/__pycache__/headerregistry.cpython-315.pyc +0 -0
  442. package/python/lib/python3.15/email/__pycache__/iterators.cpython-315.pyc +0 -0
  443. package/python/lib/python3.15/email/__pycache__/message.cpython-315.pyc +0 -0
  444. package/python/lib/python3.15/email/__pycache__/parser.cpython-315.pyc +0 -0
  445. package/python/lib/python3.15/email/__pycache__/policy.cpython-315.pyc +0 -0
  446. package/python/lib/python3.15/email/__pycache__/quoprimime.cpython-315.pyc +0 -0
  447. package/python/lib/python3.15/email/__pycache__/utils.cpython-315.pyc +0 -0
  448. package/python/lib/python3.15/email/_encoded_words.py +233 -0
  449. package/python/lib/python3.15/email/_header_value_parser.py +3216 -0
  450. package/python/lib/python3.15/email/_parseaddr.py +563 -0
  451. package/python/lib/python3.15/email/_policybase.py +392 -0
  452. package/python/lib/python3.15/email/architecture.rst +216 -0
  453. package/python/lib/python3.15/email/base64mime.py +114 -0
  454. package/python/lib/python3.15/email/charset.py +442 -0
  455. package/python/lib/python3.15/email/contentmanager.py +242 -0
  456. package/python/lib/python3.15/email/encoders.py +65 -0
  457. package/python/lib/python3.15/email/errors.py +117 -0
  458. package/python/lib/python3.15/email/feedparser.py +536 -0
  459. package/python/lib/python3.15/email/generator.py +530 -0
  460. package/python/lib/python3.15/email/header.py +582 -0
  461. package/python/lib/python3.15/email/headerregistry.py +616 -0
  462. package/python/lib/python3.15/email/iterators.py +68 -0
  463. package/python/lib/python3.15/email/message.py +1217 -0
  464. package/python/lib/python3.15/email/mime/__init__.py +0 -0
  465. package/python/lib/python3.15/email/mime/__pycache__/__init__.cpython-315.pyc +0 -0
  466. package/python/lib/python3.15/email/mime/__pycache__/application.cpython-315.pyc +0 -0
  467. package/python/lib/python3.15/email/mime/__pycache__/audio.cpython-315.pyc +0 -0
  468. package/python/lib/python3.15/email/mime/__pycache__/base.cpython-315.pyc +0 -0
  469. package/python/lib/python3.15/email/mime/__pycache__/image.cpython-315.pyc +0 -0
  470. package/python/lib/python3.15/email/mime/__pycache__/message.cpython-315.pyc +0 -0
  471. package/python/lib/python3.15/email/mime/__pycache__/multipart.cpython-315.pyc +0 -0
  472. package/python/lib/python3.15/email/mime/__pycache__/nonmultipart.cpython-315.pyc +0 -0
  473. package/python/lib/python3.15/email/mime/__pycache__/text.cpython-315.pyc +0 -0
  474. package/python/lib/python3.15/email/mime/application.py +37 -0
  475. package/python/lib/python3.15/email/mime/audio.py +97 -0
  476. package/python/lib/python3.15/email/mime/base.py +29 -0
  477. package/python/lib/python3.15/email/mime/image.py +152 -0
  478. package/python/lib/python3.15/email/mime/message.py +33 -0
  479. package/python/lib/python3.15/email/mime/multipart.py +47 -0
  480. package/python/lib/python3.15/email/mime/nonmultipart.py +21 -0
  481. package/python/lib/python3.15/email/mime/text.py +40 -0
  482. package/python/lib/python3.15/email/parser.py +127 -0
  483. package/python/lib/python3.15/email/policy.py +239 -0
  484. package/python/lib/python3.15/email/quoprimime.py +300 -0
  485. package/python/lib/python3.15/email/utils.py +493 -0
  486. package/python/lib/python3.15/encodings/__init__.py +178 -0
  487. package/python/lib/python3.15/encodings/__pycache__/__init__.cpython-315.pyc +0 -0
  488. package/python/lib/python3.15/encodings/__pycache__/_win_cp_codecs.cpython-315.pyc +0 -0
  489. package/python/lib/python3.15/encodings/__pycache__/aliases.cpython-315.pyc +0 -0
  490. package/python/lib/python3.15/encodings/__pycache__/ascii.cpython-315.pyc +0 -0
  491. package/python/lib/python3.15/encodings/__pycache__/base64_codec.cpython-315.pyc +0 -0
  492. package/python/lib/python3.15/encodings/__pycache__/big5.cpython-315.pyc +0 -0
  493. package/python/lib/python3.15/encodings/__pycache__/big5hkscs.cpython-315.pyc +0 -0
  494. package/python/lib/python3.15/encodings/__pycache__/bz2_codec.cpython-315.pyc +0 -0
  495. package/python/lib/python3.15/encodings/__pycache__/charmap.cpython-315.pyc +0 -0
  496. package/python/lib/python3.15/encodings/__pycache__/cp037.cpython-315.pyc +0 -0
  497. package/python/lib/python3.15/encodings/__pycache__/cp1006.cpython-315.pyc +0 -0
  498. package/python/lib/python3.15/encodings/__pycache__/cp1026.cpython-315.pyc +0 -0
  499. package/python/lib/python3.15/encodings/__pycache__/cp1125.cpython-315.pyc +0 -0
  500. package/python/lib/python3.15/encodings/__pycache__/cp1140.cpython-315.pyc +0 -0
  501. package/python/lib/python3.15/encodings/__pycache__/cp1250.cpython-315.pyc +0 -0
  502. package/python/lib/python3.15/encodings/__pycache__/cp1251.cpython-315.pyc +0 -0
  503. package/python/lib/python3.15/encodings/__pycache__/cp1252.cpython-315.pyc +0 -0
  504. package/python/lib/python3.15/encodings/__pycache__/cp1253.cpython-315.pyc +0 -0
  505. package/python/lib/python3.15/encodings/__pycache__/cp1254.cpython-315.pyc +0 -0
  506. package/python/lib/python3.15/encodings/__pycache__/cp1255.cpython-315.pyc +0 -0
  507. package/python/lib/python3.15/encodings/__pycache__/cp1256.cpython-315.pyc +0 -0
  508. package/python/lib/python3.15/encodings/__pycache__/cp1257.cpython-315.pyc +0 -0
  509. package/python/lib/python3.15/encodings/__pycache__/cp1258.cpython-315.pyc +0 -0
  510. package/python/lib/python3.15/encodings/__pycache__/cp273.cpython-315.pyc +0 -0
  511. package/python/lib/python3.15/encodings/__pycache__/cp424.cpython-315.pyc +0 -0
  512. package/python/lib/python3.15/encodings/__pycache__/cp437.cpython-315.pyc +0 -0
  513. package/python/lib/python3.15/encodings/__pycache__/cp500.cpython-315.pyc +0 -0
  514. package/python/lib/python3.15/encodings/__pycache__/cp720.cpython-315.pyc +0 -0
  515. package/python/lib/python3.15/encodings/__pycache__/cp737.cpython-315.pyc +0 -0
  516. package/python/lib/python3.15/encodings/__pycache__/cp775.cpython-315.pyc +0 -0
  517. package/python/lib/python3.15/encodings/__pycache__/cp850.cpython-315.pyc +0 -0
  518. package/python/lib/python3.15/encodings/__pycache__/cp852.cpython-315.pyc +0 -0
  519. package/python/lib/python3.15/encodings/__pycache__/cp855.cpython-315.pyc +0 -0
  520. package/python/lib/python3.15/encodings/__pycache__/cp856.cpython-315.pyc +0 -0
  521. package/python/lib/python3.15/encodings/__pycache__/cp857.cpython-315.pyc +0 -0
  522. package/python/lib/python3.15/encodings/__pycache__/cp858.cpython-315.pyc +0 -0
  523. package/python/lib/python3.15/encodings/__pycache__/cp860.cpython-315.pyc +0 -0
  524. package/python/lib/python3.15/encodings/__pycache__/cp861.cpython-315.pyc +0 -0
  525. package/python/lib/python3.15/encodings/__pycache__/cp862.cpython-315.pyc +0 -0
  526. package/python/lib/python3.15/encodings/__pycache__/cp863.cpython-315.pyc +0 -0
  527. package/python/lib/python3.15/encodings/__pycache__/cp864.cpython-315.pyc +0 -0
  528. package/python/lib/python3.15/encodings/__pycache__/cp865.cpython-315.pyc +0 -0
  529. package/python/lib/python3.15/encodings/__pycache__/cp866.cpython-315.pyc +0 -0
  530. package/python/lib/python3.15/encodings/__pycache__/cp869.cpython-315.pyc +0 -0
  531. package/python/lib/python3.15/encodings/__pycache__/cp874.cpython-315.pyc +0 -0
  532. package/python/lib/python3.15/encodings/__pycache__/cp875.cpython-315.pyc +0 -0
  533. package/python/lib/python3.15/encodings/__pycache__/cp932.cpython-315.pyc +0 -0
  534. package/python/lib/python3.15/encodings/__pycache__/cp949.cpython-315.pyc +0 -0
  535. package/python/lib/python3.15/encodings/__pycache__/cp950.cpython-315.pyc +0 -0
  536. package/python/lib/python3.15/encodings/__pycache__/euc_jis_2004.cpython-315.pyc +0 -0
  537. package/python/lib/python3.15/encodings/__pycache__/euc_jisx0213.cpython-315.pyc +0 -0
  538. package/python/lib/python3.15/encodings/__pycache__/euc_jp.cpython-315.pyc +0 -0
  539. package/python/lib/python3.15/encodings/__pycache__/euc_kr.cpython-315.pyc +0 -0
  540. package/python/lib/python3.15/encodings/__pycache__/gb18030.cpython-315.pyc +0 -0
  541. package/python/lib/python3.15/encodings/__pycache__/gb2312.cpython-315.pyc +0 -0
  542. package/python/lib/python3.15/encodings/__pycache__/gbk.cpython-315.pyc +0 -0
  543. package/python/lib/python3.15/encodings/__pycache__/hex_codec.cpython-315.pyc +0 -0
  544. package/python/lib/python3.15/encodings/__pycache__/hp_roman8.cpython-315.pyc +0 -0
  545. package/python/lib/python3.15/encodings/__pycache__/hz.cpython-315.pyc +0 -0
  546. package/python/lib/python3.15/encodings/__pycache__/idna.cpython-315.pyc +0 -0
  547. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp.cpython-315.pyc +0 -0
  548. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp_1.cpython-315.pyc +0 -0
  549. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp_2.cpython-315.pyc +0 -0
  550. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp_2004.cpython-315.pyc +0 -0
  551. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp_3.cpython-315.pyc +0 -0
  552. package/python/lib/python3.15/encodings/__pycache__/iso2022_jp_ext.cpython-315.pyc +0 -0
  553. package/python/lib/python3.15/encodings/__pycache__/iso2022_kr.cpython-315.pyc +0 -0
  554. package/python/lib/python3.15/encodings/__pycache__/iso8859_1.cpython-315.pyc +0 -0
  555. package/python/lib/python3.15/encodings/__pycache__/iso8859_10.cpython-315.pyc +0 -0
  556. package/python/lib/python3.15/encodings/__pycache__/iso8859_11.cpython-315.pyc +0 -0
  557. package/python/lib/python3.15/encodings/__pycache__/iso8859_13.cpython-315.pyc +0 -0
  558. package/python/lib/python3.15/encodings/__pycache__/iso8859_14.cpython-315.pyc +0 -0
  559. package/python/lib/python3.15/encodings/__pycache__/iso8859_15.cpython-315.pyc +0 -0
  560. package/python/lib/python3.15/encodings/__pycache__/iso8859_16.cpython-315.pyc +0 -0
  561. package/python/lib/python3.15/encodings/__pycache__/iso8859_2.cpython-315.pyc +0 -0
  562. package/python/lib/python3.15/encodings/__pycache__/iso8859_3.cpython-315.pyc +0 -0
  563. package/python/lib/python3.15/encodings/__pycache__/iso8859_4.cpython-315.pyc +0 -0
  564. package/python/lib/python3.15/encodings/__pycache__/iso8859_5.cpython-315.pyc +0 -0
  565. package/python/lib/python3.15/encodings/__pycache__/iso8859_6.cpython-315.pyc +0 -0
  566. package/python/lib/python3.15/encodings/__pycache__/iso8859_7.cpython-315.pyc +0 -0
  567. package/python/lib/python3.15/encodings/__pycache__/iso8859_8.cpython-315.pyc +0 -0
  568. package/python/lib/python3.15/encodings/__pycache__/iso8859_9.cpython-315.pyc +0 -0
  569. package/python/lib/python3.15/encodings/__pycache__/johab.cpython-315.pyc +0 -0
  570. package/python/lib/python3.15/encodings/__pycache__/koi8_r.cpython-315.pyc +0 -0
  571. package/python/lib/python3.15/encodings/__pycache__/koi8_t.cpython-315.pyc +0 -0
  572. package/python/lib/python3.15/encodings/__pycache__/koi8_u.cpython-315.pyc +0 -0
  573. package/python/lib/python3.15/encodings/__pycache__/kz1048.cpython-315.pyc +0 -0
  574. package/python/lib/python3.15/encodings/__pycache__/latin_1.cpython-315.pyc +0 -0
  575. package/python/lib/python3.15/encodings/__pycache__/mac_arabic.cpython-315.pyc +0 -0
  576. package/python/lib/python3.15/encodings/__pycache__/mac_croatian.cpython-315.pyc +0 -0
  577. package/python/lib/python3.15/encodings/__pycache__/mac_cyrillic.cpython-315.pyc +0 -0
  578. package/python/lib/python3.15/encodings/__pycache__/mac_farsi.cpython-315.pyc +0 -0
  579. package/python/lib/python3.15/encodings/__pycache__/mac_greek.cpython-315.pyc +0 -0
  580. package/python/lib/python3.15/encodings/__pycache__/mac_iceland.cpython-315.pyc +0 -0
  581. package/python/lib/python3.15/encodings/__pycache__/mac_latin2.cpython-315.pyc +0 -0
  582. package/python/lib/python3.15/encodings/__pycache__/mac_roman.cpython-315.pyc +0 -0
  583. package/python/lib/python3.15/encodings/__pycache__/mac_romanian.cpython-315.pyc +0 -0
  584. package/python/lib/python3.15/encodings/__pycache__/mac_turkish.cpython-315.pyc +0 -0
  585. package/python/lib/python3.15/encodings/__pycache__/mbcs.cpython-315.pyc +0 -0
  586. package/python/lib/python3.15/encodings/__pycache__/oem.cpython-315.pyc +0 -0
  587. package/python/lib/python3.15/encodings/__pycache__/palmos.cpython-315.pyc +0 -0
  588. package/python/lib/python3.15/encodings/__pycache__/ptcp154.cpython-315.pyc +0 -0
  589. package/python/lib/python3.15/encodings/__pycache__/punycode.cpython-315.pyc +0 -0
  590. package/python/lib/python3.15/encodings/__pycache__/quopri_codec.cpython-315.pyc +0 -0
  591. package/python/lib/python3.15/encodings/__pycache__/raw_unicode_escape.cpython-315.pyc +0 -0
  592. package/python/lib/python3.15/encodings/__pycache__/rot_13.cpython-315.pyc +0 -0
  593. package/python/lib/python3.15/encodings/__pycache__/shift_jis.cpython-315.pyc +0 -0
  594. package/python/lib/python3.15/encodings/__pycache__/shift_jis_2004.cpython-315.pyc +0 -0
  595. package/python/lib/python3.15/encodings/__pycache__/shift_jisx0213.cpython-315.pyc +0 -0
  596. package/python/lib/python3.15/encodings/__pycache__/tis_620.cpython-315.pyc +0 -0
  597. package/python/lib/python3.15/encodings/__pycache__/undefined.cpython-315.pyc +0 -0
  598. package/python/lib/python3.15/encodings/__pycache__/unicode_escape.cpython-315.pyc +0 -0
  599. package/python/lib/python3.15/encodings/__pycache__/utf_16.cpython-315.pyc +0 -0
  600. package/python/lib/python3.15/encodings/__pycache__/utf_16_be.cpython-315.pyc +0 -0
  601. package/python/lib/python3.15/encodings/__pycache__/utf_16_le.cpython-315.pyc +0 -0
  602. package/python/lib/python3.15/encodings/__pycache__/utf_32.cpython-315.pyc +0 -0
  603. package/python/lib/python3.15/encodings/__pycache__/utf_32_be.cpython-315.pyc +0 -0
  604. package/python/lib/python3.15/encodings/__pycache__/utf_32_le.cpython-315.pyc +0 -0
  605. package/python/lib/python3.15/encodings/__pycache__/utf_7.cpython-315.pyc +0 -0
  606. package/python/lib/python3.15/encodings/__pycache__/utf_8.cpython-315.pyc +0 -0
  607. package/python/lib/python3.15/encodings/__pycache__/utf_8_sig.cpython-315.pyc +0 -0
  608. package/python/lib/python3.15/encodings/__pycache__/uu_codec.cpython-315.pyc +0 -0
  609. package/python/lib/python3.15/encodings/__pycache__/zlib_codec.cpython-315.pyc +0 -0
  610. package/python/lib/python3.15/encodings/_win_cp_codecs.py +36 -0
  611. package/python/lib/python3.15/encodings/aliases.py +627 -0
  612. package/python/lib/python3.15/encodings/ascii.py +50 -0
  613. package/python/lib/python3.15/encodings/base64_codec.py +55 -0
  614. package/python/lib/python3.15/encodings/big5.py +39 -0
  615. package/python/lib/python3.15/encodings/big5hkscs.py +39 -0
  616. package/python/lib/python3.15/encodings/bz2_codec.py +78 -0
  617. package/python/lib/python3.15/encodings/charmap.py +69 -0
  618. package/python/lib/python3.15/encodings/cp037.py +307 -0
  619. package/python/lib/python3.15/encodings/cp1006.py +307 -0
  620. package/python/lib/python3.15/encodings/cp1026.py +307 -0
  621. package/python/lib/python3.15/encodings/cp1125.py +698 -0
  622. package/python/lib/python3.15/encodings/cp1140.py +307 -0
  623. package/python/lib/python3.15/encodings/cp1250.py +307 -0
  624. package/python/lib/python3.15/encodings/cp1251.py +307 -0
  625. package/python/lib/python3.15/encodings/cp1252.py +307 -0
  626. package/python/lib/python3.15/encodings/cp1253.py +307 -0
  627. package/python/lib/python3.15/encodings/cp1254.py +307 -0
  628. package/python/lib/python3.15/encodings/cp1255.py +307 -0
  629. package/python/lib/python3.15/encodings/cp1256.py +307 -0
  630. package/python/lib/python3.15/encodings/cp1257.py +307 -0
  631. package/python/lib/python3.15/encodings/cp1258.py +307 -0
  632. package/python/lib/python3.15/encodings/cp273.py +307 -0
  633. package/python/lib/python3.15/encodings/cp424.py +307 -0
  634. package/python/lib/python3.15/encodings/cp437.py +698 -0
  635. package/python/lib/python3.15/encodings/cp500.py +307 -0
  636. package/python/lib/python3.15/encodings/cp720.py +309 -0
  637. package/python/lib/python3.15/encodings/cp737.py +698 -0
  638. package/python/lib/python3.15/encodings/cp775.py +697 -0
  639. package/python/lib/python3.15/encodings/cp850.py +698 -0
  640. package/python/lib/python3.15/encodings/cp852.py +698 -0
  641. package/python/lib/python3.15/encodings/cp855.py +698 -0
  642. package/python/lib/python3.15/encodings/cp856.py +307 -0
  643. package/python/lib/python3.15/encodings/cp857.py +694 -0
  644. package/python/lib/python3.15/encodings/cp858.py +698 -0
  645. package/python/lib/python3.15/encodings/cp860.py +698 -0
  646. package/python/lib/python3.15/encodings/cp861.py +698 -0
  647. package/python/lib/python3.15/encodings/cp862.py +698 -0
  648. package/python/lib/python3.15/encodings/cp863.py +698 -0
  649. package/python/lib/python3.15/encodings/cp864.py +690 -0
  650. package/python/lib/python3.15/encodings/cp865.py +698 -0
  651. package/python/lib/python3.15/encodings/cp866.py +698 -0
  652. package/python/lib/python3.15/encodings/cp869.py +689 -0
  653. package/python/lib/python3.15/encodings/cp874.py +307 -0
  654. package/python/lib/python3.15/encodings/cp875.py +307 -0
  655. package/python/lib/python3.15/encodings/cp932.py +39 -0
  656. package/python/lib/python3.15/encodings/cp949.py +39 -0
  657. package/python/lib/python3.15/encodings/cp950.py +39 -0
  658. package/python/lib/python3.15/encodings/euc_jis_2004.py +39 -0
  659. package/python/lib/python3.15/encodings/euc_jisx0213.py +39 -0
  660. package/python/lib/python3.15/encodings/euc_jp.py +39 -0
  661. package/python/lib/python3.15/encodings/euc_kr.py +39 -0
  662. package/python/lib/python3.15/encodings/gb18030.py +39 -0
  663. package/python/lib/python3.15/encodings/gb2312.py +39 -0
  664. package/python/lib/python3.15/encodings/gbk.py +39 -0
  665. package/python/lib/python3.15/encodings/hex_codec.py +55 -0
  666. package/python/lib/python3.15/encodings/hp_roman8.py +314 -0
  667. package/python/lib/python3.15/encodings/hz.py +39 -0
  668. package/python/lib/python3.15/encodings/idna.py +388 -0
  669. package/python/lib/python3.15/encodings/iso2022_jp.py +39 -0
  670. package/python/lib/python3.15/encodings/iso2022_jp_1.py +39 -0
  671. package/python/lib/python3.15/encodings/iso2022_jp_2.py +39 -0
  672. package/python/lib/python3.15/encodings/iso2022_jp_2004.py +39 -0
  673. package/python/lib/python3.15/encodings/iso2022_jp_3.py +39 -0
  674. package/python/lib/python3.15/encodings/iso2022_jp_ext.py +39 -0
  675. package/python/lib/python3.15/encodings/iso2022_kr.py +39 -0
  676. package/python/lib/python3.15/encodings/iso8859_1.py +307 -0
  677. package/python/lib/python3.15/encodings/iso8859_10.py +307 -0
  678. package/python/lib/python3.15/encodings/iso8859_11.py +307 -0
  679. package/python/lib/python3.15/encodings/iso8859_13.py +307 -0
  680. package/python/lib/python3.15/encodings/iso8859_14.py +307 -0
  681. package/python/lib/python3.15/encodings/iso8859_15.py +307 -0
  682. package/python/lib/python3.15/encodings/iso8859_16.py +307 -0
  683. package/python/lib/python3.15/encodings/iso8859_2.py +307 -0
  684. package/python/lib/python3.15/encodings/iso8859_3.py +307 -0
  685. package/python/lib/python3.15/encodings/iso8859_4.py +307 -0
  686. package/python/lib/python3.15/encodings/iso8859_5.py +307 -0
  687. package/python/lib/python3.15/encodings/iso8859_6.py +307 -0
  688. package/python/lib/python3.15/encodings/iso8859_7.py +307 -0
  689. package/python/lib/python3.15/encodings/iso8859_8.py +307 -0
  690. package/python/lib/python3.15/encodings/iso8859_9.py +307 -0
  691. package/python/lib/python3.15/encodings/johab.py +39 -0
  692. package/python/lib/python3.15/encodings/koi8_r.py +307 -0
  693. package/python/lib/python3.15/encodings/koi8_t.py +308 -0
  694. package/python/lib/python3.15/encodings/koi8_u.py +307 -0
  695. package/python/lib/python3.15/encodings/kz1048.py +307 -0
  696. package/python/lib/python3.15/encodings/latin_1.py +50 -0
  697. package/python/lib/python3.15/encodings/mac_arabic.py +698 -0
  698. package/python/lib/python3.15/encodings/mac_croatian.py +307 -0
  699. package/python/lib/python3.15/encodings/mac_cyrillic.py +307 -0
  700. package/python/lib/python3.15/encodings/mac_farsi.py +307 -0
  701. package/python/lib/python3.15/encodings/mac_greek.py +307 -0
  702. package/python/lib/python3.15/encodings/mac_iceland.py +307 -0
  703. package/python/lib/python3.15/encodings/mac_latin2.py +312 -0
  704. package/python/lib/python3.15/encodings/mac_roman.py +307 -0
  705. package/python/lib/python3.15/encodings/mac_romanian.py +307 -0
  706. package/python/lib/python3.15/encodings/mac_turkish.py +307 -0
  707. package/python/lib/python3.15/encodings/mbcs.py +47 -0
  708. package/python/lib/python3.15/encodings/oem.py +41 -0
  709. package/python/lib/python3.15/encodings/palmos.py +308 -0
  710. package/python/lib/python3.15/encodings/ptcp154.py +312 -0
  711. package/python/lib/python3.15/encodings/punycode.py +253 -0
  712. package/python/lib/python3.15/encodings/quopri_codec.py +56 -0
  713. package/python/lib/python3.15/encodings/raw_unicode_escape.py +46 -0
  714. package/python/lib/python3.15/encodings/rot_13.py +113 -0
  715. package/python/lib/python3.15/encodings/shift_jis.py +39 -0
  716. package/python/lib/python3.15/encodings/shift_jis_2004.py +39 -0
  717. package/python/lib/python3.15/encodings/shift_jisx0213.py +39 -0
  718. package/python/lib/python3.15/encodings/tis_620.py +307 -0
  719. package/python/lib/python3.15/encodings/undefined.py +49 -0
  720. package/python/lib/python3.15/encodings/unicode_escape.py +46 -0
  721. package/python/lib/python3.15/encodings/utf_16.py +155 -0
  722. package/python/lib/python3.15/encodings/utf_16_be.py +42 -0
  723. package/python/lib/python3.15/encodings/utf_16_le.py +42 -0
  724. package/python/lib/python3.15/encodings/utf_32.py +150 -0
  725. package/python/lib/python3.15/encodings/utf_32_be.py +37 -0
  726. package/python/lib/python3.15/encodings/utf_32_le.py +37 -0
  727. package/python/lib/python3.15/encodings/utf_7.py +38 -0
  728. package/python/lib/python3.15/encodings/utf_8.py +42 -0
  729. package/python/lib/python3.15/encodings/utf_8_sig.py +130 -0
  730. package/python/lib/python3.15/encodings/uu_codec.py +103 -0
  731. package/python/lib/python3.15/encodings/zlib_codec.py +77 -0
  732. package/python/lib/python3.15/enum.py +2198 -0
  733. package/python/lib/python3.15/filecmp.py +320 -0
  734. package/python/lib/python3.15/fileinput.py +442 -0
  735. package/python/lib/python3.15/fnmatch.py +209 -0
  736. package/python/lib/python3.15/fractions.py +1078 -0
  737. package/python/lib/python3.15/ftplib.py +975 -0
  738. package/python/lib/python3.15/functools.py +1208 -0
  739. package/python/lib/python3.15/genericpath.py +220 -0
  740. package/python/lib/python3.15/getopt.py +232 -0
  741. package/python/lib/python3.15/getpass.py +450 -0
  742. package/python/lib/python3.15/gettext.py +661 -0
  743. package/python/lib/python3.15/glob.py +553 -0
  744. package/python/lib/python3.15/graphlib.py +309 -0
  745. package/python/lib/python3.15/gzip.py +754 -0
  746. package/python/lib/python3.15/hashlib.py +297 -0
  747. package/python/lib/python3.15/heapq.py +611 -0
  748. package/python/lib/python3.15/hmac.py +293 -0
  749. package/python/lib/python3.15/html/__init__.py +132 -0
  750. package/python/lib/python3.15/html/__pycache__/__init__.cpython-315.pyc +0 -0
  751. package/python/lib/python3.15/html/__pycache__/entities.cpython-315.pyc +0 -0
  752. package/python/lib/python3.15/html/__pycache__/parser.cpython-315.pyc +0 -0
  753. package/python/lib/python3.15/html/entities.py +2513 -0
  754. package/python/lib/python3.15/html/parser.py +583 -0
  755. package/python/lib/python3.15/http/__init__.py +213 -0
  756. package/python/lib/python3.15/http/__pycache__/__init__.cpython-315.pyc +0 -0
  757. package/python/lib/python3.15/http/__pycache__/client.cpython-315.pyc +0 -0
  758. package/python/lib/python3.15/http/__pycache__/cookiejar.cpython-315.pyc +0 -0
  759. package/python/lib/python3.15/http/__pycache__/cookies.cpython-315.pyc +0 -0
  760. package/python/lib/python3.15/http/__pycache__/server.cpython-315.pyc +0 -0
  761. package/python/lib/python3.15/http/client.py +1614 -0
  762. package/python/lib/python3.15/http/cookiejar.py +2138 -0
  763. package/python/lib/python3.15/http/cookies.py +652 -0
  764. package/python/lib/python3.15/http/server.py +1177 -0
  765. package/python/lib/python3.15/imaplib.py +2106 -0
  766. package/python/lib/python3.15/importlib/__init__.py +136 -0
  767. package/python/lib/python3.15/importlib/__pycache__/__init__.cpython-315.pyc +0 -0
  768. package/python/lib/python3.15/importlib/__pycache__/_abc.cpython-315.pyc +0 -0
  769. package/python/lib/python3.15/importlib/__pycache__/_bootstrap.cpython-315.pyc +0 -0
  770. package/python/lib/python3.15/importlib/__pycache__/_bootstrap_external.cpython-315.pyc +0 -0
  771. package/python/lib/python3.15/importlib/__pycache__/abc.cpython-315.pyc +0 -0
  772. package/python/lib/python3.15/importlib/__pycache__/machinery.cpython-315.pyc +0 -0
  773. package/python/lib/python3.15/importlib/__pycache__/readers.cpython-315.pyc +0 -0
  774. package/python/lib/python3.15/importlib/__pycache__/simple.cpython-315.pyc +0 -0
  775. package/python/lib/python3.15/importlib/__pycache__/util.cpython-315.pyc +0 -0
  776. package/python/lib/python3.15/importlib/_abc.py +21 -0
  777. package/python/lib/python3.15/importlib/_bootstrap.py +1553 -0
  778. package/python/lib/python3.15/importlib/_bootstrap_external.py +1591 -0
  779. package/python/lib/python3.15/importlib/abc.py +251 -0
  780. package/python/lib/python3.15/importlib/machinery.py +51 -0
  781. package/python/lib/python3.15/importlib/metadata/__init__.py +1206 -0
  782. package/python/lib/python3.15/importlib/metadata/__pycache__/__init__.cpython-315.pyc +0 -0
  783. package/python/lib/python3.15/importlib/metadata/__pycache__/_adapters.cpython-315.pyc +0 -0
  784. package/python/lib/python3.15/importlib/metadata/__pycache__/_collections.cpython-315.pyc +0 -0
  785. package/python/lib/python3.15/importlib/metadata/__pycache__/_context.cpython-315.pyc +0 -0
  786. package/python/lib/python3.15/importlib/metadata/__pycache__/_functools.cpython-315.pyc +0 -0
  787. package/python/lib/python3.15/importlib/metadata/__pycache__/_itertools.cpython-315.pyc +0 -0
  788. package/python/lib/python3.15/importlib/metadata/__pycache__/_meta.cpython-315.pyc +0 -0
  789. package/python/lib/python3.15/importlib/metadata/__pycache__/_text.cpython-315.pyc +0 -0
  790. package/python/lib/python3.15/importlib/metadata/__pycache__/_typing.cpython-315.pyc +0 -0
  791. package/python/lib/python3.15/importlib/metadata/__pycache__/diagnose.cpython-315.pyc +0 -0
  792. package/python/lib/python3.15/importlib/metadata/_adapters.py +136 -0
  793. package/python/lib/python3.15/importlib/metadata/_collections.py +34 -0
  794. package/python/lib/python3.15/importlib/metadata/_context.py +118 -0
  795. package/python/lib/python3.15/importlib/metadata/_functools.py +136 -0
  796. package/python/lib/python3.15/importlib/metadata/_itertools.py +171 -0
  797. package/python/lib/python3.15/importlib/metadata/_meta.py +71 -0
  798. package/python/lib/python3.15/importlib/metadata/_text.py +99 -0
  799. package/python/lib/python3.15/importlib/metadata/_typing.py +15 -0
  800. package/python/lib/python3.15/importlib/metadata/diagnose.py +21 -0
  801. package/python/lib/python3.15/importlib/readers.py +12 -0
  802. package/python/lib/python3.15/importlib/resources/__init__.py +40 -0
  803. package/python/lib/python3.15/importlib/resources/__pycache__/__init__.cpython-315.pyc +0 -0
  804. package/python/lib/python3.15/importlib/resources/__pycache__/_adapters.cpython-315.pyc +0 -0
  805. package/python/lib/python3.15/importlib/resources/__pycache__/_common.cpython-315.pyc +0 -0
  806. package/python/lib/python3.15/importlib/resources/__pycache__/_functional.cpython-315.pyc +0 -0
  807. package/python/lib/python3.15/importlib/resources/__pycache__/_itertools.cpython-315.pyc +0 -0
  808. package/python/lib/python3.15/importlib/resources/__pycache__/abc.cpython-315.pyc +0 -0
  809. package/python/lib/python3.15/importlib/resources/__pycache__/readers.cpython-315.pyc +0 -0
  810. package/python/lib/python3.15/importlib/resources/__pycache__/simple.cpython-315.pyc +0 -0
  811. package/python/lib/python3.15/importlib/resources/_adapters.py +168 -0
  812. package/python/lib/python3.15/importlib/resources/_common.py +191 -0
  813. package/python/lib/python3.15/importlib/resources/_functional.py +84 -0
  814. package/python/lib/python3.15/importlib/resources/_itertools.py +38 -0
  815. package/python/lib/python3.15/importlib/resources/abc.py +189 -0
  816. package/python/lib/python3.15/importlib/resources/readers.py +202 -0
  817. package/python/lib/python3.15/importlib/resources/simple.py +106 -0
  818. package/python/lib/python3.15/importlib/simple.py +14 -0
  819. package/python/lib/python3.15/importlib/util.py +279 -0
  820. package/python/lib/python3.15/inspect.py +3511 -0
  821. package/python/lib/python3.15/io.py +150 -0
  822. package/python/lib/python3.15/ipaddress.py +2431 -0
  823. package/python/lib/python3.15/json/__init__.py +395 -0
  824. package/python/lib/python3.15/json/__main__.py +20 -0
  825. package/python/lib/python3.15/json/__pycache__/__init__.cpython-315.pyc +0 -0
  826. package/python/lib/python3.15/json/__pycache__/__main__.cpython-315.pyc +0 -0
  827. package/python/lib/python3.15/json/__pycache__/decoder.cpython-315.pyc +0 -0
  828. package/python/lib/python3.15/json/__pycache__/encoder.cpython-315.pyc +0 -0
  829. package/python/lib/python3.15/json/__pycache__/scanner.cpython-315.pyc +0 -0
  830. package/python/lib/python3.15/json/__pycache__/tool.cpython-315.pyc +0 -0
  831. package/python/lib/python3.15/json/decoder.py +377 -0
  832. package/python/lib/python3.15/json/encoder.py +459 -0
  833. package/python/lib/python3.15/json/scanner.py +74 -0
  834. package/python/lib/python3.15/json/tool.py +123 -0
  835. package/python/lib/python3.15/keyword.py +65 -0
  836. package/python/lib/python3.15/lib-dynload/.empty +0 -0
  837. package/python/lib/python3.15/lib-dynload/_dbm.cpython-315-s390x-linux-gnu.so +0 -0
  838. package/python/lib/python3.15/linecache.py +339 -0
  839. package/python/lib/python3.15/locale.py +2007 -0
  840. package/python/lib/python3.15/logging/__init__.py +2369 -0
  841. package/python/lib/python3.15/logging/__pycache__/__init__.cpython-315.pyc +0 -0
  842. package/python/lib/python3.15/logging/__pycache__/config.cpython-315.pyc +0 -0
  843. package/python/lib/python3.15/logging/__pycache__/handlers.cpython-315.pyc +0 -0
  844. package/python/lib/python3.15/logging/config.py +1093 -0
  845. package/python/lib/python3.15/logging/handlers.py +1667 -0
  846. package/python/lib/python3.15/lzma.py +364 -0
  847. package/python/lib/python3.15/mailbox.py +2225 -0
  848. package/python/lib/python3.15/mimetypes.py +768 -0
  849. package/python/lib/python3.15/modulefinder.py +680 -0
  850. package/python/lib/python3.15/multiprocessing/__init__.py +37 -0
  851. package/python/lib/python3.15/multiprocessing/__pycache__/__init__.cpython-315.pyc +0 -0
  852. package/python/lib/python3.15/multiprocessing/__pycache__/connection.cpython-315.pyc +0 -0
  853. package/python/lib/python3.15/multiprocessing/__pycache__/context.cpython-315.pyc +0 -0
  854. package/python/lib/python3.15/multiprocessing/__pycache__/forkserver.cpython-315.pyc +0 -0
  855. package/python/lib/python3.15/multiprocessing/__pycache__/heap.cpython-315.pyc +0 -0
  856. package/python/lib/python3.15/multiprocessing/__pycache__/managers.cpython-315.pyc +0 -0
  857. package/python/lib/python3.15/multiprocessing/__pycache__/pool.cpython-315.pyc +0 -0
  858. package/python/lib/python3.15/multiprocessing/__pycache__/popen_fork.cpython-315.pyc +0 -0
  859. package/python/lib/python3.15/multiprocessing/__pycache__/popen_forkserver.cpython-315.pyc +0 -0
  860. package/python/lib/python3.15/multiprocessing/__pycache__/popen_spawn_posix.cpython-315.pyc +0 -0
  861. package/python/lib/python3.15/multiprocessing/__pycache__/popen_spawn_win32.cpython-315.pyc +0 -0
  862. package/python/lib/python3.15/multiprocessing/__pycache__/process.cpython-315.pyc +0 -0
  863. package/python/lib/python3.15/multiprocessing/__pycache__/queues.cpython-315.pyc +0 -0
  864. package/python/lib/python3.15/multiprocessing/__pycache__/reduction.cpython-315.pyc +0 -0
  865. package/python/lib/python3.15/multiprocessing/__pycache__/resource_sharer.cpython-315.pyc +0 -0
  866. package/python/lib/python3.15/multiprocessing/__pycache__/resource_tracker.cpython-315.pyc +0 -0
  867. package/python/lib/python3.15/multiprocessing/__pycache__/shared_memory.cpython-315.pyc +0 -0
  868. package/python/lib/python3.15/multiprocessing/__pycache__/sharedctypes.cpython-315.pyc +0 -0
  869. package/python/lib/python3.15/multiprocessing/__pycache__/spawn.cpython-315.pyc +0 -0
  870. package/python/lib/python3.15/multiprocessing/__pycache__/synchronize.cpython-315.pyc +0 -0
  871. package/python/lib/python3.15/multiprocessing/__pycache__/util.cpython-315.pyc +0 -0
  872. package/python/lib/python3.15/multiprocessing/connection.py +1240 -0
  873. package/python/lib/python3.15/multiprocessing/context.py +408 -0
  874. package/python/lib/python3.15/multiprocessing/dummy/__init__.py +126 -0
  875. package/python/lib/python3.15/multiprocessing/dummy/__pycache__/__init__.cpython-315.pyc +0 -0
  876. package/python/lib/python3.15/multiprocessing/dummy/__pycache__/connection.cpython-315.pyc +0 -0
  877. package/python/lib/python3.15/multiprocessing/dummy/connection.py +75 -0
  878. package/python/lib/python3.15/multiprocessing/forkserver.py +493 -0
  879. package/python/lib/python3.15/multiprocessing/heap.py +333 -0
  880. package/python/lib/python3.15/multiprocessing/managers.py +1438 -0
  881. package/python/lib/python3.15/multiprocessing/pool.py +957 -0
  882. package/python/lib/python3.15/multiprocessing/popen_fork.py +100 -0
  883. package/python/lib/python3.15/multiprocessing/popen_forkserver.py +74 -0
  884. package/python/lib/python3.15/multiprocessing/popen_spawn_posix.py +76 -0
  885. package/python/lib/python3.15/multiprocessing/popen_spawn_win32.py +147 -0
  886. package/python/lib/python3.15/multiprocessing/process.py +443 -0
  887. package/python/lib/python3.15/multiprocessing/queues.py +399 -0
  888. package/python/lib/python3.15/multiprocessing/reduction.py +281 -0
  889. package/python/lib/python3.15/multiprocessing/resource_sharer.py +154 -0
  890. package/python/lib/python3.15/multiprocessing/resource_tracker.py +495 -0
  891. package/python/lib/python3.15/multiprocessing/shared_memory.py +544 -0
  892. package/python/lib/python3.15/multiprocessing/sharedctypes.py +245 -0
  893. package/python/lib/python3.15/multiprocessing/spawn.py +307 -0
  894. package/python/lib/python3.15/multiprocessing/synchronize.py +411 -0
  895. package/python/lib/python3.15/multiprocessing/util.py +619 -0
  896. package/python/lib/python3.15/netrc.py +205 -0
  897. package/python/lib/python3.15/ntpath.py +896 -0
  898. package/python/lib/python3.15/nturl2path.py +82 -0
  899. package/python/lib/python3.15/numbers.py +427 -0
  900. package/python/lib/python3.15/opcode.py +135 -0
  901. package/python/lib/python3.15/operator.py +475 -0
  902. package/python/lib/python3.15/optparse.py +1673 -0
  903. package/python/lib/python3.15/os.py +1217 -0
  904. package/python/lib/python3.15/pathlib/__init__.py +1508 -0
  905. package/python/lib/python3.15/pathlib/__pycache__/__init__.cpython-315.pyc +0 -0
  906. package/python/lib/python3.15/pathlib/__pycache__/_local.cpython-315.pyc +0 -0
  907. package/python/lib/python3.15/pathlib/__pycache__/_os.cpython-315.pyc +0 -0
  908. package/python/lib/python3.15/pathlib/__pycache__/types.cpython-315.pyc +0 -0
  909. package/python/lib/python3.15/pathlib/_local.py +12 -0
  910. package/python/lib/python3.15/pathlib/_os.py +303 -0
  911. package/python/lib/python3.15/pathlib/types.py +476 -0
  912. package/python/lib/python3.15/pdb.py +3899 -0
  913. package/python/lib/python3.15/pickle.py +1955 -0
  914. package/python/lib/python3.15/pickletools.py +2934 -0
  915. package/python/lib/python3.15/pkgutil.py +492 -0
  916. package/python/lib/python3.15/platform.py +1446 -0
  917. package/python/lib/python3.15/plistlib.py +949 -0
  918. package/python/lib/python3.15/poplib.py +479 -0
  919. package/python/lib/python3.15/posixpath.py +597 -0
  920. package/python/lib/python3.15/pprint.py +972 -0
  921. package/python/lib/python3.15/profile.py +623 -0
  922. package/python/lib/python3.15/profiling/__init__.py +13 -0
  923. package/python/lib/python3.15/profiling/__pycache__/__init__.cpython-315.pyc +0 -0
  924. package/python/lib/python3.15/profiling/sampling/__init__.py +23 -0
  925. package/python/lib/python3.15/profiling/sampling/__main__.py +73 -0
  926. package/python/lib/python3.15/profiling/sampling/__pycache__/__init__.cpython-315.pyc +0 -0
  927. package/python/lib/python3.15/profiling/sampling/__pycache__/__main__.cpython-315.pyc +0 -0
  928. package/python/lib/python3.15/profiling/sampling/__pycache__/_child_monitor.cpython-315.pyc +0 -0
  929. package/python/lib/python3.15/profiling/sampling/__pycache__/_css_utils.cpython-315.pyc +0 -0
  930. package/python/lib/python3.15/profiling/sampling/__pycache__/_format_utils.cpython-315.pyc +0 -0
  931. package/python/lib/python3.15/profiling/sampling/__pycache__/_sync_coordinator.cpython-315.pyc +0 -0
  932. package/python/lib/python3.15/profiling/sampling/__pycache__/binary_collector.cpython-315.pyc +0 -0
  933. package/python/lib/python3.15/profiling/sampling/__pycache__/binary_reader.cpython-315.pyc +0 -0
  934. package/python/lib/python3.15/profiling/sampling/__pycache__/cli.cpython-315.pyc +0 -0
  935. package/python/lib/python3.15/profiling/sampling/__pycache__/collector.cpython-315.pyc +0 -0
  936. package/python/lib/python3.15/profiling/sampling/__pycache__/constants.cpython-315.pyc +0 -0
  937. package/python/lib/python3.15/profiling/sampling/__pycache__/dump.cpython-315.pyc +0 -0
  938. package/python/lib/python3.15/profiling/sampling/__pycache__/errors.cpython-315.pyc +0 -0
  939. package/python/lib/python3.15/profiling/sampling/__pycache__/gecko_collector.cpython-315.pyc +0 -0
  940. package/python/lib/python3.15/profiling/sampling/__pycache__/heatmap_collector.cpython-315.pyc +0 -0
  941. package/python/lib/python3.15/profiling/sampling/__pycache__/jsonl_collector.cpython-315.pyc +0 -0
  942. package/python/lib/python3.15/profiling/sampling/__pycache__/module_utils.cpython-315.pyc +0 -0
  943. package/python/lib/python3.15/profiling/sampling/__pycache__/opcode_utils.cpython-315.pyc +0 -0
  944. package/python/lib/python3.15/profiling/sampling/__pycache__/pstats_collector.cpython-315.pyc +0 -0
  945. package/python/lib/python3.15/profiling/sampling/__pycache__/sample.cpython-315.pyc +0 -0
  946. package/python/lib/python3.15/profiling/sampling/__pycache__/stack_collector.cpython-315.pyc +0 -0
  947. package/python/lib/python3.15/profiling/sampling/__pycache__/string_table.cpython-315.pyc +0 -0
  948. package/python/lib/python3.15/profiling/sampling/_assets/python-logo-only.png +0 -0
  949. package/python/lib/python3.15/profiling/sampling/_assets/tachyon-logo.png +0 -0
  950. package/python/lib/python3.15/profiling/sampling/_child_monitor.py +279 -0
  951. package/python/lib/python3.15/profiling/sampling/_css_utils.py +22 -0
  952. package/python/lib/python3.15/profiling/sampling/_flamegraph_assets/flamegraph.css +1085 -0
  953. package/python/lib/python3.15/profiling/sampling/_flamegraph_assets/flamegraph.js +1528 -0
  954. package/python/lib/python3.15/profiling/sampling/_flamegraph_assets/flamegraph_template.html +464 -0
  955. package/python/lib/python3.15/profiling/sampling/_format_utils.py +5 -0
  956. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap.css +1555 -0
  957. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap.js +738 -0
  958. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap_index.js +104 -0
  959. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap_index_template.html +136 -0
  960. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap_pyfile_template.html +131 -0
  961. package/python/lib/python3.15/profiling/sampling/_heatmap_assets/heatmap_shared.js +64 -0
  962. package/python/lib/python3.15/profiling/sampling/_shared_assets/base.css +514 -0
  963. package/python/lib/python3.15/profiling/sampling/_shared_assets/base.js +58 -0
  964. package/python/lib/python3.15/profiling/sampling/_sync_coordinator.py +261 -0
  965. package/python/lib/python3.15/profiling/sampling/_vendor/d3/7.8.5/d3.min.js +2 -0
  966. package/python/lib/python3.15/profiling/sampling/_vendor/d3-flame-graph/4.1.3/d3-flamegraph-tooltip.min.js +1 -0
  967. package/python/lib/python3.15/profiling/sampling/_vendor/d3-flame-graph/4.1.3/d3-flamegraph.css +46 -0
  968. package/python/lib/python3.15/profiling/sampling/_vendor/d3-flame-graph/4.1.3/d3-flamegraph.min.js +1 -0
  969. package/python/lib/python3.15/profiling/sampling/binary_collector.py +159 -0
  970. package/python/lib/python3.15/profiling/sampling/binary_reader.py +148 -0
  971. package/python/lib/python3.15/profiling/sampling/cli.py +1462 -0
  972. package/python/lib/python3.15/profiling/sampling/collector.py +292 -0
  973. package/python/lib/python3.15/profiling/sampling/constants.py +57 -0
  974. package/python/lib/python3.15/profiling/sampling/dump.py +295 -0
  975. package/python/lib/python3.15/profiling/sampling/errors.py +19 -0
  976. package/python/lib/python3.15/profiling/sampling/gecko_collector.py +1006 -0
  977. package/python/lib/python3.15/profiling/sampling/heatmap_collector.py +1145 -0
  978. package/python/lib/python3.15/profiling/sampling/jsonl_collector.py +268 -0
  979. package/python/lib/python3.15/profiling/sampling/live_collector/__init__.py +200 -0
  980. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/__init__.cpython-315.pyc +0 -0
  981. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/collector.cpython-315.pyc +0 -0
  982. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/constants.cpython-315.pyc +0 -0
  983. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/display.cpython-315.pyc +0 -0
  984. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/trend_tracker.cpython-315.pyc +0 -0
  985. package/python/lib/python3.15/profiling/sampling/live_collector/__pycache__/widgets.cpython-315.pyc +0 -0
  986. package/python/lib/python3.15/profiling/sampling/live_collector/collector.py +1112 -0
  987. package/python/lib/python3.15/profiling/sampling/live_collector/constants.py +65 -0
  988. package/python/lib/python3.15/profiling/sampling/live_collector/display.py +240 -0
  989. package/python/lib/python3.15/profiling/sampling/live_collector/trend_tracker.py +157 -0
  990. package/python/lib/python3.15/profiling/sampling/live_collector/widgets.py +1090 -0
  991. package/python/lib/python3.15/profiling/sampling/module_utils.py +102 -0
  992. package/python/lib/python3.15/profiling/sampling/opcode_utils.py +94 -0
  993. package/python/lib/python3.15/profiling/sampling/pstats_collector.py +429 -0
  994. package/python/lib/python3.15/profiling/sampling/sample.py +665 -0
  995. package/python/lib/python3.15/profiling/sampling/stack_collector.py +928 -0
  996. package/python/lib/python3.15/profiling/sampling/string_table.py +53 -0
  997. package/python/lib/python3.15/profiling/tracing/__init__.py +220 -0
  998. package/python/lib/python3.15/profiling/tracing/__main__.py +6 -0
  999. package/python/lib/python3.15/profiling/tracing/__pycache__/__init__.cpython-315.pyc +0 -0
  1000. package/python/lib/python3.15/profiling/tracing/__pycache__/__main__.cpython-315.pyc +0 -0
  1001. package/python/lib/python3.15/profiling/tracing/__pycache__/_utils.cpython-315.pyc +0 -0
  1002. package/python/lib/python3.15/profiling/tracing/_utils.py +32 -0
  1003. package/python/lib/python3.15/pstats.py +840 -0
  1004. package/python/lib/python3.15/pty.py +182 -0
  1005. package/python/lib/python3.15/py_compile.py +214 -0
  1006. package/python/lib/python3.15/pyclbr.py +313 -0
  1007. package/python/lib/python3.15/pydoc.py +2843 -0
  1008. package/python/lib/python3.15/queue.py +385 -0
  1009. package/python/lib/python3.15/quopri.py +235 -0
  1010. package/python/lib/python3.15/random.py +1087 -0
  1011. package/python/lib/python3.15/re/__init__.py +442 -0
  1012. package/python/lib/python3.15/re/__pycache__/__init__.cpython-315.pyc +0 -0
  1013. package/python/lib/python3.15/re/__pycache__/_casefix.cpython-315.pyc +0 -0
  1014. package/python/lib/python3.15/re/__pycache__/_compiler.cpython-315.pyc +0 -0
  1015. package/python/lib/python3.15/re/__pycache__/_constants.cpython-315.pyc +0 -0
  1016. package/python/lib/python3.15/re/__pycache__/_parser.cpython-315.pyc +0 -0
  1017. package/python/lib/python3.15/re/_casefix.py +106 -0
  1018. package/python/lib/python3.15/re/_compiler.py +782 -0
  1019. package/python/lib/python3.15/re/_constants.py +224 -0
  1020. package/python/lib/python3.15/re/_parser.py +1065 -0
  1021. package/python/lib/python3.15/reprlib.py +230 -0
  1022. package/python/lib/python3.15/rlcompleter.py +232 -0
  1023. package/python/lib/python3.15/runpy.py +324 -0
  1024. package/python/lib/python3.15/sched.py +167 -0
  1025. package/python/lib/python3.15/secrets.py +71 -0
  1026. package/python/lib/python3.15/selectors.py +603 -0
  1027. package/python/lib/python3.15/shelve.py +266 -0
  1028. package/python/lib/python3.15/shlex.py +351 -0
  1029. package/python/lib/python3.15/shutil.py +1663 -0
  1030. package/python/lib/python3.15/signal.py +94 -0
  1031. package/python/lib/python3.15/site-packages/_yaml/__init__.py +33 -0
  1032. package/python/lib/python3.15/site-packages/_yaml/__pycache__/__init__.cpython-315.pyc +0 -0
  1033. package/python/lib/python3.15/site-packages/click/__init__.py +144 -0
  1034. package/python/lib/python3.15/site-packages/click/__pycache__/__init__.cpython-315.pyc +0 -0
  1035. package/python/lib/python3.15/site-packages/click/__pycache__/_compat.cpython-315.pyc +0 -0
  1036. package/python/lib/python3.15/site-packages/click/__pycache__/_termui_impl.cpython-315.pyc +0 -0
  1037. package/python/lib/python3.15/site-packages/click/__pycache__/_textwrap.cpython-315.pyc +0 -0
  1038. package/python/lib/python3.15/site-packages/click/__pycache__/_utils.cpython-315.pyc +0 -0
  1039. package/python/lib/python3.15/site-packages/click/__pycache__/_winconsole.cpython-315.pyc +0 -0
  1040. package/python/lib/python3.15/site-packages/click/__pycache__/core.cpython-315.pyc +0 -0
  1041. package/python/lib/python3.15/site-packages/click/__pycache__/decorators.cpython-315.pyc +0 -0
  1042. package/python/lib/python3.15/site-packages/click/__pycache__/exceptions.cpython-315.pyc +0 -0
  1043. package/python/lib/python3.15/site-packages/click/__pycache__/formatting.cpython-315.pyc +0 -0
  1044. package/python/lib/python3.15/site-packages/click/__pycache__/globals.cpython-315.pyc +0 -0
  1045. package/python/lib/python3.15/site-packages/click/__pycache__/parser.cpython-315.pyc +0 -0
  1046. package/python/lib/python3.15/site-packages/click/__pycache__/shell_completion.cpython-315.pyc +0 -0
  1047. package/python/lib/python3.15/site-packages/click/__pycache__/termui.cpython-315.pyc +0 -0
  1048. package/python/lib/python3.15/site-packages/click/__pycache__/testing.cpython-315.pyc +0 -0
  1049. package/python/lib/python3.15/site-packages/click/__pycache__/types.cpython-315.pyc +0 -0
  1050. package/python/lib/python3.15/site-packages/click/__pycache__/utils.cpython-315.pyc +0 -0
  1051. package/python/lib/python3.15/site-packages/click/_compat.py +590 -0
  1052. package/python/lib/python3.15/site-packages/click/_termui_impl.py +970 -0
  1053. package/python/lib/python3.15/site-packages/click/_textwrap.py +188 -0
  1054. package/python/lib/python3.15/site-packages/click/_utils.py +45 -0
  1055. package/python/lib/python3.15/site-packages/click/_winconsole.py +292 -0
  1056. package/python/lib/python3.15/site-packages/click/core.py +3825 -0
  1057. package/python/lib/python3.15/site-packages/click/decorators.py +625 -0
  1058. package/python/lib/python3.15/site-packages/click/exceptions.py +378 -0
  1059. package/python/lib/python3.15/site-packages/click/formatting.py +320 -0
  1060. package/python/lib/python3.15/site-packages/click/globals.py +67 -0
  1061. package/python/lib/python3.15/site-packages/click/parser.py +533 -0
  1062. package/python/lib/python3.15/site-packages/click/py.typed +0 -0
  1063. package/python/lib/python3.15/site-packages/click/shell_completion.py +796 -0
  1064. package/python/lib/python3.15/site-packages/click/termui.py +1024 -0
  1065. package/python/lib/python3.15/site-packages/click/testing.py +796 -0
  1066. package/python/lib/python3.15/site-packages/click/types.py +1437 -0
  1067. package/python/lib/python3.15/site-packages/click/utils.py +676 -0
  1068. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/INSTALLER +1 -0
  1069. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/METADATA +83 -0
  1070. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/RECORD +24 -0
  1071. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/REQUESTED +0 -0
  1072. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/WHEEL +4 -0
  1073. package/python/lib/python3.15/site-packages/click-8.5.1.dist-info/licenses/LICENSE.txt +28 -0
  1074. package/python/lib/python3.15/site-packages/cssbeautifier/__init__.py +51 -0
  1075. package/python/lib/python3.15/site-packages/cssbeautifier/__pycache__/__init__.cpython-315.pyc +0 -0
  1076. package/python/lib/python3.15/site-packages/cssbeautifier/__pycache__/__version__.cpython-315.pyc +0 -0
  1077. package/python/lib/python3.15/site-packages/cssbeautifier/__pycache__/_main.cpython-315.pyc +0 -0
  1078. package/python/lib/python3.15/site-packages/cssbeautifier/__version__.py +1 -0
  1079. package/python/lib/python3.15/site-packages/cssbeautifier/_main.py +208 -0
  1080. package/python/lib/python3.15/site-packages/cssbeautifier/css/__init__.py +1 -0
  1081. package/python/lib/python3.15/site-packages/cssbeautifier/css/__pycache__/__init__.cpython-315.pyc +0 -0
  1082. package/python/lib/python3.15/site-packages/cssbeautifier/css/__pycache__/beautifier.cpython-315.pyc +0 -0
  1083. package/python/lib/python3.15/site-packages/cssbeautifier/css/__pycache__/options.cpython-315.pyc +0 -0
  1084. package/python/lib/python3.15/site-packages/cssbeautifier/css/beautifier.py +559 -0
  1085. package/python/lib/python3.15/site-packages/cssbeautifier/css/options.py +60 -0
  1086. package/python/lib/python3.15/site-packages/cssbeautifier/tests/__init__.py +1 -0
  1087. package/python/lib/python3.15/site-packages/cssbeautifier/tests/__pycache__/__init__.cpython-315.pyc +0 -0
  1088. package/python/lib/python3.15/site-packages/cssbeautifier/tests/generated/__init__.py +1 -0
  1089. package/python/lib/python3.15/site-packages/cssbeautifier/tests/generated/__pycache__/__init__.cpython-315.pyc +0 -0
  1090. package/python/lib/python3.15/site-packages/cssbeautifier/tests/generated/__pycache__/tests.cpython-315.pyc +0 -0
  1091. package/python/lib/python3.15/site-packages/cssbeautifier/tests/generated/tests.py +11333 -0
  1092. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1093. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/METADATA +19 -0
  1094. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/RECORD +51 -0
  1095. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1096. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1097. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1098. package/python/lib/python3.15/site-packages/cssbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1099. package/python/lib/python3.15/site-packages/djlint/__init__.py +27 -0
  1100. package/python/lib/python3.15/site-packages/djlint/__main__.py +8 -0
  1101. package/python/lib/python3.15/site-packages/djlint/__pycache__/__init__.cpython-315.pyc +0 -0
  1102. package/python/lib/python3.15/site-packages/djlint/__pycache__/__main__.cpython-315.pyc +0 -0
  1103. package/python/lib/python3.15/site-packages/djlint/__pycache__/_cli.cpython-315.pyc +0 -0
  1104. package/python/lib/python3.15/site-packages/djlint/__pycache__/api.cpython-315.pyc +0 -0
  1105. package/python/lib/python3.15/site-packages/djlint/__pycache__/const.cpython-315.pyc +0 -0
  1106. package/python/lib/python3.15/site-packages/djlint/__pycache__/github_output.cpython-315.pyc +0 -0
  1107. package/python/lib/python3.15/site-packages/djlint/__pycache__/helpers.cpython-315.pyc +0 -0
  1108. package/python/lib/python3.15/site-packages/djlint/__pycache__/lint.cpython-315.pyc +0 -0
  1109. package/python/lib/python3.15/site-packages/djlint/__pycache__/output.cpython-315.pyc +0 -0
  1110. package/python/lib/python3.15/site-packages/djlint/__pycache__/reformat.cpython-315.pyc +0 -0
  1111. package/python/lib/python3.15/site-packages/djlint/__pycache__/sarif_output.cpython-315.pyc +0 -0
  1112. package/python/lib/python3.15/site-packages/djlint/__pycache__/server.cpython-315.pyc +0 -0
  1113. package/python/lib/python3.15/site-packages/djlint/__pycache__/settings.cpython-315.pyc +0 -0
  1114. package/python/lib/python3.15/site-packages/djlint/__pycache__/src.cpython-315.pyc +0 -0
  1115. package/python/lib/python3.15/site-packages/djlint/_cli.py +1006 -0
  1116. package/python/lib/python3.15/site-packages/djlint/api.py +106 -0
  1117. package/python/lib/python3.15/site-packages/djlint/const.py +506 -0
  1118. package/python/lib/python3.15/site-packages/djlint/formatter/__init__.py +0 -0
  1119. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/__init__.cpython-315.pyc +0 -0
  1120. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/attribute_values.cpython-315.pyc +0 -0
  1121. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/attributes.cpython-315.pyc +0 -0
  1122. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/beautifier.cpython-315.pyc +0 -0
  1123. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/class_attributes.cpython-315.pyc +0 -0
  1124. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/compress.cpython-315.pyc +0 -0
  1125. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/condense.cpython-315.pyc +0 -0
  1126. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/css.cpython-315.pyc +0 -0
  1127. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/endblocks.cpython-315.pyc +0 -0
  1128. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/entities.cpython-315.pyc +0 -0
  1129. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/expand.cpython-315.pyc +0 -0
  1130. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/indent.cpython-315.pyc +0 -0
  1131. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/js.cpython-315.pyc +0 -0
  1132. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/load_tags.cpython-315.pyc +0 -0
  1133. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/mako.cpython-315.pyc +0 -0
  1134. package/python/lib/python3.15/site-packages/djlint/formatter/__pycache__/tokenizer.cpython-315.pyc +0 -0
  1135. package/python/lib/python3.15/site-packages/djlint/formatter/attribute_values.py +152 -0
  1136. package/python/lib/python3.15/site-packages/djlint/formatter/attributes.py +580 -0
  1137. package/python/lib/python3.15/site-packages/djlint/formatter/beautifier.py +144 -0
  1138. package/python/lib/python3.15/site-packages/djlint/formatter/class_attributes.py +318 -0
  1139. package/python/lib/python3.15/site-packages/djlint/formatter/compress.py +158 -0
  1140. package/python/lib/python3.15/site-packages/djlint/formatter/condense.py +503 -0
  1141. package/python/lib/python3.15/site-packages/djlint/formatter/css.py +28 -0
  1142. package/python/lib/python3.15/site-packages/djlint/formatter/endblocks.py +68 -0
  1143. package/python/lib/python3.15/site-packages/djlint/formatter/entities.py +39 -0
  1144. package/python/lib/python3.15/site-packages/djlint/formatter/expand.py +576 -0
  1145. package/python/lib/python3.15/site-packages/djlint/formatter/indent.py +1239 -0
  1146. package/python/lib/python3.15/site-packages/djlint/formatter/js.py +82 -0
  1147. package/python/lib/python3.15/site-packages/djlint/formatter/load_tags.py +60 -0
  1148. package/python/lib/python3.15/site-packages/djlint/formatter/mako.py +501 -0
  1149. package/python/lib/python3.15/site-packages/djlint/formatter/tokenizer.py +359 -0
  1150. package/python/lib/python3.15/site-packages/djlint/github_output.py +117 -0
  1151. package/python/lib/python3.15/site-packages/djlint/helpers.py +979 -0
  1152. package/python/lib/python3.15/site-packages/djlint/lint.py +246 -0
  1153. package/python/lib/python3.15/site-packages/djlint/output.py +250 -0
  1154. package/python/lib/python3.15/site-packages/djlint/py.typed +0 -0
  1155. package/python/lib/python3.15/site-packages/djlint/reformat.py +130 -0
  1156. package/python/lib/python3.15/site-packages/djlint/rules/D058.py +78 -0
  1157. package/python/lib/python3.15/site-packages/djlint/rules/D059.py +139 -0
  1158. package/python/lib/python3.15/site-packages/djlint/rules/H009.py +54 -0
  1159. package/python/lib/python3.15/site-packages/djlint/rules/H012.py +240 -0
  1160. package/python/lib/python3.15/site-packages/djlint/rules/H014.py +68 -0
  1161. package/python/lib/python3.15/site-packages/djlint/rules/H016.py +83 -0
  1162. package/python/lib/python3.15/site-packages/djlint/rules/H022.py +161 -0
  1163. package/python/lib/python3.15/site-packages/djlint/rules/H025.py +141 -0
  1164. package/python/lib/python3.15/site-packages/djlint/rules/H036.py +183 -0
  1165. package/python/lib/python3.15/site-packages/djlint/rules/H037.py +138 -0
  1166. package/python/lib/python3.15/site-packages/djlint/rules/H041.py +113 -0
  1167. package/python/lib/python3.15/site-packages/djlint/rules/H042.py +199 -0
  1168. package/python/lib/python3.15/site-packages/djlint/rules/H044.py +119 -0
  1169. package/python/lib/python3.15/site-packages/djlint/rules/H047.py +118 -0
  1170. package/python/lib/python3.15/site-packages/djlint/rules/H048.py +82 -0
  1171. package/python/lib/python3.15/site-packages/djlint/rules/H051.py +98 -0
  1172. package/python/lib/python3.15/site-packages/djlint/rules/H053.py +361 -0
  1173. package/python/lib/python3.15/site-packages/djlint/rules/H054.py +264 -0
  1174. package/python/lib/python3.15/site-packages/djlint/rules/H057.py +235 -0
  1175. package/python/lib/python3.15/site-packages/djlint/rules/T001.py +103 -0
  1176. package/python/lib/python3.15/site-packages/djlint/rules/T002.py +75 -0
  1177. package/python/lib/python3.15/site-packages/djlint/rules/T003.py +93 -0
  1178. package/python/lib/python3.15/site-packages/djlint/rules/T027.py +183 -0
  1179. package/python/lib/python3.15/site-packages/djlint/rules/T038.py +152 -0
  1180. package/python/lib/python3.15/site-packages/djlint/rules/T039.py +167 -0
  1181. package/python/lib/python3.15/site-packages/djlint/rules/T041.py +307 -0
  1182. package/python/lib/python3.15/site-packages/djlint/rules/T042.py +219 -0
  1183. package/python/lib/python3.15/site-packages/djlint/rules/T043.py +154 -0
  1184. package/python/lib/python3.15/site-packages/djlint/rules/T044.py +189 -0
  1185. package/python/lib/python3.15/site-packages/djlint/rules/T045.py +281 -0
  1186. package/python/lib/python3.15/site-packages/djlint/rules/__init__.py +0 -0
  1187. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/D058.cpython-315.pyc +0 -0
  1188. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/D059.cpython-315.pyc +0 -0
  1189. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H009.cpython-315.pyc +0 -0
  1190. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H012.cpython-315.pyc +0 -0
  1191. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H014.cpython-315.pyc +0 -0
  1192. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H016.cpython-315.pyc +0 -0
  1193. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H022.cpython-315.pyc +0 -0
  1194. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H025.cpython-315.pyc +0 -0
  1195. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H036.cpython-315.pyc +0 -0
  1196. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H037.cpython-315.pyc +0 -0
  1197. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H041.cpython-315.pyc +0 -0
  1198. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H042.cpython-315.pyc +0 -0
  1199. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H044.cpython-315.pyc +0 -0
  1200. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H047.cpython-315.pyc +0 -0
  1201. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H048.cpython-315.pyc +0 -0
  1202. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H051.cpython-315.pyc +0 -0
  1203. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H053.cpython-315.pyc +0 -0
  1204. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H054.cpython-315.pyc +0 -0
  1205. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/H057.cpython-315.pyc +0 -0
  1206. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T001.cpython-315.pyc +0 -0
  1207. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T002.cpython-315.pyc +0 -0
  1208. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T003.cpython-315.pyc +0 -0
  1209. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T027.cpython-315.pyc +0 -0
  1210. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T038.cpython-315.pyc +0 -0
  1211. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T039.cpython-315.pyc +0 -0
  1212. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T041.cpython-315.pyc +0 -0
  1213. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T042.cpython-315.pyc +0 -0
  1214. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T043.cpython-315.pyc +0 -0
  1215. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T044.cpython-315.pyc +0 -0
  1216. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/T045.cpython-315.pyc +0 -0
  1217. package/python/lib/python3.15/site-packages/djlint/rules/__pycache__/__init__.cpython-315.pyc +0 -0
  1218. package/python/lib/python3.15/site-packages/djlint/rules.yaml +482 -0
  1219. package/python/lib/python3.15/site-packages/djlint/sarif_output.py +171 -0
  1220. package/python/lib/python3.15/site-packages/djlint/server.py +983 -0
  1221. package/python/lib/python3.15/site-packages/djlint/settings.py +2381 -0
  1222. package/python/lib/python3.15/site-packages/djlint/src.py +192 -0
  1223. package/python/lib/python3.15/site-packages/djlint/types.pyi +20 -0
  1224. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/INSTALLER +1 -0
  1225. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/METADATA +236 -0
  1226. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/RECORD +73 -0
  1227. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/REQUESTED +0 -0
  1228. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/WHEEL +4 -0
  1229. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/entry_points.txt +2 -0
  1230. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/licenses/LICENSE +675 -0
  1231. package/python/lib/python3.15/site-packages/djlint-1.54.2.dist-info/licenses/LICENSE-THIRD-PARTY +271 -0
  1232. package/python/lib/python3.15/site-packages/editorconfig/__init__.py +20 -0
  1233. package/python/lib/python3.15/site-packages/editorconfig/__main__.py +83 -0
  1234. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/__init__.cpython-315.pyc +0 -0
  1235. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/__main__.cpython-315.pyc +0 -0
  1236. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/exceptions.cpython-315.pyc +0 -0
  1237. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/fnmatch.cpython-315.pyc +0 -0
  1238. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/handler.cpython-315.pyc +0 -0
  1239. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/ini.cpython-315.pyc +0 -0
  1240. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/version.cpython-315.pyc +0 -0
  1241. package/python/lib/python3.15/site-packages/editorconfig/__pycache__/versiontools.cpython-315.pyc +0 -0
  1242. package/python/lib/python3.15/site-packages/editorconfig/exceptions.py +24 -0
  1243. package/python/lib/python3.15/site-packages/editorconfig/fnmatch.py +224 -0
  1244. package/python/lib/python3.15/site-packages/editorconfig/handler.py +128 -0
  1245. package/python/lib/python3.15/site-packages/editorconfig/ini.py +173 -0
  1246. package/python/lib/python3.15/site-packages/editorconfig/py.typed +0 -0
  1247. package/python/lib/python3.15/site-packages/editorconfig/version.py +1 -0
  1248. package/python/lib/python3.15/site-packages/editorconfig/versiontools.py +36 -0
  1249. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/INSTALLER +1 -0
  1250. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/METADATA +116 -0
  1251. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/RECORD +20 -0
  1252. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/REQUESTED +0 -0
  1253. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/WHEEL +5 -0
  1254. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/entry_points.txt +2 -0
  1255. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/licenses/COPYING +11 -0
  1256. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.BSD +22 -0
  1257. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/licenses/LICENSE.PSF +192 -0
  1258. package/python/lib/python3.15/site-packages/editorconfig-0.17.1.dist-info/top_level.txt +1 -0
  1259. package/python/lib/python3.15/site-packages/jsbeautifier/__init__.py +309 -0
  1260. package/python/lib/python3.15/site-packages/jsbeautifier/__pycache__/__init__.cpython-315.pyc +0 -0
  1261. package/python/lib/python3.15/site-packages/jsbeautifier/__pycache__/__version__.cpython-315.pyc +0 -0
  1262. package/python/lib/python3.15/site-packages/jsbeautifier/__version__.py +1 -0
  1263. package/python/lib/python3.15/site-packages/jsbeautifier/cli/__init__.py +210 -0
  1264. package/python/lib/python3.15/site-packages/jsbeautifier/cli/__pycache__/__init__.cpython-315.pyc +0 -0
  1265. package/python/lib/python3.15/site-packages/jsbeautifier/core/__init__.py +1 -0
  1266. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/__init__.cpython-315.pyc +0 -0
  1267. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/directives.cpython-315.pyc +0 -0
  1268. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/inputscanner.cpython-315.pyc +0 -0
  1269. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/options.cpython-315.pyc +0 -0
  1270. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/output.cpython-315.pyc +0 -0
  1271. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/pattern.cpython-315.pyc +0 -0
  1272. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/templatablepattern.cpython-315.pyc +0 -0
  1273. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/token.cpython-315.pyc +0 -0
  1274. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/tokenizer.cpython-315.pyc +0 -0
  1275. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/tokenstream.cpython-315.pyc +0 -0
  1276. package/python/lib/python3.15/site-packages/jsbeautifier/core/__pycache__/whitespacepattern.cpython-315.pyc +0 -0
  1277. package/python/lib/python3.15/site-packages/jsbeautifier/core/directives.py +55 -0
  1278. package/python/lib/python3.15/site-packages/jsbeautifier/core/inputscanner.py +139 -0
  1279. package/python/lib/python3.15/site-packages/jsbeautifier/core/options.py +230 -0
  1280. package/python/lib/python3.15/site-packages/jsbeautifier/core/output.py +352 -0
  1281. package/python/lib/python3.15/site-packages/jsbeautifier/core/pattern.py +83 -0
  1282. package/python/lib/python3.15/site-packages/jsbeautifier/core/templatablepattern.py +192 -0
  1283. package/python/lib/python3.15/site-packages/jsbeautifier/core/token.py +38 -0
  1284. package/python/lib/python3.15/site-packages/jsbeautifier/core/tokenizer.py +138 -0
  1285. package/python/lib/python3.15/site-packages/jsbeautifier/core/tokenstream.py +74 -0
  1286. package/python/lib/python3.15/site-packages/jsbeautifier/core/whitespacepattern.py +73 -0
  1287. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__init__.py +1 -0
  1288. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__pycache__/__init__.cpython-315.pyc +0 -0
  1289. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__pycache__/acorn.cpython-315.pyc +0 -0
  1290. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__pycache__/beautifier.cpython-315.pyc +0 -0
  1291. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__pycache__/options.cpython-315.pyc +0 -0
  1292. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/__pycache__/tokenizer.cpython-315.pyc +0 -0
  1293. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/acorn.py +81 -0
  1294. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/beautifier.py +1647 -0
  1295. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/options.py +102 -0
  1296. package/python/lib/python3.15/site-packages/jsbeautifier/javascript/tokenizer.py +628 -0
  1297. package/python/lib/python3.15/site-packages/jsbeautifier/tests/__init__.py +1 -0
  1298. package/python/lib/python3.15/site-packages/jsbeautifier/tests/__pycache__/__init__.cpython-315.pyc +0 -0
  1299. package/python/lib/python3.15/site-packages/jsbeautifier/tests/__pycache__/testindentation.cpython-315.pyc +0 -0
  1300. package/python/lib/python3.15/site-packages/jsbeautifier/tests/generated/__init__.py +1 -0
  1301. package/python/lib/python3.15/site-packages/jsbeautifier/tests/generated/__pycache__/__init__.cpython-315.pyc +0 -0
  1302. package/python/lib/python3.15/site-packages/jsbeautifier/tests/generated/__pycache__/tests.cpython-315.pyc +0 -0
  1303. package/python/lib/python3.15/site-packages/jsbeautifier/tests/generated/tests.py +10470 -0
  1304. package/python/lib/python3.15/site-packages/jsbeautifier/tests/testindentation.py +49 -0
  1305. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__init__.py +73 -0
  1306. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/__init__.cpython-315.pyc +0 -0
  1307. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/evalbased.cpython-315.pyc +0 -0
  1308. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/javascriptobfuscator.cpython-315.pyc +0 -0
  1309. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/myobfuscate.cpython-315.pyc +0 -0
  1310. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/packer.cpython-315.pyc +0 -0
  1311. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/__pycache__/urlencode.cpython-315.pyc +0 -0
  1312. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/evalbased.py +44 -0
  1313. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/javascriptobfuscator.py +61 -0
  1314. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/myobfuscate.py +83 -0
  1315. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/packer.py +158 -0
  1316. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__init__.py +2 -0
  1317. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__pycache__/__init__.cpython-315.pyc +0 -0
  1318. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__pycache__/testjavascriptobfuscator.cpython-315.pyc +0 -0
  1319. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__pycache__/testmyobfuscate.cpython-315.pyc +0 -0
  1320. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__pycache__/testpacker.cpython-315.pyc +0 -0
  1321. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/__pycache__/testurlencode.cpython-315.pyc +0 -0
  1322. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/testjavascriptobfuscator.py +59 -0
  1323. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/testmyobfuscate.py +48 -0
  1324. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/testpacker.py +72 -0
  1325. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/tests/testurlencode.py +46 -0
  1326. package/python/lib/python3.15/site-packages/jsbeautifier/unpackers/urlencode.py +32 -0
  1327. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/INSTALLER +1 -0
  1328. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/METADATA +18 -0
  1329. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/RECORD +42 -0
  1330. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/REQUESTED +0 -0
  1331. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/WHEEL +5 -0
  1332. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/entry_points.txt +2 -0
  1333. package/python/lib/python3.15/site-packages/jsbeautifier-2.0.3.dist-info/top_level.txt +1 -0
  1334. package/python/lib/python3.15/site-packages/json5/__init__.py +30 -0
  1335. package/python/lib/python3.15/site-packages/json5/__main__.py +22 -0
  1336. package/python/lib/python3.15/site-packages/json5/__pycache__/__init__.cpython-315.pyc +0 -0
  1337. package/python/lib/python3.15/site-packages/json5/__pycache__/__main__.cpython-315.pyc +0 -0
  1338. package/python/lib/python3.15/site-packages/json5/__pycache__/host.cpython-315.pyc +0 -0
  1339. package/python/lib/python3.15/site-packages/json5/__pycache__/lib.cpython-315.pyc +0 -0
  1340. package/python/lib/python3.15/site-packages/json5/__pycache__/parser.cpython-315.pyc +0 -0
  1341. package/python/lib/python3.15/site-packages/json5/__pycache__/tool.cpython-315.pyc +0 -0
  1342. package/python/lib/python3.15/site-packages/json5/__pycache__/version.cpython-315.pyc +0 -0
  1343. package/python/lib/python3.15/site-packages/json5/host.py +53 -0
  1344. package/python/lib/python3.15/site-packages/json5/lib.py +1007 -0
  1345. package/python/lib/python3.15/site-packages/json5/parser.py +1376 -0
  1346. package/python/lib/python3.15/site-packages/json5/py.typed +0 -0
  1347. package/python/lib/python3.15/site-packages/json5/tool.py +198 -0
  1348. package/python/lib/python3.15/site-packages/json5/version.py +18 -0
  1349. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/INSTALLER +1 -0
  1350. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/METADATA +585 -0
  1351. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/RECORD +17 -0
  1352. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/REQUESTED +0 -0
  1353. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/WHEEL +5 -0
  1354. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/entry_points.txt +2 -0
  1355. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/licenses/LICENSE +281 -0
  1356. package/python/lib/python3.15/site-packages/json5-0.17.3.dist-info/top_level.txt +1 -0
  1357. package/python/lib/python3.15/site-packages/pathspec/__init__.py +68 -0
  1358. package/python/lib/python3.15/site-packages/pathspec/__pycache__/__init__.cpython-315.pyc +0 -0
  1359. package/python/lib/python3.15/site-packages/pathspec/__pycache__/_meta.cpython-315.pyc +0 -0
  1360. package/python/lib/python3.15/site-packages/pathspec/__pycache__/_typing.cpython-315.pyc +0 -0
  1361. package/python/lib/python3.15/site-packages/pathspec/__pycache__/_version.cpython-315.pyc +0 -0
  1362. package/python/lib/python3.15/site-packages/pathspec/__pycache__/backend.cpython-315.pyc +0 -0
  1363. package/python/lib/python3.15/site-packages/pathspec/__pycache__/gitignore.cpython-315.pyc +0 -0
  1364. package/python/lib/python3.15/site-packages/pathspec/__pycache__/pathspec.cpython-315.pyc +0 -0
  1365. package/python/lib/python3.15/site-packages/pathspec/__pycache__/pattern.cpython-315.pyc +0 -0
  1366. package/python/lib/python3.15/site-packages/pathspec/__pycache__/util.cpython-315.pyc +0 -0
  1367. package/python/lib/python3.15/site-packages/pathspec/_backends/__init__.py +4 -0
  1368. package/python/lib/python3.15/site-packages/pathspec/_backends/__pycache__/__init__.cpython-315.pyc +0 -0
  1369. package/python/lib/python3.15/site-packages/pathspec/_backends/__pycache__/_utils.cpython-315.pyc +0 -0
  1370. package/python/lib/python3.15/site-packages/pathspec/_backends/__pycache__/agg.cpython-315.pyc +0 -0
  1371. package/python/lib/python3.15/site-packages/pathspec/_backends/_utils.py +45 -0
  1372. package/python/lib/python3.15/site-packages/pathspec/_backends/agg.py +104 -0
  1373. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__init__.py +0 -0
  1374. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__pycache__/__init__.cpython-315.pyc +0 -0
  1375. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__pycache__/_base.cpython-315.pyc +0 -0
  1376. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__pycache__/base.cpython-315.pyc +0 -0
  1377. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__pycache__/gitignore.cpython-315.pyc +0 -0
  1378. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/__pycache__/pathspec.cpython-315.pyc +0 -0
  1379. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/_base.py +78 -0
  1380. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/base.py +24 -0
  1381. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/gitignore.py +250 -0
  1382. package/python/lib/python3.15/site-packages/pathspec/_backends/hyperscan/pathspec.py +257 -0
  1383. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__init__.py +0 -0
  1384. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__pycache__/__init__.cpython-315.pyc +0 -0
  1385. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__pycache__/_base.cpython-315.pyc +0 -0
  1386. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__pycache__/base.cpython-315.pyc +0 -0
  1387. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__pycache__/gitignore.cpython-315.pyc +0 -0
  1388. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/__pycache__/pathspec.cpython-315.pyc +0 -0
  1389. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/_base.py +95 -0
  1390. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/base.py +18 -0
  1391. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/gitignore.py +180 -0
  1392. package/python/lib/python3.15/site-packages/pathspec/_backends/re2/pathspec.py +189 -0
  1393. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/__init__.py +0 -0
  1394. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/__pycache__/__init__.cpython-315.pyc +0 -0
  1395. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/__pycache__/gitignore.cpython-315.pyc +0 -0
  1396. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/__pycache__/pathspec.cpython-315.pyc +0 -0
  1397. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/gitignore.py +104 -0
  1398. package/python/lib/python3.15/site-packages/pathspec/_backends/simple/pathspec.py +76 -0
  1399. package/python/lib/python3.15/site-packages/pathspec/_meta.py +70 -0
  1400. package/python/lib/python3.15/site-packages/pathspec/_typing.py +64 -0
  1401. package/python/lib/python3.15/site-packages/pathspec/_version.py +5 -0
  1402. package/python/lib/python3.15/site-packages/pathspec/backend.py +51 -0
  1403. package/python/lib/python3.15/site-packages/pathspec/gitignore.py +172 -0
  1404. package/python/lib/python3.15/site-packages/pathspec/pathspec.py +527 -0
  1405. package/python/lib/python3.15/site-packages/pathspec/pattern.py +259 -0
  1406. package/python/lib/python3.15/site-packages/pathspec/patterns/__init__.py +12 -0
  1407. package/python/lib/python3.15/site-packages/pathspec/patterns/__pycache__/__init__.cpython-315.pyc +0 -0
  1408. package/python/lib/python3.15/site-packages/pathspec/patterns/__pycache__/gitwildmatch.cpython-315.pyc +0 -0
  1409. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/__init__.py +17 -0
  1410. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/__pycache__/__init__.cpython-315.pyc +0 -0
  1411. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/__pycache__/base.cpython-315.pyc +0 -0
  1412. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/__pycache__/basic.cpython-315.pyc +0 -0
  1413. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/__pycache__/spec.cpython-315.pyc +0 -0
  1414. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/base.py +210 -0
  1415. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/basic.py +320 -0
  1416. package/python/lib/python3.15/site-packages/pathspec/patterns/gitignore/spec.py +344 -0
  1417. package/python/lib/python3.15/site-packages/pathspec/patterns/gitwildmatch.py +52 -0
  1418. package/python/lib/python3.15/site-packages/pathspec/py.typed +1 -0
  1419. package/python/lib/python3.15/site-packages/pathspec/util.py +864 -0
  1420. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/INSTALLER +1 -0
  1421. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/METADATA +392 -0
  1422. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/RECORD +38 -0
  1423. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/REQUESTED +0 -0
  1424. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/WHEEL +4 -0
  1425. package/python/lib/python3.15/site-packages/pathspec-1.1.1.dist-info/licenses/LICENSE +373 -0
  1426. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/INSTALLER +1 -0
  1427. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/METADATA +58 -0
  1428. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/RECORD +26 -0
  1429. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/REQUESTED +0 -0
  1430. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/WHEEL +7 -0
  1431. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/licenses/LICENSE +20 -0
  1432. package/python/lib/python3.15/site-packages/pyyaml-6.0.4.dist-info/top_level.txt +2 -0
  1433. package/python/lib/python3.15/site-packages/regex/__init__.py +3 -0
  1434. package/python/lib/python3.15/site-packages/regex/__pycache__/__init__.cpython-315.pyc +0 -0
  1435. package/python/lib/python3.15/site-packages/regex/__pycache__/_main.cpython-315.pyc +0 -0
  1436. package/python/lib/python3.15/site-packages/regex/__pycache__/_regex_core.cpython-315.pyc +0 -0
  1437. package/python/lib/python3.15/site-packages/regex/_main.py +759 -0
  1438. package/python/lib/python3.15/site-packages/regex/_regex.cpython-315-s390x-linux-gnu.so +0 -0
  1439. package/python/lib/python3.15/site-packages/regex/_regex_core.py +4689 -0
  1440. package/python/lib/python3.15/site-packages/regex/tests/__pycache__/test_regex.cpython-315.pyc +0 -0
  1441. package/python/lib/python3.15/site-packages/regex/tests/test_regex.py +4612 -0
  1442. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/INSTALLER +1 -0
  1443. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/METADATA +1060 -0
  1444. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/RECORD +12 -0
  1445. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/REQUESTED +0 -0
  1446. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/WHEEL +7 -0
  1447. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/licenses/LICENSE.txt +208 -0
  1448. package/python/lib/python3.15/site-packages/regex-2026.11.19.dist-info/top_level.txt +1 -0
  1449. package/python/lib/python3.15/site-packages/yaml/__init__.py +390 -0
  1450. package/python/lib/python3.15/site-packages/yaml/__pycache__/__init__.cpython-315.pyc +0 -0
  1451. package/python/lib/python3.15/site-packages/yaml/__pycache__/composer.cpython-315.pyc +0 -0
  1452. package/python/lib/python3.15/site-packages/yaml/__pycache__/constructor.cpython-315.pyc +0 -0
  1453. package/python/lib/python3.15/site-packages/yaml/__pycache__/cyaml.cpython-315.pyc +0 -0
  1454. package/python/lib/python3.15/site-packages/yaml/__pycache__/dumper.cpython-315.pyc +0 -0
  1455. package/python/lib/python3.15/site-packages/yaml/__pycache__/emitter.cpython-315.pyc +0 -0
  1456. package/python/lib/python3.15/site-packages/yaml/__pycache__/error.cpython-315.pyc +0 -0
  1457. package/python/lib/python3.15/site-packages/yaml/__pycache__/events.cpython-315.pyc +0 -0
  1458. package/python/lib/python3.15/site-packages/yaml/__pycache__/loader.cpython-315.pyc +0 -0
  1459. package/python/lib/python3.15/site-packages/yaml/__pycache__/nodes.cpython-315.pyc +0 -0
  1460. package/python/lib/python3.15/site-packages/yaml/__pycache__/parser.cpython-315.pyc +0 -0
  1461. package/python/lib/python3.15/site-packages/yaml/__pycache__/reader.cpython-315.pyc +0 -0
  1462. package/python/lib/python3.15/site-packages/yaml/__pycache__/representer.cpython-315.pyc +0 -0
  1463. package/python/lib/python3.15/site-packages/yaml/__pycache__/resolver.cpython-315.pyc +0 -0
  1464. package/python/lib/python3.15/site-packages/yaml/__pycache__/scanner.cpython-315.pyc +0 -0
  1465. package/python/lib/python3.15/site-packages/yaml/__pycache__/serializer.cpython-315.pyc +0 -0
  1466. package/python/lib/python3.15/site-packages/yaml/__pycache__/tokens.cpython-315.pyc +0 -0
  1467. package/python/lib/python3.15/site-packages/yaml/_yaml.cpython-315-s390x-linux-gnu.so +0 -0
  1468. package/python/lib/python3.15/site-packages/yaml/composer.py +139 -0
  1469. package/python/lib/python3.15/site-packages/yaml/constructor.py +751 -0
  1470. package/python/lib/python3.15/site-packages/yaml/cyaml.py +101 -0
  1471. package/python/lib/python3.15/site-packages/yaml/dumper.py +62 -0
  1472. package/python/lib/python3.15/site-packages/yaml/emitter.py +1137 -0
  1473. package/python/lib/python3.15/site-packages/yaml/error.py +75 -0
  1474. package/python/lib/python3.15/site-packages/yaml/events.py +86 -0
  1475. package/python/lib/python3.15/site-packages/yaml/loader.py +63 -0
  1476. package/python/lib/python3.15/site-packages/yaml/nodes.py +49 -0
  1477. package/python/lib/python3.15/site-packages/yaml/parser.py +589 -0
  1478. package/python/lib/python3.15/site-packages/yaml/reader.py +185 -0
  1479. package/python/lib/python3.15/site-packages/yaml/representer.py +389 -0
  1480. package/python/lib/python3.15/site-packages/yaml/resolver.py +227 -0
  1481. package/python/lib/python3.15/site-packages/yaml/scanner.py +1435 -0
  1482. package/python/lib/python3.15/site-packages/yaml/serializer.py +111 -0
  1483. package/python/lib/python3.15/site-packages/yaml/tokens.py +104 -0
  1484. package/python/lib/python3.15/site.py +1159 -0
  1485. package/python/lib/python3.15/smtplib.py +1121 -0
  1486. package/python/lib/python3.15/socket.py +1003 -0
  1487. package/python/lib/python3.15/socketserver.py +869 -0
  1488. package/python/lib/python3.15/sqlite3/__init__.py +57 -0
  1489. package/python/lib/python3.15/sqlite3/__main__.py +156 -0
  1490. package/python/lib/python3.15/sqlite3/__pycache__/__init__.cpython-315.pyc +0 -0
  1491. package/python/lib/python3.15/sqlite3/__pycache__/__main__.cpython-315.pyc +0 -0
  1492. package/python/lib/python3.15/sqlite3/__pycache__/_completer.cpython-315.pyc +0 -0
  1493. package/python/lib/python3.15/sqlite3/__pycache__/dbapi2.cpython-315.pyc +0 -0
  1494. package/python/lib/python3.15/sqlite3/__pycache__/dump.cpython-315.pyc +0 -0
  1495. package/python/lib/python3.15/sqlite3/_completer.py +111 -0
  1496. package/python/lib/python3.15/sqlite3/dbapi2.py +96 -0
  1497. package/python/lib/python3.15/sqlite3/dump.py +118 -0
  1498. package/python/lib/python3.15/ssl.py +1600 -0
  1499. package/python/lib/python3.15/stat.py +227 -0
  1500. package/python/lib/python3.15/statistics.py +1880 -0
  1501. package/python/lib/python3.15/string/__init__.py +323 -0
  1502. package/python/lib/python3.15/string/__pycache__/__init__.cpython-315.pyc +0 -0
  1503. package/python/lib/python3.15/string/__pycache__/templatelib.cpython-315.pyc +0 -0
  1504. package/python/lib/python3.15/string/templatelib.py +33 -0
  1505. package/python/lib/python3.15/stringprep.py +463 -0
  1506. package/python/lib/python3.15/struct.py +15 -0
  1507. package/python/lib/python3.15/subprocess.py +2509 -0
  1508. package/python/lib/python3.15/symtable.py +452 -0
  1509. package/python/lib/python3.15/sysconfig/__init__.py +797 -0
  1510. package/python/lib/python3.15/sysconfig/__main__.py +250 -0
  1511. package/python/lib/python3.15/sysconfig/__pycache__/__init__.cpython-315.pyc +0 -0
  1512. package/python/lib/python3.15/sysconfig/__pycache__/__main__.cpython-315.pyc +0 -0
  1513. package/python/lib/python3.15/tabnanny.py +345 -0
  1514. package/python/lib/python3.15/tarfile.py +3259 -0
  1515. package/python/lib/python3.15/tempfile.py +1057 -0
  1516. package/python/lib/python3.15/textwrap.py +475 -0
  1517. package/python/lib/python3.15/this.py +28 -0
  1518. package/python/lib/python3.15/threading.py +1780 -0
  1519. package/python/lib/python3.15/timeit.py +431 -0
  1520. package/python/lib/python3.15/token.py +144 -0
  1521. package/python/lib/python3.15/tokenize.py +644 -0
  1522. package/python/lib/python3.15/tomllib/__init__.py +10 -0
  1523. package/python/lib/python3.15/tomllib/__pycache__/__init__.cpython-315.pyc +0 -0
  1524. package/python/lib/python3.15/tomllib/__pycache__/_parser.cpython-315.pyc +0 -0
  1525. package/python/lib/python3.15/tomllib/__pycache__/_re.cpython-315.pyc +0 -0
  1526. package/python/lib/python3.15/tomllib/__pycache__/_types.cpython-315.pyc +0 -0
  1527. package/python/lib/python3.15/tomllib/_parser.py +776 -0
  1528. package/python/lib/python3.15/tomllib/_re.py +119 -0
  1529. package/python/lib/python3.15/tomllib/_types.py +10 -0
  1530. package/python/lib/python3.15/tomllib/mypy.ini +15 -0
  1531. package/python/lib/python3.15/trace.py +749 -0
  1532. package/python/lib/python3.15/traceback.py +2090 -0
  1533. package/python/lib/python3.15/tracemalloc.py +560 -0
  1534. package/python/lib/python3.15/tty.py +73 -0
  1535. package/python/lib/python3.15/types.py +355 -0
  1536. package/python/lib/python3.15/typing.py +3949 -0
  1537. package/python/lib/python3.15/unittest/__init__.py +80 -0
  1538. package/python/lib/python3.15/unittest/__main__.py +18 -0
  1539. package/python/lib/python3.15/unittest/__pycache__/__init__.cpython-315.pyc +0 -0
  1540. package/python/lib/python3.15/unittest/__pycache__/__main__.cpython-315.pyc +0 -0
  1541. package/python/lib/python3.15/unittest/__pycache__/_log.cpython-315.pyc +0 -0
  1542. package/python/lib/python3.15/unittest/__pycache__/async_case.cpython-315.pyc +0 -0
  1543. package/python/lib/python3.15/unittest/__pycache__/case.cpython-315.pyc +0 -0
  1544. package/python/lib/python3.15/unittest/__pycache__/loader.cpython-315.pyc +0 -0
  1545. package/python/lib/python3.15/unittest/__pycache__/main.cpython-315.pyc +0 -0
  1546. package/python/lib/python3.15/unittest/__pycache__/mock.cpython-315.pyc +0 -0
  1547. package/python/lib/python3.15/unittest/__pycache__/result.cpython-315.pyc +0 -0
  1548. package/python/lib/python3.15/unittest/__pycache__/runner.cpython-315.pyc +0 -0
  1549. package/python/lib/python3.15/unittest/__pycache__/signals.cpython-315.pyc +0 -0
  1550. package/python/lib/python3.15/unittest/__pycache__/suite.cpython-315.pyc +0 -0
  1551. package/python/lib/python3.15/unittest/__pycache__/util.cpython-315.pyc +0 -0
  1552. package/python/lib/python3.15/unittest/_log.py +87 -0
  1553. package/python/lib/python3.15/unittest/async_case.py +158 -0
  1554. package/python/lib/python3.15/unittest/case.py +1652 -0
  1555. package/python/lib/python3.15/unittest/loader.py +491 -0
  1556. package/python/lib/python3.15/unittest/main.py +280 -0
  1557. package/python/lib/python3.15/unittest/mock.py +3212 -0
  1558. package/python/lib/python3.15/unittest/result.py +259 -0
  1559. package/python/lib/python3.15/unittest/runner.py +312 -0
  1560. package/python/lib/python3.15/unittest/signals.py +71 -0
  1561. package/python/lib/python3.15/unittest/suite.py +391 -0
  1562. package/python/lib/python3.15/unittest/util.py +187 -0
  1563. package/python/lib/python3.15/urllib/__init__.py +0 -0
  1564. package/python/lib/python3.15/urllib/__pycache__/__init__.cpython-315.pyc +0 -0
  1565. package/python/lib/python3.15/urllib/__pycache__/error.cpython-315.pyc +0 -0
  1566. package/python/lib/python3.15/urllib/__pycache__/parse.cpython-315.pyc +0 -0
  1567. package/python/lib/python3.15/urllib/__pycache__/request.cpython-315.pyc +0 -0
  1568. package/python/lib/python3.15/urllib/__pycache__/response.cpython-315.pyc +0 -0
  1569. package/python/lib/python3.15/urllib/__pycache__/robotparser.cpython-315.pyc +0 -0
  1570. package/python/lib/python3.15/urllib/error.py +74 -0
  1571. package/python/lib/python3.15/urllib/parse.py +1407 -0
  1572. package/python/lib/python3.15/urllib/request.py +2177 -0
  1573. package/python/lib/python3.15/urllib/response.py +84 -0
  1574. package/python/lib/python3.15/urllib/robotparser.py +363 -0
  1575. package/python/lib/python3.15/uuid.py +1013 -0
  1576. package/python/lib/python3.15/venv/__init__.py +695 -0
  1577. package/python/lib/python3.15/venv/__main__.py +10 -0
  1578. package/python/lib/python3.15/venv/__pycache__/__init__.cpython-315.pyc +0 -0
  1579. package/python/lib/python3.15/venv/__pycache__/__main__.cpython-315.pyc +0 -0
  1580. package/python/lib/python3.15/venv/scripts/common/Activate.ps1 +248 -0
  1581. package/python/lib/python3.15/venv/scripts/common/activate +76 -0
  1582. package/python/lib/python3.15/venv/scripts/common/activate.fish +69 -0
  1583. package/python/lib/python3.15/venv/scripts/posix/activate.csh +29 -0
  1584. package/python/lib/python3.15/warnings.py +99 -0
  1585. package/python/lib/python3.15/wave.py +704 -0
  1586. package/python/lib/python3.15/weakref.py +576 -0
  1587. package/python/lib/python3.15/webbrowser.py +841 -0
  1588. package/python/lib/python3.15/wsgiref/__init__.py +25 -0
  1589. package/python/lib/python3.15/wsgiref/__pycache__/__init__.cpython-315.pyc +0 -0
  1590. package/python/lib/python3.15/wsgiref/__pycache__/handlers.cpython-315.pyc +0 -0
  1591. package/python/lib/python3.15/wsgiref/__pycache__/headers.cpython-315.pyc +0 -0
  1592. package/python/lib/python3.15/wsgiref/__pycache__/simple_server.cpython-315.pyc +0 -0
  1593. package/python/lib/python3.15/wsgiref/__pycache__/types.cpython-315.pyc +0 -0
  1594. package/python/lib/python3.15/wsgiref/__pycache__/util.cpython-315.pyc +0 -0
  1595. package/python/lib/python3.15/wsgiref/__pycache__/validate.cpython-315.pyc +0 -0
  1596. package/python/lib/python3.15/wsgiref/handlers.py +576 -0
  1597. package/python/lib/python3.15/wsgiref/headers.py +192 -0
  1598. package/python/lib/python3.15/wsgiref/simple_server.py +169 -0
  1599. package/python/lib/python3.15/wsgiref/types.py +54 -0
  1600. package/python/lib/python3.15/wsgiref/util.py +159 -0
  1601. package/python/lib/python3.15/wsgiref/validate.py +438 -0
  1602. package/python/lib/python3.15/xml/__init__.py +21 -0
  1603. package/python/lib/python3.15/xml/__pycache__/__init__.cpython-315.pyc +0 -0
  1604. package/python/lib/python3.15/xml/__pycache__/utils.cpython-315.pyc +0 -0
  1605. package/python/lib/python3.15/xml/dom/NodeFilter.py +27 -0
  1606. package/python/lib/python3.15/xml/dom/__init__.py +140 -0
  1607. package/python/lib/python3.15/xml/dom/__pycache__/NodeFilter.cpython-315.pyc +0 -0
  1608. package/python/lib/python3.15/xml/dom/__pycache__/__init__.cpython-315.pyc +0 -0
  1609. package/python/lib/python3.15/xml/dom/__pycache__/domreg.cpython-315.pyc +0 -0
  1610. package/python/lib/python3.15/xml/dom/__pycache__/expatbuilder.cpython-315.pyc +0 -0
  1611. package/python/lib/python3.15/xml/dom/__pycache__/minicompat.cpython-315.pyc +0 -0
  1612. package/python/lib/python3.15/xml/dom/__pycache__/minidom.cpython-315.pyc +0 -0
  1613. package/python/lib/python3.15/xml/dom/__pycache__/pulldom.cpython-315.pyc +0 -0
  1614. package/python/lib/python3.15/xml/dom/__pycache__/xmlbuilder.cpython-315.pyc +0 -0
  1615. package/python/lib/python3.15/xml/dom/domreg.py +99 -0
  1616. package/python/lib/python3.15/xml/dom/expatbuilder.py +964 -0
  1617. package/python/lib/python3.15/xml/dom/minicompat.py +109 -0
  1618. package/python/lib/python3.15/xml/dom/minidom.py +2027 -0
  1619. package/python/lib/python3.15/xml/dom/pulldom.py +350 -0
  1620. package/python/lib/python3.15/xml/dom/xmlbuilder.py +389 -0
  1621. package/python/lib/python3.15/xml/etree/ElementInclude.py +186 -0
  1622. package/python/lib/python3.15/xml/etree/ElementPath.py +430 -0
  1623. package/python/lib/python3.15/xml/etree/ElementTree.py +2111 -0
  1624. package/python/lib/python3.15/xml/etree/__init__.py +33 -0
  1625. package/python/lib/python3.15/xml/etree/__pycache__/ElementInclude.cpython-315.pyc +0 -0
  1626. package/python/lib/python3.15/xml/etree/__pycache__/ElementPath.cpython-315.pyc +0 -0
  1627. package/python/lib/python3.15/xml/etree/__pycache__/ElementTree.cpython-315.pyc +0 -0
  1628. package/python/lib/python3.15/xml/etree/__pycache__/__init__.cpython-315.pyc +0 -0
  1629. package/python/lib/python3.15/xml/etree/__pycache__/cElementTree.cpython-315.pyc +0 -0
  1630. package/python/lib/python3.15/xml/etree/cElementTree.py +3 -0
  1631. package/python/lib/python3.15/xml/parsers/__init__.py +8 -0
  1632. package/python/lib/python3.15/xml/parsers/__pycache__/__init__.cpython-315.pyc +0 -0
  1633. package/python/lib/python3.15/xml/parsers/__pycache__/expat.cpython-315.pyc +0 -0
  1634. package/python/lib/python3.15/xml/parsers/expat.py +8 -0
  1635. package/python/lib/python3.15/xml/sax/__init__.py +109 -0
  1636. package/python/lib/python3.15/xml/sax/__pycache__/__init__.cpython-315.pyc +0 -0
  1637. package/python/lib/python3.15/xml/sax/__pycache__/_exceptions.cpython-315.pyc +0 -0
  1638. package/python/lib/python3.15/xml/sax/__pycache__/expatreader.cpython-315.pyc +0 -0
  1639. package/python/lib/python3.15/xml/sax/__pycache__/handler.cpython-315.pyc +0 -0
  1640. package/python/lib/python3.15/xml/sax/__pycache__/saxutils.cpython-315.pyc +0 -0
  1641. package/python/lib/python3.15/xml/sax/__pycache__/xmlreader.cpython-315.pyc +0 -0
  1642. package/python/lib/python3.15/xml/sax/_exceptions.py +127 -0
  1643. package/python/lib/python3.15/xml/sax/expatreader.py +462 -0
  1644. package/python/lib/python3.15/xml/sax/handler.py +394 -0
  1645. package/python/lib/python3.15/xml/sax/saxutils.py +370 -0
  1646. package/python/lib/python3.15/xml/sax/xmlreader.py +379 -0
  1647. package/python/lib/python3.15/xml/utils.py +37 -0
  1648. package/python/lib/python3.15/xmlrpc/__init__.py +1 -0
  1649. package/python/lib/python3.15/xmlrpc/__pycache__/__init__.cpython-315.pyc +0 -0
  1650. package/python/lib/python3.15/xmlrpc/__pycache__/client.cpython-315.pyc +0 -0
  1651. package/python/lib/python3.15/xmlrpc/__pycache__/server.cpython-315.pyc +0 -0
  1652. package/python/lib/python3.15/xmlrpc/client.py +1503 -0
  1653. package/python/lib/python3.15/xmlrpc/server.py +1003 -0
  1654. package/python/lib/python3.15/zipapp.py +231 -0
  1655. package/python/lib/python3.15/zipfile/__init__.py +2444 -0
  1656. package/python/lib/python3.15/zipfile/__main__.py +4 -0
  1657. package/python/lib/python3.15/zipfile/__pycache__/__init__.cpython-315.pyc +0 -0
  1658. package/python/lib/python3.15/zipfile/__pycache__/__main__.cpython-315.pyc +0 -0
  1659. package/python/lib/python3.15/zipfile/_path/__init__.py +456 -0
  1660. package/python/lib/python3.15/zipfile/_path/__pycache__/__init__.cpython-315.pyc +0 -0
  1661. package/python/lib/python3.15/zipfile/_path/__pycache__/_functools.cpython-315.pyc +0 -0
  1662. package/python/lib/python3.15/zipfile/_path/__pycache__/glob.cpython-315.pyc +0 -0
  1663. package/python/lib/python3.15/zipfile/_path/_functools.py +31 -0
  1664. package/python/lib/python3.15/zipfile/_path/glob.py +113 -0
  1665. package/python/lib/python3.15/zipimport.py +849 -0
  1666. package/python/lib/python3.15/zoneinfo/__init__.py +34 -0
  1667. package/python/lib/python3.15/zoneinfo/__pycache__/__init__.cpython-315.pyc +0 -0
  1668. package/python/lib/python3.15/zoneinfo/__pycache__/_common.cpython-315.pyc +0 -0
  1669. package/python/lib/python3.15/zoneinfo/__pycache__/_tzpath.cpython-315.pyc +0 -0
  1670. package/python/lib/python3.15/zoneinfo/__pycache__/_zoneinfo.cpython-315.pyc +0 -0
  1671. package/python/lib/python3.15/zoneinfo/_common.py +172 -0
  1672. package/python/lib/python3.15/zoneinfo/_tzpath.py +193 -0
  1673. package/python/lib/python3.15/zoneinfo/_zoneinfo.py +779 -0
  1674. package/python/licenses/LICENSE.bdb.txt +126 -0
  1675. package/python/licenses/LICENSE.bzip2.txt +37 -0
  1676. package/python/licenses/LICENSE.cpython.txt +771 -0
  1677. package/python/licenses/LICENSE.expat.txt +21 -0
  1678. package/python/licenses/LICENSE.libX11.txt +942 -0
  1679. package/python/licenses/LICENSE.libXau.txt +21 -0
  1680. package/python/licenses/LICENSE.libedit.txt +29 -0
  1681. package/python/licenses/LICENSE.libffi.txt +21 -0
  1682. package/python/licenses/LICENSE.liblzma.txt +13 -0
  1683. package/python/licenses/LICENSE.libuuid.txt +27 -0
  1684. package/python/licenses/LICENSE.libxcb.txt +30 -0
  1685. package/python/licenses/LICENSE.mpdecimal.txt +24 -0
  1686. package/python/licenses/LICENSE.ncurses.txt +29 -0
  1687. package/python/licenses/LICENSE.openssl-3.txt +177 -0
  1688. package/python/licenses/LICENSE.sqlite.txt +23 -0
  1689. package/python/licenses/LICENSE.tcl.txt +40 -0
  1690. package/python/licenses/LICENSE.tix.txt +54 -0
  1691. package/python/licenses/LICENSE.zlib-ng.txt +19 -0
  1692. package/python/licenses/LICENSE.zlib.txt +22 -0
  1693. package/python/licenses/LICENSE.zstd.txt +30 -0
@@ -0,0 +1,3212 @@
1
+ # mock.py
2
+ # Test tools for mocking and patching.
3
+ # Maintained by Michael Foord
4
+ # Backport for other versions of Python available from
5
+ # https://pypi.org/project/mock
6
+
7
+ __all__ = (
8
+ 'Mock',
9
+ 'MagicMock',
10
+ 'patch',
11
+ 'sentinel',
12
+ 'DEFAULT',
13
+ 'ANY',
14
+ 'call',
15
+ 'create_autospec',
16
+ 'AsyncMock',
17
+ 'ThreadingMock',
18
+ 'FILTER_DIR',
19
+ 'NonCallableMock',
20
+ 'NonCallableMagicMock',
21
+ 'mock_open',
22
+ 'PropertyMock',
23
+ 'seal',
24
+ )
25
+
26
+
27
+ import asyncio
28
+ import contextlib
29
+ import io
30
+ import inspect
31
+ import pprint
32
+ import sys
33
+ import builtins
34
+ import pkgutil
35
+ from inspect import iscoroutinefunction
36
+ import threading
37
+ from annotationlib import Format
38
+ from dataclasses import fields, is_dataclass
39
+ from types import CodeType, LazyImportType, ModuleType, MethodType
40
+ from unittest.util import safe_repr
41
+ from functools import wraps, partial
42
+ from threading import RLock
43
+
44
+
45
+ class InvalidSpecError(Exception):
46
+ """Indicates that an invalid value was used as a mock spec."""
47
+
48
+
49
+ _builtins = {name for name in dir(builtins) if not name.startswith('_')}
50
+
51
+ FILTER_DIR = True
52
+
53
+ # Workaround for issue #12370
54
+ # Without this, the __class__ properties wouldn't be set correctly
55
+ _safe_super = super
56
+
57
+ def _is_async_obj(obj):
58
+ if _is_instance_mock(obj) and not isinstance(obj, AsyncMock):
59
+ return False
60
+ if hasattr(obj, '__func__'):
61
+ obj = getattr(obj, '__func__')
62
+ return iscoroutinefunction(obj) or inspect.isawaitable(obj)
63
+
64
+
65
+ def _is_async_func(func):
66
+ if getattr(func, '__code__', None):
67
+ return iscoroutinefunction(func)
68
+ else:
69
+ return False
70
+
71
+
72
+ def _is_instance_mock(obj):
73
+ # can't use isinstance on Mock objects because they override __class__
74
+ # The base class for all mocks is NonCallableMock
75
+ return issubclass(type(obj), NonCallableMock)
76
+
77
+
78
+ def _is_exception(obj):
79
+ return (
80
+ isinstance(obj, BaseException) or
81
+ isinstance(obj, type) and issubclass(obj, BaseException)
82
+ )
83
+
84
+
85
+ def _extract_mock(obj):
86
+ # Autospecced functions will return a FunctionType with "mock" attribute
87
+ # which is the actual mock object that needs to be used.
88
+ if isinstance(obj, FunctionTypes) and hasattr(obj, 'mock'):
89
+ return obj.mock
90
+ else:
91
+ return obj
92
+
93
+
94
+ def _get_signature_object(func, as_instance, eat_self):
95
+ """
96
+ Given an arbitrary, possibly callable object, try to create a suitable
97
+ signature object.
98
+ Return a (reduced func, signature) tuple, or None.
99
+ """
100
+ if isinstance(func, type) and not as_instance:
101
+ # If it's a type and should be modelled as a type, use __init__.
102
+ func = func.__init__
103
+ # Skip the `self` argument in __init__
104
+ eat_self = True
105
+ elif isinstance(func, (classmethod, staticmethod)):
106
+ if isinstance(func, classmethod):
107
+ # Skip the `cls` argument of a class method
108
+ eat_self = True
109
+ # Use the original decorated method to extract the correct function signature
110
+ func = func.__func__
111
+ elif not isinstance(func, FunctionTypes):
112
+ # If we really want to model an instance of the passed type,
113
+ # __call__ should be looked up, not __init__.
114
+ try:
115
+ func = func.__call__
116
+ except AttributeError:
117
+ return None
118
+ if eat_self:
119
+ sig_func = partial(func, None)
120
+ else:
121
+ sig_func = func
122
+ try:
123
+ return func, inspect.signature(sig_func, annotation_format=Format.FORWARDREF)
124
+ except ValueError:
125
+ # Certain callable types are not supported by inspect.signature()
126
+ return None
127
+
128
+
129
+ def _check_signature(func, mock, skipfirst, instance=False):
130
+ sig = _get_signature_object(func, instance, skipfirst)
131
+ if sig is None:
132
+ return
133
+ func, sig = sig
134
+ def checksig(self, /, *args, **kwargs):
135
+ sig.bind(*args, **kwargs)
136
+ _copy_func_details(func, checksig)
137
+ type(mock)._mock_check_sig = checksig
138
+ type(mock).__signature__ = sig
139
+
140
+
141
+ def _copy_func_details(func, funcopy):
142
+ # we explicitly don't copy func.__dict__ into this copy as it would
143
+ # expose original attributes that should be mocked
144
+ for attribute in (
145
+ '__name__', '__doc__', '__text_signature__',
146
+ '__module__', '__defaults__', '__kwdefaults__',
147
+ ):
148
+ try:
149
+ setattr(funcopy, attribute, getattr(func, attribute))
150
+ except AttributeError:
151
+ pass
152
+
153
+
154
+ def _callable(obj):
155
+ if isinstance(obj, type):
156
+ return True
157
+ if isinstance(obj, (staticmethod, classmethod, MethodType)):
158
+ return _callable(obj.__func__)
159
+ if getattr(obj, '__call__', None) is not None:
160
+ return True
161
+ return False
162
+
163
+
164
+ def _is_list(obj):
165
+ # checks for list or tuples
166
+ # XXXX badly named!
167
+ return type(obj) in (list, tuple)
168
+
169
+
170
+ def _instance_callable(obj):
171
+ """Given an object, return True if the object is callable.
172
+ For classes, return True if instances would be callable."""
173
+ if not isinstance(obj, type):
174
+ # already an instance
175
+ return getattr(obj, '__call__', None) is not None
176
+
177
+ # *could* be broken by a class overriding __mro__ or __dict__ via
178
+ # a metaclass
179
+ for base in (obj,) + obj.__mro__:
180
+ if base.__dict__.get('__call__') is not None:
181
+ return True
182
+ return False
183
+
184
+
185
+ def _set_signature(mock, original, instance=False):
186
+ # creates a function with signature (*args, **kwargs) that delegates to a
187
+ # mock. It still does signature checking by calling a lambda with the same
188
+ # signature as the original.
189
+
190
+ skipfirst = isinstance(original, type)
191
+ result = _get_signature_object(original, instance, skipfirst)
192
+ if result is None:
193
+ return mock
194
+ func, sig = result
195
+ def checksig(*args, **kwargs):
196
+ sig.bind(*args, **kwargs)
197
+ _copy_func_details(func, checksig)
198
+
199
+ name = original.__name__
200
+ if not name.isidentifier():
201
+ name = 'funcopy'
202
+ context = {'_checksig_': checksig, 'mock': mock}
203
+ src = """def %s(*args, **kwargs):
204
+ _checksig_(*args, **kwargs)
205
+ return mock(*args, **kwargs)""" % name
206
+ exec (src, context)
207
+ funcopy = context[name]
208
+ _setup_func(funcopy, mock, sig)
209
+ return funcopy
210
+
211
+ def _set_async_signature(mock, original, instance=False, is_async_mock=False):
212
+ # creates an async function with signature (*args, **kwargs) that delegates to a
213
+ # mock. It still does signature checking by calling a lambda with the same
214
+ # signature as the original.
215
+
216
+ skipfirst = isinstance(original, type)
217
+ func, sig = _get_signature_object(original, instance, skipfirst)
218
+ def checksig(*args, **kwargs):
219
+ sig.bind(*args, **kwargs)
220
+ _copy_func_details(func, checksig)
221
+
222
+ name = original.__name__
223
+ context = {'_checksig_': checksig, 'mock': mock}
224
+ src = """async def %s(*args, **kwargs):
225
+ _checksig_(*args, **kwargs)
226
+ return await mock(*args, **kwargs)""" % name
227
+ exec (src, context)
228
+ funcopy = context[name]
229
+ _setup_func(funcopy, mock, sig)
230
+ _setup_async_mock(funcopy)
231
+ return funcopy
232
+
233
+
234
+ def _setup_func(funcopy, mock, sig):
235
+ funcopy.mock = mock
236
+
237
+ def assert_called_with(*args, **kwargs):
238
+ return mock.assert_called_with(*args, **kwargs)
239
+ def assert_called(*args, **kwargs):
240
+ return mock.assert_called(*args, **kwargs)
241
+ def assert_not_called(*args, **kwargs):
242
+ return mock.assert_not_called(*args, **kwargs)
243
+ def assert_called_once(*args, **kwargs):
244
+ return mock.assert_called_once(*args, **kwargs)
245
+ def assert_called_once_with(*args, **kwargs):
246
+ return mock.assert_called_once_with(*args, **kwargs)
247
+ def assert_has_calls(*args, **kwargs):
248
+ return mock.assert_has_calls(*args, **kwargs)
249
+ def assert_any_call(*args, **kwargs):
250
+ return mock.assert_any_call(*args, **kwargs)
251
+ def reset_mock():
252
+ funcopy.method_calls = _CallList()
253
+ funcopy.mock_calls = _CallList()
254
+ mock.reset_mock()
255
+ ret = funcopy.return_value
256
+ if _is_instance_mock(ret) and not ret is mock:
257
+ ret.reset_mock()
258
+
259
+ funcopy.called = False
260
+ funcopy.call_count = 0
261
+ funcopy.call_args = None
262
+ funcopy.call_args_list = _CallList()
263
+ funcopy.method_calls = _CallList()
264
+ funcopy.mock_calls = _CallList()
265
+
266
+ funcopy.return_value = mock.return_value
267
+ funcopy.side_effect = mock.side_effect
268
+ funcopy._mock_children = mock._mock_children
269
+
270
+ funcopy.assert_called_with = assert_called_with
271
+ funcopy.assert_called_once_with = assert_called_once_with
272
+ funcopy.assert_has_calls = assert_has_calls
273
+ funcopy.assert_any_call = assert_any_call
274
+ funcopy.reset_mock = reset_mock
275
+ funcopy.assert_called = assert_called
276
+ funcopy.assert_not_called = assert_not_called
277
+ funcopy.assert_called_once = assert_called_once
278
+ funcopy.__signature__ = sig
279
+
280
+ mock._mock_delegate = funcopy
281
+
282
+
283
+ def _setup_async_mock(mock):
284
+ mock._is_coroutine = asyncio.coroutines._is_coroutine
285
+ mock.await_count = 0
286
+ mock.await_args = None
287
+ mock.await_args_list = _CallList()
288
+
289
+ # Mock is not configured yet so the attributes are set
290
+ # to a function and then the corresponding mock helper function
291
+ # is called when the helper is accessed similar to _setup_func.
292
+ def wrapper(attr, /, *args, **kwargs):
293
+ return getattr(mock.mock, attr)(*args, **kwargs)
294
+
295
+ for attribute in ('assert_awaited',
296
+ 'assert_awaited_once',
297
+ 'assert_awaited_with',
298
+ 'assert_awaited_once_with',
299
+ 'assert_any_await',
300
+ 'assert_has_awaits',
301
+ 'assert_not_awaited'):
302
+
303
+ # setattr(mock, attribute, wrapper) causes late binding
304
+ # hence attribute will always be the last value in the loop
305
+ # Use partial(wrapper, attribute) to ensure the attribute is bound
306
+ # correctly.
307
+ setattr(mock, attribute, partial(wrapper, attribute))
308
+
309
+
310
+ def _is_magic(name):
311
+ return '__%s__' % name[2:-2] == name
312
+
313
+
314
+ class _SentinelObject(object):
315
+ "A unique, named, sentinel object."
316
+ def __init__(self, name):
317
+ self.name = name
318
+
319
+ def __repr__(self):
320
+ return 'sentinel.%s' % self.name
321
+
322
+ def __reduce__(self):
323
+ return 'sentinel.%s' % self.name
324
+
325
+
326
+ class _Sentinel(object):
327
+ """Access attributes to return a named object, usable as a sentinel."""
328
+ def __init__(self):
329
+ self._sentinels = {}
330
+
331
+ def __getattr__(self, name):
332
+ if name == '__bases__':
333
+ # Without this help(unittest.mock) raises an exception
334
+ raise AttributeError
335
+ return self._sentinels.setdefault(name, _SentinelObject(name))
336
+
337
+ def __reduce__(self):
338
+ return 'sentinel'
339
+
340
+
341
+ sentinel = _Sentinel()
342
+
343
+ DEFAULT = sentinel.DEFAULT
344
+ _missing = sentinel.MISSING
345
+ _deleted = sentinel.DELETED
346
+
347
+
348
+ _allowed_names = {
349
+ 'return_value', '_mock_return_value', 'side_effect',
350
+ '_mock_side_effect', '_mock_parent', '_mock_new_parent',
351
+ '_mock_name', '_mock_new_name'
352
+ }
353
+
354
+
355
+ def _delegating_property(name):
356
+ _allowed_names.add(name)
357
+ _the_name = '_mock_' + name
358
+ def _get(self, name=name, _the_name=_the_name):
359
+ sig = self._mock_delegate
360
+ if sig is None:
361
+ return getattr(self, _the_name)
362
+ return getattr(sig, name)
363
+ def _set(self, value, name=name, _the_name=_the_name):
364
+ sig = self._mock_delegate
365
+ if sig is None:
366
+ self.__dict__[_the_name] = value
367
+ else:
368
+ setattr(sig, name, value)
369
+
370
+ return property(_get, _set)
371
+
372
+
373
+
374
+ class _CallList(list):
375
+
376
+ def __contains__(self, value):
377
+ if not isinstance(value, list):
378
+ return list.__contains__(self, value)
379
+ len_value = len(value)
380
+ len_self = len(self)
381
+ if len_value > len_self:
382
+ return False
383
+
384
+ for i in range(0, len_self - len_value + 1):
385
+ sub_list = self[i:i+len_value]
386
+ if sub_list == value:
387
+ return True
388
+ return False
389
+
390
+ def __repr__(self):
391
+ return pprint.pformat(list(self))
392
+
393
+
394
+ def _check_and_set_parent(parent, value, name, new_name):
395
+ value = _extract_mock(value)
396
+
397
+ if not _is_instance_mock(value):
398
+ return False
399
+ if ((value._mock_name or value._mock_new_name) or
400
+ (value._mock_parent is not None) or
401
+ (value._mock_new_parent is not None)):
402
+ return False
403
+
404
+ _parent = parent
405
+ while _parent is not None:
406
+ # setting a mock (value) as a child or return value of itself
407
+ # should not modify the mock
408
+ if _parent is value:
409
+ return False
410
+ _parent = _parent._mock_new_parent
411
+
412
+ if new_name:
413
+ value._mock_new_parent = parent
414
+ value._mock_new_name = new_name
415
+ if name:
416
+ value._mock_parent = parent
417
+ value._mock_name = name
418
+ return True
419
+
420
+ # Internal class to identify if we wrapped an iterator object or not.
421
+ class _MockIter(object):
422
+ def __init__(self, obj):
423
+ self.obj = iter(obj)
424
+ def __next__(self):
425
+ return next(self.obj)
426
+
427
+ class Base(object):
428
+ _mock_return_value = DEFAULT
429
+ _mock_side_effect = None
430
+ def __init__(self, /, *args, **kwargs):
431
+ pass
432
+
433
+
434
+
435
+ class NonCallableMock(Base):
436
+ """A non-callable version of `Mock`"""
437
+
438
+ # Store a mutex as a class attribute in order to protect concurrent access
439
+ # to mock attributes. Using a class attribute allows all NonCallableMock
440
+ # instances to share the mutex for simplicity.
441
+ #
442
+ # See https://github.com/python/cpython/issues/98624 for why this is
443
+ # necessary.
444
+ _lock = RLock()
445
+
446
+ def __new__(
447
+ cls, spec=None, wraps=None, name=None, spec_set=None,
448
+ parent=None, _spec_state=None, _new_name='', _new_parent=None,
449
+ _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
450
+ ):
451
+ # every instance has its own class
452
+ # so we can create magic methods on the
453
+ # class without stomping on other mocks
454
+ bases = (cls,)
455
+ if not issubclass(cls, AsyncMockMixin):
456
+ # Check if spec is an async object or function
457
+ spec_arg = spec_set or spec
458
+ if spec_arg is not None and _is_async_obj(spec_arg):
459
+ bases = (AsyncMockMixin, cls)
460
+ new = type(cls.__name__, bases, {'__doc__': cls.__doc__})
461
+ instance = _safe_super(NonCallableMock, cls).__new__(new)
462
+ return instance
463
+
464
+
465
+ def __init__(
466
+ self, spec=None, wraps=None, name=None, spec_set=None,
467
+ parent=None, _spec_state=None, _new_name='', _new_parent=None,
468
+ _spec_as_instance=False, _eat_self=None, unsafe=False, **kwargs
469
+ ):
470
+ if _new_parent is None:
471
+ _new_parent = parent
472
+
473
+ __dict__ = self.__dict__
474
+ __dict__['_mock_parent'] = parent
475
+ __dict__['_mock_name'] = name
476
+ __dict__['_mock_new_name'] = _new_name
477
+ __dict__['_mock_new_parent'] = _new_parent
478
+ __dict__['_mock_sealed'] = False
479
+
480
+ if spec_set is not None:
481
+ spec = spec_set
482
+ spec_set = True
483
+ if _eat_self is None:
484
+ _eat_self = parent is not None
485
+
486
+ self._mock_add_spec(spec, spec_set, _spec_as_instance, _eat_self)
487
+
488
+ __dict__['_mock_children'] = {}
489
+ __dict__['_mock_wraps'] = wraps
490
+ __dict__['_mock_delegate'] = None
491
+
492
+ __dict__['_mock_called'] = False
493
+ __dict__['_mock_call_args'] = None
494
+ __dict__['_mock_call_count'] = 0
495
+ __dict__['_mock_call_args_list'] = _CallList()
496
+ __dict__['_mock_mock_calls'] = _CallList()
497
+
498
+ __dict__['method_calls'] = _CallList()
499
+ __dict__['_mock_unsafe'] = unsafe
500
+
501
+ if kwargs:
502
+ self.configure_mock(**kwargs)
503
+
504
+ _safe_super(NonCallableMock, self).__init__(
505
+ spec, wraps, name, spec_set, parent,
506
+ _spec_state
507
+ )
508
+
509
+
510
+ def attach_mock(self, mock, attribute):
511
+ """
512
+ Attach a mock as an attribute of this one, replacing its name and
513
+ parent. Calls to the attached mock will be recorded in the
514
+ `method_calls` and `mock_calls` attributes of this one."""
515
+ inner_mock = _extract_mock(mock)
516
+
517
+ inner_mock._mock_parent = None
518
+ inner_mock._mock_new_parent = None
519
+ inner_mock._mock_name = ''
520
+ inner_mock._mock_new_name = None
521
+
522
+ setattr(self, attribute, mock)
523
+
524
+
525
+ def mock_add_spec(self, spec, spec_set=False):
526
+ """Add a spec to a mock. `spec` can either be an object or a
527
+ list of strings. Only attributes on the `spec` can be fetched as
528
+ attributes from the mock.
529
+
530
+ If `spec_set` is True then only attributes on the spec can be set."""
531
+ self._mock_add_spec(spec, spec_set)
532
+
533
+
534
+ def _mock_add_spec(self, spec, spec_set, _spec_as_instance=False,
535
+ _eat_self=False):
536
+ if _is_instance_mock(spec):
537
+ raise InvalidSpecError(f'Cannot spec a Mock object. [object={spec!r}]')
538
+
539
+ _spec_class = None
540
+ _spec_signature = None
541
+ _spec_asyncs = []
542
+
543
+ if spec is not None and not _is_list(spec):
544
+ if isinstance(spec, type):
545
+ _spec_class = spec
546
+ else:
547
+ _spec_class = type(spec)
548
+ res = _get_signature_object(spec,
549
+ _spec_as_instance, _eat_self)
550
+ _spec_signature = res and res[1]
551
+
552
+ spec_list = dir(spec)
553
+
554
+ for attr in spec_list:
555
+ static_attr = inspect.getattr_static(spec, attr, None)
556
+ unwrapped_attr = static_attr
557
+ try:
558
+ unwrapped_attr = inspect.unwrap(unwrapped_attr)
559
+ except ValueError:
560
+ pass
561
+ if iscoroutinefunction(unwrapped_attr):
562
+ _spec_asyncs.append(attr)
563
+
564
+ spec = spec_list
565
+
566
+ __dict__ = self.__dict__
567
+ __dict__['_spec_class'] = _spec_class
568
+ __dict__['_spec_set'] = spec_set
569
+ __dict__['_spec_signature'] = _spec_signature
570
+ __dict__['_mock_methods'] = spec
571
+ __dict__['_spec_asyncs'] = _spec_asyncs
572
+
573
+ def _mock_extend_spec_methods(self, spec_methods):
574
+ methods = self.__dict__.get('_mock_methods') or []
575
+ methods.extend(spec_methods)
576
+ self.__dict__['_mock_methods'] = methods
577
+
578
+ def __get_return_value(self):
579
+ ret = self._mock_return_value
580
+ if self._mock_delegate is not None:
581
+ ret = self._mock_delegate.return_value
582
+
583
+ if ret is DEFAULT and self._mock_wraps is None:
584
+ ret = self._get_child_mock(
585
+ _new_parent=self, _new_name='()'
586
+ )
587
+ self.return_value = ret
588
+ return ret
589
+
590
+
591
+ def __set_return_value(self, value):
592
+ if self._mock_delegate is not None:
593
+ self._mock_delegate.return_value = value
594
+ else:
595
+ self._mock_return_value = value
596
+ _check_and_set_parent(self, value, None, '()')
597
+
598
+ __return_value_doc = "The value to be returned when the mock is called."
599
+ return_value = property(__get_return_value, __set_return_value,
600
+ doc=__return_value_doc)
601
+
602
+
603
+ @property
604
+ def __class__(self):
605
+ if self._spec_class is None:
606
+ return type(self)
607
+ return self._spec_class
608
+
609
+ called = _delegating_property('called')
610
+ call_count = _delegating_property('call_count')
611
+ call_args = _delegating_property('call_args')
612
+ call_args_list = _delegating_property('call_args_list')
613
+ mock_calls = _delegating_property('mock_calls')
614
+
615
+
616
+ def __get_side_effect(self):
617
+ delegated = self._mock_delegate
618
+ if delegated is None:
619
+ return self._mock_side_effect
620
+ sf = delegated.side_effect
621
+ if (sf is not None and not callable(sf)
622
+ and not isinstance(sf, _MockIter) and not _is_exception(sf)):
623
+ sf = _MockIter(sf)
624
+ delegated.side_effect = sf
625
+ return sf
626
+
627
+ def __set_side_effect(self, value):
628
+ value = _try_iter(value)
629
+ delegated = self._mock_delegate
630
+ if delegated is None:
631
+ self._mock_side_effect = value
632
+ else:
633
+ delegated.side_effect = value
634
+
635
+ side_effect = property(__get_side_effect, __set_side_effect)
636
+
637
+
638
+ def reset_mock(self, visited=None, *,
639
+ return_value: bool = False,
640
+ side_effect: bool = False):
641
+ "Restore the mock object to its initial state."
642
+ if visited is None:
643
+ visited = []
644
+ if id(self) in visited:
645
+ return
646
+ visited.append(id(self))
647
+
648
+ self.called = False
649
+ self.call_args = None
650
+ self.call_count = 0
651
+ self.mock_calls = _CallList()
652
+ self.call_args_list = _CallList()
653
+ self.method_calls = _CallList()
654
+
655
+ if return_value:
656
+ self._mock_return_value = DEFAULT
657
+ if side_effect:
658
+ self._mock_side_effect = None
659
+
660
+ for child in self._mock_children.values():
661
+ if isinstance(child, _SpecState) or child is _deleted:
662
+ continue
663
+ child.reset_mock(visited, return_value=return_value, side_effect=side_effect)
664
+
665
+ ret = self._mock_return_value
666
+ if _is_instance_mock(ret) and ret is not self:
667
+ ret.reset_mock(visited)
668
+
669
+
670
+ def configure_mock(self, /, **kwargs):
671
+ """Set attributes on the mock through keyword arguments.
672
+
673
+ Attributes plus return values and side effects can be set on child
674
+ mocks using standard dot notation and unpacking a dictionary in the
675
+ method call:
676
+
677
+ >>> attrs = {'method.return_value': 3, 'other.side_effect': KeyError}
678
+ >>> mock.configure_mock(**attrs)"""
679
+ for arg, val in sorted(kwargs.items(),
680
+ # we sort on the number of dots so that
681
+ # attributes are set before we set attributes on
682
+ # attributes
683
+ key=lambda entry: entry[0].count('.')):
684
+ args = arg.split('.')
685
+ final = args.pop()
686
+ obj = self
687
+ for entry in args:
688
+ obj = getattr(obj, entry)
689
+ setattr(obj, final, val)
690
+
691
+
692
+ def __getattr__(self, name):
693
+ if name in {'_mock_methods', '_mock_unsafe'}:
694
+ raise AttributeError(name)
695
+ elif self._mock_methods is not None:
696
+ if name not in self._mock_methods or name in _all_magics:
697
+ raise AttributeError("Mock object has no attribute %r" % name)
698
+ elif _is_magic(name):
699
+ raise AttributeError(name)
700
+ if not self._mock_unsafe and (not self._mock_methods or name not in self._mock_methods):
701
+ if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST:
702
+ raise AttributeError(
703
+ f"{name!r} is not a valid assertion. Use a spec "
704
+ f"for the mock if {name!r} is meant to be an attribute")
705
+
706
+ with NonCallableMock._lock:
707
+ result = self._mock_children.get(name)
708
+ if result is _deleted:
709
+ raise AttributeError(name)
710
+ elif result is None:
711
+ wraps = None
712
+ if self._mock_wraps is not None:
713
+ # XXXX should we get the attribute without triggering code
714
+ # execution?
715
+ wraps = getattr(self._mock_wraps, name)
716
+
717
+ result = self._get_child_mock(
718
+ parent=self, name=name, wraps=wraps, _new_name=name,
719
+ _new_parent=self
720
+ )
721
+ self._mock_children[name] = result
722
+
723
+ elif isinstance(result, _SpecState):
724
+ try:
725
+ result = create_autospec(
726
+ result.spec, result.spec_set, result.instance,
727
+ result.parent, result.name
728
+ )
729
+ except InvalidSpecError:
730
+ target_name = self.__dict__['_mock_name'] or self
731
+ raise InvalidSpecError(
732
+ f'Cannot autospec attr {name!r} from target '
733
+ f'{target_name!r} as it has already been mocked out. '
734
+ f'[target={self!r}, attr={result.spec!r}]')
735
+ self._mock_children[name] = result
736
+
737
+ return result
738
+
739
+
740
+ def _extract_mock_name(self):
741
+ _name_list = [self._mock_new_name]
742
+ _parent = self._mock_new_parent
743
+ last = self
744
+
745
+ dot = '.'
746
+ if _name_list == ['()']:
747
+ dot = ''
748
+
749
+ while _parent is not None:
750
+ last = _parent
751
+
752
+ _name_list.append(_parent._mock_new_name + dot)
753
+ dot = '.'
754
+ if _parent._mock_new_name == '()':
755
+ dot = ''
756
+
757
+ _parent = _parent._mock_new_parent
758
+
759
+ _name_list = list(reversed(_name_list))
760
+ _first = last._mock_name or 'mock'
761
+ if len(_name_list) > 1:
762
+ if _name_list[1] not in ('()', '().'):
763
+ _first += '.'
764
+ _name_list[0] = _first
765
+ return ''.join(_name_list)
766
+
767
+ def __repr__(self):
768
+ name = self._extract_mock_name()
769
+
770
+ name_string = ''
771
+ if name not in ('mock', 'mock.'):
772
+ name_string = ' name=%r' % name
773
+
774
+ spec_string = ''
775
+ if self._spec_class is not None:
776
+ spec_string = ' spec=%r'
777
+ if self._spec_set:
778
+ spec_string = ' spec_set=%r'
779
+ spec_string = spec_string % self._spec_class.__name__
780
+ return "<%s%s%s id='%s'>" % (
781
+ type(self).__name__,
782
+ name_string,
783
+ spec_string,
784
+ id(self)
785
+ )
786
+
787
+
788
+ def __dir__(self):
789
+ """Filter the output of `dir(mock)` to only useful members."""
790
+ if not FILTER_DIR:
791
+ return object.__dir__(self)
792
+
793
+ extras = self._mock_methods or []
794
+ from_type = dir(type(self))
795
+ from_dict = list(self.__dict__)
796
+ from_child_mocks = [
797
+ m_name for m_name, m_value in self._mock_children.items()
798
+ if m_value is not _deleted]
799
+
800
+ from_type = [e for e in from_type if not e.startswith('_')]
801
+ from_dict = [e for e in from_dict if not e.startswith('_') or
802
+ _is_magic(e)]
803
+ return sorted(set(extras + from_type + from_dict + from_child_mocks))
804
+
805
+
806
+ def __setattr__(self, name, value):
807
+ if name in _allowed_names:
808
+ # property setters go through here
809
+ return object.__setattr__(self, name, value)
810
+ elif (self._spec_set and self._mock_methods is not None and
811
+ name not in self._mock_methods and
812
+ name not in self.__dict__):
813
+ raise AttributeError("Mock object has no attribute '%s'" % name)
814
+ elif name in _unsupported_magics:
815
+ msg = 'Attempting to set unsupported magic method %r.' % name
816
+ raise AttributeError(msg)
817
+ elif name in _all_magics:
818
+ if self._mock_methods is not None and name not in self._mock_methods:
819
+ raise AttributeError("Mock object has no attribute '%s'" % name)
820
+
821
+ if not _is_instance_mock(value):
822
+ setattr(type(self), name, _get_method(name, value))
823
+ original = value
824
+ value = lambda *args, **kw: original(self, *args, **kw)
825
+ else:
826
+ # only set _new_name and not name so that mock_calls is tracked
827
+ # but not method calls
828
+ _check_and_set_parent(self, value, None, name)
829
+ setattr(type(self), name, value)
830
+ self._mock_children[name] = value
831
+ elif name == '__class__':
832
+ self._spec_class = value
833
+ return
834
+ else:
835
+ if _check_and_set_parent(self, value, name, name):
836
+ self._mock_children[name] = value
837
+
838
+ if self._mock_sealed and not hasattr(self, name):
839
+ mock_name = f'{self._extract_mock_name()}.{name}'
840
+ raise AttributeError(f'Cannot set {mock_name}')
841
+
842
+ if isinstance(value, PropertyMock):
843
+ self.__dict__[name] = value
844
+ return
845
+ return object.__setattr__(self, name, value)
846
+
847
+
848
+ def __delattr__(self, name):
849
+ if name in _all_magics and name in type(self).__dict__:
850
+ delattr(type(self), name)
851
+ if name not in self.__dict__:
852
+ # for magic methods that are still MagicProxy objects and
853
+ # not set on the instance itself
854
+ return
855
+
856
+ obj = self._mock_children.get(name, _missing)
857
+ if name in self.__dict__:
858
+ _safe_super(NonCallableMock, self).__delattr__(name)
859
+ elif obj is _deleted:
860
+ raise AttributeError(name)
861
+ if obj is not _missing:
862
+ del self._mock_children[name]
863
+ self._mock_children[name] = _deleted
864
+
865
+
866
+ def _format_mock_call_signature(self, args, kwargs):
867
+ name = self._mock_name or 'mock'
868
+ return _format_call_signature(name, args, kwargs)
869
+
870
+
871
+ def _format_mock_failure_message(self, args, kwargs, action='call'):
872
+ message = 'expected %s not found.\nExpected: %s\n Actual: %s'
873
+ expected_string = self._format_mock_call_signature(args, kwargs)
874
+ call_args = self.call_args
875
+ actual_string = self._format_mock_call_signature(*call_args)
876
+ return message % (action, expected_string, actual_string)
877
+
878
+
879
+ def _get_call_signature_from_name(self, name):
880
+ """
881
+ * If call objects are asserted against a method/function like obj.meth1
882
+ then there could be no name for the call object to lookup. Hence just
883
+ return the spec_signature of the method/function being asserted against.
884
+ * If the name is not empty then remove () and split by '.' to get
885
+ list of names to iterate through the children until a potential
886
+ match is found. A child mock is created only during attribute access
887
+ so if we get a _SpecState then no attributes of the spec were accessed
888
+ and can be safely exited.
889
+ """
890
+ if not name:
891
+ return self._spec_signature
892
+
893
+ sig = None
894
+ names = name.replace('()', '').split('.')
895
+ children = self._mock_children
896
+
897
+ for name in names:
898
+ child = children.get(name)
899
+ if child is None or isinstance(child, _SpecState):
900
+ break
901
+ else:
902
+ # If an autospecced object is attached using attach_mock the
903
+ # child would be a function with mock object as attribute from
904
+ # which signature has to be derived.
905
+ child = _extract_mock(child)
906
+ children = child._mock_children
907
+ sig = child._spec_signature
908
+
909
+ return sig
910
+
911
+
912
+ def _call_matcher(self, _call):
913
+ """
914
+ Given a call (or simply an (args, kwargs) tuple), return a
915
+ comparison key suitable for matching with other calls.
916
+ This is a best effort method which relies on the spec's signature,
917
+ if available, or falls back on the arguments themselves.
918
+ """
919
+
920
+ if isinstance(_call, tuple) and len(_call) > 2:
921
+ sig = self._get_call_signature_from_name(_call[0])
922
+ else:
923
+ sig = self._spec_signature
924
+
925
+ if sig is not None:
926
+ if len(_call) == 2:
927
+ name = ''
928
+ args, kwargs = _call
929
+ else:
930
+ name, args, kwargs = _call
931
+ try:
932
+ bound_call = sig.bind(*args, **kwargs)
933
+ return call(name, bound_call.args, bound_call.kwargs)
934
+ except TypeError as e:
935
+ return e.with_traceback(None)
936
+ else:
937
+ return _call
938
+
939
+ def assert_not_called(self):
940
+ """Assert that the mock was never called.
941
+ """
942
+ if self.call_count != 0:
943
+ msg = ("Expected '%s' to not have been called. Called %s times.%s"
944
+ % (self._mock_name or 'mock',
945
+ self.call_count,
946
+ self._calls_repr()))
947
+ raise AssertionError(msg)
948
+
949
+ def assert_called(self):
950
+ """Assert that the mock was called at least once.
951
+ """
952
+ if self.call_count == 0:
953
+ msg = ("Expected '%s' to have been called." %
954
+ (self._mock_name or 'mock'))
955
+ raise AssertionError(msg)
956
+
957
+ def assert_called_once(self):
958
+ """Assert that the mock was called only once.
959
+ """
960
+ if not self.call_count == 1:
961
+ msg = ("Expected '%s' to have been called once. Called %s times.%s"
962
+ % (self._mock_name or 'mock',
963
+ self.call_count,
964
+ self._calls_repr()))
965
+ raise AssertionError(msg)
966
+
967
+ def assert_called_with(self, /, *args, **kwargs):
968
+ """Assert that the last call was made with the specified arguments.
969
+
970
+ Raises an AssertionError if the args and keyword args passed in are
971
+ different to the last call to the mock."""
972
+ if self.call_args is None:
973
+ expected = self._format_mock_call_signature(args, kwargs)
974
+ actual = 'not called.'
975
+ error_message = ('expected call not found.\nExpected: %s\n Actual: %s'
976
+ % (expected, actual))
977
+ raise AssertionError(error_message)
978
+
979
+ def _error_message():
980
+ msg = self._format_mock_failure_message(args, kwargs)
981
+ return msg
982
+ expected = self._call_matcher(_Call((args, kwargs), two=True))
983
+ actual = self._call_matcher(self.call_args)
984
+ if actual != expected:
985
+ cause = expected if isinstance(expected, Exception) else None
986
+ raise AssertionError(_error_message()) from cause
987
+
988
+
989
+ def assert_called_once_with(self, /, *args, **kwargs):
990
+ """Assert that the mock was called exactly once and that call was
991
+ with the specified arguments."""
992
+ if not self.call_count == 1:
993
+ msg = ("Expected '%s' to be called once. Called %s times.%s"
994
+ % (self._mock_name or 'mock',
995
+ self.call_count,
996
+ self._calls_repr()))
997
+ raise AssertionError(msg)
998
+ return self.assert_called_with(*args, **kwargs)
999
+
1000
+
1001
+ def assert_has_calls(self, calls, any_order=False):
1002
+ """Assert the mock has been called with the specified calls.
1003
+ The `mock_calls` list is checked for the calls.
1004
+
1005
+ If `any_order` is False (the default) then the calls must be
1006
+ sequential. There can be extra calls before or after the
1007
+ specified calls.
1008
+
1009
+ If `any_order` is True then the calls can be in any order, but
1010
+ they must all appear in `mock_calls`."""
1011
+ expected = [self._call_matcher(c) for c in calls]
1012
+ cause = next((e for e in expected if isinstance(e, Exception)), None)
1013
+ all_calls = _CallList(self._call_matcher(c) for c in self.mock_calls)
1014
+ if not any_order:
1015
+ if expected not in all_calls:
1016
+ if cause is None:
1017
+ problem = 'Calls not found.'
1018
+ else:
1019
+ problem = ('Error processing expected calls.\n'
1020
+ 'Errors: {}').format(
1021
+ [e if isinstance(e, Exception) else None
1022
+ for e in expected])
1023
+ raise AssertionError(
1024
+ f'{problem}\n'
1025
+ f'Expected: {_CallList(calls)}\n'
1026
+ f' Actual: {safe_repr(self.mock_calls)}'
1027
+ ) from cause
1028
+ return
1029
+
1030
+ all_calls = list(all_calls)
1031
+
1032
+ not_found = []
1033
+ for kall in expected:
1034
+ try:
1035
+ all_calls.remove(kall)
1036
+ except ValueError:
1037
+ not_found.append(kall)
1038
+ if not_found:
1039
+ raise AssertionError(
1040
+ '%r does not contain all of %r in its call list, '
1041
+ 'found %r instead' % (self._mock_name or 'mock',
1042
+ tuple(not_found), all_calls)
1043
+ ) from cause
1044
+
1045
+
1046
+ def assert_any_call(self, /, *args, **kwargs):
1047
+ """Assert the mock has been called with the specified arguments.
1048
+
1049
+ The assert passes if the mock has *ever* been called, unlike
1050
+ `assert_called_with` and `assert_called_once_with` that only pass if
1051
+ the call is the most recent one."""
1052
+ expected = self._call_matcher(_Call((args, kwargs), two=True))
1053
+ cause = expected if isinstance(expected, Exception) else None
1054
+ actual = [self._call_matcher(c) for c in self.call_args_list]
1055
+ if cause or expected not in _AnyComparer(actual):
1056
+ expected_string = self._format_mock_call_signature(args, kwargs)
1057
+ raise AssertionError(
1058
+ '%s call not found' % expected_string
1059
+ ) from cause
1060
+
1061
+
1062
+ def _get_child_mock(self, /, **kw):
1063
+ """Create the child mocks for attributes and return value.
1064
+ By default child mocks will be the same type as the parent.
1065
+ Subclasses of Mock may want to override this to customize the way
1066
+ child mocks are made.
1067
+
1068
+ For non-callable mocks the callable variant will be used (rather than
1069
+ any custom subclass)."""
1070
+ if self._mock_sealed:
1071
+ attribute = f".{kw['name']}" if "name" in kw else "()"
1072
+ mock_name = self._extract_mock_name() + attribute
1073
+ raise AttributeError(mock_name)
1074
+
1075
+ _new_name = kw.get("_new_name")
1076
+ if _new_name in self.__dict__['_spec_asyncs']:
1077
+ return AsyncMock(**kw)
1078
+
1079
+ _type = type(self)
1080
+ if issubclass(_type, MagicMock) and _new_name in _async_method_magics:
1081
+ # Any asynchronous magic becomes an AsyncMock
1082
+ klass = AsyncMock
1083
+ elif issubclass(_type, AsyncMockMixin):
1084
+ if (_new_name in _all_sync_magics or
1085
+ self._mock_methods and _new_name in self._mock_methods):
1086
+ # Any synchronous method on AsyncMock becomes a MagicMock
1087
+ klass = MagicMock
1088
+ else:
1089
+ klass = AsyncMock
1090
+ elif not issubclass(_type, CallableMixin):
1091
+ if issubclass(_type, NonCallableMagicMock):
1092
+ klass = MagicMock
1093
+ elif issubclass(_type, NonCallableMock):
1094
+ klass = Mock
1095
+ else:
1096
+ klass = _type.__mro__[1]
1097
+ return klass(**kw)
1098
+
1099
+
1100
+ def _calls_repr(self):
1101
+ """Renders self.mock_calls as a string.
1102
+
1103
+ Example: "\nCalls: [call(1), call(2)]."
1104
+
1105
+ If self.mock_calls is empty, an empty string is returned. The
1106
+ output will be truncated if very long.
1107
+ """
1108
+ if not self.mock_calls:
1109
+ return ""
1110
+ return f"\nCalls: {safe_repr(self.mock_calls)}."
1111
+
1112
+
1113
+ # Denylist for forbidden attribute names in safe mode
1114
+ _ATTRIB_DENY_LIST = frozenset({
1115
+ name.removeprefix("assert_")
1116
+ for name in dir(NonCallableMock)
1117
+ if name.startswith("assert_")
1118
+ })
1119
+
1120
+
1121
+ class _AnyComparer(list):
1122
+ """A list which checks if it contains a call which may have an
1123
+ argument of ANY, flipping the components of item and self from
1124
+ their traditional locations so that ANY is guaranteed to be on
1125
+ the left."""
1126
+ def __contains__(self, item):
1127
+ for _call in self:
1128
+ assert len(item) == len(_call)
1129
+ if all([
1130
+ expected == actual
1131
+ for expected, actual in zip(item, _call)
1132
+ ]):
1133
+ return True
1134
+ return False
1135
+
1136
+
1137
+ def _try_iter(obj):
1138
+ if obj is None:
1139
+ return obj
1140
+ if _is_exception(obj):
1141
+ return obj
1142
+ if _callable(obj):
1143
+ return obj
1144
+ try:
1145
+ return iter(obj)
1146
+ except TypeError:
1147
+ # XXXX backwards compatibility
1148
+ # but this will blow up on first call - so maybe we should fail early?
1149
+ return obj
1150
+
1151
+
1152
+ class CallableMixin(Base):
1153
+
1154
+ def __init__(self, spec=None, side_effect=None, return_value=DEFAULT,
1155
+ wraps=None, name=None, spec_set=None, parent=None,
1156
+ _spec_state=None, _new_name='', _new_parent=None, **kwargs):
1157
+ self.__dict__['_mock_return_value'] = return_value
1158
+ _safe_super(CallableMixin, self).__init__(
1159
+ spec, wraps, name, spec_set, parent,
1160
+ _spec_state, _new_name, _new_parent, **kwargs
1161
+ )
1162
+
1163
+ self.side_effect = side_effect
1164
+
1165
+
1166
+ def _mock_check_sig(self, /, *args, **kwargs):
1167
+ # stub method that can be replaced with one with a specific signature
1168
+ pass
1169
+
1170
+
1171
+ def __call__(self, /, *args, **kwargs):
1172
+ # can't use self in-case a function / method we are mocking uses self
1173
+ # in the signature
1174
+ self._mock_check_sig(*args, **kwargs)
1175
+ self._increment_mock_call(*args, **kwargs)
1176
+ return self._mock_call(*args, **kwargs)
1177
+
1178
+
1179
+ def _mock_call(self, /, *args, **kwargs):
1180
+ return self._execute_mock_call(*args, **kwargs)
1181
+
1182
+ def _increment_mock_call(self, /, *args, **kwargs):
1183
+ self.called = True
1184
+
1185
+ # handle call_args
1186
+ # needs to be set here so assertions on call arguments pass before
1187
+ # execution in the case of awaited calls
1188
+ with NonCallableMock._lock:
1189
+ # Lock is used here so that call_args_list and call_count are
1190
+ # set atomically otherwise it is possible that by the time call_count
1191
+ # is set another thread may have appended to call_args_list.
1192
+ # The rest of this function relies on list.append being atomic and
1193
+ # skips locking.
1194
+ _call = _Call((args, kwargs), two=True)
1195
+ self.call_args = _call
1196
+ self.call_args_list.append(_call)
1197
+ self.call_count = len(self.call_args_list)
1198
+
1199
+ # initial stuff for method_calls:
1200
+ do_method_calls = self._mock_parent is not None
1201
+ method_call_name = self._mock_name
1202
+
1203
+ # initial stuff for mock_calls:
1204
+ mock_call_name = self._mock_new_name
1205
+ is_a_call = mock_call_name == '()'
1206
+ self.mock_calls.append(_Call(('', args, kwargs)))
1207
+
1208
+ # follow up the chain of mocks:
1209
+ _new_parent = self._mock_new_parent
1210
+ while _new_parent is not None:
1211
+
1212
+ # handle method_calls:
1213
+ if do_method_calls:
1214
+ _new_parent.method_calls.append(_Call((method_call_name, args, kwargs)))
1215
+ do_method_calls = _new_parent._mock_parent is not None
1216
+ if do_method_calls:
1217
+ method_call_name = _new_parent._mock_name + '.' + method_call_name
1218
+
1219
+ # handle mock_calls:
1220
+ this_mock_call = _Call((mock_call_name, args, kwargs))
1221
+ _new_parent.mock_calls.append(this_mock_call)
1222
+
1223
+ if _new_parent._mock_new_name:
1224
+ if is_a_call:
1225
+ dot = ''
1226
+ else:
1227
+ dot = '.'
1228
+ is_a_call = _new_parent._mock_new_name == '()'
1229
+ mock_call_name = _new_parent._mock_new_name + dot + mock_call_name
1230
+
1231
+ # follow the parental chain:
1232
+ _new_parent = _new_parent._mock_new_parent
1233
+
1234
+ def _execute_mock_call(self, /, *args, **kwargs):
1235
+ # separate from _increment_mock_call so that awaited functions are
1236
+ # executed separately from their call, also AsyncMock overrides this method
1237
+
1238
+ effect = self.side_effect
1239
+ if effect is not None:
1240
+ if _is_exception(effect):
1241
+ raise effect
1242
+ elif not _callable(effect):
1243
+ result = next(effect)
1244
+ if _is_exception(result):
1245
+ raise result
1246
+ else:
1247
+ result = effect(*args, **kwargs)
1248
+
1249
+ if result is not DEFAULT:
1250
+ return result
1251
+
1252
+ if self._mock_return_value is not DEFAULT:
1253
+ return self.return_value
1254
+
1255
+ if self._mock_delegate and self._mock_delegate.return_value is not DEFAULT:
1256
+ return self.return_value
1257
+
1258
+ if self._mock_wraps is not None:
1259
+ return self._mock_wraps(*args, **kwargs)
1260
+
1261
+ return self.return_value
1262
+
1263
+
1264
+
1265
+ class Mock(CallableMixin, NonCallableMock):
1266
+ """
1267
+ Create a new `Mock` object. `Mock` takes several optional arguments
1268
+ that specify the behaviour of the Mock object:
1269
+
1270
+ * `spec`: This can be either a list of strings or an existing object (a
1271
+ class or instance) that acts as the specification for the mock object. If
1272
+ you pass in an object then a list of strings is formed by calling dir on
1273
+ the object (excluding unsupported magic attributes and methods). Accessing
1274
+ any attribute not in this list will raise an `AttributeError`.
1275
+
1276
+ If `spec` is an object (rather than a list of strings) then
1277
+ `mock.__class__` returns the class of the spec object. This allows mocks
1278
+ to pass `isinstance` tests.
1279
+
1280
+ * `spec_set`: A stricter variant of `spec`. If used, attempting to *set*
1281
+ or get an attribute on the mock that isn't on the object passed as
1282
+ `spec_set` will raise an `AttributeError`.
1283
+
1284
+ * `side_effect`: A function to be called whenever the Mock is called. See
1285
+ the `side_effect` attribute. Useful for raising exceptions or
1286
+ dynamically changing return values. The function is called with the same
1287
+ arguments as the mock, and unless it returns `DEFAULT`, the return
1288
+ value of this function is used as the return value.
1289
+
1290
+ If `side_effect` is an iterable then each call to the mock will return
1291
+ the next value from the iterable. If any of the members of the iterable
1292
+ are exceptions they will be raised instead of returned.
1293
+
1294
+ * `return_value`: The value returned when the mock is called. By default
1295
+ this is a new Mock (created on first access). See the
1296
+ `return_value` attribute.
1297
+
1298
+ * `unsafe`: By default, accessing any attribute whose name starts with
1299
+ *assert*, *assret*, *asert*, *aseert*, or *assrt* raises an AttributeError.
1300
+ Additionally, an AttributeError is raised when accessing
1301
+ attributes that match the name of an assertion method without the prefix
1302
+ `assert_`, e.g. accessing `called_once` instead of `assert_called_once`.
1303
+ Passing `unsafe=True` will allow access to these attributes.
1304
+
1305
+ * `wraps`: Item for the mock object to wrap. If `wraps` is not None then
1306
+ calling the Mock will pass the call through to the wrapped object
1307
+ (returning the real result). Attribute access on the mock will return a
1308
+ Mock object that wraps the corresponding attribute of the wrapped object
1309
+ (so attempting to access an attribute that doesn't exist will raise an
1310
+ `AttributeError`).
1311
+
1312
+ If the mock has an explicit `return_value` set then calls are not passed
1313
+ to the wrapped object and the `return_value` is returned instead.
1314
+
1315
+ * `name`: If the mock has a name then it will be used in the repr of the
1316
+ mock. This can be useful for debugging. The name is propagated to child
1317
+ mocks.
1318
+
1319
+ Mocks can also be called with arbitrary keyword arguments. These will be
1320
+ used to set attributes on the mock after it is created.
1321
+ """
1322
+
1323
+
1324
+ # _check_spec_arg_typos takes kwargs from commands like patch and checks that
1325
+ # they don't contain common misspellings of arguments related to autospeccing.
1326
+ def _check_spec_arg_typos(kwargs_to_check):
1327
+ typos = ("autospect", "auto_spec", "set_spec")
1328
+ for typo in typos:
1329
+ if typo in kwargs_to_check:
1330
+ raise RuntimeError(
1331
+ f"{typo!r} might be a typo; use unsafe=True if this is intended"
1332
+ )
1333
+
1334
+
1335
+ class _patch(object):
1336
+
1337
+ attribute_name = None
1338
+ _active_patches = []
1339
+
1340
+ def __init__(
1341
+ self, getter, attribute, new, spec, create,
1342
+ spec_set, autospec, new_callable, kwargs, *, unsafe=False
1343
+ ):
1344
+ if new_callable is not None:
1345
+ if new is not DEFAULT:
1346
+ raise ValueError(
1347
+ "Cannot use 'new' and 'new_callable' together"
1348
+ )
1349
+ if autospec is not None:
1350
+ raise ValueError(
1351
+ "Cannot use 'autospec' and 'new_callable' together"
1352
+ )
1353
+ if not unsafe:
1354
+ _check_spec_arg_typos(kwargs)
1355
+ if _is_instance_mock(spec):
1356
+ raise InvalidSpecError(
1357
+ f'Cannot spec attr {attribute!r} as the spec '
1358
+ f'has already been mocked out. [spec={spec!r}]')
1359
+ if _is_instance_mock(spec_set):
1360
+ raise InvalidSpecError(
1361
+ f'Cannot spec attr {attribute!r} as the spec_set '
1362
+ f'target has already been mocked out. [spec_set={spec_set!r}]')
1363
+
1364
+ self.getter = getter
1365
+ self.attribute = attribute
1366
+ self.new = new
1367
+ self.new_callable = new_callable
1368
+ self.spec = spec
1369
+ self.create = create
1370
+ self.has_local = False
1371
+ self.spec_set = spec_set
1372
+ self.autospec = autospec
1373
+ self.kwargs = kwargs
1374
+ self.additional_patchers = []
1375
+ self.is_started = False
1376
+
1377
+
1378
+ def copy(self):
1379
+ patcher = _patch(
1380
+ self.getter, self.attribute, self.new, self.spec,
1381
+ self.create, self.spec_set,
1382
+ self.autospec, self.new_callable, self.kwargs
1383
+ )
1384
+ patcher.attribute_name = self.attribute_name
1385
+ patcher.additional_patchers = [
1386
+ p.copy() for p in self.additional_patchers
1387
+ ]
1388
+ return patcher
1389
+
1390
+
1391
+ def __call__(self, func):
1392
+ if isinstance(func, type):
1393
+ return self.decorate_class(func)
1394
+ if inspect.iscoroutinefunction(func):
1395
+ return self.decorate_async_callable(func)
1396
+ return self.decorate_callable(func)
1397
+
1398
+
1399
+ def decorate_class(self, klass):
1400
+ for attr in dir(klass):
1401
+ if not attr.startswith(patch.TEST_PREFIX):
1402
+ continue
1403
+
1404
+ attr_value = getattr(klass, attr)
1405
+ if not hasattr(attr_value, "__call__"):
1406
+ continue
1407
+
1408
+ patcher = self.copy()
1409
+ setattr(klass, attr, patcher(attr_value))
1410
+ return klass
1411
+
1412
+
1413
+ @contextlib.contextmanager
1414
+ def decoration_helper(self, patched, args, keywargs):
1415
+ extra_args = []
1416
+ with contextlib.ExitStack() as exit_stack:
1417
+ for patching in patched.patchings:
1418
+ arg = exit_stack.enter_context(patching)
1419
+ if patching.attribute_name is not None:
1420
+ keywargs.update(arg)
1421
+ elif patching.new is DEFAULT:
1422
+ extra_args.append(arg)
1423
+
1424
+ args += tuple(extra_args)
1425
+ yield (args, keywargs)
1426
+
1427
+
1428
+ def decorate_callable(self, func):
1429
+ # NB. Keep the method in sync with decorate_async_callable()
1430
+ if hasattr(func, 'patchings'):
1431
+ func.patchings.append(self)
1432
+ return func
1433
+
1434
+ @wraps(func)
1435
+ def patched(*args, **keywargs):
1436
+ with self.decoration_helper(patched,
1437
+ args,
1438
+ keywargs) as (newargs, newkeywargs):
1439
+ return func(*newargs, **newkeywargs)
1440
+
1441
+ patched.patchings = [self]
1442
+ return patched
1443
+
1444
+
1445
+ def decorate_async_callable(self, func):
1446
+ # NB. Keep the method in sync with decorate_callable()
1447
+ if hasattr(func, 'patchings'):
1448
+ func.patchings.append(self)
1449
+ return func
1450
+
1451
+ @wraps(func)
1452
+ async def patched(*args, **keywargs):
1453
+ with self.decoration_helper(patched,
1454
+ args,
1455
+ keywargs) as (newargs, newkeywargs):
1456
+ return await func(*newargs, **newkeywargs)
1457
+
1458
+ patched.patchings = [self]
1459
+ return patched
1460
+
1461
+
1462
+ def get_original(self):
1463
+ target = self.getter()
1464
+ name = self.attribute
1465
+
1466
+ original = DEFAULT
1467
+ local = False
1468
+
1469
+ try:
1470
+ original = target.__dict__[name]
1471
+ except (AttributeError, KeyError):
1472
+ original = getattr(target, name, DEFAULT)
1473
+ else:
1474
+ local = True
1475
+
1476
+ if name in _builtins and isinstance(target, ModuleType):
1477
+ self.create = True
1478
+
1479
+ if not self.create and original is DEFAULT:
1480
+ raise AttributeError(
1481
+ "%s does not have the attribute %r" % (target, name)
1482
+ )
1483
+ return original, local
1484
+
1485
+
1486
+ def __enter__(self):
1487
+ """Perform the patch."""
1488
+ if self.is_started:
1489
+ raise RuntimeError("Patch is already started")
1490
+
1491
+ new, spec, spec_set = self.new, self.spec, self.spec_set
1492
+ autospec, kwargs = self.autospec, self.kwargs
1493
+ new_callable = self.new_callable
1494
+ self.target = self.getter()
1495
+
1496
+ # normalise False to None
1497
+ if spec is False:
1498
+ spec = None
1499
+ if spec_set is False:
1500
+ spec_set = None
1501
+ if autospec is False:
1502
+ autospec = None
1503
+
1504
+ if spec is not None and autospec is not None:
1505
+ raise TypeError("Can't specify spec and autospec")
1506
+ if ((spec is not None or autospec is not None) and
1507
+ spec_set not in (True, None)):
1508
+ raise TypeError("Can't provide explicit spec_set *and* spec or autospec")
1509
+
1510
+ original, local = self.get_original()
1511
+
1512
+ if (isinstance(original, LazyImportType)
1513
+ and (spec is True or spec_set is True or autospec is True)):
1514
+ original = original.resolve()
1515
+
1516
+ if new is DEFAULT and autospec is None:
1517
+ inherit = False
1518
+ if spec is True:
1519
+ # set spec to the object we are replacing
1520
+ spec = original
1521
+ if spec_set is True:
1522
+ spec_set = original
1523
+ spec = None
1524
+ elif spec is not None:
1525
+ if spec_set is True:
1526
+ spec_set = spec
1527
+ spec = None
1528
+ elif spec_set is True:
1529
+ spec_set = original
1530
+
1531
+ if spec is not None or spec_set is not None:
1532
+ if original is DEFAULT:
1533
+ raise TypeError("Can't use 'spec' with create=True")
1534
+ if isinstance(original, type):
1535
+ # If we're patching out a class and there is a spec
1536
+ inherit = True
1537
+
1538
+ # Determine the Klass to use
1539
+ if new_callable is not None:
1540
+ Klass = new_callable
1541
+ elif spec is None and _is_async_obj(original):
1542
+ Klass = AsyncMock
1543
+ elif spec is not None or spec_set is not None:
1544
+ this_spec = spec
1545
+ if spec_set is not None:
1546
+ this_spec = spec_set
1547
+ if _is_list(this_spec):
1548
+ not_callable = '__call__' not in this_spec
1549
+ else:
1550
+ not_callable = not callable(this_spec)
1551
+ if _is_async_obj(this_spec):
1552
+ Klass = AsyncMock
1553
+ elif not_callable:
1554
+ Klass = NonCallableMagicMock
1555
+ else:
1556
+ Klass = MagicMock
1557
+ else:
1558
+ Klass = MagicMock
1559
+
1560
+ _kwargs = {}
1561
+ if spec is not None:
1562
+ _kwargs['spec'] = spec
1563
+ if spec_set is not None:
1564
+ _kwargs['spec_set'] = spec_set
1565
+
1566
+ # add a name to mocks
1567
+ if (isinstance(Klass, type) and
1568
+ issubclass(Klass, NonCallableMock) and self.attribute):
1569
+ _kwargs['name'] = self.attribute
1570
+
1571
+ _kwargs.update(kwargs)
1572
+ new = Klass(**_kwargs)
1573
+
1574
+ if inherit and _is_instance_mock(new):
1575
+ # we can only tell if the instance should be callable if the
1576
+ # spec is not a list
1577
+ this_spec = spec
1578
+ if spec_set is not None:
1579
+ this_spec = spec_set
1580
+ if (not _is_list(this_spec) and not
1581
+ _instance_callable(this_spec)):
1582
+ Klass = NonCallableMagicMock
1583
+
1584
+ _kwargs.pop('name')
1585
+ new.return_value = Klass(_new_parent=new, _new_name='()',
1586
+ **_kwargs)
1587
+ elif autospec is not None:
1588
+ # spec is ignored, new *must* be default, spec_set is treated
1589
+ # as a boolean. Should we check spec is not None and that spec_set
1590
+ # is a bool?
1591
+ if new is not DEFAULT:
1592
+ raise TypeError(
1593
+ "autospec creates the mock for you. Can't specify "
1594
+ "autospec and new."
1595
+ )
1596
+ if original is DEFAULT:
1597
+ raise TypeError("Can't use 'autospec' with create=True")
1598
+ spec_set = bool(spec_set)
1599
+ if autospec is True:
1600
+ autospec = original
1601
+
1602
+ if _is_instance_mock(self.target):
1603
+ raise InvalidSpecError(
1604
+ f'Cannot autospec attr {self.attribute!r} as the patch '
1605
+ f'target has already been mocked out. '
1606
+ f'[target={self.target!r}, attr={autospec!r}]')
1607
+ if _is_instance_mock(autospec):
1608
+ target_name = getattr(self.target, '__name__', self.target)
1609
+ raise InvalidSpecError(
1610
+ f'Cannot autospec attr {self.attribute!r} from target '
1611
+ f'{target_name!r} as it has already been mocked out. '
1612
+ f'[target={self.target!r}, attr={autospec!r}]')
1613
+
1614
+ new = create_autospec(autospec, spec_set=spec_set,
1615
+ _name=self.attribute, **kwargs)
1616
+ elif kwargs:
1617
+ # can't set keyword args when we aren't creating the mock
1618
+ # XXXX If new is a Mock we could call new.configure_mock(**kwargs)
1619
+ raise TypeError("Can't pass kwargs to a mock we aren't creating")
1620
+
1621
+ new_attr = new
1622
+
1623
+ self.temp_original = original
1624
+ self.is_local = local
1625
+ self._exit_stack = contextlib.ExitStack()
1626
+ self.is_started = True
1627
+ try:
1628
+ setattr(self.target, self.attribute, new_attr)
1629
+ if self.attribute_name is not None:
1630
+ extra_args = {}
1631
+ if self.new is DEFAULT:
1632
+ extra_args[self.attribute_name] = new
1633
+ for patching in self.additional_patchers:
1634
+ arg = self._exit_stack.enter_context(patching)
1635
+ if patching.new is DEFAULT:
1636
+ extra_args.update(arg)
1637
+ return extra_args
1638
+
1639
+ return new
1640
+ except:
1641
+ if not self.__exit__(*sys.exc_info()):
1642
+ raise
1643
+
1644
+ def __exit__(self, *exc_info):
1645
+ """Undo the patch."""
1646
+ if not self.is_started:
1647
+ return
1648
+
1649
+ if self.is_local and self.temp_original is not DEFAULT:
1650
+ setattr(self.target, self.attribute, self.temp_original)
1651
+ else:
1652
+ delattr(self.target, self.attribute)
1653
+ if not self.create and (not hasattr(self.target, self.attribute) or
1654
+ self.attribute in ('__doc__', '__module__',
1655
+ '__defaults__', '__annotations__',
1656
+ '__kwdefaults__')):
1657
+ # needed for proxy objects like django settings
1658
+ setattr(self.target, self.attribute, self.temp_original)
1659
+
1660
+ del self.temp_original
1661
+ del self.is_local
1662
+ del self.target
1663
+ exit_stack = self._exit_stack
1664
+ del self._exit_stack
1665
+ self.is_started = False
1666
+ return exit_stack.__exit__(*exc_info)
1667
+
1668
+
1669
+ def start(self):
1670
+ """Activate a patch, returning any created mock."""
1671
+ result = self.__enter__()
1672
+ self._active_patches.append(self)
1673
+ return result
1674
+
1675
+
1676
+ def stop(self):
1677
+ """Stop an active patch."""
1678
+ try:
1679
+ self._active_patches.remove(self)
1680
+ except ValueError:
1681
+ # If the patch hasn't been started this will fail
1682
+ return None
1683
+
1684
+ return self.__exit__(None, None, None)
1685
+
1686
+
1687
+
1688
+ def _get_target(target):
1689
+ try:
1690
+ target, attribute = target.rsplit('.', 1)
1691
+ except (TypeError, ValueError, AttributeError):
1692
+ raise TypeError(
1693
+ f"Need a valid target to patch. You supplied: {target!r}")
1694
+ return partial(pkgutil.resolve_name, target), attribute
1695
+
1696
+
1697
+ def _patch_object(
1698
+ target, attribute, new=DEFAULT, spec=None,
1699
+ create=False, spec_set=None, autospec=None,
1700
+ new_callable=None, *, unsafe=False, **kwargs
1701
+ ):
1702
+ """
1703
+ patch the named member (`attribute`) on an object (`target`) with a mock
1704
+ object.
1705
+
1706
+ `patch.object` can be used as a decorator, class decorator or a context
1707
+ manager. Arguments `new`, `spec`, `create`, `spec_set`,
1708
+ `autospec` and `new_callable` have the same meaning as for `patch`. Like
1709
+ `patch`, `patch.object` takes arbitrary keyword arguments for configuring
1710
+ the mock object it creates.
1711
+
1712
+ When used as a class decorator `patch.object` honours `patch.TEST_PREFIX`
1713
+ for choosing which methods to wrap.
1714
+ """
1715
+ if type(target) is str:
1716
+ raise TypeError(
1717
+ f"{target!r} must be the actual object to be patched, not a str"
1718
+ )
1719
+ getter = lambda: target
1720
+ return _patch(
1721
+ getter, attribute, new, spec, create,
1722
+ spec_set, autospec, new_callable, kwargs, unsafe=unsafe
1723
+ )
1724
+
1725
+
1726
+ def _patch_multiple(target, spec=None, create=False, spec_set=None,
1727
+ autospec=None, new_callable=None, **kwargs):
1728
+ """Perform multiple patches in a single call. It takes the object to be
1729
+ patched (either as an object or a string to fetch the object by importing)
1730
+ and keyword arguments for the patches::
1731
+
1732
+ with patch.multiple(settings, FIRST_PATCH='one', SECOND_PATCH='two'):
1733
+ ...
1734
+
1735
+ Use `DEFAULT` as the value if you want `patch.multiple` to create
1736
+ mocks for you. In this case the created mocks are passed into a decorated
1737
+ function by keyword, and a dictionary is returned when `patch.multiple` is
1738
+ used as a context manager.
1739
+
1740
+ `patch.multiple` can be used as a decorator, class decorator or a context
1741
+ manager. The arguments `spec`, `spec_set`, `create`,
1742
+ `autospec` and `new_callable` have the same meaning as for `patch`. These
1743
+ arguments will be applied to *all* patches done by `patch.multiple`.
1744
+
1745
+ When used as a class decorator `patch.multiple` honours `patch.TEST_PREFIX`
1746
+ for choosing which methods to wrap.
1747
+ """
1748
+ if type(target) is str:
1749
+ getter = partial(pkgutil.resolve_name, target)
1750
+ else:
1751
+ getter = lambda: target
1752
+
1753
+ if not kwargs:
1754
+ raise ValueError(
1755
+ 'Must supply at least one keyword argument with patch.multiple'
1756
+ )
1757
+ # need to wrap in a list for python 3, where items is a view
1758
+ items = list(kwargs.items())
1759
+ attribute, new = items[0]
1760
+ patcher = _patch(
1761
+ getter, attribute, new, spec, create, spec_set,
1762
+ autospec, new_callable, {}
1763
+ )
1764
+ patcher.attribute_name = attribute
1765
+ for attribute, new in items[1:]:
1766
+ this_patcher = _patch(
1767
+ getter, attribute, new, spec, create, spec_set,
1768
+ autospec, new_callable, {}
1769
+ )
1770
+ this_patcher.attribute_name = attribute
1771
+ patcher.additional_patchers.append(this_patcher)
1772
+ return patcher
1773
+
1774
+
1775
+ def patch(
1776
+ target, new=DEFAULT, spec=None, create=False,
1777
+ spec_set=None, autospec=None, new_callable=None, *, unsafe=False, **kwargs
1778
+ ):
1779
+ """
1780
+ `patch` acts as a function decorator, class decorator or a context
1781
+ manager. Inside the body of the function or with statement, the `target`
1782
+ is patched with a `new` object. When the function/with statement exits
1783
+ the patch is undone.
1784
+
1785
+ If `new` is omitted, then the target is replaced with an
1786
+ `AsyncMock` if the patched object is an async function or a
1787
+ `MagicMock` otherwise. If `patch` is used as a decorator and `new` is
1788
+ omitted, the created mock is passed in as an extra argument to the
1789
+ decorated function. If `patch` is used as a context manager the created
1790
+ mock is returned by the context manager.
1791
+
1792
+ `target` should be a string in the form `'package.module.ClassName'`. The
1793
+ `target` is imported and the specified object replaced with the `new`
1794
+ object, so the `target` must be importable from the environment you are
1795
+ calling `patch` from. The target is imported when the decorated function
1796
+ is executed, not at decoration time.
1797
+
1798
+ The `spec` and `spec_set` keyword arguments are passed to the `MagicMock`
1799
+ if patch is creating one for you.
1800
+
1801
+ In addition you can pass `spec=True` or `spec_set=True`, which causes
1802
+ patch to pass in the object being mocked as the spec/spec_set object.
1803
+
1804
+ `new_callable` allows you to specify a different class, or callable object,
1805
+ that will be called to create the `new` object. By default `AsyncMock` is
1806
+ used for async functions and `MagicMock` for the rest.
1807
+
1808
+ A more powerful form of `spec` is `autospec`. If you set `autospec=True`
1809
+ then the mock will be created with a spec from the object being replaced.
1810
+ All attributes of the mock will also have the spec of the corresponding
1811
+ attribute of the object being replaced. Methods and functions being
1812
+ mocked will have their arguments checked and will raise a `TypeError` if
1813
+ they are called with the wrong signature. For mocks replacing a class,
1814
+ their return value (the 'instance') will have the same spec as the class.
1815
+
1816
+ Instead of `autospec=True` you can pass `autospec=some_object` to use an
1817
+ arbitrary object as the spec instead of the one being replaced.
1818
+
1819
+ By default `patch` will fail to replace attributes that don't exist. If
1820
+ you pass in `create=True`, and the attribute doesn't exist, patch will
1821
+ create the attribute for you when the patched function is called, and
1822
+ delete it again afterwards. This is useful for writing tests against
1823
+ attributes that your production code creates at runtime. It is off by
1824
+ default because it can be dangerous. With it switched on you can write
1825
+ passing tests against APIs that don't actually exist!
1826
+
1827
+ Patch can be used as a `TestCase` class decorator. It works by
1828
+ decorating each test method in the class. This reduces the boilerplate
1829
+ code when your test methods share a common patchings set. `patch` finds
1830
+ tests by looking for method names that start with `patch.TEST_PREFIX`.
1831
+ By default this is `test`, which matches the way `unittest` finds tests.
1832
+ You can specify an alternative prefix by setting `patch.TEST_PREFIX`.
1833
+
1834
+ Patch can be used as a context manager, with the with statement. Here the
1835
+ patching applies to the indented block after the with statement. If you
1836
+ use "as" then the patched object will be bound to the name after the
1837
+ "as"; very useful if `patch` is creating a mock object for you.
1838
+
1839
+ Patch will raise a `RuntimeError` if passed some common misspellings of
1840
+ the arguments autospec and spec_set. Pass the argument `unsafe` with the
1841
+ value True to disable that check.
1842
+
1843
+ `patch` takes arbitrary keyword arguments. These will be passed to
1844
+ `AsyncMock` if the patched object is asynchronous, to `MagicMock`
1845
+ otherwise or to `new_callable` if specified.
1846
+
1847
+ `patch.dict(...)`, `patch.multiple(...)` and `patch.object(...)` are
1848
+ available for alternate use-cases.
1849
+ """
1850
+ getter, attribute = _get_target(target)
1851
+ return _patch(
1852
+ getter, attribute, new, spec, create,
1853
+ spec_set, autospec, new_callable, kwargs, unsafe=unsafe
1854
+ )
1855
+
1856
+
1857
+ class _patch_dict(object):
1858
+ """
1859
+ Patch a dictionary, or dictionary like object, and restore the dictionary
1860
+ to its original state after the test, where the restored dictionary is
1861
+ a copy of the dictionary as it was before the test.
1862
+
1863
+ `in_dict` can be a dictionary or a mapping like container. If it is a
1864
+ mapping then it must at least support getting, setting and deleting items
1865
+ plus iterating over keys.
1866
+
1867
+ `in_dict` can also be a string specifying the name of the dictionary, which
1868
+ will then be fetched by importing it.
1869
+
1870
+ `values` can be a dictionary of values to set in the dictionary. `values`
1871
+ can also be an iterable of `(key, value)` pairs.
1872
+
1873
+ If `clear` is True then the dictionary will be cleared before the new
1874
+ values are set.
1875
+
1876
+ `patch.dict` can also be called with arbitrary keyword arguments to set
1877
+ values in the dictionary::
1878
+
1879
+ with patch.dict('sys.modules', mymodule=Mock(), other_module=Mock()):
1880
+ ...
1881
+
1882
+ `patch.dict` can be used as a context manager, decorator or class
1883
+ decorator. When used as a class decorator `patch.dict` honours
1884
+ `patch.TEST_PREFIX` for choosing which methods to wrap.
1885
+ """
1886
+
1887
+ def __init__(self, in_dict, values=(), clear=False, **kwargs):
1888
+ self.in_dict = in_dict
1889
+ # support any argument supported by dict(...) constructor
1890
+ self.values = dict(values)
1891
+ self.values.update(kwargs)
1892
+ self.clear = clear
1893
+ self._original = None
1894
+
1895
+
1896
+ def __call__(self, f):
1897
+ if isinstance(f, type):
1898
+ return self.decorate_class(f)
1899
+ if inspect.iscoroutinefunction(f):
1900
+ return self.decorate_async_callable(f)
1901
+ return self.decorate_callable(f)
1902
+
1903
+
1904
+ def decorate_callable(self, f):
1905
+ @wraps(f)
1906
+ def _inner(*args, **kw):
1907
+ self._patch_dict()
1908
+ try:
1909
+ return f(*args, **kw)
1910
+ finally:
1911
+ self._unpatch_dict()
1912
+
1913
+ return _inner
1914
+
1915
+
1916
+ def decorate_async_callable(self, f):
1917
+ @wraps(f)
1918
+ async def _inner(*args, **kw):
1919
+ self._patch_dict()
1920
+ try:
1921
+ return await f(*args, **kw)
1922
+ finally:
1923
+ self._unpatch_dict()
1924
+
1925
+ return _inner
1926
+
1927
+
1928
+ def decorate_class(self, klass):
1929
+ for attr in dir(klass):
1930
+ attr_value = getattr(klass, attr)
1931
+ if (attr.startswith(patch.TEST_PREFIX) and
1932
+ hasattr(attr_value, "__call__")):
1933
+ decorator = _patch_dict(self.in_dict, self.values, self.clear)
1934
+ decorated = decorator(attr_value)
1935
+ setattr(klass, attr, decorated)
1936
+ return klass
1937
+
1938
+
1939
+ def __enter__(self):
1940
+ """Patch the dict."""
1941
+ self._patch_dict()
1942
+ return self.in_dict
1943
+
1944
+
1945
+ def _patch_dict(self):
1946
+ values = self.values
1947
+ if isinstance(self.in_dict, str):
1948
+ self.in_dict = pkgutil.resolve_name(self.in_dict)
1949
+ in_dict = self.in_dict
1950
+ clear = self.clear
1951
+
1952
+ try:
1953
+ original = in_dict.copy()
1954
+ except AttributeError:
1955
+ # dict like object with no copy method
1956
+ # must support iteration over keys
1957
+ original = {}
1958
+ for key in in_dict:
1959
+ original[key] = in_dict[key]
1960
+ self._original = original
1961
+
1962
+ if clear:
1963
+ _clear_dict(in_dict)
1964
+
1965
+ try:
1966
+ in_dict.update(values)
1967
+ except AttributeError:
1968
+ # dict like object with no update method
1969
+ for key in values:
1970
+ in_dict[key] = values[key]
1971
+
1972
+
1973
+ def _unpatch_dict(self):
1974
+ in_dict = self.in_dict
1975
+ original = self._original
1976
+
1977
+ _clear_dict(in_dict)
1978
+
1979
+ try:
1980
+ in_dict.update(original)
1981
+ except AttributeError:
1982
+ for key in original:
1983
+ in_dict[key] = original[key]
1984
+
1985
+
1986
+ def __exit__(self, *args):
1987
+ """Unpatch the dict."""
1988
+ if self._original is not None:
1989
+ self._unpatch_dict()
1990
+ return False
1991
+
1992
+
1993
+ def start(self):
1994
+ """Activate a patch, returning any created mock."""
1995
+ result = self.__enter__()
1996
+ _patch._active_patches.append(self)
1997
+ return result
1998
+
1999
+
2000
+ def stop(self):
2001
+ """Stop an active patch."""
2002
+ try:
2003
+ _patch._active_patches.remove(self)
2004
+ except ValueError:
2005
+ # If the patch hasn't been started this will fail
2006
+ return None
2007
+
2008
+ return self.__exit__(None, None, None)
2009
+
2010
+
2011
+ def _clear_dict(in_dict):
2012
+ try:
2013
+ in_dict.clear()
2014
+ except AttributeError:
2015
+ keys = list(in_dict)
2016
+ for key in keys:
2017
+ del in_dict[key]
2018
+
2019
+
2020
+ def _patch_stopall():
2021
+ """Stop all active patches. LIFO to unroll nested patches."""
2022
+ for patch in reversed(_patch._active_patches):
2023
+ patch.stop()
2024
+
2025
+
2026
+ patch.object = _patch_object
2027
+ patch.dict = _patch_dict
2028
+ patch.multiple = _patch_multiple
2029
+ patch.stopall = _patch_stopall
2030
+ patch.TEST_PREFIX = 'test'
2031
+
2032
+ magic_methods = (
2033
+ "lt le gt ge eq ne "
2034
+ "getitem setitem delitem "
2035
+ "len contains iter "
2036
+ "hash str sizeof "
2037
+ "enter exit "
2038
+ # we added divmod and rdivmod here instead of numerics
2039
+ # because there is no idivmod
2040
+ "divmod rdivmod neg pos abs invert "
2041
+ "complex int float index "
2042
+ "round trunc floor ceil "
2043
+ "bool next "
2044
+ "fspath "
2045
+ "aiter "
2046
+ )
2047
+
2048
+ numerics = (
2049
+ "add sub mul matmul truediv floordiv mod lshift rshift and xor or pow"
2050
+ )
2051
+ inplace = ' '.join('i%s' % n for n in numerics.split())
2052
+ right = ' '.join('r%s' % n for n in numerics.split())
2053
+
2054
+ # not including __prepare__, __instancecheck__, __subclasscheck__
2055
+ # (as they are metaclass methods)
2056
+ # __del__ is not supported at all as it causes problems if it exists
2057
+
2058
+ _non_defaults = {
2059
+ '__get__', '__set__', '__delete__', '__reversed__', '__missing__',
2060
+ '__reduce__', '__reduce_ex__', '__getinitargs__', '__getnewargs__',
2061
+ '__getstate__', '__setstate__', '__getformat__',
2062
+ '__repr__', '__dir__', '__subclasses__', '__format__',
2063
+ '__getnewargs_ex__',
2064
+ }
2065
+
2066
+
2067
+ def _get_method(name, func):
2068
+ "Turns a callable object (like a mock) into a real function"
2069
+ def method(self, /, *args, **kw):
2070
+ return func(self, *args, **kw)
2071
+ method.__name__ = name
2072
+ return method
2073
+
2074
+
2075
+ _magics = {
2076
+ '__%s__' % method for method in
2077
+ ' '.join([magic_methods, numerics, inplace, right]).split()
2078
+ }
2079
+
2080
+ # Magic methods used for async `with` statements
2081
+ _async_method_magics = {"__aenter__", "__aexit__", "__anext__"}
2082
+ # Magic methods that are only used with async calls but are synchronous functions themselves
2083
+ _sync_async_magics = {"__aiter__"}
2084
+ _async_magics = _async_method_magics | _sync_async_magics
2085
+
2086
+ _all_sync_magics = _magics | _non_defaults
2087
+ _all_magics = _all_sync_magics | _async_magics
2088
+
2089
+ _unsupported_magics = {
2090
+ '__getattr__', '__setattr__',
2091
+ '__init__', '__new__', '__prepare__',
2092
+ '__instancecheck__', '__subclasscheck__',
2093
+ '__del__'
2094
+ }
2095
+
2096
+ _calculate_return_value = {
2097
+ '__hash__': lambda self: object.__hash__(self),
2098
+ '__str__': lambda self: object.__str__(self),
2099
+ '__sizeof__': lambda self: object.__sizeof__(self),
2100
+ '__fspath__': lambda self: f"{type(self).__name__}/{self._extract_mock_name()}/{id(self)}",
2101
+ }
2102
+
2103
+ _return_values = {
2104
+ '__lt__': NotImplemented,
2105
+ '__gt__': NotImplemented,
2106
+ '__le__': NotImplemented,
2107
+ '__ge__': NotImplemented,
2108
+ '__int__': 1,
2109
+ '__contains__': False,
2110
+ '__len__': 0,
2111
+ '__exit__': False,
2112
+ '__complex__': 1j,
2113
+ '__float__': 1.0,
2114
+ '__bool__': True,
2115
+ '__index__': 1,
2116
+ '__aexit__': False,
2117
+ }
2118
+
2119
+
2120
+ def _get_eq(self):
2121
+ def __eq__(other):
2122
+ ret_val = self.__eq__._mock_return_value
2123
+ if ret_val is not DEFAULT:
2124
+ return ret_val
2125
+ if self is other:
2126
+ return True
2127
+ return NotImplemented
2128
+ return __eq__
2129
+
2130
+ def _get_ne(self):
2131
+ def __ne__(other):
2132
+ if self.__ne__._mock_return_value is not DEFAULT:
2133
+ return DEFAULT
2134
+ if self is other:
2135
+ return False
2136
+ return NotImplemented
2137
+ return __ne__
2138
+
2139
+ def _get_iter(self):
2140
+ def __iter__():
2141
+ ret_val = self.__iter__._mock_return_value
2142
+ if ret_val is DEFAULT:
2143
+ return iter([])
2144
+ # if ret_val was already an iterator, then calling iter on it should
2145
+ # return the iterator unchanged
2146
+ return iter(ret_val)
2147
+ return __iter__
2148
+
2149
+ def _get_async_iter(self):
2150
+ def __aiter__():
2151
+ ret_val = self.__aiter__._mock_return_value
2152
+ if ret_val is DEFAULT:
2153
+ return _AsyncIterator(iter([]))
2154
+ return _AsyncIterator(iter(ret_val))
2155
+ return __aiter__
2156
+
2157
+ _side_effect_methods = {
2158
+ '__eq__': _get_eq,
2159
+ '__ne__': _get_ne,
2160
+ '__iter__': _get_iter,
2161
+ '__aiter__': _get_async_iter
2162
+ }
2163
+
2164
+
2165
+
2166
+ def _set_return_value(mock, method, name):
2167
+ fixed = _return_values.get(name, DEFAULT)
2168
+ if fixed is not DEFAULT:
2169
+ method.return_value = fixed
2170
+ return
2171
+
2172
+ return_calculator = _calculate_return_value.get(name)
2173
+ if return_calculator is not None:
2174
+ return_value = return_calculator(mock)
2175
+ method.return_value = return_value
2176
+ return
2177
+
2178
+ side_effector = _side_effect_methods.get(name)
2179
+ if side_effector is not None:
2180
+ method.side_effect = side_effector(mock)
2181
+
2182
+
2183
+
2184
+ class MagicMixin(Base):
2185
+ def __init__(self, /, *args, **kw):
2186
+ self._mock_set_magics() # make magic work for kwargs in init
2187
+ _safe_super(MagicMixin, self).__init__(*args, **kw)
2188
+ self._mock_set_magics() # fix magic broken by upper level init
2189
+
2190
+
2191
+ def _mock_set_magics(self):
2192
+ orig_magics = _magics | _async_method_magics
2193
+ these_magics = orig_magics
2194
+
2195
+ if getattr(self, "_mock_methods", None) is not None:
2196
+ these_magics = orig_magics.intersection(self._mock_methods)
2197
+ remove_magics = orig_magics - these_magics
2198
+
2199
+ for entry in remove_magics:
2200
+ if entry in type(self).__dict__:
2201
+ # remove unneeded magic methods
2202
+ delattr(self, entry)
2203
+
2204
+ # don't overwrite existing attributes if called a second time
2205
+ these_magics = these_magics - set(type(self).__dict__)
2206
+
2207
+ _type = type(self)
2208
+ for entry in these_magics:
2209
+ setattr(_type, entry, MagicProxy(entry, self))
2210
+
2211
+
2212
+
2213
+ class NonCallableMagicMock(MagicMixin, NonCallableMock):
2214
+ """A version of `MagicMock` that isn't callable."""
2215
+ def mock_add_spec(self, spec, spec_set=False):
2216
+ """Add a spec to a mock. `spec` can either be an object or a
2217
+ list of strings. Only attributes on the `spec` can be fetched as
2218
+ attributes from the mock.
2219
+
2220
+ If `spec_set` is True then only attributes on the spec can be set."""
2221
+ self._mock_add_spec(spec, spec_set)
2222
+ self._mock_set_magics()
2223
+
2224
+
2225
+ class AsyncMagicMixin(MagicMixin):
2226
+ pass
2227
+
2228
+
2229
+ class MagicMock(MagicMixin, Mock):
2230
+ """
2231
+ MagicMock is a subclass of Mock with default implementations
2232
+ of most of the magic methods. You can use MagicMock without having to
2233
+ configure the magic methods yourself.
2234
+
2235
+ If you use the `spec` or `spec_set` arguments then *only* magic
2236
+ methods that exist in the spec will be created.
2237
+
2238
+ Attributes and the return value of a `MagicMock` will also be `MagicMocks`.
2239
+ """
2240
+ def mock_add_spec(self, spec, spec_set=False):
2241
+ """Add a spec to a mock. `spec` can either be an object or a
2242
+ list of strings. Only attributes on the `spec` can be fetched as
2243
+ attributes from the mock.
2244
+
2245
+ If `spec_set` is True then only attributes on the spec can be set."""
2246
+ self._mock_add_spec(spec, spec_set)
2247
+ self._mock_set_magics()
2248
+
2249
+ def reset_mock(self, /, *args, return_value: bool = False, **kwargs):
2250
+ if (
2251
+ return_value
2252
+ and self._mock_name
2253
+ and _is_magic(self._mock_name)
2254
+ ):
2255
+ # Don't reset return values for magic methods,
2256
+ # otherwise `m.__str__` will start
2257
+ # to return `MagicMock` instances, instead of `str` instances.
2258
+ return_value = False
2259
+ super().reset_mock(*args, return_value=return_value, **kwargs)
2260
+
2261
+
2262
+ class MagicProxy(Base):
2263
+ def __init__(self, name, parent):
2264
+ self.name = name
2265
+ self.parent = parent
2266
+
2267
+ def create_mock(self):
2268
+ entry = self.name
2269
+ parent = self.parent
2270
+ m = parent._get_child_mock(name=entry, _new_name=entry,
2271
+ _new_parent=parent)
2272
+ setattr(parent, entry, m)
2273
+ _set_return_value(parent, m, entry)
2274
+ return m
2275
+
2276
+ def __get__(self, obj, _type=None):
2277
+ return self.create_mock()
2278
+
2279
+
2280
+ try:
2281
+ _CODE_SIG = inspect.signature(partial(CodeType.__init__, None))
2282
+ _CODE_ATTRS = dir(CodeType)
2283
+ except ValueError:
2284
+ _CODE_SIG = None
2285
+
2286
+
2287
+ class AsyncMockMixin(Base):
2288
+ await_count = _delegating_property('await_count')
2289
+ await_args = _delegating_property('await_args')
2290
+ await_args_list = _delegating_property('await_args_list')
2291
+
2292
+ def __init__(self, /, *args, **kwargs):
2293
+ super().__init__(*args, **kwargs)
2294
+ # iscoroutinefunction() checks _is_coroutine property to say if an
2295
+ # object is a coroutine. Without this check it looks to see if it is a
2296
+ # function/method, which in this case it is not (since it is an
2297
+ # AsyncMock).
2298
+ # It is set through __dict__ because when spec_set is True, this
2299
+ # attribute is likely undefined.
2300
+ self.__dict__['_is_coroutine'] = asyncio.coroutines._is_coroutine
2301
+ self.__dict__['_mock_await_count'] = 0
2302
+ self.__dict__['_mock_await_args'] = None
2303
+ self.__dict__['_mock_await_args_list'] = _CallList()
2304
+ if _CODE_SIG:
2305
+ code_mock = NonCallableMock(spec_set=_CODE_ATTRS)
2306
+ code_mock.__dict__["_spec_class"] = CodeType
2307
+ code_mock.__dict__["_spec_signature"] = _CODE_SIG
2308
+ else:
2309
+ code_mock = NonCallableMock(spec_set=CodeType)
2310
+ code_mock.co_flags = (
2311
+ inspect.CO_COROUTINE
2312
+ + inspect.CO_VARARGS
2313
+ + inspect.CO_VARKEYWORDS
2314
+ )
2315
+ code_mock.co_argcount = 0
2316
+ code_mock.co_varnames = ('args', 'kwargs')
2317
+ code_mock.co_posonlyargcount = 0
2318
+ code_mock.co_kwonlyargcount = 0
2319
+ self.__dict__['__code__'] = code_mock
2320
+ self.__dict__['__name__'] = 'AsyncMock'
2321
+ self.__dict__['__defaults__'] = tuple()
2322
+ self.__dict__['__kwdefaults__'] = {}
2323
+ self.__dict__['__annotations__'] = None
2324
+
2325
+ async def _execute_mock_call(self, /, *args, **kwargs):
2326
+ # This is nearly just like super(), except for special handling
2327
+ # of coroutines
2328
+
2329
+ _call = _Call((args, kwargs), two=True)
2330
+ self.await_count += 1
2331
+ self.await_args = _call
2332
+ self.await_args_list.append(_call)
2333
+
2334
+ effect = self.side_effect
2335
+ if effect is not None:
2336
+ if _is_exception(effect):
2337
+ raise effect
2338
+ elif not _callable(effect):
2339
+ try:
2340
+ result = next(effect)
2341
+ except StopIteration:
2342
+ # It is impossible to propagate a StopIteration
2343
+ # through coroutines because of PEP 479
2344
+ raise StopAsyncIteration
2345
+ if _is_exception(result):
2346
+ raise result
2347
+ elif iscoroutinefunction(effect):
2348
+ result = await effect(*args, **kwargs)
2349
+ else:
2350
+ result = effect(*args, **kwargs)
2351
+
2352
+ if result is not DEFAULT:
2353
+ return result
2354
+
2355
+ if self._mock_return_value is not DEFAULT:
2356
+ return self.return_value
2357
+
2358
+ if self._mock_wraps is not None:
2359
+ if iscoroutinefunction(self._mock_wraps):
2360
+ return await self._mock_wraps(*args, **kwargs)
2361
+ return self._mock_wraps(*args, **kwargs)
2362
+
2363
+ return self.return_value
2364
+
2365
+ def assert_awaited(self):
2366
+ """
2367
+ Assert that the mock was awaited at least once.
2368
+ """
2369
+ if self.await_count == 0:
2370
+ msg = f"Expected {self._mock_name or 'mock'} to have been awaited."
2371
+ raise AssertionError(msg)
2372
+
2373
+ def assert_awaited_once(self):
2374
+ """
2375
+ Assert that the mock was awaited exactly once.
2376
+ """
2377
+ if not self.await_count == 1:
2378
+ msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
2379
+ f" Awaited {self.await_count} times.")
2380
+ raise AssertionError(msg)
2381
+
2382
+ def assert_awaited_with(self, /, *args, **kwargs):
2383
+ """
2384
+ Assert that the last await was with the specified arguments.
2385
+ """
2386
+ if self.await_args is None:
2387
+ expected = self._format_mock_call_signature(args, kwargs)
2388
+ raise AssertionError(f'Expected await: {expected}\nNot awaited')
2389
+
2390
+ def _error_message():
2391
+ msg = self._format_mock_failure_message(args, kwargs, action='await')
2392
+ return msg
2393
+
2394
+ expected = self._call_matcher(_Call((args, kwargs), two=True))
2395
+ actual = self._call_matcher(self.await_args)
2396
+ if actual != expected:
2397
+ cause = expected if isinstance(expected, Exception) else None
2398
+ raise AssertionError(_error_message()) from cause
2399
+
2400
+ def assert_awaited_once_with(self, /, *args, **kwargs):
2401
+ """
2402
+ Assert that the mock was awaited exactly once and with the specified
2403
+ arguments.
2404
+ """
2405
+ if not self.await_count == 1:
2406
+ msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once."
2407
+ f" Awaited {self.await_count} times.")
2408
+ raise AssertionError(msg)
2409
+ return self.assert_awaited_with(*args, **kwargs)
2410
+
2411
+ def assert_any_await(self, /, *args, **kwargs):
2412
+ """
2413
+ Assert the mock has ever been awaited with the specified arguments.
2414
+ """
2415
+ expected = self._call_matcher(_Call((args, kwargs), two=True))
2416
+ cause = expected if isinstance(expected, Exception) else None
2417
+ actual = [self._call_matcher(c) for c in self.await_args_list]
2418
+ if cause or expected not in _AnyComparer(actual):
2419
+ expected_string = self._format_mock_call_signature(args, kwargs)
2420
+ raise AssertionError(
2421
+ '%s await not found' % expected_string
2422
+ ) from cause
2423
+
2424
+ def assert_has_awaits(self, calls, any_order=False):
2425
+ """
2426
+ Assert the mock has been awaited with the specified calls.
2427
+ The :attr:`await_args_list` list is checked for the awaits.
2428
+
2429
+ If `any_order` is False (the default) then the awaits must be
2430
+ sequential. There can be extra calls before or after the
2431
+ specified awaits.
2432
+
2433
+ If `any_order` is True then the awaits can be in any order, but
2434
+ they must all appear in :attr:`await_args_list`.
2435
+ """
2436
+ expected = [self._call_matcher(c) for c in calls]
2437
+ cause = next((e for e in expected if isinstance(e, Exception)), None)
2438
+ all_awaits = _CallList(self._call_matcher(c) for c in self.await_args_list)
2439
+ if not any_order:
2440
+ if expected not in all_awaits:
2441
+ if cause is None:
2442
+ problem = 'Awaits not found.'
2443
+ else:
2444
+ problem = ('Error processing expected awaits.\n'
2445
+ 'Errors: {}').format(
2446
+ [e if isinstance(e, Exception) else None
2447
+ for e in expected])
2448
+ raise AssertionError(
2449
+ f'{problem}\n'
2450
+ f'Expected: {_CallList(calls)}\n'
2451
+ f'Actual: {self.await_args_list}'
2452
+ ) from cause
2453
+ return
2454
+
2455
+ all_awaits = list(all_awaits)
2456
+
2457
+ not_found = []
2458
+ for kall in expected:
2459
+ try:
2460
+ all_awaits.remove(kall)
2461
+ except ValueError:
2462
+ not_found.append(kall)
2463
+ if not_found:
2464
+ raise AssertionError(
2465
+ '%r not all found in await list' % (tuple(not_found),)
2466
+ ) from cause
2467
+
2468
+ def assert_not_awaited(self):
2469
+ """
2470
+ Assert that the mock was never awaited.
2471
+ """
2472
+ if self.await_count != 0:
2473
+ msg = (f"Expected {self._mock_name or 'mock'} to not have been awaited."
2474
+ f" Awaited {self.await_count} times.")
2475
+ raise AssertionError(msg)
2476
+
2477
+ def reset_mock(self, /, *args, **kwargs):
2478
+ """
2479
+ See :func:`.Mock.reset_mock()`
2480
+ """
2481
+ super().reset_mock(*args, **kwargs)
2482
+ self.await_count = 0
2483
+ self.await_args = None
2484
+ self.await_args_list = _CallList()
2485
+
2486
+
2487
+ class AsyncMock(AsyncMockMixin, AsyncMagicMixin, Mock):
2488
+ """
2489
+ Enhance :class:`Mock` with features allowing to mock
2490
+ an async function.
2491
+
2492
+ The :class:`AsyncMock` object will behave so the object is
2493
+ recognized as an async function, and the result of a call is an awaitable:
2494
+
2495
+ >>> mock = AsyncMock()
2496
+ >>> inspect.iscoroutinefunction(mock)
2497
+ True
2498
+ >>> inspect.isawaitable(mock())
2499
+ True
2500
+
2501
+
2502
+ The result of ``mock()`` is an async function which will have the outcome
2503
+ of ``side_effect`` or ``return_value``:
2504
+
2505
+ - if ``side_effect`` is a function, the async function will return the
2506
+ result of that function,
2507
+ - if ``side_effect`` is an exception, the async function will raise the
2508
+ exception,
2509
+ - if ``side_effect`` is an iterable, the async function will return the
2510
+ next value of the iterable, however, if the sequence of result is
2511
+ exhausted, ``StopIteration`` is raised immediately,
2512
+ - if ``side_effect`` is not defined, the async function will return the
2513
+ value defined by ``return_value``, hence, by default, the async function
2514
+ returns a new :class:`AsyncMock` object.
2515
+
2516
+ If the outcome of ``side_effect`` or ``return_value`` is an async function,
2517
+ the mock async function obtained when the mock object is called will be this
2518
+ async function itself (and not an async function returning an async
2519
+ function).
2520
+
2521
+ The test author can also specify a wrapped object with ``wraps``. In this
2522
+ case, the :class:`Mock` object behavior is the same as with an
2523
+ :class:`.Mock` object: the wrapped object may have methods
2524
+ defined as async function functions.
2525
+
2526
+ Based on Martin Richard's asynctest project.
2527
+ """
2528
+
2529
+
2530
+ class _ANY(object):
2531
+ "A helper object that compares equal to everything."
2532
+
2533
+ def __eq__(self, other):
2534
+ return True
2535
+
2536
+ def __ne__(self, other):
2537
+ return False
2538
+
2539
+ def __repr__(self):
2540
+ return '<ANY>'
2541
+
2542
+ ANY = _ANY()
2543
+
2544
+
2545
+
2546
+ def _format_call_signature(name, args, kwargs):
2547
+ message = '%s(%%s)' % name
2548
+ formatted_args = ''
2549
+ args_string = ', '.join([repr(arg) for arg in args])
2550
+ kwargs_string = ', '.join([
2551
+ '%s=%r' % (key, value) for key, value in kwargs.items()
2552
+ ])
2553
+ if args_string:
2554
+ formatted_args = args_string
2555
+ if kwargs_string:
2556
+ if formatted_args:
2557
+ formatted_args += ', '
2558
+ formatted_args += kwargs_string
2559
+
2560
+ return message % formatted_args
2561
+
2562
+
2563
+
2564
+ class _Call(tuple):
2565
+ """
2566
+ A tuple for holding the results of a call to a mock, either in the form
2567
+ `(args, kwargs)` or `(name, args, kwargs)`.
2568
+
2569
+ If args or kwargs are empty then a call tuple will compare equal to
2570
+ a tuple without those values. This makes comparisons less verbose::
2571
+
2572
+ _Call(('name', (), {})) == ('name',)
2573
+ _Call(('name', (1,), {})) == ('name', (1,))
2574
+ _Call(((), {'a': 'b'})) == ({'a': 'b'},)
2575
+
2576
+ The `_Call` object provides a useful shortcut for comparing with call::
2577
+
2578
+ _Call(((1, 2), {'a': 3})) == call(1, 2, a=3)
2579
+ _Call(('foo', (1, 2), {'a': 3})) == call.foo(1, 2, a=3)
2580
+
2581
+ If the _Call has no name then it will match any name.
2582
+ """
2583
+ def __new__(cls, value=(), name='', parent=None, two=False,
2584
+ from_kall=True):
2585
+ args = ()
2586
+ kwargs = {}
2587
+ _len = len(value)
2588
+ if _len == 3:
2589
+ name, args, kwargs = value
2590
+ elif _len == 2:
2591
+ first, second = value
2592
+ if isinstance(first, str):
2593
+ name = first
2594
+ if isinstance(second, tuple):
2595
+ args = second
2596
+ else:
2597
+ kwargs = second
2598
+ else:
2599
+ args, kwargs = first, second
2600
+ elif _len == 1:
2601
+ value, = value
2602
+ if isinstance(value, str):
2603
+ name = value
2604
+ elif isinstance(value, tuple):
2605
+ args = value
2606
+ else:
2607
+ kwargs = value
2608
+
2609
+ if two:
2610
+ return tuple.__new__(cls, (args, kwargs))
2611
+
2612
+ return tuple.__new__(cls, (name, args, kwargs))
2613
+
2614
+
2615
+ def __init__(self, value=(), name=None, parent=None, two=False,
2616
+ from_kall=True):
2617
+ self._mock_name = name
2618
+ self._mock_parent = parent
2619
+ self._mock_from_kall = from_kall
2620
+
2621
+
2622
+ def __eq__(self, other):
2623
+ try:
2624
+ len_other = len(other)
2625
+ except TypeError:
2626
+ return NotImplemented
2627
+
2628
+ self_name = ''
2629
+ if len(self) == 2:
2630
+ self_args, self_kwargs = self
2631
+ else:
2632
+ self_name, self_args, self_kwargs = self
2633
+
2634
+ if (getattr(self, '_mock_parent', None) and getattr(other, '_mock_parent', None)
2635
+ and self._mock_parent != other._mock_parent):
2636
+ return False
2637
+
2638
+ other_name = ''
2639
+ if len_other == 0:
2640
+ other_args, other_kwargs = (), {}
2641
+ elif len_other == 3:
2642
+ other_name, other_args, other_kwargs = other
2643
+ elif len_other == 1:
2644
+ value, = other
2645
+ if isinstance(value, tuple):
2646
+ other_args = value
2647
+ other_kwargs = {}
2648
+ elif isinstance(value, str):
2649
+ other_name = value
2650
+ other_args, other_kwargs = (), {}
2651
+ else:
2652
+ other_args = ()
2653
+ other_kwargs = value
2654
+ elif len_other == 2:
2655
+ # could be (name, args) or (name, kwargs) or (args, kwargs)
2656
+ first, second = other
2657
+ if isinstance(first, str):
2658
+ other_name = first
2659
+ if isinstance(second, tuple):
2660
+ other_args, other_kwargs = second, {}
2661
+ else:
2662
+ other_args, other_kwargs = (), second
2663
+ else:
2664
+ other_args, other_kwargs = first, second
2665
+ else:
2666
+ return False
2667
+
2668
+ if self_name and other_name != self_name:
2669
+ return False
2670
+
2671
+ # this order is important for ANY to work!
2672
+ return (other_args, other_kwargs) == (self_args, self_kwargs)
2673
+
2674
+
2675
+ __ne__ = object.__ne__
2676
+
2677
+
2678
+ def __call__(self, /, *args, **kwargs):
2679
+ if self._mock_name is None:
2680
+ return _Call(('', args, kwargs), name='()')
2681
+
2682
+ name = self._mock_name + '()'
2683
+ return _Call((self._mock_name, args, kwargs), name=name, parent=self)
2684
+
2685
+
2686
+ def __getattr__(self, attr):
2687
+ if self._mock_name is None:
2688
+ return _Call(name=attr, from_kall=False)
2689
+ name = '%s.%s' % (self._mock_name, attr)
2690
+ return _Call(name=name, parent=self, from_kall=False)
2691
+
2692
+
2693
+ def __getattribute__(self, attr):
2694
+ if attr in tuple.__dict__:
2695
+ raise AttributeError
2696
+ return tuple.__getattribute__(self, attr)
2697
+
2698
+
2699
+ def _get_call_arguments(self):
2700
+ if len(self) == 2:
2701
+ args, kwargs = self
2702
+ else:
2703
+ name, args, kwargs = self
2704
+
2705
+ return args, kwargs
2706
+
2707
+ @property
2708
+ def args(self):
2709
+ return self._get_call_arguments()[0]
2710
+
2711
+ @property
2712
+ def kwargs(self):
2713
+ return self._get_call_arguments()[1]
2714
+
2715
+ def __repr__(self):
2716
+ if not self._mock_from_kall:
2717
+ name = self._mock_name or 'call'
2718
+ if name.startswith('()'):
2719
+ name = 'call%s' % name
2720
+ return name
2721
+
2722
+ if len(self) == 2:
2723
+ name = 'call'
2724
+ args, kwargs = self
2725
+ else:
2726
+ name, args, kwargs = self
2727
+ if not name:
2728
+ name = 'call'
2729
+ elif not name.startswith('()'):
2730
+ name = 'call.%s' % name
2731
+ else:
2732
+ name = 'call%s' % name
2733
+ return _format_call_signature(name, args, kwargs)
2734
+
2735
+
2736
+ def call_list(self):
2737
+ """For a call object that represents multiple calls, `call_list`
2738
+ returns a list of all the intermediate calls as well as the
2739
+ final call."""
2740
+ vals = []
2741
+ thing = self
2742
+ while thing is not None:
2743
+ if thing._mock_from_kall:
2744
+ vals.append(thing)
2745
+ thing = thing._mock_parent
2746
+ return _CallList(reversed(vals))
2747
+
2748
+
2749
+ call = _Call(from_kall=False)
2750
+
2751
+
2752
+ def create_autospec(spec, spec_set=False, instance=False, _parent=None,
2753
+ _name=None, *, unsafe=False, **kwargs):
2754
+ """Create a mock object using another object as a spec. Attributes on the
2755
+ mock will use the corresponding attribute on the `spec` object as their
2756
+ spec.
2757
+
2758
+ Functions or methods being mocked will have their arguments checked
2759
+ to check that they are called with the correct signature.
2760
+
2761
+ If `spec_set` is True then attempting to set attributes that don't exist
2762
+ on the spec object will raise an `AttributeError`.
2763
+
2764
+ If a class is used as a spec then the return value of the mock (the
2765
+ instance of the class) will have the same spec. You can use a class as the
2766
+ spec for an instance object by passing `instance=True`. The returned mock
2767
+ will only be callable if instances of the mock are callable.
2768
+
2769
+ `create_autospec` will raise a `RuntimeError` if passed some common
2770
+ misspellings of the arguments autospec and spec_set. Pass the argument
2771
+ `unsafe` with the value True to disable that check.
2772
+
2773
+ `create_autospec` also takes arbitrary keyword arguments that are passed to
2774
+ the constructor of the created mock."""
2775
+ if _is_list(spec):
2776
+ # can't pass a list instance to the mock constructor as it will be
2777
+ # interpreted as a list of strings
2778
+ spec = type(spec)
2779
+
2780
+ is_type = isinstance(spec, type)
2781
+ if _is_instance_mock(spec):
2782
+ raise InvalidSpecError(f'Cannot autospec a Mock object. '
2783
+ f'[object={spec!r}]')
2784
+ is_async_func = _is_async_func(spec)
2785
+ _kwargs = {'spec': spec}
2786
+
2787
+ entries = [(entry, _missing) for entry in dir(spec)]
2788
+ if is_type and instance and is_dataclass(spec):
2789
+ is_dataclass_spec = True
2790
+ dataclass_fields = fields(spec)
2791
+ entries.extend((f.name, f.type) for f in dataclass_fields)
2792
+ dataclass_spec_list = [f.name for f in dataclass_fields]
2793
+ else:
2794
+ is_dataclass_spec = False
2795
+
2796
+ if spec_set:
2797
+ _kwargs = {'spec_set': spec}
2798
+ elif spec is None:
2799
+ # None we mock with a normal mock without a spec
2800
+ _kwargs = {}
2801
+ if _kwargs and instance:
2802
+ _kwargs['_spec_as_instance'] = True
2803
+ if not unsafe:
2804
+ _check_spec_arg_typos(kwargs)
2805
+
2806
+ _name = kwargs.pop('name', _name)
2807
+ _new_name = _name
2808
+ if _parent is None:
2809
+ # for a top level object no _new_name should be set
2810
+ _new_name = ''
2811
+
2812
+ _kwargs.update(kwargs)
2813
+
2814
+ Klass = MagicMock
2815
+ if inspect.isdatadescriptor(spec):
2816
+ # descriptors don't have a spec
2817
+ # because we don't know what type they return
2818
+ _kwargs = {}
2819
+ elif is_async_func:
2820
+ if instance:
2821
+ raise RuntimeError("Instance can not be True when create_autospec "
2822
+ "is mocking an async function")
2823
+ Klass = AsyncMock
2824
+ elif not _callable(spec):
2825
+ Klass = NonCallableMagicMock
2826
+ elif is_type and instance and not _instance_callable(spec):
2827
+ Klass = NonCallableMagicMock
2828
+
2829
+ mock = Klass(parent=_parent, _new_parent=_parent, _new_name=_new_name,
2830
+ name=_name, **_kwargs)
2831
+ if is_dataclass_spec:
2832
+ mock._mock_extend_spec_methods(dataclass_spec_list)
2833
+
2834
+ if isinstance(spec, FunctionTypes):
2835
+ # should only happen at the top level because we don't
2836
+ # recurse for functions
2837
+ if is_async_func:
2838
+ mock = _set_async_signature(mock, spec)
2839
+ else:
2840
+ mock = _set_signature(mock, spec)
2841
+ else:
2842
+ _check_signature(spec, mock, is_type, instance)
2843
+
2844
+ if _parent is not None and not instance:
2845
+ _parent._mock_children[_name] = mock
2846
+
2847
+ # Pop wraps from kwargs because it must not be passed to configure_mock.
2848
+ wrapped = kwargs.pop('wraps', None)
2849
+ if is_type and not instance and 'return_value' not in kwargs:
2850
+ mock.return_value = create_autospec(spec, spec_set, instance=True,
2851
+ _name='()', _parent=mock,
2852
+ wraps=wrapped)
2853
+
2854
+ for entry, original in entries:
2855
+ if _is_magic(entry):
2856
+ # MagicMock already does the useful magic methods for us
2857
+ continue
2858
+
2859
+ # XXXX do we need a better way of getting attributes without
2860
+ # triggering code execution (?) Probably not - we need the actual
2861
+ # object to mock it so we would rather trigger a property than mock
2862
+ # the property descriptor. Likewise we want to mock out dynamically
2863
+ # provided attributes.
2864
+ # XXXX what about attributes that raise exceptions other than
2865
+ # AttributeError on being fetched?
2866
+ # we could be resilient against it, or catch and propagate the
2867
+ # exception when the attribute is fetched from the mock
2868
+ if original is _missing:
2869
+ try:
2870
+ original = getattr(spec, entry)
2871
+ except AttributeError:
2872
+ continue
2873
+
2874
+ child_kwargs = {'spec': original}
2875
+ # Wrap child attributes also.
2876
+ if wrapped and hasattr(wrapped, entry):
2877
+ child_kwargs.update(wraps=original)
2878
+ if spec_set:
2879
+ child_kwargs = {'spec_set': original}
2880
+
2881
+ if not isinstance(original, FunctionTypes):
2882
+ new = _SpecState(original, spec_set, mock, entry, instance)
2883
+ mock._mock_children[entry] = new
2884
+ else:
2885
+ parent = mock
2886
+ if isinstance(spec, FunctionTypes):
2887
+ parent = mock.mock
2888
+
2889
+ skipfirst = _must_skip(spec, entry, is_type)
2890
+ child_kwargs['_eat_self'] = skipfirst
2891
+ if iscoroutinefunction(original):
2892
+ child_klass = AsyncMock
2893
+ else:
2894
+ child_klass = MagicMock
2895
+ new = child_klass(parent=parent, name=entry, _new_name=entry,
2896
+ _new_parent=parent, **child_kwargs)
2897
+ mock._mock_children[entry] = new
2898
+ new.return_value = child_klass()
2899
+ _check_signature(original, new, skipfirst=skipfirst)
2900
+
2901
+ # so functions created with _set_signature become instance attributes,
2902
+ # *plus* their underlying mock exists in _mock_children of the parent
2903
+ # mock. Adding to _mock_children may be unnecessary where we are also
2904
+ # setting as an instance attribute?
2905
+ if isinstance(new, FunctionTypes):
2906
+ setattr(mock, entry, new)
2907
+ # kwargs are passed with respect to the parent mock so, they are not used
2908
+ # for creating return_value of the parent mock. So, this condition
2909
+ # should be true only for the parent mock if kwargs are given.
2910
+ if _is_instance_mock(mock) and kwargs:
2911
+ mock.configure_mock(**kwargs)
2912
+
2913
+ return mock
2914
+
2915
+
2916
+ def _must_skip(spec, entry, is_type):
2917
+ """
2918
+ Return whether we should skip the first argument on spec's `entry`
2919
+ attribute.
2920
+ """
2921
+ if not isinstance(spec, type):
2922
+ if entry in getattr(spec, '__dict__', {}):
2923
+ # instance attribute - shouldn't skip
2924
+ return False
2925
+ spec = spec.__class__
2926
+
2927
+ for klass in spec.__mro__:
2928
+ result = klass.__dict__.get(entry, DEFAULT)
2929
+ if result is DEFAULT:
2930
+ continue
2931
+ if isinstance(result, (staticmethod, classmethod)):
2932
+ return False
2933
+ elif isinstance(result, FunctionTypes):
2934
+ # Normal method => skip if looked up on type
2935
+ # (if looked up on instance, self is already skipped)
2936
+ return is_type
2937
+ else:
2938
+ return False
2939
+
2940
+ # function is a dynamically provided attribute
2941
+ return is_type
2942
+
2943
+
2944
+ class _SpecState(object):
2945
+
2946
+ def __init__(self, spec, spec_set=False, parent=None,
2947
+ name=None, ids=None, instance=False):
2948
+ self.spec = spec
2949
+ self.ids = ids
2950
+ self.spec_set = spec_set
2951
+ self.parent = parent
2952
+ self.instance = instance
2953
+ self.name = name
2954
+
2955
+
2956
+ FunctionTypes = (
2957
+ # python function
2958
+ type(create_autospec),
2959
+ # instance method
2960
+ type(ANY.__eq__),
2961
+ )
2962
+
2963
+
2964
+ file_spec = None
2965
+ open_spec = None
2966
+
2967
+
2968
+ def _to_stream(read_data):
2969
+ if isinstance(read_data, bytes):
2970
+ return io.BytesIO(read_data)
2971
+ else:
2972
+ return io.StringIO(read_data)
2973
+
2974
+
2975
+ def mock_open(mock=None, read_data=''):
2976
+ """
2977
+ A helper function to create a mock to replace the use of `open`. It works
2978
+ for `open` called directly or used as a context manager.
2979
+
2980
+ The `mock` argument is the mock object to configure. If `None` (the
2981
+ default) then a `MagicMock` will be created for you, with the API limited
2982
+ to methods or attributes available on standard file handles.
2983
+
2984
+ `read_data` is a string for the `read`, `readline` and `readlines` of the
2985
+ file handle to return. This is an empty string by default.
2986
+ """
2987
+ _read_data = _to_stream(read_data)
2988
+ _state = [_read_data, None]
2989
+
2990
+ def _readlines_side_effect(*args, **kwargs):
2991
+ if handle.readlines.return_value is not None:
2992
+ return handle.readlines.return_value
2993
+ return _state[0].readlines(*args, **kwargs)
2994
+
2995
+ def _read_side_effect(*args, **kwargs):
2996
+ if handle.read.return_value is not None:
2997
+ return handle.read.return_value
2998
+ return _state[0].read(*args, **kwargs)
2999
+
3000
+ def _readline_side_effect(*args, **kwargs):
3001
+ yield from _iter_side_effect()
3002
+ while True:
3003
+ yield _state[0].readline(*args, **kwargs)
3004
+
3005
+ def _iter_side_effect():
3006
+ if handle.readline.return_value is not None:
3007
+ while True:
3008
+ yield handle.readline.return_value
3009
+ for line in _state[0]:
3010
+ yield line
3011
+
3012
+ def _next_side_effect():
3013
+ if handle.readline.return_value is not None:
3014
+ return handle.readline.return_value
3015
+ return next(_state[0])
3016
+
3017
+ def _exit_side_effect(exctype, excinst, exctb):
3018
+ handle.close()
3019
+
3020
+ global file_spec
3021
+ if file_spec is None:
3022
+ import _io
3023
+ file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO))))
3024
+
3025
+ global open_spec
3026
+ if open_spec is None:
3027
+ import _io
3028
+ open_spec = list(set(dir(_io.open)))
3029
+ if mock is None:
3030
+ mock = MagicMock(name='open', spec=open_spec)
3031
+
3032
+ handle = MagicMock(spec=file_spec)
3033
+ handle.__enter__.return_value = handle
3034
+
3035
+ handle.write.return_value = None
3036
+ handle.read.return_value = None
3037
+ handle.readline.return_value = None
3038
+ handle.readlines.return_value = None
3039
+
3040
+ handle.read.side_effect = _read_side_effect
3041
+ _state[1] = _readline_side_effect()
3042
+ handle.readline.side_effect = _state[1]
3043
+ handle.readlines.side_effect = _readlines_side_effect
3044
+ handle.__iter__.side_effect = _iter_side_effect
3045
+ handle.__next__.side_effect = _next_side_effect
3046
+ handle.__exit__.side_effect = _exit_side_effect
3047
+
3048
+ def reset_data(*args, **kwargs):
3049
+ _state[0] = _to_stream(read_data)
3050
+ if handle.readline.side_effect == _state[1]:
3051
+ # Only reset the side effect if the user hasn't overridden it.
3052
+ _state[1] = _readline_side_effect()
3053
+ handle.readline.side_effect = _state[1]
3054
+ return DEFAULT
3055
+
3056
+ mock.side_effect = reset_data
3057
+ mock.return_value = handle
3058
+ return mock
3059
+
3060
+
3061
+ class PropertyMock(Mock):
3062
+ """
3063
+ A mock intended to be used as a property, or other descriptor, on a class.
3064
+ `PropertyMock` provides `__get__` and `__set__` methods so you can specify
3065
+ a return value when it is fetched.
3066
+
3067
+ Fetching a `PropertyMock` instance from an object calls the mock, with
3068
+ no args. Setting it calls the mock with the value being set.
3069
+ """
3070
+ def _get_child_mock(self, /, **kwargs):
3071
+ return MagicMock(**kwargs)
3072
+
3073
+ def __get__(self, obj, obj_type=None):
3074
+ return self()
3075
+ def __set__(self, obj, val):
3076
+ self(val)
3077
+
3078
+
3079
+ _timeout_unset = sentinel.TIMEOUT_UNSET
3080
+
3081
+ class ThreadingMixin(Base):
3082
+
3083
+ DEFAULT_TIMEOUT = None
3084
+
3085
+ def _get_child_mock(self, /, **kw):
3086
+ if isinstance(kw.get("parent"), ThreadingMixin):
3087
+ kw["timeout"] = kw["parent"]._mock_wait_timeout
3088
+ elif isinstance(kw.get("_new_parent"), ThreadingMixin):
3089
+ kw["timeout"] = kw["_new_parent"]._mock_wait_timeout
3090
+ return super()._get_child_mock(**kw)
3091
+
3092
+ def __init__(self, *args, timeout=_timeout_unset, **kwargs):
3093
+ super().__init__(*args, **kwargs)
3094
+ if timeout is _timeout_unset:
3095
+ timeout = self.DEFAULT_TIMEOUT
3096
+ self.__dict__["_mock_event"] = threading.Event() # Event for any call
3097
+ self.__dict__["_mock_calls_events"] = [] # Events for each of the calls
3098
+ self.__dict__["_mock_calls_events_lock"] = threading.Lock()
3099
+ self.__dict__["_mock_wait_timeout"] = timeout
3100
+
3101
+ def reset_mock(self, /, *args, **kwargs):
3102
+ """
3103
+ See :func:`.Mock.reset_mock()`
3104
+ """
3105
+ super().reset_mock(*args, **kwargs)
3106
+ self.__dict__["_mock_event"] = threading.Event()
3107
+ self.__dict__["_mock_calls_events"] = []
3108
+
3109
+ def __get_event(self, expected_args, expected_kwargs):
3110
+ with self._mock_calls_events_lock:
3111
+ for args, kwargs, event in self._mock_calls_events:
3112
+ if (args, kwargs) == (expected_args, expected_kwargs):
3113
+ return event
3114
+ new_event = threading.Event()
3115
+ self._mock_calls_events.append((expected_args, expected_kwargs, new_event))
3116
+ return new_event
3117
+
3118
+ def _mock_call(self, *args, **kwargs):
3119
+ ret_value = super()._mock_call(*args, **kwargs)
3120
+
3121
+ call_event = self.__get_event(args, kwargs)
3122
+ call_event.set()
3123
+
3124
+ self._mock_event.set()
3125
+
3126
+ return ret_value
3127
+
3128
+ def _increment_mock_call(self, /, *args, **kwargs):
3129
+ with self._mock_calls_events_lock:
3130
+ super()._increment_mock_call(*args, **kwargs)
3131
+
3132
+ def wait_until_called(self, *, timeout=_timeout_unset):
3133
+ """Wait until the mock object is called.
3134
+
3135
+ `timeout` - time to wait for in seconds, waits forever otherwise.
3136
+ Defaults to the constructor provided timeout.
3137
+ Use None to block undefinetively.
3138
+ """
3139
+ if timeout is _timeout_unset:
3140
+ timeout = self._mock_wait_timeout
3141
+ if not self._mock_event.wait(timeout=timeout):
3142
+ msg = (f"{self._mock_name or 'mock'} was not called before"
3143
+ f" timeout({timeout}).")
3144
+ raise AssertionError(msg)
3145
+
3146
+ def wait_until_any_call_with(self, *args, **kwargs):
3147
+ """Wait until the mock object is called with given args.
3148
+
3149
+ Waits for the timeout in seconds provided in the constructor.
3150
+ """
3151
+ event = self.__get_event(args, kwargs)
3152
+ if not event.wait(timeout=self._mock_wait_timeout):
3153
+ expected_string = self._format_mock_call_signature(args, kwargs)
3154
+ raise AssertionError(f'{expected_string} call not found')
3155
+
3156
+
3157
+ class ThreadingMock(ThreadingMixin, MagicMixin, Mock):
3158
+ """
3159
+ A mock that can be used to wait until on calls happening
3160
+ in a different thread.
3161
+
3162
+ The constructor can take a `timeout` argument which
3163
+ controls the timeout in seconds for all `wait` calls of the mock.
3164
+
3165
+ You can change the default timeout of all instances via the
3166
+ `ThreadingMock.DEFAULT_TIMEOUT` attribute.
3167
+
3168
+ If no timeout is set, it will block undefinetively.
3169
+ """
3170
+ pass
3171
+
3172
+
3173
+ def seal(mock):
3174
+ """Disable the automatic generation of child mocks.
3175
+
3176
+ Given an input Mock, seals it to ensure no further mocks will be generated
3177
+ when accessing an attribute that was not already defined.
3178
+
3179
+ The operation recursively seals the mock passed in, meaning that
3180
+ the mock itself, any mocks generated by accessing one of its attributes,
3181
+ and all assigned mocks without a name or spec will be sealed.
3182
+ """
3183
+ mock._mock_sealed = True
3184
+ for attr in dir(mock):
3185
+ try:
3186
+ m = getattr(mock, attr)
3187
+ except AttributeError:
3188
+ continue
3189
+ if not isinstance(m, NonCallableMock):
3190
+ continue
3191
+ if isinstance(m._mock_children.get(attr), _SpecState):
3192
+ continue
3193
+ if m._mock_new_parent is mock:
3194
+ seal(m)
3195
+
3196
+
3197
+ class _AsyncIterator:
3198
+ """
3199
+ Wraps an iterator in an asynchronous iterator.
3200
+ """
3201
+ def __init__(self, iterator):
3202
+ self.iterator = iterator
3203
+ code_mock = NonCallableMock(spec_set=CodeType)
3204
+ code_mock.co_flags = inspect.CO_ITERABLE_COROUTINE
3205
+ self.__dict__['__code__'] = code_mock
3206
+
3207
+ async def __anext__(self):
3208
+ try:
3209
+ return next(self.iterator)
3210
+ except StopIteration:
3211
+ pass
3212
+ raise StopAsyncIteration