cairnml-agent 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (404) hide show
  1. cairnml_agent/__init__.py +1 -0
  2. cairnml_agent/__main__.py +93 -0
  3. cairnml_agent/_vendor/__init__.py +0 -0
  4. cairnml_agent/_vendor/attr/__init__.py +93 -0
  5. cairnml_agent/_vendor/attr/__init__.pyi +509 -0
  6. cairnml_agent/_vendor/attr/_cmp.py +155 -0
  7. cairnml_agent/_vendor/attr/_cmp.pyi +13 -0
  8. cairnml_agent/_vendor/attr/_compat.py +176 -0
  9. cairnml_agent/_vendor/attr/_config.py +31 -0
  10. cairnml_agent/_vendor/attr/_funcs.py +418 -0
  11. cairnml_agent/_vendor/attr/_make.py +2965 -0
  12. cairnml_agent/_vendor/attr/_next_gen.py +226 -0
  13. cairnml_agent/_vendor/attr/_typing_compat.pyi +15 -0
  14. cairnml_agent/_vendor/attr/_version_info.py +86 -0
  15. cairnml_agent/_vendor/attr/_version_info.pyi +9 -0
  16. cairnml_agent/_vendor/attr/converters.py +144 -0
  17. cairnml_agent/_vendor/attr/converters.pyi +13 -0
  18. cairnml_agent/_vendor/attr/exceptions.py +92 -0
  19. cairnml_agent/_vendor/attr/exceptions.pyi +17 -0
  20. cairnml_agent/_vendor/attr/filters.py +51 -0
  21. cairnml_agent/_vendor/attr/filters.pyi +6 -0
  22. cairnml_agent/_vendor/attr/py.typed +0 -0
  23. cairnml_agent/_vendor/attr/setters.py +73 -0
  24. cairnml_agent/_vendor/attr/setters.pyi +19 -0
  25. cairnml_agent/_vendor/attr/validators.py +714 -0
  26. cairnml_agent/_vendor/attr/validators.pyi +86 -0
  27. cairnml_agent/_vendor/attrs/__init__.py +72 -0
  28. cairnml_agent/_vendor/attrs/__init__.pyi +67 -0
  29. cairnml_agent/_vendor/attrs/converters.py +3 -0
  30. cairnml_agent/_vendor/attrs/exceptions.py +3 -0
  31. cairnml_agent/_vendor/attrs/filters.py +3 -0
  32. cairnml_agent/_vendor/attrs/py.typed +0 -0
  33. cairnml_agent/_vendor/attrs/setters.py +3 -0
  34. cairnml_agent/_vendor/attrs/validators.py +3 -0
  35. cairnml_agent/_vendor/chardet/__init__.py +93 -0
  36. cairnml_agent/_vendor/chardet/big5freq.py +386 -0
  37. cairnml_agent/_vendor/chardet/big5prober.py +47 -0
  38. cairnml_agent/_vendor/chardet/chardistribution.py +259 -0
  39. cairnml_agent/_vendor/chardet/charsetgroupprober.py +109 -0
  40. cairnml_agent/_vendor/chardet/charsetprober.py +138 -0
  41. cairnml_agent/_vendor/chardet/cli/__init__.py +0 -0
  42. cairnml_agent/_vendor/chardet/cli/chardetect.py +86 -0
  43. cairnml_agent/_vendor/chardet/codingstatemachine.py +88 -0
  44. cairnml_agent/_vendor/chardet/cp949prober.py +49 -0
  45. cairnml_agent/_vendor/chardet/enums.py +82 -0
  46. cairnml_agent/_vendor/chardet/escprober.py +102 -0
  47. cairnml_agent/_vendor/chardet/escsm.py +260 -0
  48. cairnml_agent/_vendor/chardet/eucjpprober.py +95 -0
  49. cairnml_agent/_vendor/chardet/euckrfreq.py +196 -0
  50. cairnml_agent/_vendor/chardet/euckrprober.py +47 -0
  51. cairnml_agent/_vendor/chardet/euctwfreq.py +388 -0
  52. cairnml_agent/_vendor/chardet/euctwprober.py +47 -0
  53. cairnml_agent/_vendor/chardet/gb2312freq.py +284 -0
  54. cairnml_agent/_vendor/chardet/gb2312prober.py +47 -0
  55. cairnml_agent/_vendor/chardet/hebrewprober.py +302 -0
  56. cairnml_agent/_vendor/chardet/jisfreq.py +325 -0
  57. cairnml_agent/_vendor/chardet/johabfreq.py +2382 -0
  58. cairnml_agent/_vendor/chardet/johabprober.py +47 -0
  59. cairnml_agent/_vendor/chardet/jpcntx.py +237 -0
  60. cairnml_agent/_vendor/chardet/langbulgarianmodel.py +4649 -0
  61. cairnml_agent/_vendor/chardet/langgreekmodel.py +4397 -0
  62. cairnml_agent/_vendor/chardet/langhebrewmodel.py +4380 -0
  63. cairnml_agent/_vendor/chardet/langhungarianmodel.py +4649 -0
  64. cairnml_agent/_vendor/chardet/langrussianmodel.py +5725 -0
  65. cairnml_agent/_vendor/chardet/langthaimodel.py +4380 -0
  66. cairnml_agent/_vendor/chardet/langturkishmodel.py +4380 -0
  67. cairnml_agent/_vendor/chardet/latin1prober.py +145 -0
  68. cairnml_agent/_vendor/chardet/mbcharsetprober.py +95 -0
  69. cairnml_agent/_vendor/chardet/mbcsgroupprober.py +56 -0
  70. cairnml_agent/_vendor/chardet/mbcssm.py +660 -0
  71. cairnml_agent/_vendor/chardet/metadata/__init__.py +0 -0
  72. cairnml_agent/_vendor/chardet/metadata/languages.py +351 -0
  73. cairnml_agent/_vendor/chardet/sbcharsetprober.py +160 -0
  74. cairnml_agent/_vendor/chardet/sbcsgroupprober.py +88 -0
  75. cairnml_agent/_vendor/chardet/sjisprober.py +98 -0
  76. cairnml_agent/_vendor/chardet/universaldetector.py +328 -0
  77. cairnml_agent/_vendor/chardet/utf1632prober.py +223 -0
  78. cairnml_agent/_vendor/chardet/utf8prober.py +80 -0
  79. cairnml_agent/_vendor/chardet/version.py +9 -0
  80. cairnml_agent/_vendor/dateutil/__init__.py +24 -0
  81. cairnml_agent/_vendor/dateutil/_common.py +43 -0
  82. cairnml_agent/_vendor/dateutil/_version.py +4 -0
  83. cairnml_agent/_vendor/dateutil/easter.py +89 -0
  84. cairnml_agent/_vendor/dateutil/parser/__init__.py +61 -0
  85. cairnml_agent/_vendor/dateutil/parser/_parser.py +1613 -0
  86. cairnml_agent/_vendor/dateutil/parser/isoparser.py +416 -0
  87. cairnml_agent/_vendor/dateutil/relativedelta.py +599 -0
  88. cairnml_agent/_vendor/dateutil/rrule.py +1737 -0
  89. cairnml_agent/_vendor/dateutil/tz/__init__.py +12 -0
  90. cairnml_agent/_vendor/dateutil/tz/_common.py +419 -0
  91. cairnml_agent/_vendor/dateutil/tz/_factories.py +79 -0
  92. cairnml_agent/_vendor/dateutil/tz/tz.py +1849 -0
  93. cairnml_agent/_vendor/dateutil/tz/win.py +370 -0
  94. cairnml_agent/_vendor/dateutil/tzwin.py +2 -0
  95. cairnml_agent/_vendor/dateutil/utils.py +71 -0
  96. cairnml_agent/_vendor/dateutil/zoneinfo/__init__.py +167 -0
  97. cairnml_agent/_vendor/dateutil/zoneinfo/rebuild.py +75 -0
  98. cairnml_agent/_vendor/furl/__init__.py +16 -0
  99. cairnml_agent/_vendor/furl/__version__.py +20 -0
  100. cairnml_agent/_vendor/furl/common.py +24 -0
  101. cairnml_agent/_vendor/furl/compat.py +37 -0
  102. cairnml_agent/_vendor/furl/furl.py +1895 -0
  103. cairnml_agent/_vendor/furl/omdict1D.py +112 -0
  104. cairnml_agent/_vendor/jsonschema/__init__.py +35 -0
  105. cairnml_agent/_vendor/jsonschema/__main__.py +2 -0
  106. cairnml_agent/_vendor/jsonschema/_format.py +425 -0
  107. cairnml_agent/_vendor/jsonschema/_legacy_validators.py +141 -0
  108. cairnml_agent/_vendor/jsonschema/_reflect.py +155 -0
  109. cairnml_agent/_vendor/jsonschema/_types.py +188 -0
  110. cairnml_agent/_vendor/jsonschema/_utils.py +212 -0
  111. cairnml_agent/_vendor/jsonschema/_validators.py +373 -0
  112. cairnml_agent/_vendor/jsonschema/benchmarks/__init__.py +5 -0
  113. cairnml_agent/_vendor/jsonschema/benchmarks/issue232.py +26 -0
  114. cairnml_agent/_vendor/jsonschema/benchmarks/json_schema_test_suite.py +14 -0
  115. cairnml_agent/_vendor/jsonschema/cli.py +90 -0
  116. cairnml_agent/_vendor/jsonschema/compat.py +55 -0
  117. cairnml_agent/_vendor/jsonschema/exceptions.py +374 -0
  118. cairnml_agent/_vendor/jsonschema/schemas/__init__.py +0 -0
  119. cairnml_agent/_vendor/jsonschema/schemas/draft3.json +199 -0
  120. cairnml_agent/_vendor/jsonschema/schemas/draft4.json +222 -0
  121. cairnml_agent/_vendor/jsonschema/schemas/draft6.json +153 -0
  122. cairnml_agent/_vendor/jsonschema/schemas/draft7.json +166 -0
  123. cairnml_agent/_vendor/jsonschema/tests/__init__.py +0 -0
  124. cairnml_agent/_vendor/jsonschema/tests/_helpers.py +5 -0
  125. cairnml_agent/_vendor/jsonschema/tests/_suite.py +239 -0
  126. cairnml_agent/_vendor/jsonschema/tests/test_cli.py +151 -0
  127. cairnml_agent/_vendor/jsonschema/tests/test_exceptions.py +462 -0
  128. cairnml_agent/_vendor/jsonschema/tests/test_format.py +89 -0
  129. cairnml_agent/_vendor/jsonschema/tests/test_jsonschema_test_suite.py +277 -0
  130. cairnml_agent/_vendor/jsonschema/tests/test_types.py +190 -0
  131. cairnml_agent/_vendor/jsonschema/tests/test_validators.py +1762 -0
  132. cairnml_agent/_vendor/jsonschema/validators.py +970 -0
  133. cairnml_agent/_vendor/jwt/__init__.py +70 -0
  134. cairnml_agent/_vendor/jwt/algorithms.py +677 -0
  135. cairnml_agent/_vendor/jwt/api_jwk.py +103 -0
  136. cairnml_agent/_vendor/jwt/api_jws.py +289 -0
  137. cairnml_agent/_vendor/jwt/api_jwt.py +231 -0
  138. cairnml_agent/_vendor/jwt/exceptions.py +66 -0
  139. cairnml_agent/_vendor/jwt/help.py +60 -0
  140. cairnml_agent/_vendor/jwt/jwks_client.py +59 -0
  141. cairnml_agent/_vendor/jwt/py.typed +0 -0
  142. cairnml_agent/_vendor/jwt/utils.py +160 -0
  143. cairnml_agent/_vendor/orderedmultidict/__init__.py +23 -0
  144. cairnml_agent/_vendor/orderedmultidict/__version__.py +19 -0
  145. cairnml_agent/_vendor/orderedmultidict/itemlist.py +158 -0
  146. cairnml_agent/_vendor/orderedmultidict/orderedmultidict.py +833 -0
  147. cairnml_agent/_vendor/pathlib2/__init__.py +1896 -0
  148. cairnml_agent/_vendor/pkg_resources/__init__.py +3366 -0
  149. cairnml_agent/_vendor/pkg_resources/_vendor/__init__.py +0 -0
  150. cairnml_agent/_vendor/pkg_resources/_vendor/jaraco/__init__.py +0 -0
  151. cairnml_agent/_vendor/pkg_resources/_vendor/jaraco/context.py +288 -0
  152. cairnml_agent/_vendor/pkg_resources/_vendor/jaraco/functools.py +556 -0
  153. cairnml_agent/_vendor/pkg_resources/_vendor/jaraco/text/__init__.py +599 -0
  154. cairnml_agent/_vendor/pkg_resources/_vendor/more_itertools/__init__.py +6 -0
  155. cairnml_agent/_vendor/pkg_resources/_vendor/more_itertools/more.py +4391 -0
  156. cairnml_agent/_vendor/pkg_resources/_vendor/more_itertools/recipes.py +930 -0
  157. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/__init__.py +15 -0
  158. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_elffile.py +108 -0
  159. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_manylinux.py +240 -0
  160. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_musllinux.py +80 -0
  161. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_parser.py +353 -0
  162. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_structures.py +61 -0
  163. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/_tokenizer.py +192 -0
  164. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/markers.py +252 -0
  165. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/metadata.py +408 -0
  166. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/requirements.py +95 -0
  167. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/specifiers.py +1008 -0
  168. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/tags.py +546 -0
  169. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/utils.py +141 -0
  170. cairnml_agent/_vendor/pkg_resources/_vendor/packaging/version.py +564 -0
  171. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/__init__.py +342 -0
  172. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/__main__.py +46 -0
  173. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/android.py +120 -0
  174. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/api.py +156 -0
  175. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/macos.py +64 -0
  176. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/unix.py +181 -0
  177. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/version.py +4 -0
  178. cairnml_agent/_vendor/pkg_resources/_vendor/platformdirs/windows.py +184 -0
  179. cairnml_agent/_vendor/pkg_resources/_vendor/typing_extensions.py +2209 -0
  180. cairnml_agent/_vendor/pkg_resources/_vendor/zipp.py +329 -0
  181. cairnml_agent/_vendor/pkg_resources/extern/__init__.py +79 -0
  182. cairnml_agent/_vendor/pyparsing/__init__.py +325 -0
  183. cairnml_agent/_vendor/pyparsing/actions.py +206 -0
  184. cairnml_agent/_vendor/pyparsing/common.py +434 -0
  185. cairnml_agent/_vendor/pyparsing/core.py +6152 -0
  186. cairnml_agent/_vendor/pyparsing/diagram/__init__.py +687 -0
  187. cairnml_agent/_vendor/pyparsing/exceptions.py +301 -0
  188. cairnml_agent/_vendor/pyparsing/helpers.py +1082 -0
  189. cairnml_agent/_vendor/pyparsing/py.typed +0 -0
  190. cairnml_agent/_vendor/pyparsing/results.py +799 -0
  191. cairnml_agent/_vendor/pyparsing/testing.py +345 -0
  192. cairnml_agent/_vendor/pyparsing/unicode.py +356 -0
  193. cairnml_agent/_vendor/pyparsing/util.py +277 -0
  194. cairnml_agent/_vendor/pyrsistent/__init__.py +47 -0
  195. cairnml_agent/_vendor/pyrsistent/__init__.pyi +213 -0
  196. cairnml_agent/_vendor/pyrsistent/_checked_types.py +542 -0
  197. cairnml_agent/_vendor/pyrsistent/_field_common.py +329 -0
  198. cairnml_agent/_vendor/pyrsistent/_helpers.py +97 -0
  199. cairnml_agent/_vendor/pyrsistent/_immutable.py +103 -0
  200. cairnml_agent/_vendor/pyrsistent/_pbag.py +266 -0
  201. cairnml_agent/_vendor/pyrsistent/_pclass.py +262 -0
  202. cairnml_agent/_vendor/pyrsistent/_pdeque.py +376 -0
  203. cairnml_agent/_vendor/pyrsistent/_plist.py +313 -0
  204. cairnml_agent/_vendor/pyrsistent/_pmap.py +461 -0
  205. cairnml_agent/_vendor/pyrsistent/_precord.py +167 -0
  206. cairnml_agent/_vendor/pyrsistent/_pset.py +227 -0
  207. cairnml_agent/_vendor/pyrsistent/_pvector.py +711 -0
  208. cairnml_agent/_vendor/pyrsistent/_toolz.py +83 -0
  209. cairnml_agent/_vendor/pyrsistent/_transformations.py +139 -0
  210. cairnml_agent/_vendor/pyrsistent/py.typed +0 -0
  211. cairnml_agent/_vendor/pyrsistent/typing.py +80 -0
  212. cairnml_agent/_vendor/pyrsistent/typing.pyi +292 -0
  213. cairnml_agent/_vendor/pyyaml/__init__.py +70 -0
  214. cairnml_agent/_vendor/ruamel/__init__.py +0 -0
  215. cairnml_agent/_vendor/ruamel/yaml/__init__.py +56 -0
  216. cairnml_agent/_vendor/ruamel/yaml/anchor.py +18 -0
  217. cairnml_agent/_vendor/ruamel/yaml/comments.py +1175 -0
  218. cairnml_agent/_vendor/ruamel/yaml/compat.py +235 -0
  219. cairnml_agent/_vendor/ruamel/yaml/composer.py +228 -0
  220. cairnml_agent/_vendor/ruamel/yaml/configobjwalker.py +15 -0
  221. cairnml_agent/_vendor/ruamel/yaml/constructor.py +1723 -0
  222. cairnml_agent/_vendor/ruamel/yaml/cyaml.py +195 -0
  223. cairnml_agent/_vendor/ruamel/yaml/dumper.py +218 -0
  224. cairnml_agent/_vendor/ruamel/yaml/emitter.py +1779 -0
  225. cairnml_agent/_vendor/ruamel/yaml/error.py +297 -0
  226. cairnml_agent/_vendor/ruamel/yaml/events.py +264 -0
  227. cairnml_agent/_vendor/ruamel/yaml/loader.py +90 -0
  228. cairnml_agent/_vendor/ruamel/yaml/main.py +1501 -0
  229. cairnml_agent/_vendor/ruamel/yaml/nodes.py +145 -0
  230. cairnml_agent/_vendor/ruamel/yaml/parser.py +854 -0
  231. cairnml_agent/_vendor/ruamel/yaml/py.typed +0 -0
  232. cairnml_agent/_vendor/ruamel/yaml/reader.py +275 -0
  233. cairnml_agent/_vendor/ruamel/yaml/representer.py +1127 -0
  234. cairnml_agent/_vendor/ruamel/yaml/resolver.py +389 -0
  235. cairnml_agent/_vendor/ruamel/yaml/scalarbool.py +42 -0
  236. cairnml_agent/_vendor/ruamel/yaml/scalarfloat.py +103 -0
  237. cairnml_agent/_vendor/ruamel/yaml/scalarint.py +122 -0
  238. cairnml_agent/_vendor/ruamel/yaml/scalarstring.py +140 -0
  239. cairnml_agent/_vendor/ruamel/yaml/scanner.py +2359 -0
  240. cairnml_agent/_vendor/ruamel/yaml/serializer.py +231 -0
  241. cairnml_agent/_vendor/ruamel/yaml/tag.py +124 -0
  242. cairnml_agent/_vendor/ruamel/yaml/timestamp.py +58 -0
  243. cairnml_agent/_vendor/ruamel/yaml/tokens.py +379 -0
  244. cairnml_agent/_vendor/ruamel/yaml/util.py +257 -0
  245. cairnml_agent/_vendor/six.py +998 -0
  246. cairnml_agent/_vendor/typing_extensions.py +2908 -0
  247. cairnml_agent/backend_api/__init__.py +2 -0
  248. cairnml_agent/backend_api/config/__init__.py +17 -0
  249. cairnml_agent/backend_api/config/default/agent.conf +659 -0
  250. cairnml_agent/backend_api/config/default/api.conf +42 -0
  251. cairnml_agent/backend_api/config/default/logging.conf +8 -0
  252. cairnml_agent/backend_api/config/default/sdk.conf +181 -0
  253. cairnml_agent/backend_api/schema/__init__.py +0 -0
  254. cairnml_agent/backend_api/schema/action.py +38 -0
  255. cairnml_agent/backend_api/schema/service.py +201 -0
  256. cairnml_agent/backend_api/services/__init__.py +17 -0
  257. cairnml_agent/backend_api/services/v2_4/__init__.py +0 -0
  258. cairnml_agent/backend_api/services/v2_4/auth.py +623 -0
  259. cairnml_agent/backend_api/services/v2_4/debug.py +194 -0
  260. cairnml_agent/backend_api/services/v2_4/events.py +2977 -0
  261. cairnml_agent/backend_api/services/v2_4/models.py +2850 -0
  262. cairnml_agent/backend_api/services/v2_4/queues.py +2198 -0
  263. cairnml_agent/backend_api/services/v2_4/tasks.py +6643 -0
  264. cairnml_agent/backend_api/services/v2_4/workers.py +2368 -0
  265. cairnml_agent/backend_api/services/v2_5/__init__.py +0 -0
  266. cairnml_agent/backend_api/services/v2_5/auth.py +623 -0
  267. cairnml_agent/backend_api/services/v2_5/debug.py +194 -0
  268. cairnml_agent/backend_api/services/v2_5/events.py +3000 -0
  269. cairnml_agent/backend_api/services/v2_5/models.py +2850 -0
  270. cairnml_agent/backend_api/services/v2_5/queues.py +2198 -0
  271. cairnml_agent/backend_api/services/v2_5/tasks.py +7053 -0
  272. cairnml_agent/backend_api/services/v2_5/workers.py +2368 -0
  273. cairnml_agent/backend_api/session/__init__.py +7 -0
  274. cairnml_agent/backend_api/session/apimodel.py +8 -0
  275. cairnml_agent/backend_api/session/callresult.py +131 -0
  276. cairnml_agent/backend_api/session/client/__init__.py +1 -0
  277. cairnml_agent/backend_api/session/client/client.py +543 -0
  278. cairnml_agent/backend_api/session/datamodel.py +153 -0
  279. cairnml_agent/backend_api/session/defs.py +42 -0
  280. cairnml_agent/backend_api/session/errors.py +17 -0
  281. cairnml_agent/backend_api/session/job_token_file.py +16 -0
  282. cairnml_agent/backend_api/session/jsonmodels/__init__.py +9 -0
  283. cairnml_agent/backend_api/session/jsonmodels/builders.py +230 -0
  284. cairnml_agent/backend_api/session/jsonmodels/collections.py +21 -0
  285. cairnml_agent/backend_api/session/jsonmodels/errors.py +15 -0
  286. cairnml_agent/backend_api/session/jsonmodels/fields.py +488 -0
  287. cairnml_agent/backend_api/session/jsonmodels/models.py +154 -0
  288. cairnml_agent/backend_api/session/jsonmodels/parsers.py +106 -0
  289. cairnml_agent/backend_api/session/jsonmodels/utilities.py +156 -0
  290. cairnml_agent/backend_api/session/jsonmodels/validators.py +202 -0
  291. cairnml_agent/backend_api/session/request.py +95 -0
  292. cairnml_agent/backend_api/session/response.py +55 -0
  293. cairnml_agent/backend_api/session/session.py +698 -0
  294. cairnml_agent/backend_api/session/token_manager.py +133 -0
  295. cairnml_agent/backend_api/utils.py +128 -0
  296. cairnml_agent/backend_config/__init__.py +3 -0
  297. cairnml_agent/backend_config/config.py +396 -0
  298. cairnml_agent/backend_config/converters.py +8 -0
  299. cairnml_agent/backend_config/defs.py +67 -0
  300. cairnml_agent/backend_config/entry.py +6 -0
  301. cairnml_agent/backend_config/environment.py +46 -0
  302. cairnml_agent/backend_config/errors.py +5 -0
  303. cairnml_agent/backend_config/log.py +30 -0
  304. cairnml_agent/backend_config/utils.py +125 -0
  305. cairnml_agent/commands/__init__.py +5 -0
  306. cairnml_agent/commands/base.py +465 -0
  307. cairnml_agent/commands/bootstrap.py +145 -0
  308. cairnml_agent/commands/check_config.py +20 -0
  309. cairnml_agent/commands/config.py +263 -0
  310. cairnml_agent/commands/events.py +134 -0
  311. cairnml_agent/commands/install_bootstrap.py +352 -0
  312. cairnml_agent/commands/resolver.py +179 -0
  313. cairnml_agent/commands/worker.py +5745 -0
  314. cairnml_agent/complete.py +87 -0
  315. cairnml_agent/config.py +34 -0
  316. cairnml_agent/definitions.py +272 -0
  317. cairnml_agent/errors.py +96 -0
  318. cairnml_agent/external/__init__.py +0 -0
  319. cairnml_agent/external/pyhocon/__init__.py +5 -0
  320. cairnml_agent/external/pyhocon/config_parser.py +762 -0
  321. cairnml_agent/external/pyhocon/config_tree.py +608 -0
  322. cairnml_agent/external/pyhocon/converter.py +329 -0
  323. cairnml_agent/external/pyhocon/exceptions.py +17 -0
  324. cairnml_agent/external/requirements_parser/__init__.py +22 -0
  325. cairnml_agent/external/requirements_parser/fragment.py +44 -0
  326. cairnml_agent/external/requirements_parser/parser.py +68 -0
  327. cairnml_agent/external/requirements_parser/requirement.py +257 -0
  328. cairnml_agent/external/requirements_parser/vcs.py +30 -0
  329. cairnml_agent/glue/__init__.py +1 -0
  330. cairnml_agent/glue/daemon.py +15 -0
  331. cairnml_agent/glue/definitions.py +45 -0
  332. cairnml_agent/glue/errors.py +15 -0
  333. cairnml_agent/glue/k8s.py +1549 -0
  334. cairnml_agent/glue/pending_pods_daemon.py +256 -0
  335. cairnml_agent/glue/utilities.py +18 -0
  336. cairnml_agent/helper/__init__.py +0 -0
  337. cairnml_agent/helper/base.py +701 -0
  338. cairnml_agent/helper/check_update.py +62 -0
  339. cairnml_agent/helper/console.py +118 -0
  340. cairnml_agent/helper/custom_template.py +466 -0
  341. cairnml_agent/helper/dicts.py +46 -0
  342. cairnml_agent/helper/docker_args.py +321 -0
  343. cairnml_agent/helper/environment/__init__.py +8 -0
  344. cairnml_agent/helper/environment/converters.py +85 -0
  345. cairnml_agent/helper/environment/entry.py +134 -0
  346. cairnml_agent/helper/environment/environment.py +28 -0
  347. cairnml_agent/helper/gpu/__init__.py +0 -0
  348. cairnml_agent/helper/gpu/gpustat.py +714 -0
  349. cairnml_agent/helper/gpu/pynvml.py +4893 -0
  350. cairnml_agent/helper/gpu/pyrsmi.py +609 -0
  351. cairnml_agent/helper/gpu/util.py +18 -0
  352. cairnml_agent/helper/hash.py +21 -0
  353. cairnml_agent/helper/job_token.py +79 -0
  354. cairnml_agent/helper/os/__init__.py +0 -0
  355. cairnml_agent/helper/os/daemonize.py +74 -0
  356. cairnml_agent/helper/os/folder_cache.py +243 -0
  357. cairnml_agent/helper/os/locks.py +236 -0
  358. cairnml_agent/helper/os/networking.py +57 -0
  359. cairnml_agent/helper/os/portalocker.py +200 -0
  360. cairnml_agent/helper/package/__init__.py +0 -0
  361. cairnml_agent/helper/package/base.py +424 -0
  362. cairnml_agent/helper/package/conda_api.py +853 -0
  363. cairnml_agent/helper/package/external_req.py +187 -0
  364. cairnml_agent/helper/package/pip_api/__init__.py +0 -0
  365. cairnml_agent/helper/package/pip_api/system.py +121 -0
  366. cairnml_agent/helper/package/pip_api/venv.py +101 -0
  367. cairnml_agent/helper/package/poetry_api.py +193 -0
  368. cairnml_agent/helper/package/post_req.py +48 -0
  369. cairnml_agent/helper/package/priority_req.py +161 -0
  370. cairnml_agent/helper/package/pytorch.py +1029 -0
  371. cairnml_agent/helper/package/requirements.py +918 -0
  372. cairnml_agent/helper/package/translator.py +100 -0
  373. cairnml_agent/helper/package/uv_api.py +554 -0
  374. cairnml_agent/helper/process.py +561 -0
  375. cairnml_agent/helper/repo.py +1151 -0
  376. cairnml_agent/helper/resource_monitor.py +732 -0
  377. cairnml_agent/helper/runtime_verification.py +171 -0
  378. cairnml_agent/helper/sdk_client/__init__.py +0 -0
  379. cairnml_agent/helper/sdk_client/utilities/__init__.py +0 -0
  380. cairnml_agent/helper/sdk_client/utilities/networking.py +98 -0
  381. cairnml_agent/helper/singleton.py +200 -0
  382. cairnml_agent/helper/task_logs.py +38 -0
  383. cairnml_agent/helper/task_runtime.py +43 -0
  384. cairnml_agent/helper/trace.py +144 -0
  385. cairnml_agent/idp/__init__.py +0 -0
  386. cairnml_agent/idp/assertion.py +76 -0
  387. cairnml_agent/idp/browser_login.py +113 -0
  388. cairnml_agent/idp/device.py +20 -0
  389. cairnml_agent/idp/enrol.py +145 -0
  390. cairnml_agent/idp/keys.py +60 -0
  391. cairnml_agent/interface/__init__.py +41 -0
  392. cairnml_agent/interface/base.py +419 -0
  393. cairnml_agent/interface/worker.py +289 -0
  394. cairnml_agent/scheduler/__init__.py +2 -0
  395. cairnml_agent/scheduler/usage.py +94 -0
  396. cairnml_agent/session.py +431 -0
  397. cairnml_agent/version.py +1 -0
  398. cairnml_agent-0.0.1.dist-info/METADATA +78 -0
  399. cairnml_agent-0.0.1.dist-info/RECORD +404 -0
  400. cairnml_agent-0.0.1.dist-info/WHEEL +5 -0
  401. cairnml_agent-0.0.1.dist-info/entry_points.txt +2 -0
  402. cairnml_agent-0.0.1.dist-info/licenses/LICENSE +201 -0
  403. cairnml_agent-0.0.1.dist-info/licenses/NOTICE +9 -0
  404. cairnml_agent-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1 @@
1
+ from .backend_api.session.client import APIClient
@@ -0,0 +1,93 @@
1
+ from __future__ import print_function, unicode_literals, absolute_import
2
+
3
+ import argparse
4
+ import sys
5
+ import warnings
6
+
7
+ from cairnml_agent.backend_api.session.datamodel import UnusedKwargsWarning
8
+
9
+ import cairnml_agent
10
+ from cairnml_agent.config import get_config
11
+ from cairnml_agent.definitions import FileBuffering, CONFIG_FILE
12
+ from cairnml_agent.helper.base import reverse_home_folder_expansion, chain_map, named_temporary_file
13
+ from cairnml_agent.helper.process import ExitStatus
14
+ from . import interface, session, definitions, commands
15
+ from .errors import ConfigFileNotFound, Sigterm, APIError, CustomBuildScriptFailed
16
+ from .helper.trace import PackageTrace
17
+ from .interface import get_parser
18
+
19
+
20
+ def run_command(parser, args, command_name):
21
+
22
+ debug = args.debug
23
+ session.Session.set_debug_mode(debug)
24
+
25
+ # install-bootstrap does not require a server session
26
+ if command_name and command_name.lower() in ('install-bootstrap',):
27
+ args_dict = dict(vars(args))
28
+ parser.remove_top_level_results(args_dict)
29
+ return commands.install_bootstrap(**args_dict)
30
+
31
+ if command_name and command_name.lower() in ('config', 'init'):
32
+ command_class = commands.Config
33
+ elif len(command_name.split('.')) < 2:
34
+ command_class = commands.Worker
35
+ elif hasattr(args, 'func') and getattr(args, 'func'):
36
+ command_class = getattr(commands, command_name.capitalize())
37
+ command_name = args.func
38
+ else:
39
+ command_class, command_name = command_name.split('.')
40
+ command_class = getattr(commands, command_class.capitalize())
41
+
42
+ args_dict = dict(vars(args))
43
+ parser.remove_top_level_results(args_dict)
44
+
45
+ warnings.simplefilter('ignore', UnusedKwargsWarning)
46
+
47
+ try:
48
+ command = command_class(**vars(args))
49
+ get_config()['command'] = command
50
+ debug = command._session.debug_mode
51
+ func = getattr(command, command_name)
52
+ return func(**args_dict)
53
+ except CustomBuildScriptFailed as e:
54
+ command_class.exit(e.message, e.errno)
55
+ except ConfigFileNotFound:
56
+ message = 'Cannot find configuration file in "{}".\n' \
57
+ 'To create a configuration file, run:\n' \
58
+ '$ cairnml_agent init'.format(reverse_home_folder_expansion(CONFIG_FILE))
59
+ command_class.exit(message)
60
+ except APIError as api_error:
61
+ if not debug:
62
+ command_class.error(api_error)
63
+ return ExitStatus.failure
64
+ traceback = api_error.format_traceback()
65
+ if traceback:
66
+ print(traceback)
67
+ print('Own traceback:')
68
+ raise
69
+ except Exception as e:
70
+ if debug:
71
+ raise
72
+ command_class.error(e)
73
+ return ExitStatus.failure
74
+ except (KeyboardInterrupt, Sigterm):
75
+ return ExitStatus.interrupted
76
+
77
+
78
+ def main():
79
+ parser = get_parser()
80
+ args = parser.parse_args()
81
+
82
+ try:
83
+ command_name = args.command
84
+ if not command_name:
85
+ return parser.print_help()
86
+ except AttributeError:
87
+ parser.error(argparse._('too few arguments'))
88
+
89
+ return run_command(parser, args, command_name)
90
+
91
+
92
+ if __name__ == "__main__":
93
+ sys.exit(main())
File without changes
@@ -0,0 +1,93 @@
1
+ # SPDX-License-Identifier: MIT
2
+
3
+ import sys
4
+ import warnings
5
+
6
+ from functools import partial
7
+
8
+ from . import converters, exceptions, filters, setters, validators
9
+ from ._cmp import cmp_using
10
+ from ._config import get_run_validators, set_run_validators
11
+ from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
12
+ from ._make import (
13
+ NOTHING,
14
+ Attribute,
15
+ Factory,
16
+ attrib,
17
+ attrs,
18
+ fields,
19
+ fields_dict,
20
+ make_class,
21
+ validate,
22
+ )
23
+ from ._next_gen import define, field, frozen, mutable
24
+ from ._version_info import VersionInfo
25
+
26
+
27
+ if sys.version_info < (3, 7): # pragma: no cover
28
+ warnings.warn(
29
+ "Running attrs on Python 3.6 is deprecated & we intend to drop "
30
+ "support soon. If that's a problem for you, please let us know why & "
31
+ "we MAY re-evaluate: <https://github.com/python-attrs/attrs/pull/993>",
32
+ DeprecationWarning,
33
+ )
34
+
35
+ __version__ = "22.2.0"
36
+ __version_info__ = VersionInfo._from_version_string(__version__)
37
+
38
+ __title__ = "attrs"
39
+ __description__ = "Classes Without Boilerplate"
40
+ __url__ = "https://www.attrs.org/"
41
+ __uri__ = __url__
42
+ __doc__ = __description__ + " <" + __uri__ + ">"
43
+
44
+ __author__ = "Hynek Schlawack"
45
+ __email__ = "hs@ox.cx"
46
+
47
+ __license__ = "MIT"
48
+ __copyright__ = "Copyright (c) 2015 Hynek Schlawack"
49
+
50
+
51
+ s = attributes = attrs
52
+ ib = attr = attrib
53
+ dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
54
+
55
+
56
+ class AttrsInstance:
57
+ pass
58
+
59
+
60
+ __all__ = [
61
+ "Attribute",
62
+ "AttrsInstance",
63
+ "Factory",
64
+ "NOTHING",
65
+ "asdict",
66
+ "assoc",
67
+ "astuple",
68
+ "attr",
69
+ "attrib",
70
+ "attributes",
71
+ "attrs",
72
+ "cmp_using",
73
+ "converters",
74
+ "define",
75
+ "evolve",
76
+ "exceptions",
77
+ "field",
78
+ "fields",
79
+ "fields_dict",
80
+ "filters",
81
+ "frozen",
82
+ "get_run_validators",
83
+ "has",
84
+ "ib",
85
+ "make_class",
86
+ "mutable",
87
+ "resolve_types",
88
+ "s",
89
+ "set_run_validators",
90
+ "setters",
91
+ "validate",
92
+ "validators",
93
+ ]
@@ -0,0 +1,509 @@
1
+ import enum
2
+ import sys
3
+
4
+ from typing import (
5
+ Any,
6
+ Callable,
7
+ Dict,
8
+ Generic,
9
+ List,
10
+ Mapping,
11
+ Optional,
12
+ Protocol,
13
+ Sequence,
14
+ Tuple,
15
+ Type,
16
+ TypeVar,
17
+ Union,
18
+ overload,
19
+ )
20
+
21
+ # `import X as X` is required to make these public
22
+ from . import converters as converters
23
+ from . import exceptions as exceptions
24
+ from . import filters as filters
25
+ from . import setters as setters
26
+ from . import validators as validators
27
+ from ._cmp import cmp_using as cmp_using
28
+ from ._typing_compat import AttrsInstance_
29
+ from ._version_info import VersionInfo
30
+
31
+ if sys.version_info >= (3, 10):
32
+ from typing import TypeGuard
33
+ else:
34
+ from ..._vendor.typing_extensions import TypeGuard
35
+
36
+ __version__: str
37
+ __version_info__: VersionInfo
38
+ __title__: str
39
+ __description__: str
40
+ __url__: str
41
+ __uri__: str
42
+ __author__: str
43
+ __email__: str
44
+ __license__: str
45
+ __copyright__: str
46
+
47
+ _T = TypeVar("_T")
48
+ _C = TypeVar("_C", bound=type)
49
+
50
+ _EqOrderType = Union[bool, Callable[[Any], Any]]
51
+ _ValidatorType = Callable[[Any, "Attribute[_T]", _T], Any]
52
+ _ConverterType = Callable[[Any], Any]
53
+ _FilterType = Callable[["Attribute[_T]", _T], bool]
54
+ _ReprType = Callable[[Any], str]
55
+ _ReprArgType = Union[bool, _ReprType]
56
+ _OnSetAttrType = Callable[[Any, "Attribute[Any]", Any], Any]
57
+ _OnSetAttrArgType = Union[
58
+ _OnSetAttrType, List[_OnSetAttrType], setters._NoOpType
59
+ ]
60
+ _FieldTransformer = Callable[
61
+ [type, List["Attribute[Any]"]], List["Attribute[Any]"]
62
+ ]
63
+ # FIXME: in reality, if multiple validators are passed they must be in a list
64
+ # or tuple, but those are invariant and so would prevent subtypes of
65
+ # _ValidatorType from working when passed in a list or tuple.
66
+ _ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
67
+
68
+ # We subclass this here to keep the protocol's qualified name clean.
69
+ class AttrsInstance(AttrsInstance_, Protocol):
70
+ pass
71
+
72
+ # _make --
73
+
74
+ class _Nothing(enum.Enum):
75
+ NOTHING = enum.auto()
76
+
77
+ NOTHING = _Nothing.NOTHING
78
+
79
+ # NOTE: Factory lies about its return type to make this possible:
80
+ # `x: List[int] # = Factory(list)`
81
+ # Work around mypy issue #4554 in the common case by using an overload.
82
+ if sys.version_info >= (3, 8):
83
+ from typing import Literal
84
+ @overload
85
+ def Factory(factory: Callable[[], _T]) -> _T: ...
86
+ @overload
87
+ def Factory(
88
+ factory: Callable[[Any], _T],
89
+ takes_self: Literal[True],
90
+ ) -> _T: ...
91
+ @overload
92
+ def Factory(
93
+ factory: Callable[[], _T],
94
+ takes_self: Literal[False],
95
+ ) -> _T: ...
96
+
97
+ else:
98
+ @overload
99
+ def Factory(factory: Callable[[], _T]) -> _T: ...
100
+ @overload
101
+ def Factory(
102
+ factory: Union[Callable[[Any], _T], Callable[[], _T]],
103
+ takes_self: bool = ...,
104
+ ) -> _T: ...
105
+
106
+ # Static type inference support via __dataclass_transform__ implemented as per:
107
+ # https://github.com/microsoft/pyright/blob/1.1.135/specs/dataclass_transforms.md
108
+ # This annotation must be applied to all overloads of "define" and "attrs"
109
+ #
110
+ # NOTE: This is a typing construct and does not exist at runtime. Extensions
111
+ # wrapping attrs decorators should declare a separate __dataclass_transform__
112
+ # signature in the extension module using the specification linked above to
113
+ # provide pyright support.
114
+ def __dataclass_transform__(
115
+ *,
116
+ eq_default: bool = True,
117
+ order_default: bool = False,
118
+ kw_only_default: bool = False,
119
+ field_descriptors: Tuple[Union[type, Callable[..., Any]], ...] = (()),
120
+ ) -> Callable[[_T], _T]: ...
121
+
122
+ class Attribute(Generic[_T]):
123
+ name: str
124
+ default: Optional[_T]
125
+ validator: Optional[_ValidatorType[_T]]
126
+ repr: _ReprArgType
127
+ cmp: _EqOrderType
128
+ eq: _EqOrderType
129
+ order: _EqOrderType
130
+ hash: Optional[bool]
131
+ init: bool
132
+ converter: Optional[_ConverterType]
133
+ metadata: Dict[Any, Any]
134
+ type: Optional[Type[_T]]
135
+ kw_only: bool
136
+ on_setattr: _OnSetAttrType
137
+ alias: Optional[str]
138
+
139
+ def evolve(self, **changes: Any) -> "Attribute[Any]": ...
140
+
141
+ # NOTE: We had several choices for the annotation to use for type arg:
142
+ # 1) Type[_T]
143
+ # - Pros: Handles simple cases correctly
144
+ # - Cons: Might produce less informative errors in the case of conflicting
145
+ # TypeVars e.g. `attr.ib(default='bad', type=int)`
146
+ # 2) Callable[..., _T]
147
+ # - Pros: Better error messages than #1 for conflicting TypeVars
148
+ # - Cons: Terrible error messages for validator checks.
149
+ # e.g. attr.ib(type=int, validator=validate_str)
150
+ # -> error: Cannot infer function type argument
151
+ # 3) type (and do all of the work in the mypy plugin)
152
+ # - Pros: Simple here, and we could customize the plugin with our own errors.
153
+ # - Cons: Would need to write mypy plugin code to handle all the cases.
154
+ # We chose option #1.
155
+
156
+ # `attr` lies about its return type to make the following possible:
157
+ # attr() -> Any
158
+ # attr(8) -> int
159
+ # attr(validator=<some callable>) -> Whatever the callable expects.
160
+ # This makes this type of assignments possible:
161
+ # x: int = attr(8)
162
+ #
163
+ # This form catches explicit None or no default but with no other arguments
164
+ # returns Any.
165
+ @overload
166
+ def attrib(
167
+ default: None = ...,
168
+ validator: None = ...,
169
+ repr: _ReprArgType = ...,
170
+ cmp: Optional[_EqOrderType] = ...,
171
+ hash: Optional[bool] = ...,
172
+ init: bool = ...,
173
+ metadata: Optional[Mapping[Any, Any]] = ...,
174
+ type: None = ...,
175
+ converter: None = ...,
176
+ factory: None = ...,
177
+ kw_only: bool = ...,
178
+ eq: Optional[_EqOrderType] = ...,
179
+ order: Optional[_EqOrderType] = ...,
180
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
181
+ alias: Optional[str] = ...,
182
+ ) -> Any: ...
183
+
184
+ # This form catches an explicit None or no default and infers the type from the
185
+ # other arguments.
186
+ @overload
187
+ def attrib(
188
+ default: None = ...,
189
+ validator: Optional[_ValidatorArgType[_T]] = ...,
190
+ repr: _ReprArgType = ...,
191
+ cmp: Optional[_EqOrderType] = ...,
192
+ hash: Optional[bool] = ...,
193
+ init: bool = ...,
194
+ metadata: Optional[Mapping[Any, Any]] = ...,
195
+ type: Optional[Type[_T]] = ...,
196
+ converter: Optional[_ConverterType] = ...,
197
+ factory: Optional[Callable[[], _T]] = ...,
198
+ kw_only: bool = ...,
199
+ eq: Optional[_EqOrderType] = ...,
200
+ order: Optional[_EqOrderType] = ...,
201
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
202
+ alias: Optional[str] = ...,
203
+ ) -> _T: ...
204
+
205
+ # This form catches an explicit default argument.
206
+ @overload
207
+ def attrib(
208
+ default: _T,
209
+ validator: Optional[_ValidatorArgType[_T]] = ...,
210
+ repr: _ReprArgType = ...,
211
+ cmp: Optional[_EqOrderType] = ...,
212
+ hash: Optional[bool] = ...,
213
+ init: bool = ...,
214
+ metadata: Optional[Mapping[Any, Any]] = ...,
215
+ type: Optional[Type[_T]] = ...,
216
+ converter: Optional[_ConverterType] = ...,
217
+ factory: Optional[Callable[[], _T]] = ...,
218
+ kw_only: bool = ...,
219
+ eq: Optional[_EqOrderType] = ...,
220
+ order: Optional[_EqOrderType] = ...,
221
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
222
+ alias: Optional[str] = ...,
223
+ ) -> _T: ...
224
+
225
+ # This form covers type=non-Type: e.g. forward references (str), Any
226
+ @overload
227
+ def attrib(
228
+ default: Optional[_T] = ...,
229
+ validator: Optional[_ValidatorArgType[_T]] = ...,
230
+ repr: _ReprArgType = ...,
231
+ cmp: Optional[_EqOrderType] = ...,
232
+ hash: Optional[bool] = ...,
233
+ init: bool = ...,
234
+ metadata: Optional[Mapping[Any, Any]] = ...,
235
+ type: object = ...,
236
+ converter: Optional[_ConverterType] = ...,
237
+ factory: Optional[Callable[[], _T]] = ...,
238
+ kw_only: bool = ...,
239
+ eq: Optional[_EqOrderType] = ...,
240
+ order: Optional[_EqOrderType] = ...,
241
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
242
+ alias: Optional[str] = ...,
243
+ ) -> Any: ...
244
+ @overload
245
+ def field(
246
+ *,
247
+ default: None = ...,
248
+ validator: None = ...,
249
+ repr: _ReprArgType = ...,
250
+ hash: Optional[bool] = ...,
251
+ init: bool = ...,
252
+ metadata: Optional[Mapping[Any, Any]] = ...,
253
+ converter: None = ...,
254
+ factory: None = ...,
255
+ kw_only: bool = ...,
256
+ eq: Optional[bool] = ...,
257
+ order: Optional[bool] = ...,
258
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
259
+ alias: Optional[str] = ...,
260
+ ) -> Any: ...
261
+
262
+ # This form catches an explicit None or no default and infers the type from the
263
+ # other arguments.
264
+ @overload
265
+ def field(
266
+ *,
267
+ default: None = ...,
268
+ validator: Optional[_ValidatorArgType[_T]] = ...,
269
+ repr: _ReprArgType = ...,
270
+ hash: Optional[bool] = ...,
271
+ init: bool = ...,
272
+ metadata: Optional[Mapping[Any, Any]] = ...,
273
+ converter: Optional[_ConverterType] = ...,
274
+ factory: Optional[Callable[[], _T]] = ...,
275
+ kw_only: bool = ...,
276
+ eq: Optional[_EqOrderType] = ...,
277
+ order: Optional[_EqOrderType] = ...,
278
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
279
+ alias: Optional[str] = ...,
280
+ ) -> _T: ...
281
+
282
+ # This form catches an explicit default argument.
283
+ @overload
284
+ def field(
285
+ *,
286
+ default: _T,
287
+ validator: Optional[_ValidatorArgType[_T]] = ...,
288
+ repr: _ReprArgType = ...,
289
+ hash: Optional[bool] = ...,
290
+ init: bool = ...,
291
+ metadata: Optional[Mapping[Any, Any]] = ...,
292
+ converter: Optional[_ConverterType] = ...,
293
+ factory: Optional[Callable[[], _T]] = ...,
294
+ kw_only: bool = ...,
295
+ eq: Optional[_EqOrderType] = ...,
296
+ order: Optional[_EqOrderType] = ...,
297
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
298
+ alias: Optional[str] = ...,
299
+ ) -> _T: ...
300
+
301
+ # This form covers type=non-Type: e.g. forward references (str), Any
302
+ @overload
303
+ def field(
304
+ *,
305
+ default: Optional[_T] = ...,
306
+ validator: Optional[_ValidatorArgType[_T]] = ...,
307
+ repr: _ReprArgType = ...,
308
+ hash: Optional[bool] = ...,
309
+ init: bool = ...,
310
+ metadata: Optional[Mapping[Any, Any]] = ...,
311
+ converter: Optional[_ConverterType] = ...,
312
+ factory: Optional[Callable[[], _T]] = ...,
313
+ kw_only: bool = ...,
314
+ eq: Optional[_EqOrderType] = ...,
315
+ order: Optional[_EqOrderType] = ...,
316
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
317
+ alias: Optional[str] = ...,
318
+ ) -> Any: ...
319
+ @overload
320
+ @__dataclass_transform__(order_default=True, field_descriptors=(attrib, field))
321
+ def attrs(
322
+ maybe_cls: _C,
323
+ these: Optional[Dict[str, Any]] = ...,
324
+ repr_ns: Optional[str] = ...,
325
+ repr: bool = ...,
326
+ cmp: Optional[_EqOrderType] = ...,
327
+ hash: Optional[bool] = ...,
328
+ init: bool = ...,
329
+ slots: bool = ...,
330
+ frozen: bool = ...,
331
+ weakref_slot: bool = ...,
332
+ str: bool = ...,
333
+ auto_attribs: bool = ...,
334
+ kw_only: bool = ...,
335
+ cache_hash: bool = ...,
336
+ auto_exc: bool = ...,
337
+ eq: Optional[_EqOrderType] = ...,
338
+ order: Optional[_EqOrderType] = ...,
339
+ auto_detect: bool = ...,
340
+ collect_by_mro: bool = ...,
341
+ getstate_setstate: Optional[bool] = ...,
342
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
343
+ field_transformer: Optional[_FieldTransformer] = ...,
344
+ match_args: bool = ...,
345
+ unsafe_hash: Optional[bool] = ...,
346
+ ) -> _C: ...
347
+ @overload
348
+ @__dataclass_transform__(order_default=True, field_descriptors=(attrib, field))
349
+ def attrs(
350
+ maybe_cls: None = ...,
351
+ these: Optional[Dict[str, Any]] = ...,
352
+ repr_ns: Optional[str] = ...,
353
+ repr: bool = ...,
354
+ cmp: Optional[_EqOrderType] = ...,
355
+ hash: Optional[bool] = ...,
356
+ init: bool = ...,
357
+ slots: bool = ...,
358
+ frozen: bool = ...,
359
+ weakref_slot: bool = ...,
360
+ str: bool = ...,
361
+ auto_attribs: bool = ...,
362
+ kw_only: bool = ...,
363
+ cache_hash: bool = ...,
364
+ auto_exc: bool = ...,
365
+ eq: Optional[_EqOrderType] = ...,
366
+ order: Optional[_EqOrderType] = ...,
367
+ auto_detect: bool = ...,
368
+ collect_by_mro: bool = ...,
369
+ getstate_setstate: Optional[bool] = ...,
370
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
371
+ field_transformer: Optional[_FieldTransformer] = ...,
372
+ match_args: bool = ...,
373
+ unsafe_hash: Optional[bool] = ...,
374
+ ) -> Callable[[_C], _C]: ...
375
+ @overload
376
+ @__dataclass_transform__(field_descriptors=(attrib, field))
377
+ def define(
378
+ maybe_cls: _C,
379
+ *,
380
+ these: Optional[Dict[str, Any]] = ...,
381
+ repr: bool = ...,
382
+ unsafe_hash: Optional[bool] = ...,
383
+ hash: Optional[bool] = ...,
384
+ init: bool = ...,
385
+ slots: bool = ...,
386
+ frozen: bool = ...,
387
+ weakref_slot: bool = ...,
388
+ str: bool = ...,
389
+ auto_attribs: bool = ...,
390
+ kw_only: bool = ...,
391
+ cache_hash: bool = ...,
392
+ auto_exc: bool = ...,
393
+ eq: Optional[bool] = ...,
394
+ order: Optional[bool] = ...,
395
+ auto_detect: bool = ...,
396
+ getstate_setstate: Optional[bool] = ...,
397
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
398
+ field_transformer: Optional[_FieldTransformer] = ...,
399
+ match_args: bool = ...,
400
+ ) -> _C: ...
401
+ @overload
402
+ @__dataclass_transform__(field_descriptors=(attrib, field))
403
+ def define(
404
+ maybe_cls: None = ...,
405
+ *,
406
+ these: Optional[Dict[str, Any]] = ...,
407
+ repr: bool = ...,
408
+ unsafe_hash: Optional[bool] = ...,
409
+ hash: Optional[bool] = ...,
410
+ init: bool = ...,
411
+ slots: bool = ...,
412
+ frozen: bool = ...,
413
+ weakref_slot: bool = ...,
414
+ str: bool = ...,
415
+ auto_attribs: bool = ...,
416
+ kw_only: bool = ...,
417
+ cache_hash: bool = ...,
418
+ auto_exc: bool = ...,
419
+ eq: Optional[bool] = ...,
420
+ order: Optional[bool] = ...,
421
+ auto_detect: bool = ...,
422
+ getstate_setstate: Optional[bool] = ...,
423
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
424
+ field_transformer: Optional[_FieldTransformer] = ...,
425
+ match_args: bool = ...,
426
+ ) -> Callable[[_C], _C]: ...
427
+
428
+ mutable = define
429
+ frozen = define # they differ only in their defaults
430
+
431
+ def fields(cls: Type[AttrsInstance]) -> Any: ...
432
+ def fields_dict(cls: Type[AttrsInstance]) -> Dict[str, Attribute[Any]]: ...
433
+ def validate(inst: AttrsInstance) -> None: ...
434
+ def resolve_types(
435
+ cls: _C,
436
+ globalns: Optional[Dict[str, Any]] = ...,
437
+ localns: Optional[Dict[str, Any]] = ...,
438
+ attribs: Optional[List[Attribute[Any]]] = ...,
439
+ ) -> _C: ...
440
+
441
+ # TODO: add support for returning a proper attrs class from the mypy plugin
442
+ # we use Any instead of _CountingAttr so that e.g. `make_class('Foo',
443
+ # [attr.ib()])` is valid
444
+ def make_class(
445
+ name: str,
446
+ attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]],
447
+ bases: Tuple[type, ...] = ...,
448
+ repr_ns: Optional[str] = ...,
449
+ repr: bool = ...,
450
+ cmp: Optional[_EqOrderType] = ...,
451
+ hash: Optional[bool] = ...,
452
+ init: bool = ...,
453
+ slots: bool = ...,
454
+ frozen: bool = ...,
455
+ weakref_slot: bool = ...,
456
+ str: bool = ...,
457
+ auto_attribs: bool = ...,
458
+ kw_only: bool = ...,
459
+ cache_hash: bool = ...,
460
+ auto_exc: bool = ...,
461
+ eq: Optional[_EqOrderType] = ...,
462
+ order: Optional[_EqOrderType] = ...,
463
+ collect_by_mro: bool = ...,
464
+ on_setattr: Optional[_OnSetAttrArgType] = ...,
465
+ field_transformer: Optional[_FieldTransformer] = ...,
466
+ ) -> type: ...
467
+
468
+ # _funcs --
469
+
470
+ # TODO: add support for returning TypedDict from the mypy plugin
471
+ # FIXME: asdict/astuple do not honor their factory args. Waiting on one of
472
+ # these:
473
+ # https://github.com/python/mypy/issues/4236
474
+ # https://github.com/python/typing/issues/253
475
+ # XXX: remember to fix attrs.asdict/astuple too!
476
+ def asdict(
477
+ inst: AttrsInstance,
478
+ recurse: bool = ...,
479
+ filter: Optional[_FilterType[Any]] = ...,
480
+ dict_factory: Type[Mapping[Any, Any]] = ...,
481
+ retain_collection_types: bool = ...,
482
+ value_serializer: Optional[
483
+ Callable[[type, Attribute[Any], Any], Any]
484
+ ] = ...,
485
+ tuple_keys: Optional[bool] = ...,
486
+ ) -> Dict[str, Any]: ...
487
+
488
+ # TODO: add support for returning NamedTuple from the mypy plugin
489
+ def astuple(
490
+ inst: AttrsInstance,
491
+ recurse: bool = ...,
492
+ filter: Optional[_FilterType[Any]] = ...,
493
+ tuple_factory: Type[Sequence[Any]] = ...,
494
+ retain_collection_types: bool = ...,
495
+ ) -> Tuple[Any, ...]: ...
496
+ def has(cls: type) -> TypeGuard[Type[AttrsInstance]]: ...
497
+ def assoc(inst: _T, **changes: Any) -> _T: ...
498
+ def evolve(inst: _T, **changes: Any) -> _T: ...
499
+
500
+ # _config --
501
+
502
+ def set_run_validators(run: bool) -> None: ...
503
+ def get_run_validators() -> bool: ...
504
+
505
+ # aliases --
506
+
507
+ s = attributes = attrs
508
+ ib = attr = attrib
509
+ dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;)