arctrl 3.0.0__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 (511) hide show
  1. arctrl/__init__.py +23 -0
  2. arctrl/cwl.py +12 -0
  3. arctrl/py/CWL/__init__.py +0 -0
  4. arctrl/py/CWL/cwlprocessing_unit.py +221 -0
  5. arctrl/py/CWL/cwltypes.py +364 -0
  6. arctrl/py/CWL/decode.py +3532 -0
  7. arctrl/py/CWL/encode.py +1905 -0
  8. arctrl/py/CWL/expression_tool_description.py +192 -0
  9. arctrl/py/CWL/hash_helpers.py +60 -0
  10. arctrl/py/CWL/inputs.py +122 -0
  11. arctrl/py/CWL/operation_description.py +169 -0
  12. arctrl/py/CWL/outputs.py +171 -0
  13. arctrl/py/CWL/parameter_reference.py +74 -0
  14. arctrl/py/CWL/requirements.py +350 -0
  15. arctrl/py/CWL/tool_description.py +192 -0
  16. arctrl/py/CWL/workflow_description.py +181 -0
  17. arctrl/py/CWL/workflow_steps.py +354 -0
  18. arctrl/py/Contract/__init__.py +0 -0
  19. arctrl/py/Contract/arc.py +89 -0
  20. arctrl/py/Contract/arc_assay.py +125 -0
  21. arctrl/py/Contract/arc_investigation.py +88 -0
  22. arctrl/py/Contract/arc_run.py +291 -0
  23. arctrl/py/Contract/arc_study.py +126 -0
  24. arctrl/py/Contract/arc_workflow.py +213 -0
  25. arctrl/py/Contract/contract.py +153 -0
  26. arctrl/py/Contract/datamap.py +396 -0
  27. arctrl/py/Contract/git.py +116 -0
  28. arctrl/py/Contract/license.py +58 -0
  29. arctrl/py/Contract/validation_packages_config.py +107 -0
  30. arctrl/py/ContractIO/__init__.py +0 -0
  31. arctrl/py/ContractIO/contract_io.py +350 -0
  32. arctrl/py/ContractIO/file_system_helper.py +264 -0
  33. arctrl/py/Conversion/__init__.py +0 -0
  34. arctrl/py/Conversion/assay.py +151 -0
  35. arctrl/py/Conversion/basic.py +559 -0
  36. arctrl/py/Conversion/column_index.py +91 -0
  37. arctrl/py/Conversion/datamap.py +36 -0
  38. arctrl/py/Conversion/date_time.py +32 -0
  39. arctrl/py/Conversion/investigation.py +171 -0
  40. arctrl/py/Conversion/person.py +148 -0
  41. arctrl/py/Conversion/process.py +828 -0
  42. arctrl/py/Conversion/run.py +367 -0
  43. arctrl/py/Conversion/scholarly_article.py +163 -0
  44. arctrl/py/Conversion/study.py +99 -0
  45. arctrl/py/Conversion/table.py +229 -0
  46. arctrl/py/Conversion/workflow.py +680 -0
  47. arctrl/py/Core/Helper/__init__.py +0 -0
  48. arctrl/py/Core/Helper/collections_.py +512 -0
  49. arctrl/py/Core/Helper/date_time.py +26 -0
  50. arctrl/py/Core/Helper/hash_codes.py +60 -0
  51. arctrl/py/Core/Helper/identifier.py +290 -0
  52. arctrl/py/Core/Helper/orcid.py +42 -0
  53. arctrl/py/Core/Helper/printer.py +13 -0
  54. arctrl/py/Core/Helper/regex.py +554 -0
  55. arctrl/py/Core/Helper/sem_ver.py +71 -0
  56. arctrl/py/Core/Helper/url.py +148 -0
  57. arctrl/py/Core/Process/__init__.py +0 -0
  58. arctrl/py/Core/Process/column_index.py +280 -0
  59. arctrl/py/Core/Process/component.py +200 -0
  60. arctrl/py/Core/Process/factor.py +151 -0
  61. arctrl/py/Core/Process/factor_value.py +182 -0
  62. arctrl/py/Core/Process/material.py +74 -0
  63. arctrl/py/Core/Process/material_attribute.py +95 -0
  64. arctrl/py/Core/Process/material_attribute_value.py +184 -0
  65. arctrl/py/Core/Process/material_type.py +45 -0
  66. arctrl/py/Core/Process/process.py +477 -0
  67. arctrl/py/Core/Process/process_input.py +265 -0
  68. arctrl/py/Core/Process/process_output.py +235 -0
  69. arctrl/py/Core/Process/process_parameter_value.py +200 -0
  70. arctrl/py/Core/Process/process_sequence.py +435 -0
  71. arctrl/py/Core/Process/protocol.py +175 -0
  72. arctrl/py/Core/Process/protocol_parameter.py +98 -0
  73. arctrl/py/Core/Process/sample.py +82 -0
  74. arctrl/py/Core/Process/source.py +62 -0
  75. arctrl/py/Core/Table/__init__.py +0 -0
  76. arctrl/py/Core/Table/arc_table.py +1206 -0
  77. arctrl/py/Core/Table/arc_table_aux.py +1308 -0
  78. arctrl/py/Core/Table/arc_tables.py +574 -0
  79. arctrl/py/Core/Table/composite_cell.py +319 -0
  80. arctrl/py/Core/Table/composite_column.py +73 -0
  81. arctrl/py/Core/Table/composite_header.py +739 -0
  82. arctrl/py/Core/__init__.py +0 -0
  83. arctrl/py/Core/arc_types.py +5312 -0
  84. arctrl/py/Core/comment.py +128 -0
  85. arctrl/py/Core/comment_list.py +127 -0
  86. arctrl/py/Core/conversion.py +1375 -0
  87. arctrl/py/Core/data.py +247 -0
  88. arctrl/py/Core/data_context.py +157 -0
  89. arctrl/py/Core/data_file.py +112 -0
  90. arctrl/py/Core/datamap.py +217 -0
  91. arctrl/py/Core/identifier_setters.py +43 -0
  92. arctrl/py/Core/iproperty_value.py +36 -0
  93. arctrl/py/Core/ontology_annotation.py +298 -0
  94. arctrl/py/Core/ontology_source_reference.py +114 -0
  95. arctrl/py/Core/person.py +259 -0
  96. arctrl/py/Core/publication.py +161 -0
  97. arctrl/py/Core/template.py +231 -0
  98. arctrl/py/Core/templates.py +148 -0
  99. arctrl/py/Core/uri.py +11 -0
  100. arctrl/py/Core/value.py +188 -0
  101. arctrl/py/FileSystem/__init__.py +0 -0
  102. arctrl/py/FileSystem/commit.py +21 -0
  103. arctrl/py/FileSystem/default_gitattributes.py +1 -0
  104. arctrl/py/FileSystem/default_gitignore.py +1 -0
  105. arctrl/py/FileSystem/default_license.py +1 -0
  106. arctrl/py/FileSystem/file_system.py +58 -0
  107. arctrl/py/FileSystem/file_system_tree.py +483 -0
  108. arctrl/py/FileSystem/path.py +266 -0
  109. arctrl/py/Json/Datamap/__init__.py +0 -0
  110. arctrl/py/Json/Datamap/data_context.py +101 -0
  111. arctrl/py/Json/Datamap/datamap.py +53 -0
  112. arctrl/py/Json/Process/__init__.py +0 -0
  113. arctrl/py/Json/Process/assay_materials.py +46 -0
  114. arctrl/py/Json/Process/component.py +125 -0
  115. arctrl/py/Json/Process/factor.py +107 -0
  116. arctrl/py/Json/Process/factor_value.py +101 -0
  117. arctrl/py/Json/Process/material.py +226 -0
  118. arctrl/py/Json/Process/material_attribute.py +79 -0
  119. arctrl/py/Json/Process/material_attribute_value.py +101 -0
  120. arctrl/py/Json/Process/material_type.py +53 -0
  121. arctrl/py/Json/Process/process.py +296 -0
  122. arctrl/py/Json/Process/process_input.py +83 -0
  123. arctrl/py/Json/Process/process_output.py +67 -0
  124. arctrl/py/Json/Process/process_parameter_value.py +81 -0
  125. arctrl/py/Json/Process/protocol.py +354 -0
  126. arctrl/py/Json/Process/protocol_parameter.py +91 -0
  127. arctrl/py/Json/Process/sample.py +277 -0
  128. arctrl/py/Json/Process/source.py +214 -0
  129. arctrl/py/Json/Process/study_materials.py +52 -0
  130. arctrl/py/Json/Process/value.py +56 -0
  131. arctrl/py/Json/ROCrate/__init__.py +0 -0
  132. arctrl/py/Json/ROCrate/ldcontext.py +143 -0
  133. arctrl/py/Json/ROCrate/ldgraph.py +117 -0
  134. arctrl/py/Json/ROCrate/ldnode.py +304 -0
  135. arctrl/py/Json/ROCrate/ldref.py +44 -0
  136. arctrl/py/Json/ROCrate/ldvalue.py +102 -0
  137. arctrl/py/Json/Table/__init__.py +0 -0
  138. arctrl/py/Json/Table/arc_table.py +375 -0
  139. arctrl/py/Json/Table/cell_table.py +83 -0
  140. arctrl/py/Json/Table/composite_cell.py +136 -0
  141. arctrl/py/Json/Table/composite_header.py +67 -0
  142. arctrl/py/Json/Table/iotype.py +24 -0
  143. arctrl/py/Json/Table/oatable.py +82 -0
  144. arctrl/py/Json/Table/templates.py +281 -0
  145. arctrl/py/Json/__init__.py +0 -0
  146. arctrl/py/Json/assay.py +600 -0
  147. arctrl/py/Json/comment.py +206 -0
  148. arctrl/py/Json/context/rocrate/__init__.py +0 -0
  149. arctrl/py/Json/context/rocrate/isa_assay_context.py +101 -0
  150. arctrl/py/Json/context/rocrate/isa_comment_context.py +60 -0
  151. arctrl/py/Json/context/rocrate/isa_component_context.py +77 -0
  152. arctrl/py/Json/context/rocrate/isa_data_context.py +74 -0
  153. arctrl/py/Json/context/rocrate/isa_factor_context.py +74 -0
  154. arctrl/py/Json/context/rocrate/isa_factor_value_context.py +84 -0
  155. arctrl/py/Json/context/rocrate/isa_investigation_context.py +110 -0
  156. arctrl/py/Json/context/rocrate/isa_material_attribute_context.py +64 -0
  157. arctrl/py/Json/context/rocrate/isa_material_attribute_value_context.py +80 -0
  158. arctrl/py/Json/context/rocrate/isa_material_context.py +71 -0
  159. arctrl/py/Json/context/rocrate/isa_ontology_annotation_context.py +68 -0
  160. arctrl/py/Json/context/rocrate/isa_ontology_source_reference_context.py +75 -0
  161. arctrl/py/Json/context/rocrate/isa_organization_context.py +55 -0
  162. arctrl/py/Json/context/rocrate/isa_person_context.py +131 -0
  163. arctrl/py/Json/context/rocrate/isa_process_context.py +94 -0
  164. arctrl/py/Json/context/rocrate/isa_process_parameter_value_context.py +80 -0
  165. arctrl/py/Json/context/rocrate/isa_protocol_context.py +97 -0
  166. arctrl/py/Json/context/rocrate/isa_protocol_parameter_context.py +64 -0
  167. arctrl/py/Json/context/rocrate/isa_publication_context.py +78 -0
  168. arctrl/py/Json/context/rocrate/isa_sample_context.py +65 -0
  169. arctrl/py/Json/context/rocrate/isa_source_context.py +66 -0
  170. arctrl/py/Json/context/rocrate/isa_study_context.py +125 -0
  171. arctrl/py/Json/context/rocrate/property_value_context.py +73 -0
  172. arctrl/py/Json/context/rocrate/rocrate_context.py +81 -0
  173. arctrl/py/Json/converter_options.py +23 -0
  174. arctrl/py/Json/data.py +356 -0
  175. arctrl/py/Json/data_file.py +63 -0
  176. arctrl/py/Json/decode.py +271 -0
  177. arctrl/py/Json/encode.py +140 -0
  178. arctrl/py/Json/idtable.py +44 -0
  179. arctrl/py/Json/investigation.py +695 -0
  180. arctrl/py/Json/ontology_annotation.py +404 -0
  181. arctrl/py/Json/ontology_source_reference.py +255 -0
  182. arctrl/py/Json/person.py +658 -0
  183. arctrl/py/Json/property_value.py +359 -0
  184. arctrl/py/Json/publication.py +279 -0
  185. arctrl/py/Json/run.py +275 -0
  186. arctrl/py/Json/string_table.py +87 -0
  187. arctrl/py/Json/study.py +793 -0
  188. arctrl/py/Json/workflow.py +307 -0
  189. arctrl/py/JsonIO/Process/__init__.py +0 -0
  190. arctrl/py/JsonIO/Process/component.py +60 -0
  191. arctrl/py/JsonIO/Process/factor.py +36 -0
  192. arctrl/py/JsonIO/Process/factor_value.py +38 -0
  193. arctrl/py/JsonIO/Process/material.py +60 -0
  194. arctrl/py/JsonIO/Process/material_attribute.py +38 -0
  195. arctrl/py/JsonIO/Process/material_attribute_value.py +60 -0
  196. arctrl/py/JsonIO/Process/material_type.py +36 -0
  197. arctrl/py/JsonIO/Process/process.py +60 -0
  198. arctrl/py/JsonIO/Process/process_input.py +38 -0
  199. arctrl/py/JsonIO/Process/process_output.py +60 -0
  200. arctrl/py/JsonIO/Process/process_parameter_value.py +60 -0
  201. arctrl/py/JsonIO/Process/process_sequence.py +71 -0
  202. arctrl/py/JsonIO/Process/protocol.py +60 -0
  203. arctrl/py/JsonIO/Process/protocol_parameter.py +36 -0
  204. arctrl/py/JsonIO/Process/sample.py +60 -0
  205. arctrl/py/JsonIO/Process/source.py +60 -0
  206. arctrl/py/JsonIO/Process/study_materials.py +52 -0
  207. arctrl/py/JsonIO/Process/value.py +32 -0
  208. arctrl/py/JsonIO/Table/__init__.py +0 -0
  209. arctrl/py/JsonIO/Table/arc_table.py +103 -0
  210. arctrl/py/JsonIO/Table/composite_cell.py +36 -0
  211. arctrl/py/JsonIO/Table/composite_header.py +36 -0
  212. arctrl/py/JsonIO/Table/compression.py +67 -0
  213. arctrl/py/JsonIO/Table/iotype.py +36 -0
  214. arctrl/py/JsonIO/Table/templates.py +113 -0
  215. arctrl/py/JsonIO/__init__.py +0 -0
  216. arctrl/py/JsonIO/assay.py +113 -0
  217. arctrl/py/JsonIO/comment.py +80 -0
  218. arctrl/py/JsonIO/data.py +60 -0
  219. arctrl/py/JsonIO/data_file.py +58 -0
  220. arctrl/py/JsonIO/datamap.py +36 -0
  221. arctrl/py/JsonIO/decode.py +9 -0
  222. arctrl/py/JsonIO/encode.py +1 -0
  223. arctrl/py/JsonIO/investigation.py +91 -0
  224. arctrl/py/JsonIO/ldobject.py +106 -0
  225. arctrl/py/JsonIO/ontology_annotation.py +80 -0
  226. arctrl/py/JsonIO/ontology_source_reference.py +80 -0
  227. arctrl/py/JsonIO/person.py +82 -0
  228. arctrl/py/JsonIO/publication.py +82 -0
  229. arctrl/py/JsonIO/run.py +68 -0
  230. arctrl/py/JsonIO/study.py +114 -0
  231. arctrl/py/JsonIO/workflow.py +68 -0
  232. arctrl/py/ROCrate/ISAProfile/__init__.py +0 -0
  233. arctrl/py/ROCrate/ISAProfile/assay.py +70 -0
  234. arctrl/py/ROCrate/ISAProfile/data.py +65 -0
  235. arctrl/py/ROCrate/ISAProfile/dataset.py +24 -0
  236. arctrl/py/ROCrate/ISAProfile/investigation.py +73 -0
  237. arctrl/py/ROCrate/ISAProfile/lab_process.py +162 -0
  238. arctrl/py/ROCrate/ISAProfile/lab_protocol.py +37 -0
  239. arctrl/py/ROCrate/ISAProfile/person.py +72 -0
  240. arctrl/py/ROCrate/ISAProfile/property_value.py +98 -0
  241. arctrl/py/ROCrate/ISAProfile/sample.py +64 -0
  242. arctrl/py/ROCrate/ISAProfile/scholarly_article.py +98 -0
  243. arctrl/py/ROCrate/ISAProfile/study.py +74 -0
  244. arctrl/py/ROCrate/LDTypes/__init__.py +0 -0
  245. arctrl/py/ROCrate/LDTypes/comment.py +131 -0
  246. arctrl/py/ROCrate/LDTypes/computational_workflow.py +455 -0
  247. arctrl/py/ROCrate/LDTypes/computer_language.py +269 -0
  248. arctrl/py/ROCrate/LDTypes/create_action.py +303 -0
  249. arctrl/py/ROCrate/LDTypes/creative_work.py +566 -0
  250. arctrl/py/ROCrate/LDTypes/dataset.py +943 -0
  251. arctrl/py/ROCrate/LDTypes/defined_term.py +131 -0
  252. arctrl/py/ROCrate/LDTypes/file.py +281 -0
  253. arctrl/py/ROCrate/LDTypes/formal_parameter.py +431 -0
  254. arctrl/py/ROCrate/LDTypes/lab_process.py +352 -0
  255. arctrl/py/ROCrate/LDTypes/lab_protocol.py +395 -0
  256. arctrl/py/ROCrate/LDTypes/organization.py +83 -0
  257. arctrl/py/ROCrate/LDTypes/person.py +484 -0
  258. arctrl/py/ROCrate/LDTypes/postal_address.py +195 -0
  259. arctrl/py/ROCrate/LDTypes/property_value.py +952 -0
  260. arctrl/py/ROCrate/LDTypes/sample.py +202 -0
  261. arctrl/py/ROCrate/LDTypes/scholarly_article.py +229 -0
  262. arctrl/py/ROCrate/LDTypes/software_source_code.py +310 -0
  263. arctrl/py/ROCrate/LDTypes/workflow_invocation.py +48 -0
  264. arctrl/py/ROCrate/LDTypes/workflow_protocol.py +52 -0
  265. arctrl/py/ROCrate/__init__.py +0 -0
  266. arctrl/py/ROCrate/arc_rocrate_metadata.py +39 -0
  267. arctrl/py/ROCrate/dyn_obj_extensions.py +1 -0
  268. arctrl/py/ROCrate/helper.py +8 -0
  269. arctrl/py/ROCrate/ldcontext.py +406 -0
  270. arctrl/py/ROCrate/ldobject.py +1247 -0
  271. arctrl/py/ROCrate/rocrate_context.py +51 -0
  272. arctrl/py/Spreadsheet/AnnotationTable/__init__.py +0 -0
  273. arctrl/py/Spreadsheet/AnnotationTable/arc_table.py +203 -0
  274. arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
  275. arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +305 -0
  276. arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
  277. arctrl/py/Spreadsheet/DatamapTable/__init__.py +0 -0
  278. arctrl/py/Spreadsheet/DatamapTable/datamap_column.py +114 -0
  279. arctrl/py/Spreadsheet/DatamapTable/datamap_header.py +621 -0
  280. arctrl/py/Spreadsheet/DatamapTable/datamap_table.py +118 -0
  281. arctrl/py/Spreadsheet/Metadata/__init__.py +0 -0
  282. arctrl/py/Spreadsheet/Metadata/assays.py +125 -0
  283. arctrl/py/Spreadsheet/Metadata/comment.py +77 -0
  284. arctrl/py/Spreadsheet/Metadata/contacts.py +134 -0
  285. arctrl/py/Spreadsheet/Metadata/conversions.py +190 -0
  286. arctrl/py/Spreadsheet/Metadata/design_descriptors.py +34 -0
  287. arctrl/py/Spreadsheet/Metadata/factors.py +107 -0
  288. arctrl/py/Spreadsheet/Metadata/ontology_annotation.py +88 -0
  289. arctrl/py/Spreadsheet/Metadata/ontology_source_reference.py +96 -0
  290. arctrl/py/Spreadsheet/Metadata/protocols.py +146 -0
  291. arctrl/py/Spreadsheet/Metadata/publication.py +122 -0
  292. arctrl/py/Spreadsheet/Metadata/run.py +122 -0
  293. arctrl/py/Spreadsheet/Metadata/sparse_table.py +499 -0
  294. arctrl/py/Spreadsheet/Metadata/study.py +312 -0
  295. arctrl/py/Spreadsheet/Metadata/workflow.py +159 -0
  296. arctrl/py/Spreadsheet/__init__.py +0 -0
  297. arctrl/py/Spreadsheet/arc_assay.py +233 -0
  298. arctrl/py/Spreadsheet/arc_investigation.py +435 -0
  299. arctrl/py/Spreadsheet/arc_run.py +190 -0
  300. arctrl/py/Spreadsheet/arc_study.py +144 -0
  301. arctrl/py/Spreadsheet/arc_workflow.py +177 -0
  302. arctrl/py/Spreadsheet/assembly_info.py +1 -0
  303. arctrl/py/Spreadsheet/collection_aux.py +167 -0
  304. arctrl/py/Spreadsheet/datamap.py +43 -0
  305. arctrl/py/Spreadsheet/template.py +460 -0
  306. arctrl/py/ValidationPackages/__init__.py +0 -0
  307. arctrl/py/ValidationPackages/validation_package.py +82 -0
  308. arctrl/py/ValidationPackages/validation_packages_config.py +132 -0
  309. arctrl/py/WebRequest/__init__.py +0 -0
  310. arctrl/py/WebRequest/web_request.py +9 -0
  311. arctrl/py/WebRequest/web_request_py.py +135 -0
  312. arctrl/py/WorkflowGraph/__init__.py +0 -0
  313. arctrl/py/WorkflowGraph/adapters.py +141 -0
  314. arctrl/py/WorkflowGraph/build_options.py +45 -0
  315. arctrl/py/WorkflowGraph/builder.py +720 -0
  316. arctrl/py/WorkflowGraph/graph_types.py +260 -0
  317. arctrl/py/WorkflowGraph/query_helpers.py +76 -0
  318. arctrl/py/WorkflowGraph/reference_parsing.py +59 -0
  319. arctrl/py/WorkflowGraph/visualization_siren.py +574 -0
  320. arctrl/py/WorkflowGraph/workflow_graph.py +119 -0
  321. arctrl/py/Yaml/__init__.py +0 -0
  322. arctrl/py/Yaml/decode.py +1 -0
  323. arctrl/py/Yaml/encode.py +10 -0
  324. arctrl/py/Yaml/validation_package.py +77 -0
  325. arctrl/py/Yaml/validation_packages_config.py +86 -0
  326. arctrl/py/__init__.py +0 -0
  327. arctrl/py/arc.py +1891 -0
  328. arctrl/py/column_index.py +280 -0
  329. arctrl/py/conversion.py +142 -0
  330. arctrl/py/cross_async.py +76 -0
  331. arctrl/py/cwlrun_resolver.py +228 -0
  332. arctrl/py/fable_modules/dynamic_obj/__init__.py +0 -0
  333. arctrl/py/fable_modules/dynamic_obj/dyn_obj.py +136 -0
  334. arctrl/py/fable_modules/dynamic_obj/dynamic_obj.py +415 -0
  335. arctrl/py/fable_modules/dynamic_obj/fable_js.py +1 -0
  336. arctrl/py/fable_modules/dynamic_obj/fable_py.py +288 -0
  337. arctrl/py/fable_modules/dynamic_obj/hash_codes.py +82 -0
  338. arctrl/py/fable_modules/dynamic_obj/property_helper.py +25 -0
  339. arctrl/py/fable_modules/dynamic_obj/reflection_utils.py +87 -0
  340. arctrl/py/fable_modules/fable_library/__init__.py +0 -0
  341. arctrl/py/fable_modules/fable_library/array_.py +1528 -0
  342. arctrl/py/fable_modules/fable_library/async_.py +377 -0
  343. arctrl/py/fable_modules/fable_library/async_builder.py +379 -0
  344. arctrl/py/fable_modules/fable_library/big_int.py +330 -0
  345. arctrl/py/fable_modules/fable_library/bit_converter.py +131 -0
  346. arctrl/py/fable_modules/fable_library/boolean.py +26 -0
  347. arctrl/py/fable_modules/fable_library/char.py +237 -0
  348. arctrl/py/fable_modules/fable_library/choice.py +212 -0
  349. arctrl/py/fable_modules/fable_library/date.py +779 -0
  350. arctrl/py/fable_modules/fable_library/date_offset.py +79 -0
  351. arctrl/py/fable_modules/fable_library/decimal_.py +190 -0
  352. arctrl/py/fable_modules/fable_library/diagnostics.py +54 -0
  353. arctrl/py/fable_modules/fable_library/double.py +87 -0
  354. arctrl/py/fable_modules/fable_library/encoding.py +41 -0
  355. arctrl/py/fable_modules/fable_library/event.py +206 -0
  356. arctrl/py/fable_modules/fable_library/file.py +107 -0
  357. arctrl/py/fable_modules/fable_library/fsharp_collections.py +52 -0
  358. arctrl/py/fable_modules/fable_library/fsharp_core.py +123 -0
  359. arctrl/py/fable_modules/fable_library/global_.py +63 -0
  360. arctrl/py/fable_modules/fable_library/guid.py +41 -0
  361. arctrl/py/fable_modules/fable_library/int32.py +73 -0
  362. arctrl/py/fable_modules/fable_library/list.py +1788 -0
  363. arctrl/py/fable_modules/fable_library/long.py +240 -0
  364. arctrl/py/fable_modules/fable_library/mailbox_processor.py +179 -0
  365. arctrl/py/fable_modules/fable_library/map.py +1854 -0
  366. arctrl/py/fable_modules/fable_library/map_util.py +148 -0
  367. arctrl/py/fable_modules/fable_library/mutable_map.py +397 -0
  368. arctrl/py/fable_modules/fable_library/mutable_set.py +279 -0
  369. arctrl/py/fable_modules/fable_library/native.py +45 -0
  370. arctrl/py/fable_modules/fable_library/numeric.py +46 -0
  371. arctrl/py/fable_modules/fable_library/observable.py +222 -0
  372. arctrl/py/fable_modules/fable_library/option.py +128 -0
  373. arctrl/py/fable_modules/fable_library/path.py +62 -0
  374. arctrl/py/fable_modules/fable_library/range.py +117 -0
  375. arctrl/py/fable_modules/fable_library/reflection.py +463 -0
  376. arctrl/py/fable_modules/fable_library/reg_exp.py +137 -0
  377. arctrl/py/fable_modules/fable_library/resize_array.py +31 -0
  378. arctrl/py/fable_modules/fable_library/result.py +212 -0
  379. arctrl/py/fable_modules/fable_library/seq.py +1979 -0
  380. arctrl/py/fable_modules/fable_library/seq2.py +221 -0
  381. arctrl/py/fable_modules/fable_library/set.py +2414 -0
  382. arctrl/py/fable_modules/fable_library/singleton_local_time_zone.py +36 -0
  383. arctrl/py/fable_modules/fable_library/string_.py +573 -0
  384. arctrl/py/fable_modules/fable_library/system_collections_generic.py +462 -0
  385. arctrl/py/fable_modules/fable_library/system_text.py +237 -0
  386. arctrl/py/fable_modules/fable_library/task.py +116 -0
  387. arctrl/py/fable_modules/fable_library/task_builder.py +122 -0
  388. arctrl/py/fable_modules/fable_library/thread.py +5 -0
  389. arctrl/py/fable_modules/fable_library/time_span.py +283 -0
  390. arctrl/py/fable_modules/fable_library/timer.py +24 -0
  391. arctrl/py/fable_modules/fable_library/types.py +401 -0
  392. arctrl/py/fable_modules/fable_library/uri.py +109 -0
  393. arctrl/py/fable_modules/fable_library/util.py +2735 -0
  394. arctrl/py/fable_modules/fable_openpyxl/__init__.py +0 -0
  395. arctrl/py/fable_modules/fable_openpyxl/openpyxl.py +362 -0
  396. arctrl/py/fable_modules/fable_python/cognite-sdk/__init__.py +0 -0
  397. arctrl/py/fable_modules/fable_python/cognite-sdk/cognite_sdk.py +22 -0
  398. arctrl/py/fable_modules/fable_python/flask/__init__.py +0 -0
  399. arctrl/py/fable_modules/fable_python/flask/flask.py +34 -0
  400. arctrl/py/fable_modules/fable_python/jupyter/__init__.py +0 -0
  401. arctrl/py/fable_modules/fable_python/jupyter/ipy_widgets.py +47 -0
  402. arctrl/py/fable_modules/fable_python/jupyter/ipython.py +13 -0
  403. arctrl/py/fable_modules/fable_python/stdlib/__init__.py +0 -0
  404. arctrl/py/fable_modules/fable_python/stdlib/ast.py +1 -0
  405. arctrl/py/fable_modules/fable_python/stdlib/asyncio/__init__.py +0 -0
  406. arctrl/py/fable_modules/fable_python/stdlib/asyncio/events.py +17 -0
  407. arctrl/py/fable_modules/fable_python/stdlib/asyncio/futures.py +52 -0
  408. arctrl/py/fable_modules/fable_python/stdlib/asyncio/tasks.py +38 -0
  409. arctrl/py/fable_modules/fable_python/stdlib/base64_.py +1 -0
  410. arctrl/py/fable_modules/fable_python/stdlib/builtins_.py +38 -0
  411. arctrl/py/fable_modules/fable_python/stdlib/html.py +1 -0
  412. arctrl/py/fable_modules/fable_python/stdlib/json.py +1 -0
  413. arctrl/py/fable_modules/fable_python/stdlib/math_.py +1 -0
  414. arctrl/py/fable_modules/fable_python/stdlib/os_.py +1 -0
  415. arctrl/py/fable_modules/fable_python/stdlib/queue_.py +1 -0
  416. arctrl/py/fable_modules/fable_python/stdlib/string_.py +1 -0
  417. arctrl/py/fable_modules/fable_python/stdlib/sys_.py +30 -0
  418. arctrl/py/fable_modules/fable_python/stdlib/time_.py +1 -0
  419. arctrl/py/fable_modules/fable_python/stdlib/tk_inter.py +1 -0
  420. arctrl/py/fable_modules/fs_spreadsheet/Cells/__init__.py +0 -0
  421. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cell.py +340 -0
  422. arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +466 -0
  423. arctrl/py/fable_modules/fs_spreadsheet/DSL/__init__.py +0 -0
  424. arctrl/py/fable_modules/fs_spreadsheet/DSL/cell_builder.py +214 -0
  425. arctrl/py/fable_modules/fs_spreadsheet/DSL/column_builder.py +139 -0
  426. arctrl/py/fable_modules/fs_spreadsheet/DSL/dsl.py +50 -0
  427. arctrl/py/fable_modules/fs_spreadsheet/DSL/expression.py +65 -0
  428. arctrl/py/fable_modules/fs_spreadsheet/DSL/operators.py +9 -0
  429. arctrl/py/fable_modules/fs_spreadsheet/DSL/row_builder.py +139 -0
  430. arctrl/py/fable_modules/fs_spreadsheet/DSL/sheet_builder.py +118 -0
  431. arctrl/py/fable_modules/fs_spreadsheet/DSL/table_builder.py +122 -0
  432. arctrl/py/fable_modules/fs_spreadsheet/DSL/transform.py +463 -0
  433. arctrl/py/fable_modules/fs_spreadsheet/DSL/types.py +314 -0
  434. arctrl/py/fable_modules/fs_spreadsheet/DSL/workbook_builder.py +106 -0
  435. arctrl/py/fable_modules/fs_spreadsheet/Json/__init__.py +0 -0
  436. arctrl/py/fable_modules/fs_spreadsheet/Json/cell.py +103 -0
  437. arctrl/py/fable_modules/fs_spreadsheet/Json/column.py +70 -0
  438. arctrl/py/fable_modules/fs_spreadsheet/Json/row.py +70 -0
  439. arctrl/py/fable_modules/fs_spreadsheet/Json/table.py +54 -0
  440. arctrl/py/fable_modules/fs_spreadsheet/Json/value.py +93 -0
  441. arctrl/py/fable_modules/fs_spreadsheet/Json/workbook.py +71 -0
  442. arctrl/py/fable_modules/fs_spreadsheet/Json/worksheet.py +216 -0
  443. arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
  444. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +43 -0
  445. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +190 -0
  446. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +92 -0
  447. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +77 -0
  448. arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_row.py +48 -0
  449. arctrl/py/fable_modules/fs_spreadsheet/Tables/__init__.py +0 -0
  450. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table.py +461 -0
  451. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +117 -0
  452. arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_row.py +23 -0
  453. arctrl/py/fable_modules/fs_spreadsheet/__init__.py +0 -0
  454. arctrl/py/fable_modules/fs_spreadsheet/fs_address.py +236 -0
  455. arctrl/py/fable_modules/fs_spreadsheet/fs_column.py +172 -0
  456. arctrl/py/fable_modules/fs_spreadsheet/fs_row.py +183 -0
  457. arctrl/py/fable_modules/fs_spreadsheet/fs_workbook.py +192 -0
  458. arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +610 -0
  459. arctrl/py/fable_modules/fs_spreadsheet/hash_codes.py +60 -0
  460. arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +329 -0
  461. arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
  462. arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +60 -0
  463. arctrl/py/fable_modules/fs_spreadsheet_py/cell_type.py +50 -0
  464. arctrl/py/fable_modules/fs_spreadsheet_py/fs_extension.py +60 -0
  465. arctrl/py/fable_modules/fs_spreadsheet_py/json.py +47 -0
  466. arctrl/py/fable_modules/fs_spreadsheet_py/table.py +54 -0
  467. arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +41 -0
  468. arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +52 -0
  469. arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
  470. arctrl/py/fable_modules/siren/__init__.py +0 -0
  471. arctrl/py/fable_modules/siren/config.py +1038 -0
  472. arctrl/py/fable_modules/siren/formatting.py +1121 -0
  473. arctrl/py/fable_modules/siren/siren.py +1941 -0
  474. arctrl/py/fable_modules/siren/siren_types.py +1229 -0
  475. arctrl/py/fable_modules/siren/theme_variables.py +517 -0
  476. arctrl/py/fable_modules/siren/util.py +37 -0
  477. arctrl/py/fable_modules/siren/yaml.py +101 -0
  478. arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
  479. arctrl/py/fable_modules/thoth_json_core/decode.py +1614 -0
  480. arctrl/py/fable_modules/thoth_json_core/encode.py +305 -0
  481. arctrl/py/fable_modules/thoth_json_core/types.py +181 -0
  482. arctrl/py/fable_modules/thoth_json_python/__init__.py +0 -0
  483. arctrl/py/fable_modules/thoth_json_python/decode.py +112 -0
  484. arctrl/py/fable_modules/thoth_json_python/encode.py +72 -0
  485. arctrl/py/fable_modules/thoth_json_python/python.py +1 -0
  486. arctrl/py/fable_modules/yamlicious/Interop/__init__.py +0 -0
  487. arctrl/py/fable_modules/yamlicious/Interop/js_interop.py +1 -0
  488. arctrl/py/fable_modules/yamlicious/Interop/py_interop.py +7 -0
  489. arctrl/py/fable_modules/yamlicious/__init__.py +0 -0
  490. arctrl/py/fable_modules/yamlicious/decode.py +1784 -0
  491. arctrl/py/fable_modules/yamlicious/encode.py +84 -0
  492. arctrl/py/fable_modules/yamlicious/flow_to_block.py +994 -0
  493. arctrl/py/fable_modules/yamlicious/library.py +10 -0
  494. arctrl/py/fable_modules/yamlicious/persil.py +57 -0
  495. arctrl/py/fable_modules/yamlicious/preprocessing.py +99 -0
  496. arctrl/py/fable_modules/yamlicious/reader.py +739 -0
  497. arctrl/py/fable_modules/yamlicious/regex.py +29 -0
  498. arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +265 -0
  499. arctrl/py/fable_modules/yamlicious/writer.py +175 -0
  500. arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
  501. arctrl/py/json.py +389 -0
  502. arctrl/py/license.py +169 -0
  503. arctrl/py/rocrate_io.py +242 -0
  504. arctrl/py/template_web.py +23 -0
  505. arctrl/py/xlsx.py +212 -0
  506. arctrl/py/yaml.py +79 -0
  507. arctrl/rocrate.py +21 -0
  508. arctrl-3.0.0.dist-info/METADATA +157 -0
  509. arctrl-3.0.0.dist-info/RECORD +511 -0
  510. arctrl-3.0.0.dist-info/WHEEL +4 -0
  511. arctrl-3.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,1788 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Callable
4
+ from dataclasses import dataclass
5
+ from typing import Any, Generic, TypeVar
6
+
7
+ from .array_ import chunk_by_size as chunk_by_size_1
8
+ from .array_ import fill, sort_in_place_with
9
+ from .array_ import fold_back as fold_back_1
10
+ from .array_ import fold_back2 as fold_back2_1
11
+ from .array_ import iterate as iterate_1
12
+ from .array_ import map as map_1
13
+ from .array_ import pairwise as pairwise_1
14
+ from .array_ import permute as permute_1
15
+ from .array_ import scan_back as scan_back_1
16
+ from .array_ import split_into as split_into_1
17
+ from .array_ import transpose as transpose_1
18
+ from .array_ import try_find_back as try_find_back_1
19
+ from .array_ import try_find_index_back as try_find_index_back_1
20
+ from .array_ import windowed as windowed_1
21
+ from .global_ import (
22
+ IGenericAdder_1,
23
+ IGenericAverager_1,
24
+ SR_differentLengths,
25
+ SR_indexOutOfBounds,
26
+ SR_inputMustBeNonNegative,
27
+ SR_inputSequenceEmpty,
28
+ SR_inputSequenceTooLong,
29
+ SR_inputWasEmpty,
30
+ SR_keyNotFoundAlt,
31
+ SR_notEnoughElements,
32
+ )
33
+ from .option import default_arg, some
34
+ from .option import value as value_1
35
+ from .reflection import TypeInfo, class_type, option_type, record_type
36
+ from .string_ import join
37
+ from .types import Array, Record
38
+ from .util import (
39
+ IComparer_1,
40
+ IDisposable,
41
+ IEnumerable_1,
42
+ IEnumerator,
43
+ IEqualityComparer_1,
44
+ compare,
45
+ equals,
46
+ get_enumerator,
47
+ ignore,
48
+ is_array_like,
49
+ structural_hash,
50
+ to_iterator,
51
+ )
52
+
53
+
54
+ _T = TypeVar("_T")
55
+
56
+ _STATE = TypeVar("_STATE")
57
+
58
+ _T1 = TypeVar("_T1")
59
+
60
+ _T2 = TypeVar("_T2")
61
+
62
+ __A = TypeVar("__A")
63
+
64
+ __B = TypeVar("__B")
65
+
66
+ _U = TypeVar("_U")
67
+
68
+ _T3 = TypeVar("_T3")
69
+
70
+ _RESULT = TypeVar("_RESULT")
71
+
72
+ __C = TypeVar("__C")
73
+
74
+
75
+ def _expr66(gen0: TypeInfo) -> TypeInfo:
76
+ return record_type(
77
+ "ListModule.FSharpList",
78
+ [gen0],
79
+ FSharpList,
80
+ lambda: [("head", gen0), ("tail", option_type(FSharpList_reflection(gen0)))],
81
+ )
82
+
83
+
84
+ @dataclass(eq=False, repr=False, slots=True)
85
+ class FSharpList(Record, Generic[_T]):
86
+ head: _T
87
+ tail: FSharpList[_T] | None
88
+
89
+ def __str__(self, __unit: None = None) -> str:
90
+ xs: FSharpList[_T] = self
91
+ return ("[" + join("; ", xs)) + "]"
92
+
93
+ def __eq__(self, other: Any = None) -> bool:
94
+ xs: FSharpList[_T] = self
95
+ if xs is other:
96
+ return True
97
+
98
+ else:
99
+
100
+ def loop(xs_1_mut: FSharpList[_T], ys_1_mut: FSharpList[_T]) -> bool:
101
+ while True:
102
+ (xs_1, ys_1) = (xs_1_mut, ys_1_mut)
103
+ match_value: FSharpList[_T] | None = xs_1.tail
104
+ match_value_1: FSharpList[_T] | None = ys_1.tail
105
+ if match_value is not None:
106
+ if match_value_1 is not None:
107
+ xt: FSharpList[_T] = match_value
108
+ yt: FSharpList[_T] = match_value_1
109
+ if equals(xs_1.head, ys_1.head):
110
+ xs_1_mut = xt
111
+ ys_1_mut = yt
112
+ continue
113
+
114
+ else:
115
+ return False
116
+
117
+ else:
118
+ return False
119
+
120
+ elif match_value_1 is not None:
121
+ return False
122
+
123
+ else:
124
+ return True
125
+
126
+ break
127
+
128
+ return loop(xs, other)
129
+
130
+ def __hash__(self, __unit: None = None) -> int:
131
+ xs: FSharpList[_T] = self
132
+
133
+ def loop(i_mut: int, h_mut: int, xs_1_mut: FSharpList[_T]) -> int:
134
+ while True:
135
+ (i, h, xs_1) = (i_mut, h_mut, xs_1_mut)
136
+ match_value: FSharpList[_T] | None = xs_1.tail
137
+ if match_value is not None:
138
+ t: FSharpList[_T] = match_value
139
+ if i > 18:
140
+ return h
141
+
142
+ else:
143
+ i_mut = i + 1
144
+ h_mut = ((h << 1) + structural_hash(xs_1.head)) + (631 * i)
145
+ xs_1_mut = t
146
+ continue
147
+
148
+ else:
149
+ return h
150
+
151
+ break
152
+
153
+ return loop(0, 0, xs)
154
+
155
+ def to_json(self, __unit: None = None) -> Any:
156
+ this: FSharpList[_T] = self
157
+ return list(this)
158
+
159
+ def __cmp__(self, other: Any = None) -> int:
160
+ xs: FSharpList[_T] = self
161
+
162
+ def loop(xs_1_mut: FSharpList[_T], ys_1_mut: FSharpList[_T]) -> int:
163
+ while True:
164
+ (xs_1, ys_1) = (xs_1_mut, ys_1_mut)
165
+ match_value: FSharpList[_T] | None = xs_1.tail
166
+ match_value_1: FSharpList[_T] | None = ys_1.tail
167
+ if match_value is not None:
168
+ if match_value_1 is not None:
169
+ xt: FSharpList[_T] = match_value
170
+ yt: FSharpList[_T] = match_value_1
171
+ c: int = compare(xs_1.head, ys_1.head) or 0
172
+ if c == 0:
173
+ xs_1_mut = xt
174
+ ys_1_mut = yt
175
+ continue
176
+
177
+ else:
178
+ return c
179
+
180
+ else:
181
+ return 1
182
+
183
+ elif match_value_1 is not None:
184
+ return -1
185
+
186
+ else:
187
+ return 0
188
+
189
+ break
190
+
191
+ return loop(xs, other)
192
+
193
+ def GetEnumerator(self, __unit: None = None) -> IEnumerator[_T]:
194
+ xs: FSharpList[_T] = self
195
+ return ListEnumerator_1__ctor_3002E699(xs)
196
+
197
+ def __iter__(self) -> IEnumerator[_T]:
198
+ return to_iterator(self.GetEnumerator())
199
+
200
+ def System_Collections_IEnumerable_GetEnumerator(self, __unit: None = None) -> IEnumerator[Any]:
201
+ xs: FSharpList[_T] = self
202
+ return get_enumerator(xs)
203
+
204
+
205
+ FSharpList_reflection = _expr66
206
+
207
+
208
+ def _expr67(gen0: TypeInfo) -> TypeInfo:
209
+ return class_type("ListModule.ListEnumerator`1", [gen0], ListEnumerator_1)
210
+
211
+
212
+ class ListEnumerator_1(IDisposable, Generic[_T]):
213
+ def __init__(self, xs: FSharpList[Any]) -> None:
214
+ self.xs: FSharpList[_T] = xs
215
+ self.it: FSharpList[_T] = self.xs
216
+ self.current: _T = None
217
+
218
+ def System_Collections_Generic_IEnumerator_1_get_Current(self, __unit: None = None) -> _T:
219
+ _: ListEnumerator_1[_T] = self
220
+ return _.current
221
+
222
+ def System_Collections_IEnumerator_get_Current(self, __unit: None = None) -> Any:
223
+ _: ListEnumerator_1[_T] = self
224
+ return _.current
225
+
226
+ def System_Collections_IEnumerator_MoveNext(self, __unit: None = None) -> bool:
227
+ _: ListEnumerator_1[_T] = self
228
+ match_value: FSharpList[_T] | None = _.it.tail
229
+ if match_value is not None:
230
+ t: FSharpList[_T] = match_value
231
+ _.current = _.it.head
232
+ _.it = t
233
+ return True
234
+
235
+ else:
236
+ return False
237
+
238
+ def System_Collections_IEnumerator_Reset(self, __unit: None = None) -> None:
239
+ _: ListEnumerator_1[_T] = self
240
+ _.it = _.xs
241
+ _.current = None
242
+
243
+ def Dispose(self, __unit: None = None) -> None:
244
+ pass
245
+
246
+
247
+ ListEnumerator_1_reflection = _expr67
248
+
249
+
250
+ def ListEnumerator_1__ctor_3002E699(xs: FSharpList[Any]) -> ListEnumerator_1[_T]:
251
+ return ListEnumerator_1(xs)
252
+
253
+
254
+ def FSharpList_get_Empty(__unit: None = None) -> FSharpList[Any]:
255
+ return FSharpList(None, None)
256
+
257
+
258
+ def FSharpList_Cons_305B8EAC(x: Any, xs: FSharpList[Any]) -> FSharpList[Any]:
259
+ return FSharpList(x, xs)
260
+
261
+
262
+ def FSharpList__get_IsEmpty(xs: FSharpList[Any]) -> bool:
263
+ return xs.tail is None
264
+
265
+
266
+ def FSharpList__get_Length(xs: FSharpList[Any]) -> int:
267
+ def loop(i_mut: int, xs_1_mut: FSharpList[_T], xs: Any = xs) -> int:
268
+ while True:
269
+ (i, xs_1) = (i_mut, xs_1_mut)
270
+ match_value: FSharpList[_T] | None = xs_1.tail
271
+ if match_value is not None:
272
+ i_mut = i + 1
273
+ xs_1_mut = match_value
274
+ continue
275
+
276
+ else:
277
+ return i
278
+
279
+ break
280
+
281
+ return loop(0, xs)
282
+
283
+
284
+ def FSharpList__get_Head(xs: FSharpList[Any]) -> Any:
285
+ match_value: FSharpList[_T] | None = xs.tail
286
+ if match_value is not None:
287
+ return xs.head
288
+
289
+ else:
290
+ raise Exception((SR_inputWasEmpty + "\\nParameter name: ") + "list")
291
+
292
+
293
+ def FSharpList__get_Tail(xs: FSharpList[Any]) -> FSharpList[Any]:
294
+ match_value: FSharpList[_T] | None = xs.tail
295
+ if match_value is not None:
296
+ return match_value
297
+
298
+ else:
299
+ raise Exception((SR_inputWasEmpty + "\\nParameter name: ") + "list")
300
+
301
+
302
+ def FSharpList__get_Item_Z524259A4(xs: FSharpList[Any], index: int) -> Any:
303
+ def loop(i_mut: int, xs_1_mut: FSharpList[_T], xs: Any = xs, index: Any = index) -> _T:
304
+ while True:
305
+ (i, xs_1) = (i_mut, xs_1_mut)
306
+ match_value: FSharpList[_T] | None = xs_1.tail
307
+ if match_value is not None:
308
+ if i == index:
309
+ return xs_1.head
310
+
311
+ else:
312
+ i_mut = i + 1
313
+ xs_1_mut = match_value
314
+ continue
315
+
316
+ else:
317
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index")
318
+
319
+ break
320
+
321
+ return loop(0, xs)
322
+
323
+
324
+ def index_not_found(__unit: None = None) -> Any:
325
+ raise Exception(SR_keyNotFoundAlt)
326
+
327
+
328
+ def empty(__unit: None = None) -> FSharpList[Any]:
329
+ return FSharpList_get_Empty()
330
+
331
+
332
+ def cons(x: Any, xs: FSharpList[Any]) -> FSharpList[Any]:
333
+ return FSharpList_Cons_305B8EAC(x, xs)
334
+
335
+
336
+ def singleton(x: Any | None = None) -> FSharpList[Any]:
337
+ return FSharpList_Cons_305B8EAC(x, FSharpList_get_Empty())
338
+
339
+
340
+ def is_empty(xs: FSharpList[Any]) -> bool:
341
+ return FSharpList__get_IsEmpty(xs)
342
+
343
+
344
+ def length(xs: FSharpList[Any]) -> int:
345
+ return FSharpList__get_Length(xs)
346
+
347
+
348
+ def head(xs: FSharpList[Any]) -> Any:
349
+ return FSharpList__get_Head(xs)
350
+
351
+
352
+ def try_head(xs: FSharpList[Any]) -> Any | None:
353
+ if FSharpList__get_IsEmpty(xs):
354
+ return None
355
+
356
+ else:
357
+ return some(FSharpList__get_Head(xs))
358
+
359
+
360
+ def tail(xs: FSharpList[Any]) -> FSharpList[Any]:
361
+ return FSharpList__get_Tail(xs)
362
+
363
+
364
+ def try_last(xs_mut: FSharpList[Any]) -> Any | None:
365
+ while True:
366
+ (xs,) = (xs_mut,)
367
+ if FSharpList__get_IsEmpty(xs):
368
+ return None
369
+
370
+ else:
371
+ t: FSharpList[_T] = FSharpList__get_Tail(xs)
372
+ if FSharpList__get_IsEmpty(t):
373
+ return some(FSharpList__get_Head(xs))
374
+
375
+ else:
376
+ xs_mut = t
377
+ continue
378
+
379
+ break
380
+
381
+
382
+ def last(xs: FSharpList[Any]) -> Any:
383
+ match_value: _T | None = try_last(xs)
384
+ if match_value is None:
385
+ raise Exception(SR_inputWasEmpty)
386
+
387
+ else:
388
+ return value_1(match_value)
389
+
390
+
391
+ def compare_with(comparer: Callable[[_T, _T], int], xs: FSharpList[Any], ys: FSharpList[Any]) -> int:
392
+ def loop(
393
+ xs_1_mut: FSharpList[_T], ys_1_mut: FSharpList[_T], comparer: Any = comparer, xs: Any = xs, ys: Any = ys
394
+ ) -> int:
395
+ while True:
396
+ (xs_1, ys_1) = (xs_1_mut, ys_1_mut)
397
+ match_value: bool = FSharpList__get_IsEmpty(xs_1)
398
+ match_value_1: bool = FSharpList__get_IsEmpty(ys_1)
399
+ if match_value:
400
+ if match_value_1:
401
+ return 0
402
+
403
+ else:
404
+ return -1
405
+
406
+ elif match_value_1:
407
+ return 1
408
+
409
+ else:
410
+ c: int = comparer(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)) or 0
411
+ if c == 0:
412
+ xs_1_mut = FSharpList__get_Tail(xs_1)
413
+ ys_1_mut = FSharpList__get_Tail(ys_1)
414
+ continue
415
+
416
+ else:
417
+ return c
418
+
419
+ break
420
+
421
+ return loop(xs, ys)
422
+
423
+
424
+ def to_array(xs: FSharpList[Any]) -> Array[Any]:
425
+ len_1: int = FSharpList__get_Length(xs) or 0
426
+ res: Array[_T] = fill([0] * len_1, 0, len_1, None)
427
+
428
+ def loop(i_mut: int, xs_1_mut: FSharpList[_T], xs: Any = xs) -> None:
429
+ while True:
430
+ (i, xs_1) = (i_mut, xs_1_mut)
431
+ if not FSharpList__get_IsEmpty(xs_1):
432
+ res[i] = FSharpList__get_Head(xs_1)
433
+ i_mut = i + 1
434
+ xs_1_mut = FSharpList__get_Tail(xs_1)
435
+ continue
436
+
437
+ break
438
+
439
+ loop(0, xs)
440
+ return res
441
+
442
+
443
+ def fold(folder: Callable[[_STATE, _T], _STATE], state: Any, xs: FSharpList[Any]) -> Any:
444
+ acc: _STATE = state
445
+ xs_1: FSharpList[_T] = xs
446
+ while not FSharpList__get_IsEmpty(xs_1):
447
+ acc = folder(acc, head(xs_1))
448
+ xs_1 = FSharpList__get_Tail(xs_1)
449
+ return acc
450
+
451
+
452
+ def reverse(xs: FSharpList[Any]) -> FSharpList[Any]:
453
+ def _arrow68(acc: FSharpList[_T], x: _T, xs: Any = xs) -> FSharpList[_T]:
454
+ return FSharpList_Cons_305B8EAC(x, acc)
455
+
456
+ return fold(_arrow68, FSharpList_get_Empty(), xs)
457
+
458
+
459
+ def fold_back(folder: Callable[[_T, _STATE], _STATE], xs: FSharpList[Any], state: Any) -> Any:
460
+ return fold_back_1(folder, to_array(xs), state)
461
+
462
+
463
+ def fold_indexed(folder: Callable[[int, _STATE, _T], _STATE], state: Any, xs: FSharpList[Any]) -> Any:
464
+ def loop(
465
+ i_mut: int, acc_mut: _STATE, xs_1_mut: FSharpList[_T], folder: Any = folder, state: Any = state, xs: Any = xs
466
+ ) -> _STATE:
467
+ while True:
468
+ (i, acc, xs_1) = (i_mut, acc_mut, xs_1_mut)
469
+ if FSharpList__get_IsEmpty(xs_1):
470
+ return acc
471
+
472
+ else:
473
+ i_mut = i + 1
474
+ acc_mut = folder(i, acc, FSharpList__get_Head(xs_1))
475
+ xs_1_mut = FSharpList__get_Tail(xs_1)
476
+ continue
477
+
478
+ break
479
+
480
+ return loop(0, state, xs)
481
+
482
+
483
+ def fold2(folder: Callable[[_STATE, _T1, _T2], _STATE], state: Any, xs: FSharpList[Any], ys: FSharpList[Any]) -> Any:
484
+ acc: _STATE = state
485
+ xs_1: FSharpList[_T1] = xs
486
+ ys_1: FSharpList[_T2] = ys
487
+ while (not FSharpList__get_IsEmpty(ys_1)) if (not FSharpList__get_IsEmpty(xs_1)) else False:
488
+ acc = folder(acc, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1))
489
+ xs_1 = FSharpList__get_Tail(xs_1)
490
+ ys_1 = FSharpList__get_Tail(ys_1)
491
+ return acc
492
+
493
+
494
+ def fold_back2(
495
+ folder: Callable[[_T1, _T2, _STATE], _STATE], xs: FSharpList[Any], ys: FSharpList[Any], state: Any
496
+ ) -> Any:
497
+ return fold_back2_1(folder, to_array(xs), to_array(ys), state)
498
+
499
+
500
+ def unfold(gen: Callable[[_STATE], tuple[_T, _STATE] | None], state: Any) -> FSharpList[Any]:
501
+ def loop(acc_mut: _STATE, node_mut: FSharpList[_T], gen: Any = gen, state: Any = state) -> FSharpList[_T]:
502
+ while True:
503
+ (acc, node) = (acc_mut, node_mut)
504
+ match_value: tuple[_T, _STATE] | None = gen(acc)
505
+ if match_value is not None:
506
+ acc_mut = match_value[1]
507
+
508
+ def _arrow69(__unit: None = None, acc: Any = acc, node: Any = node) -> FSharpList[_T]:
509
+ t: FSharpList[_T] = FSharpList(match_value[0], None)
510
+ node.tail = t
511
+ return t
512
+
513
+ node_mut = _arrow69()
514
+ continue
515
+
516
+ else:
517
+ return node
518
+
519
+ break
520
+
521
+ root: FSharpList[_T] = FSharpList_get_Empty()
522
+ node_1: FSharpList[_T] = loop(state, root)
523
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
524
+ node_1.tail = t_2
525
+ return FSharpList__get_Tail(root)
526
+
527
+
528
+ def iterate(action: Callable[[__A], None], xs: FSharpList[Any]) -> None:
529
+ def _arrow70(unit_var: None, x: __A, action: Any = action, xs: Any = xs) -> None:
530
+ action(x)
531
+
532
+ fold(_arrow70, None, xs)
533
+
534
+
535
+ def iterate2(action: Callable[[__A, __B], None], xs: FSharpList[Any], ys: FSharpList[Any]) -> None:
536
+ def _arrow71(unit_var: None, x: __A, y: __B, action: Any = action, xs: Any = xs, ys: Any = ys) -> None:
537
+ action(x, y)
538
+
539
+ fold2(_arrow71, None, xs, ys)
540
+
541
+
542
+ def iterate_indexed(action: Callable[[int, __A], None], xs: FSharpList[Any]) -> None:
543
+ def _arrow72(i: int, x: __A, action: Any = action, xs: Any = xs) -> int:
544
+ action(i, x)
545
+ return i + 1
546
+
547
+ ignore(fold(_arrow72, 0, xs))
548
+
549
+
550
+ def iterate_indexed2(action: Callable[[int, __A, __B], None], xs: FSharpList[Any], ys: FSharpList[Any]) -> None:
551
+ def _arrow73(i: int, x: __A, y: __B, action: Any = action, xs: Any = xs, ys: Any = ys) -> int:
552
+ action(i, x, y)
553
+ return i + 1
554
+
555
+ ignore(fold2(_arrow73, 0, xs, ys))
556
+
557
+
558
+ def to_seq(xs: FSharpList[Any]) -> IEnumerable_1[Any]:
559
+ return xs
560
+
561
+
562
+ def of_array_with_tail(xs: Array[Any], tail_1: FSharpList[Any]) -> FSharpList[Any]:
563
+ res: FSharpList[_T] = tail_1
564
+ for i in range(len(xs) - 1, 0 - 1, -1):
565
+ res = FSharpList_Cons_305B8EAC(xs[i], res)
566
+ return res
567
+
568
+
569
+ def of_array(xs: Array[Any]) -> FSharpList[Any]:
570
+ return of_array_with_tail(xs, FSharpList_get_Empty())
571
+
572
+
573
+ def of_seq(xs: IEnumerable_1[Any]) -> FSharpList[Any]:
574
+ if is_array_like(xs):
575
+ return of_array(xs)
576
+
577
+ elif isinstance(xs, FSharpList):
578
+ return xs
579
+
580
+ else:
581
+ root: FSharpList[_T] = FSharpList_get_Empty()
582
+ node: FSharpList[_T] = root
583
+ with get_enumerator(xs) as enumerator:
584
+ while enumerator.System_Collections_IEnumerator_MoveNext():
585
+ x: _T = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
586
+
587
+ def _arrow74(__unit: None = None, xs: Any = xs) -> FSharpList[_T]:
588
+ xs_3: FSharpList[_T] = node
589
+ t: FSharpList[_T] = FSharpList(x, None)
590
+ xs_3.tail = t
591
+ return t
592
+
593
+ node = _arrow74()
594
+ xs_5: FSharpList[_T] = node
595
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
596
+ xs_5.tail = t_2
597
+ return FSharpList__get_Tail(root)
598
+
599
+
600
+ def concat(lists: IEnumerable_1[FSharpList[Any]]) -> FSharpList[Any]:
601
+ root: FSharpList[_T] = FSharpList_get_Empty()
602
+ node: FSharpList[_T] = root
603
+
604
+ def action(xs: FSharpList[_T], lists: Any = lists) -> None:
605
+ nonlocal node
606
+
607
+ def _arrow75(acc: FSharpList[_T], x: _T, xs: Any = xs) -> FSharpList[_T]:
608
+ t: FSharpList[_T] = FSharpList(x, None)
609
+ acc.tail = t
610
+ return t
611
+
612
+ node = fold(_arrow75, node, xs)
613
+
614
+ if is_array_like(lists):
615
+ iterate_1(action, lists)
616
+
617
+ elif isinstance(lists, FSharpList):
618
+ iterate(action, lists)
619
+
620
+ else:
621
+ with get_enumerator(lists) as enumerator:
622
+ while enumerator.System_Collections_IEnumerator_MoveNext():
623
+ action(enumerator.System_Collections_Generic_IEnumerator_1_get_Current())
624
+
625
+ xs_6: FSharpList[_T] = node
626
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
627
+ xs_6.tail = t_2
628
+ return FSharpList__get_Tail(root)
629
+
630
+
631
+ def scan(folder: Callable[[_STATE, _T], _STATE], state: Any, xs: FSharpList[Any]) -> FSharpList[Any]:
632
+ root: FSharpList[_STATE] = FSharpList_get_Empty()
633
+ node: FSharpList[_STATE]
634
+ t: FSharpList[_STATE] = FSharpList(state, None)
635
+ root.tail = t
636
+ node = t
637
+ acc: _STATE = state
638
+ xs_3: FSharpList[_T] = xs
639
+ while not FSharpList__get_IsEmpty(xs_3):
640
+ acc = folder(acc, FSharpList__get_Head(xs_3))
641
+
642
+ def _arrow76(__unit: None = None, folder: Any = folder, state: Any = state, xs: Any = xs) -> FSharpList[_STATE]:
643
+ xs_4: FSharpList[_STATE] = node
644
+ t_2: FSharpList[_STATE] = FSharpList(acc, None)
645
+ xs_4.tail = t_2
646
+ return t_2
647
+
648
+ node = _arrow76()
649
+ xs_3 = FSharpList__get_Tail(xs_3)
650
+ xs_6: FSharpList[_STATE] = node
651
+ t_4: FSharpList[_STATE] = FSharpList_get_Empty()
652
+ xs_6.tail = t_4
653
+ return FSharpList__get_Tail(root)
654
+
655
+
656
+ def scan_back(folder: Callable[[_T, _STATE], _STATE], xs: FSharpList[Any], state: Any) -> FSharpList[Any]:
657
+ return of_array(scan_back_1(folder, to_array(xs), state, None))
658
+
659
+
660
+ def append(xs: FSharpList[Any], ys: FSharpList[Any]) -> FSharpList[Any]:
661
+ def _arrow77(acc: FSharpList[_T], x: _T, xs: Any = xs, ys: Any = ys) -> FSharpList[_T]:
662
+ return FSharpList_Cons_305B8EAC(x, acc)
663
+
664
+ return fold(_arrow77, ys, reverse(xs))
665
+
666
+
667
+ def collect(mapping: Callable[[_T], FSharpList[_U]], xs: FSharpList[Any]) -> FSharpList[Any]:
668
+ root: FSharpList[_U] = FSharpList_get_Empty()
669
+ node: FSharpList[_U] = root
670
+ ys: FSharpList[_T] = xs
671
+ while not FSharpList__get_IsEmpty(ys):
672
+ zs: FSharpList[_U] = mapping(FSharpList__get_Head(ys))
673
+ while not FSharpList__get_IsEmpty(zs):
674
+
675
+ def _arrow78(__unit: None = None, mapping: Any = mapping, xs: Any = xs) -> FSharpList[_U]:
676
+ xs_1: FSharpList[_U] = node
677
+ t: FSharpList[_U] = FSharpList(FSharpList__get_Head(zs), None)
678
+ xs_1.tail = t
679
+ return t
680
+
681
+ node = _arrow78()
682
+ zs = FSharpList__get_Tail(zs)
683
+ ys = FSharpList__get_Tail(ys)
684
+ xs_3: FSharpList[_U] = node
685
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
686
+ xs_3.tail = t_2
687
+ return FSharpList__get_Tail(root)
688
+
689
+
690
+ def map_indexed(mapping: Callable[[int, _T], _U], xs: FSharpList[Any]) -> FSharpList[Any]:
691
+ root: FSharpList[_U] = FSharpList_get_Empty()
692
+
693
+ def folder(i: int, acc: FSharpList[_U], x: _T, mapping: Any = mapping, xs: Any = xs) -> FSharpList[_U]:
694
+ t: FSharpList[_U] = FSharpList(mapping(i, x), None)
695
+ acc.tail = t
696
+ return t
697
+
698
+ node: FSharpList[_U] = fold_indexed(folder, root, xs)
699
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
700
+ node.tail = t_2
701
+ return FSharpList__get_Tail(root)
702
+
703
+
704
+ def map(mapping: Callable[[_T], _U], xs: FSharpList[Any]) -> FSharpList[Any]:
705
+ root: FSharpList[_U] = FSharpList_get_Empty()
706
+
707
+ def folder(acc: FSharpList[_U], x: _T, mapping: Any = mapping, xs: Any = xs) -> FSharpList[_U]:
708
+ t: FSharpList[_U] = FSharpList(mapping(x), None)
709
+ acc.tail = t
710
+ return t
711
+
712
+ node: FSharpList[_U] = fold(folder, root, xs)
713
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
714
+ node.tail = t_2
715
+ return FSharpList__get_Tail(root)
716
+
717
+
718
+ def indexed(xs: FSharpList[Any]) -> FSharpList[tuple[int, __A]]:
719
+ def _arrow79(i: int, x: __A, xs: Any = xs) -> tuple[int, __A]:
720
+ return (i, x)
721
+
722
+ return map_indexed(_arrow79, xs)
723
+
724
+
725
+ def map2(mapping: Callable[[_T1, _T2], _U], xs: FSharpList[Any], ys: FSharpList[Any]) -> FSharpList[Any]:
726
+ root: FSharpList[_U] = FSharpList_get_Empty()
727
+
728
+ def folder(
729
+ acc: FSharpList[_U], x: _T1, y: _T2, mapping: Any = mapping, xs: Any = xs, ys: Any = ys
730
+ ) -> FSharpList[_U]:
731
+ t: FSharpList[_U] = FSharpList(mapping(x, y), None)
732
+ acc.tail = t
733
+ return t
734
+
735
+ node: FSharpList[_U] = fold2(folder, root, xs, ys)
736
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
737
+ node.tail = t_2
738
+ return FSharpList__get_Tail(root)
739
+
740
+
741
+ def map_indexed2(mapping: Callable[[int, _T1, _T2], _U], xs: FSharpList[Any], ys: FSharpList[Any]) -> FSharpList[Any]:
742
+ def loop(
743
+ i_mut: int,
744
+ acc_mut: FSharpList[_U],
745
+ xs_1_mut: FSharpList[_T1],
746
+ ys_1_mut: FSharpList[_T2],
747
+ mapping: Any = mapping,
748
+ xs: Any = xs,
749
+ ys: Any = ys,
750
+ ) -> FSharpList[_U]:
751
+ while True:
752
+ (i, acc, xs_1, ys_1) = (i_mut, acc_mut, xs_1_mut, ys_1_mut)
753
+ if True if FSharpList__get_IsEmpty(xs_1) else FSharpList__get_IsEmpty(ys_1):
754
+ return acc
755
+
756
+ else:
757
+ i_mut = i + 1
758
+
759
+ def _arrow80(
760
+ __unit: None = None, i: Any = i, acc: Any = acc, xs_1: Any = xs_1, ys_1: Any = ys_1
761
+ ) -> FSharpList[_U]:
762
+ t: FSharpList[_U] = FSharpList(
763
+ mapping(i, FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1)), None
764
+ )
765
+ acc.tail = t
766
+ return t
767
+
768
+ acc_mut = _arrow80()
769
+ xs_1_mut = FSharpList__get_Tail(xs_1)
770
+ ys_1_mut = FSharpList__get_Tail(ys_1)
771
+ continue
772
+
773
+ break
774
+
775
+ root: FSharpList[_U] = FSharpList_get_Empty()
776
+ node_1: FSharpList[_U] = loop(0, root, xs, ys)
777
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
778
+ node_1.tail = t_2
779
+ return FSharpList__get_Tail(root)
780
+
781
+
782
+ def map3(
783
+ mapping: Callable[[_T1, _T2, _T3], _U], xs: FSharpList[Any], ys: FSharpList[Any], zs: FSharpList[Any]
784
+ ) -> FSharpList[Any]:
785
+ def loop(
786
+ acc_mut: FSharpList[_U],
787
+ xs_1_mut: FSharpList[_T1],
788
+ ys_1_mut: FSharpList[_T2],
789
+ zs_1_mut: FSharpList[_T3],
790
+ mapping: Any = mapping,
791
+ xs: Any = xs,
792
+ ys: Any = ys,
793
+ zs: Any = zs,
794
+ ) -> FSharpList[_U]:
795
+ while True:
796
+ (acc, xs_1, ys_1, zs_1) = (acc_mut, xs_1_mut, ys_1_mut, zs_1_mut)
797
+ if (
798
+ True
799
+ if (True if FSharpList__get_IsEmpty(xs_1) else FSharpList__get_IsEmpty(ys_1))
800
+ else FSharpList__get_IsEmpty(zs_1)
801
+ ):
802
+ return acc
803
+
804
+ else:
805
+
806
+ def _arrow81(
807
+ __unit: None = None, acc: Any = acc, xs_1: Any = xs_1, ys_1: Any = ys_1, zs_1: Any = zs_1
808
+ ) -> FSharpList[_U]:
809
+ t: FSharpList[_U] = FSharpList(
810
+ mapping(FSharpList__get_Head(xs_1), FSharpList__get_Head(ys_1), FSharpList__get_Head(zs_1)),
811
+ None,
812
+ )
813
+ acc.tail = t
814
+ return t
815
+
816
+ acc_mut = _arrow81()
817
+ xs_1_mut = FSharpList__get_Tail(xs_1)
818
+ ys_1_mut = FSharpList__get_Tail(ys_1)
819
+ zs_1_mut = FSharpList__get_Tail(zs_1)
820
+ continue
821
+
822
+ break
823
+
824
+ root: FSharpList[_U] = FSharpList_get_Empty()
825
+ node_1: FSharpList[_U] = loop(root, xs, ys, zs)
826
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
827
+ node_1.tail = t_2
828
+ return FSharpList__get_Tail(root)
829
+
830
+
831
+ def map_fold(
832
+ mapping: Callable[[_STATE, _T], tuple[_RESULT, _STATE]], state: Any, xs: FSharpList[Any]
833
+ ) -> tuple[FSharpList[_RESULT], _STATE]:
834
+ root: FSharpList[_RESULT] = FSharpList_get_Empty()
835
+
836
+ def folder(
837
+ tupled_arg: tuple[FSharpList[_RESULT], _STATE], x: _T, mapping: Any = mapping, state: Any = state, xs: Any = xs
838
+ ) -> tuple[FSharpList[_RESULT], _STATE]:
839
+ pattern_input: tuple[_RESULT, _STATE] = mapping(tupled_arg[1], x)
840
+
841
+ def _arrow82(__unit: None = None, tupled_arg: Any = tupled_arg, x: Any = x) -> FSharpList[_RESULT]:
842
+ t: FSharpList[_RESULT] = FSharpList(pattern_input[0], None)
843
+ tupled_arg[0].tail = t
844
+ return t
845
+
846
+ return (_arrow82(), pattern_input[1])
847
+
848
+ pattern_input_1: tuple[FSharpList[_RESULT], _STATE] = fold(folder, (root, state), xs)
849
+ t_2: FSharpList[_RESULT] = FSharpList_get_Empty()
850
+ pattern_input_1[0].tail = t_2
851
+ return (FSharpList__get_Tail(root), pattern_input_1[1])
852
+
853
+
854
+ def map_fold_back(
855
+ mapping: Callable[[_T, _STATE], tuple[_RESULT, _STATE]], xs: FSharpList[Any], state: Any
856
+ ) -> tuple[FSharpList[_RESULT], _STATE]:
857
+ def _arrow83(
858
+ acc: _STATE, x: _T, mapping: Any = mapping, xs: Any = xs, state: Any = state
859
+ ) -> tuple[_RESULT, _STATE]:
860
+ return mapping(x, acc)
861
+
862
+ return map_fold(_arrow83, state, reverse(xs))
863
+
864
+
865
+ def try_pick(f: Callable[[_T], __A | None], xs: FSharpList[Any]) -> Any | None:
866
+ def loop(xs_1_mut: FSharpList[_T], f: Any = f, xs: Any = xs) -> __A | None:
867
+ while True:
868
+ (xs_1,) = (xs_1_mut,)
869
+ if FSharpList__get_IsEmpty(xs_1):
870
+ return None
871
+
872
+ else:
873
+ match_value: __A | None = f(FSharpList__get_Head(xs_1))
874
+ if match_value is None:
875
+ xs_1_mut = FSharpList__get_Tail(xs_1)
876
+ continue
877
+
878
+ else:
879
+ return match_value
880
+
881
+ break
882
+
883
+ return loop(xs)
884
+
885
+
886
+ def pick(f: Callable[[__A], __B | None], xs: FSharpList[Any]) -> Any:
887
+ match_value: __B | None = try_pick(f, xs)
888
+ if match_value is None:
889
+ return index_not_found()
890
+
891
+ else:
892
+ return value_1(match_value)
893
+
894
+
895
+ def try_find(f: Callable[[__A], bool], xs: FSharpList[Any]) -> Any | None:
896
+ def _arrow84(x: __A | None = None, f: Any = f, xs: Any = xs) -> __A | None:
897
+ return some(x) if f(x) else None
898
+
899
+ return try_pick(_arrow84, xs)
900
+
901
+
902
+ def find(f: Callable[[__A], bool], xs: FSharpList[Any]) -> Any:
903
+ match_value: __A | None = try_find(f, xs)
904
+ if match_value is None:
905
+ return index_not_found()
906
+
907
+ else:
908
+ return value_1(match_value)
909
+
910
+
911
+ def try_find_back(f: Callable[[__A], bool], xs: FSharpList[Any]) -> Any | None:
912
+ return try_find_back_1(f, to_array(xs))
913
+
914
+
915
+ def find_back(f: Callable[[__A], bool], xs: FSharpList[Any]) -> Any:
916
+ match_value: __A | None = try_find_back(f, xs)
917
+ if match_value is None:
918
+ return index_not_found()
919
+
920
+ else:
921
+ return value_1(match_value)
922
+
923
+
924
+ def try_find_index(f: Callable[[_T], bool], xs: FSharpList[Any]) -> int | None:
925
+ def loop(i_mut: int, xs_1_mut: FSharpList[_T], f: Any = f, xs: Any = xs) -> int | None:
926
+ while True:
927
+ (i, xs_1) = (i_mut, xs_1_mut)
928
+ if FSharpList__get_IsEmpty(xs_1):
929
+ return None
930
+
931
+ elif f(FSharpList__get_Head(xs_1)):
932
+ return i
933
+
934
+ else:
935
+ i_mut = i + 1
936
+ xs_1_mut = FSharpList__get_Tail(xs_1)
937
+ continue
938
+
939
+ break
940
+
941
+ return loop(0, xs)
942
+
943
+
944
+ def find_index(f: Callable[[__A], bool], xs: FSharpList[Any]) -> int:
945
+ match_value: int | None = try_find_index(f, xs)
946
+ if match_value is None:
947
+ index_not_found()
948
+ return -1
949
+
950
+ else:
951
+ return match_value
952
+
953
+
954
+ def try_find_index_back(f: Callable[[__A], bool], xs: FSharpList[Any]) -> int | None:
955
+ return try_find_index_back_1(f, to_array(xs))
956
+
957
+
958
+ def find_index_back(f: Callable[[__A], bool], xs: FSharpList[Any]) -> int:
959
+ match_value: int | None = try_find_index_back(f, xs)
960
+ if match_value is None:
961
+ index_not_found()
962
+ return -1
963
+
964
+ else:
965
+ return match_value
966
+
967
+
968
+ def try_item(n: int, xs: FSharpList[Any]) -> Any | None:
969
+ def loop(i_mut: int, xs_1_mut: FSharpList[_T], n: Any = n, xs: Any = xs) -> _T | None:
970
+ while True:
971
+ (i, xs_1) = (i_mut, xs_1_mut)
972
+ if FSharpList__get_IsEmpty(xs_1):
973
+ return None
974
+
975
+ elif i == n:
976
+ return some(FSharpList__get_Head(xs_1))
977
+
978
+ else:
979
+ i_mut = i + 1
980
+ xs_1_mut = FSharpList__get_Tail(xs_1)
981
+ continue
982
+
983
+ break
984
+
985
+ return loop(0, xs)
986
+
987
+
988
+ def item(n: int, xs: FSharpList[Any]) -> Any:
989
+ return FSharpList__get_Item_Z524259A4(xs, n)
990
+
991
+
992
+ def filter(f: Callable[[_T], bool], xs: FSharpList[Any]) -> FSharpList[Any]:
993
+ root: FSharpList[_T] = FSharpList_get_Empty()
994
+
995
+ def folder(acc: FSharpList[_T], x: _T, f: Any = f, xs: Any = xs) -> FSharpList[_T]:
996
+ if f(x):
997
+ t: FSharpList[_T] = FSharpList(x, None)
998
+ acc.tail = t
999
+ return t
1000
+
1001
+ else:
1002
+ return acc
1003
+
1004
+ node: FSharpList[_T] = fold(folder, root, xs)
1005
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
1006
+ node.tail = t_2
1007
+ return FSharpList__get_Tail(root)
1008
+
1009
+
1010
+ def partition(f: Callable[[_T], bool], xs: FSharpList[Any]) -> tuple[FSharpList[_T], FSharpList[_T]]:
1011
+ match_value: FSharpList[_T] = FSharpList_get_Empty()
1012
+ root2: FSharpList[_T] = FSharpList_get_Empty()
1013
+ root1: FSharpList[_T] = match_value
1014
+
1015
+ def folder(
1016
+ tupled_arg: tuple[FSharpList[_T], FSharpList[_T]], x: _T, f: Any = f, xs: Any = xs
1017
+ ) -> tuple[FSharpList[_T], FSharpList[_T]]:
1018
+ lacc: FSharpList[_T] = tupled_arg[0]
1019
+ racc: FSharpList[_T] = tupled_arg[1]
1020
+ if f(x):
1021
+
1022
+ def _arrow85(__unit: None = None, tupled_arg: Any = tupled_arg, x: Any = x) -> FSharpList[_T]:
1023
+ t: FSharpList[_T] = FSharpList(x, None)
1024
+ lacc.tail = t
1025
+ return t
1026
+
1027
+ return (_arrow85(), racc)
1028
+
1029
+ else:
1030
+
1031
+ def _arrow86(__unit: None = None, tupled_arg: Any = tupled_arg, x: Any = x) -> FSharpList[_T]:
1032
+ t_2: FSharpList[_T] = FSharpList(x, None)
1033
+ racc.tail = t_2
1034
+ return t_2
1035
+
1036
+ return (lacc, _arrow86())
1037
+
1038
+ pattern_input_1: tuple[FSharpList[_T], FSharpList[_T]] = fold(folder, (root1, root2), xs)
1039
+ t_4: FSharpList[_T] = FSharpList_get_Empty()
1040
+ pattern_input_1[0].tail = t_4
1041
+ t_5: FSharpList[_T] = FSharpList_get_Empty()
1042
+ pattern_input_1[1].tail = t_5
1043
+ return (FSharpList__get_Tail(root1), FSharpList__get_Tail(root2))
1044
+
1045
+
1046
+ def choose(f: Callable[[_T], _U | None], xs: FSharpList[Any]) -> FSharpList[Any]:
1047
+ root: FSharpList[_U] = FSharpList_get_Empty()
1048
+
1049
+ def folder(acc: FSharpList[_U], x: _T, f: Any = f, xs: Any = xs) -> FSharpList[_U]:
1050
+ match_value: _U | None = f(x)
1051
+ if match_value is None:
1052
+ return acc
1053
+
1054
+ else:
1055
+ t: FSharpList[_U] = FSharpList(value_1(match_value), None)
1056
+ acc.tail = t
1057
+ return t
1058
+
1059
+ node: FSharpList[_U] = fold(folder, root, xs)
1060
+ t_2: FSharpList[_U] = FSharpList_get_Empty()
1061
+ node.tail = t_2
1062
+ return FSharpList__get_Tail(root)
1063
+
1064
+
1065
+ def contains(value: Any, xs: FSharpList[Any], eq: IEqualityComparer_1[Any]) -> bool:
1066
+ def _arrow87(v: _T | None = None, value: Any = value, xs: Any = xs, eq: Any = eq) -> bool:
1067
+ return eq.Equals(value, v)
1068
+
1069
+ return try_find_index(_arrow87, xs) is not None
1070
+
1071
+
1072
+ def initialize(n: int, f: Callable[[int], _T]) -> FSharpList[Any]:
1073
+ root: FSharpList[_T] = FSharpList_get_Empty()
1074
+ node: FSharpList[_T] = root
1075
+ for i in range(0, (n - 1) + 1, 1):
1076
+
1077
+ def _arrow88(__unit: None = None, n: Any = n, f: Any = f) -> FSharpList[_T]:
1078
+ xs: FSharpList[_T] = node
1079
+ t: FSharpList[_T] = FSharpList(f(i), None)
1080
+ xs.tail = t
1081
+ return t
1082
+
1083
+ node = _arrow88()
1084
+ xs_2: FSharpList[_T] = node
1085
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
1086
+ xs_2.tail = t_2
1087
+ return FSharpList__get_Tail(root)
1088
+
1089
+
1090
+ def replicate(n: int, x: Any) -> FSharpList[Any]:
1091
+ def _arrow89(_arg: int, n: Any = n, x: Any = x) -> __A:
1092
+ return x
1093
+
1094
+ return initialize(n, _arrow89)
1095
+
1096
+
1097
+ def reduce(f: Callable[[_T, _T], _T], xs: FSharpList[Any]) -> Any:
1098
+ if FSharpList__get_IsEmpty(xs):
1099
+ raise Exception(SR_inputWasEmpty)
1100
+
1101
+ else:
1102
+ return fold(f, head(xs), tail(xs))
1103
+
1104
+
1105
+ def reduce_back(f: Callable[[_T, _T], _T], xs: FSharpList[Any]) -> Any:
1106
+ if FSharpList__get_IsEmpty(xs):
1107
+ raise Exception(SR_inputWasEmpty)
1108
+
1109
+ else:
1110
+ return fold_back(f, tail(xs), head(xs))
1111
+
1112
+
1113
+ def for_all(f: Callable[[__A], bool], xs: FSharpList[Any]) -> bool:
1114
+ def _arrow90(acc: bool, x: __A, f: Any = f, xs: Any = xs) -> bool:
1115
+ return f(x) if acc else False
1116
+
1117
+ return fold(_arrow90, True, xs)
1118
+
1119
+
1120
+ def for_all2(f: Callable[[__A, __B], bool], xs: FSharpList[Any], ys: FSharpList[Any]) -> bool:
1121
+ def _arrow91(acc: bool, x: __A, y: __B, f: Any = f, xs: Any = xs, ys: Any = ys) -> bool:
1122
+ return f(x, y) if acc else False
1123
+
1124
+ return fold2(_arrow91, True, xs, ys)
1125
+
1126
+
1127
+ def exists(f: Callable[[__A], bool], xs: FSharpList[Any]) -> bool:
1128
+ return try_find_index(f, xs) is not None
1129
+
1130
+
1131
+ def exists2(f_mut: Callable[[_T1, _T2], bool], xs_mut: FSharpList[Any], ys_mut: FSharpList[Any]) -> bool:
1132
+ while True:
1133
+ (f, xs, ys) = (f_mut, xs_mut, ys_mut)
1134
+ match_value: bool = FSharpList__get_IsEmpty(xs)
1135
+ match_value_1: bool = FSharpList__get_IsEmpty(ys)
1136
+ (pattern_matching_result,) = (None,)
1137
+ if match_value:
1138
+ if match_value_1:
1139
+ pattern_matching_result = 0
1140
+
1141
+ else:
1142
+ pattern_matching_result = 2
1143
+
1144
+ elif match_value_1:
1145
+ pattern_matching_result = 2
1146
+
1147
+ else:
1148
+ pattern_matching_result = 1
1149
+
1150
+ if pattern_matching_result == 0:
1151
+ return False
1152
+
1153
+ elif pattern_matching_result == 1:
1154
+ if f(FSharpList__get_Head(xs), FSharpList__get_Head(ys)):
1155
+ return True
1156
+
1157
+ else:
1158
+ f_mut = f
1159
+ xs_mut = FSharpList__get_Tail(xs)
1160
+ ys_mut = FSharpList__get_Tail(ys)
1161
+ continue
1162
+
1163
+ elif pattern_matching_result == 2:
1164
+ raise Exception((SR_differentLengths + "\\nParameter name: ") + "list2")
1165
+
1166
+ break
1167
+
1168
+
1169
+ def unzip(xs: FSharpList[tuple[__A, __B]]) -> tuple[FSharpList[__A], FSharpList[__B]]:
1170
+ def _arrow92(
1171
+ tupled_arg: tuple[__A, __B], tupled_arg_1: tuple[FSharpList[__A], FSharpList[__B]], xs: Any = xs
1172
+ ) -> tuple[FSharpList[__A], FSharpList[__B]]:
1173
+ return (
1174
+ FSharpList_Cons_305B8EAC(tupled_arg[0], tupled_arg_1[0]),
1175
+ FSharpList_Cons_305B8EAC(tupled_arg[1], tupled_arg_1[1]),
1176
+ )
1177
+
1178
+ return fold_back(_arrow92, xs, (FSharpList_get_Empty(), FSharpList_get_Empty()))
1179
+
1180
+
1181
+ def unzip3(xs: FSharpList[tuple[__A, __B, __C]]) -> tuple[FSharpList[__A], FSharpList[__B], FSharpList[__C]]:
1182
+ def _arrow93(
1183
+ tupled_arg: tuple[__A, __B, __C],
1184
+ tupled_arg_1: tuple[FSharpList[__A], FSharpList[__B], FSharpList[__C]],
1185
+ xs: Any = xs,
1186
+ ) -> tuple[FSharpList[__A], FSharpList[__B], FSharpList[__C]]:
1187
+ return (
1188
+ FSharpList_Cons_305B8EAC(tupled_arg[0], tupled_arg_1[0]),
1189
+ FSharpList_Cons_305B8EAC(tupled_arg[1], tupled_arg_1[1]),
1190
+ FSharpList_Cons_305B8EAC(tupled_arg[2], tupled_arg_1[2]),
1191
+ )
1192
+
1193
+ return fold_back(_arrow93, xs, (FSharpList_get_Empty(), FSharpList_get_Empty(), FSharpList_get_Empty()))
1194
+
1195
+
1196
+ def zip(xs: FSharpList[Any], ys: FSharpList[Any]) -> FSharpList[tuple[__A, __B]]:
1197
+ def _arrow94(x: __A, y: __B, xs: Any = xs, ys: Any = ys) -> tuple[__A, __B]:
1198
+ return (x, y)
1199
+
1200
+ return map2(_arrow94, xs, ys)
1201
+
1202
+
1203
+ def zip3(xs: FSharpList[Any], ys: FSharpList[Any], zs: FSharpList[Any]) -> FSharpList[tuple[__A, __B, __C]]:
1204
+ def _arrow95(x: __A, y: __B, z: __C, xs: Any = xs, ys: Any = ys, zs: Any = zs) -> tuple[__A, __B, __C]:
1205
+ return (x, y, z)
1206
+
1207
+ return map3(_arrow95, xs, ys, zs)
1208
+
1209
+
1210
+ def sort_with(comparer: Callable[[_T, _T], int], xs: FSharpList[Any]) -> FSharpList[Any]:
1211
+ arr: Array[_T] = to_array(xs)
1212
+ sort_in_place_with(comparer, arr)
1213
+ return of_array(arr)
1214
+
1215
+
1216
+ def sort(xs: FSharpList[Any], comparer: IComparer_1[Any]) -> FSharpList[Any]:
1217
+ def _arrow96(x: _T, y: _T, xs: Any = xs, comparer: Any = comparer) -> int:
1218
+ return comparer.Compare(x, y)
1219
+
1220
+ return sort_with(_arrow96, xs)
1221
+
1222
+
1223
+ def sort_by(projection: Callable[[_T], _U], xs: FSharpList[Any], comparer: IComparer_1[Any]) -> FSharpList[Any]:
1224
+ def _arrow97(x: _T, y: _T, projection: Any = projection, xs: Any = xs, comparer: Any = comparer) -> int:
1225
+ return comparer.Compare(projection(x), projection(y))
1226
+
1227
+ return sort_with(_arrow97, xs)
1228
+
1229
+
1230
+ def sort_descending(xs: FSharpList[Any], comparer: IComparer_1[Any]) -> FSharpList[Any]:
1231
+ def _arrow98(x: _T, y: _T, xs: Any = xs, comparer: Any = comparer) -> int:
1232
+ return comparer.Compare(x, y) * -1
1233
+
1234
+ return sort_with(_arrow98, xs)
1235
+
1236
+
1237
+ def sort_by_descending(
1238
+ projection: Callable[[_T], _U], xs: FSharpList[Any], comparer: IComparer_1[Any]
1239
+ ) -> FSharpList[Any]:
1240
+ def _arrow99(x: _T, y: _T, projection: Any = projection, xs: Any = xs, comparer: Any = comparer) -> int:
1241
+ return comparer.Compare(projection(x), projection(y)) * -1
1242
+
1243
+ return sort_with(_arrow99, xs)
1244
+
1245
+
1246
+ def sum(xs: FSharpList[Any], adder: IGenericAdder_1[Any]) -> Any:
1247
+ def _arrow100(acc: _T, x: _T, xs: Any = xs, adder: Any = adder) -> _T:
1248
+ return adder.Add(acc, x)
1249
+
1250
+ return fold(_arrow100, adder.GetZero(), xs)
1251
+
1252
+
1253
+ def sum_by(f: Callable[[_T], _U], xs: FSharpList[Any], adder: IGenericAdder_1[Any]) -> Any:
1254
+ def _arrow101(acc: _U, x: _T, f: Any = f, xs: Any = xs, adder: Any = adder) -> _U:
1255
+ return adder.Add(acc, f(x))
1256
+
1257
+ return fold(_arrow101, adder.GetZero(), xs)
1258
+
1259
+
1260
+ def max_by(projection: Callable[[_T], _U], xs: FSharpList[Any], comparer: IComparer_1[Any]) -> Any:
1261
+ def _arrow102(x: _T, y: _T, projection: Any = projection, xs: Any = xs, comparer: Any = comparer) -> _T:
1262
+ return y if (comparer.Compare(projection(y), projection(x)) > 0) else x
1263
+
1264
+ return reduce(_arrow102, xs)
1265
+
1266
+
1267
+ def max(xs: FSharpList[Any], comparer: IComparer_1[Any]) -> Any:
1268
+ def _arrow103(x: _T, y: _T, xs: Any = xs, comparer: Any = comparer) -> _T:
1269
+ return y if (comparer.Compare(y, x) > 0) else x
1270
+
1271
+ return reduce(_arrow103, xs)
1272
+
1273
+
1274
+ def min_by(projection: Callable[[_T], _U], xs: FSharpList[Any], comparer: IComparer_1[Any]) -> Any:
1275
+ def _arrow104(x: _T, y: _T, projection: Any = projection, xs: Any = xs, comparer: Any = comparer) -> _T:
1276
+ return x if (comparer.Compare(projection(y), projection(x)) > 0) else y
1277
+
1278
+ return reduce(_arrow104, xs)
1279
+
1280
+
1281
+ def min(xs: FSharpList[Any], comparer: IComparer_1[Any]) -> Any:
1282
+ def _arrow105(x: _T, y: _T, xs: Any = xs, comparer: Any = comparer) -> _T:
1283
+ return x if (comparer.Compare(y, x) > 0) else y
1284
+
1285
+ return reduce(_arrow105, xs)
1286
+
1287
+
1288
+ def average(xs: FSharpList[Any], averager: IGenericAverager_1[Any]) -> Any:
1289
+ count: int = 0
1290
+
1291
+ def folder(acc: _T, x: _T, xs: Any = xs, averager: Any = averager) -> _T:
1292
+ nonlocal count
1293
+ count = (count + 1) or 0
1294
+ return averager.Add(acc, x)
1295
+
1296
+ total: _T = fold(folder, averager.GetZero(), xs)
1297
+ return averager.DivideByInt(total, count)
1298
+
1299
+
1300
+ def average_by(f: Callable[[_T], _U], xs: FSharpList[Any], averager: IGenericAverager_1[Any]) -> Any:
1301
+ count: int = 0
1302
+
1303
+ def _arrow106(acc: _U, x: _T, f: Any = f, xs: Any = xs, averager: Any = averager) -> _U:
1304
+ nonlocal count
1305
+ count = (count + 1) or 0
1306
+ return averager.Add(acc, f(x))
1307
+
1308
+ total: _U = fold(_arrow106, averager.GetZero(), xs)
1309
+ return averager.DivideByInt(total, count)
1310
+
1311
+
1312
+ def permute(f: Callable[[int], int], xs: FSharpList[Any]) -> FSharpList[Any]:
1313
+ return of_array(permute_1(f, to_array(xs)))
1314
+
1315
+
1316
+ def chunk_by_size(chunk_size: int, xs: FSharpList[Any]) -> FSharpList[FSharpList[Any]]:
1317
+ def mapping(xs_1: Array[_T], chunk_size: Any = chunk_size, xs: Any = xs) -> FSharpList[_T]:
1318
+ return of_array(xs_1)
1319
+
1320
+ return of_array(map_1(mapping, chunk_by_size_1(chunk_size, to_array(xs)), None))
1321
+
1322
+
1323
+ def all_pairs(xs: FSharpList[Any], ys: FSharpList[Any]) -> FSharpList[tuple[_T1, _T2]]:
1324
+ root: FSharpList[tuple[_T1, _T2]] = FSharpList_get_Empty()
1325
+ node: FSharpList[tuple[_T1, _T2]] = root
1326
+
1327
+ def _arrow109(x: _T1 | None = None, xs: Any = xs, ys: Any = ys) -> None:
1328
+ def _arrow108(y: _T2 | None = None) -> None:
1329
+ nonlocal node
1330
+
1331
+ def _arrow107(__unit: None = None) -> FSharpList[tuple[_T1, _T2]]:
1332
+ xs_1: FSharpList[tuple[_T1, _T2]] = node
1333
+ t: FSharpList[tuple[_T1, _T2]] = FSharpList((x, y), None)
1334
+ xs_1.tail = t
1335
+ return t
1336
+
1337
+ node = _arrow107()
1338
+
1339
+ iterate(_arrow108, ys)
1340
+
1341
+ iterate(_arrow109, xs)
1342
+ xs_3: FSharpList[tuple[_T1, _T2]] = node
1343
+ t_2: FSharpList[tuple[_T1, _T2]] = FSharpList_get_Empty()
1344
+ xs_3.tail = t_2
1345
+ return FSharpList__get_Tail(root)
1346
+
1347
+
1348
+ def skip(count_mut: int, xs_mut: FSharpList[Any]) -> FSharpList[Any]:
1349
+ while True:
1350
+ (count, xs) = (count_mut, xs_mut)
1351
+ if count <= 0:
1352
+ return xs
1353
+
1354
+ elif FSharpList__get_IsEmpty(xs):
1355
+ raise Exception((SR_notEnoughElements + "\\nParameter name: ") + "list")
1356
+
1357
+ else:
1358
+ count_mut = count - 1
1359
+ xs_mut = FSharpList__get_Tail(xs)
1360
+ continue
1361
+
1362
+ break
1363
+
1364
+
1365
+ def skip_while(predicate_mut: Callable[[_T], bool], xs_mut: FSharpList[Any]) -> FSharpList[Any]:
1366
+ while True:
1367
+ (predicate, xs) = (predicate_mut, xs_mut)
1368
+ if FSharpList__get_IsEmpty(xs):
1369
+ return xs
1370
+
1371
+ elif not predicate(FSharpList__get_Head(xs)):
1372
+ return xs
1373
+
1374
+ else:
1375
+ predicate_mut = predicate
1376
+ xs_mut = FSharpList__get_Tail(xs)
1377
+ continue
1378
+
1379
+ break
1380
+
1381
+
1382
+ def take(count: int, xs: FSharpList[Any]) -> FSharpList[Any]:
1383
+ if count < 0:
1384
+ raise Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "count")
1385
+
1386
+ def loop(
1387
+ i_mut: int, acc_mut: FSharpList[_T], xs_1_mut: FSharpList[_T], count: Any = count, xs: Any = xs
1388
+ ) -> FSharpList[_T]:
1389
+ while True:
1390
+ (i, acc, xs_1) = (i_mut, acc_mut, xs_1_mut)
1391
+ if i <= 0:
1392
+ return acc
1393
+
1394
+ elif FSharpList__get_IsEmpty(xs_1):
1395
+ raise Exception((SR_notEnoughElements + "\\nParameter name: ") + "list")
1396
+
1397
+ else:
1398
+ i_mut = i - 1
1399
+
1400
+ def _arrow110(__unit: None = None, i: Any = i, acc: Any = acc, xs_1: Any = xs_1) -> FSharpList[_T]:
1401
+ t: FSharpList[_T] = FSharpList(FSharpList__get_Head(xs_1), None)
1402
+ acc.tail = t
1403
+ return t
1404
+
1405
+ acc_mut = _arrow110()
1406
+ xs_1_mut = FSharpList__get_Tail(xs_1)
1407
+ continue
1408
+
1409
+ break
1410
+
1411
+ root: FSharpList[_T] = FSharpList_get_Empty()
1412
+ node: FSharpList[_T] = loop(count, root, xs)
1413
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
1414
+ node.tail = t_2
1415
+ return FSharpList__get_Tail(root)
1416
+
1417
+
1418
+ def take_while(predicate: Callable[[_T], bool], xs: FSharpList[Any]) -> FSharpList[Any]:
1419
+ def loop(
1420
+ acc_mut: FSharpList[_T], xs_1_mut: FSharpList[_T], predicate: Any = predicate, xs: Any = xs
1421
+ ) -> FSharpList[_T]:
1422
+ while True:
1423
+ (acc, xs_1) = (acc_mut, xs_1_mut)
1424
+ if FSharpList__get_IsEmpty(xs_1):
1425
+ return acc
1426
+
1427
+ elif not predicate(FSharpList__get_Head(xs_1)):
1428
+ return acc
1429
+
1430
+ else:
1431
+
1432
+ def _arrow111(__unit: None = None, acc: Any = acc, xs_1: Any = xs_1) -> FSharpList[_T]:
1433
+ t: FSharpList[_T] = FSharpList(FSharpList__get_Head(xs_1), None)
1434
+ acc.tail = t
1435
+ return t
1436
+
1437
+ acc_mut = _arrow111()
1438
+ xs_1_mut = FSharpList__get_Tail(xs_1)
1439
+ continue
1440
+
1441
+ break
1442
+
1443
+ root: FSharpList[_T] = FSharpList_get_Empty()
1444
+ node: FSharpList[_T] = loop(root, xs)
1445
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
1446
+ node.tail = t_2
1447
+ return FSharpList__get_Tail(root)
1448
+
1449
+
1450
+ def truncate(count: int, xs: FSharpList[Any]) -> FSharpList[Any]:
1451
+ def loop(
1452
+ i_mut: int, acc_mut: FSharpList[_T], xs_1_mut: FSharpList[_T], count: Any = count, xs: Any = xs
1453
+ ) -> FSharpList[_T]:
1454
+ while True:
1455
+ (i, acc, xs_1) = (i_mut, acc_mut, xs_1_mut)
1456
+ if i <= 0:
1457
+ return acc
1458
+
1459
+ elif FSharpList__get_IsEmpty(xs_1):
1460
+ return acc
1461
+
1462
+ else:
1463
+ i_mut = i - 1
1464
+
1465
+ def _arrow112(__unit: None = None, i: Any = i, acc: Any = acc, xs_1: Any = xs_1) -> FSharpList[_T]:
1466
+ t: FSharpList[_T] = FSharpList(FSharpList__get_Head(xs_1), None)
1467
+ acc.tail = t
1468
+ return t
1469
+
1470
+ acc_mut = _arrow112()
1471
+ xs_1_mut = FSharpList__get_Tail(xs_1)
1472
+ continue
1473
+
1474
+ break
1475
+
1476
+ root: FSharpList[_T] = FSharpList_get_Empty()
1477
+ node: FSharpList[_T] = loop(count, root, xs)
1478
+ t_2: FSharpList[_T] = FSharpList_get_Empty()
1479
+ node.tail = t_2
1480
+ return FSharpList__get_Tail(root)
1481
+
1482
+
1483
+ def get_slice(start_index: int | None, end_index: int | None, xs: FSharpList[Any]) -> FSharpList[Any]:
1484
+ len_1: int = length(xs) or 0
1485
+ start_index_1: int
1486
+ index: int = default_arg(start_index, 0) or 0
1487
+ start_index_1 = 0 if (index < 0) else index
1488
+ end_index_1: int
1489
+ index_1: int = default_arg(end_index, len_1 - 1) or 0
1490
+ end_index_1 = (len_1 - 1) if (index_1 >= len_1) else index_1
1491
+ if end_index_1 < start_index_1:
1492
+ return FSharpList_get_Empty()
1493
+
1494
+ else:
1495
+ return take((end_index_1 - start_index_1) + 1, skip(start_index_1, xs))
1496
+
1497
+
1498
+ def split_at(index: int, xs: FSharpList[Any]) -> tuple[FSharpList[_T], FSharpList[_T]]:
1499
+ if index < 0:
1500
+ raise Exception((SR_inputMustBeNonNegative + "\\nParameter name: ") + "index")
1501
+
1502
+ if index > FSharpList__get_Length(xs):
1503
+ raise Exception((SR_notEnoughElements + "\\nParameter name: ") + "index")
1504
+
1505
+ return (take(index, xs), skip(index, xs))
1506
+
1507
+
1508
+ def exactly_one(xs: FSharpList[Any]) -> Any:
1509
+ if FSharpList__get_IsEmpty(xs):
1510
+ raise Exception((SR_inputSequenceEmpty + "\\nParameter name: ") + "list")
1511
+
1512
+ elif FSharpList__get_IsEmpty(FSharpList__get_Tail(xs)):
1513
+ return FSharpList__get_Head(xs)
1514
+
1515
+ else:
1516
+ raise Exception((SR_inputSequenceTooLong + "\\nParameter name: ") + "list")
1517
+
1518
+
1519
+ def try_exactly_one(xs: FSharpList[Any]) -> Any | None:
1520
+ if FSharpList__get_IsEmpty(FSharpList__get_Tail(xs)) if (not FSharpList__get_IsEmpty(xs)) else False:
1521
+ return some(FSharpList__get_Head(xs))
1522
+
1523
+ else:
1524
+ return None
1525
+
1526
+
1527
+ def where(predicate: Callable[[_T], bool], xs: FSharpList[Any]) -> FSharpList[Any]:
1528
+ return filter(predicate, xs)
1529
+
1530
+
1531
+ def pairwise(xs: FSharpList[Any]) -> FSharpList[tuple[_T, _T]]:
1532
+ return of_array(pairwise_1(to_array(xs)))
1533
+
1534
+
1535
+ def windowed(window_size: int, xs: FSharpList[Any]) -> FSharpList[FSharpList[Any]]:
1536
+ def mapping(xs_1: Array[_T], window_size: Any = window_size, xs: Any = xs) -> FSharpList[_T]:
1537
+ return of_array(xs_1)
1538
+
1539
+ return of_array(map_1(mapping, windowed_1(window_size, to_array(xs)), None))
1540
+
1541
+
1542
+ def split_into(chunks: int, xs: FSharpList[Any]) -> FSharpList[FSharpList[Any]]:
1543
+ def mapping(xs_1: Array[_T], chunks: Any = chunks, xs: Any = xs) -> FSharpList[_T]:
1544
+ return of_array(xs_1)
1545
+
1546
+ return of_array(map_1(mapping, split_into_1(chunks, to_array(xs)), None))
1547
+
1548
+
1549
+ def transpose(lists: IEnumerable_1[FSharpList[Any]]) -> FSharpList[FSharpList[Any]]:
1550
+ def mapping_1(xs_1: Array[_T], lists: Any = lists) -> FSharpList[_T]:
1551
+ return of_array(xs_1)
1552
+
1553
+ def mapping(xs: FSharpList[_T], lists: Any = lists) -> Array[_T]:
1554
+ return to_array(xs)
1555
+
1556
+ return of_array(map_1(mapping_1, transpose_1(map_1(mapping, list(lists), None), None), None))
1557
+
1558
+
1559
+ def insert_at(index: int, y: Any, xs: FSharpList[Any]) -> FSharpList[Any]:
1560
+ i: int = -1
1561
+ is_done: bool = False
1562
+
1563
+ def folder(acc: FSharpList[_T], x: _T, index: Any = index, y: Any = y, xs: Any = xs) -> FSharpList[_T]:
1564
+ nonlocal i, is_done
1565
+ i = (i + 1) or 0
1566
+ if i == index:
1567
+ is_done = True
1568
+ return FSharpList_Cons_305B8EAC(x, FSharpList_Cons_305B8EAC(y, acc))
1569
+
1570
+ else:
1571
+ return FSharpList_Cons_305B8EAC(x, acc)
1572
+
1573
+ result: FSharpList[_T] = fold(folder, FSharpList_get_Empty(), xs)
1574
+
1575
+ def _arrow113(__unit: None = None, index: Any = index, y: Any = y, xs: Any = xs) -> FSharpList[_T]:
1576
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index")
1577
+
1578
+ return reverse(result if is_done else (FSharpList_Cons_305B8EAC(y, result) if ((i + 1) == index) else _arrow113()))
1579
+
1580
+
1581
+ def insert_many_at(index: int, ys: IEnumerable_1[Any], xs: FSharpList[Any]) -> FSharpList[Any]:
1582
+ i: int = -1
1583
+ is_done: bool = False
1584
+ ys_1: FSharpList[_T] = of_seq(ys)
1585
+
1586
+ def folder(acc: FSharpList[_T], x: _T, index: Any = index, ys: Any = ys, xs: Any = xs) -> FSharpList[_T]:
1587
+ nonlocal i, is_done
1588
+ i = (i + 1) or 0
1589
+ if i == index:
1590
+ is_done = True
1591
+ return FSharpList_Cons_305B8EAC(x, append(ys_1, acc))
1592
+
1593
+ else:
1594
+ return FSharpList_Cons_305B8EAC(x, acc)
1595
+
1596
+ result: FSharpList[_T] = fold(folder, FSharpList_get_Empty(), xs)
1597
+
1598
+ def _arrow114(__unit: None = None, index: Any = index, ys: Any = ys, xs: Any = xs) -> FSharpList[_T]:
1599
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index")
1600
+
1601
+ return reverse(result if is_done else (append(ys_1, result) if ((i + 1) == index) else _arrow114()))
1602
+
1603
+
1604
+ def remove_at(index: int, xs: FSharpList[Any]) -> FSharpList[Any]:
1605
+ i: int = -1
1606
+ is_done: bool = False
1607
+
1608
+ def f(_arg: _T | None = None, index: Any = index, xs: Any = xs) -> bool:
1609
+ nonlocal i, is_done
1610
+ i = (i + 1) or 0
1611
+ if i == index:
1612
+ is_done = True
1613
+ return False
1614
+
1615
+ else:
1616
+ return True
1617
+
1618
+ ys: FSharpList[_T] = filter(f, xs)
1619
+ if not is_done:
1620
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index")
1621
+
1622
+ return ys
1623
+
1624
+
1625
+ def remove_many_at(index: int, count: int, xs: FSharpList[Any]) -> FSharpList[Any]:
1626
+ i: int = -1
1627
+ status: int = -1
1628
+
1629
+ def f(_arg: _T | None = None, index: Any = index, count: Any = count, xs: Any = xs) -> bool:
1630
+ nonlocal i, status
1631
+ i = (i + 1) or 0
1632
+ if i == index:
1633
+ status = 0
1634
+ return False
1635
+
1636
+ elif i > index:
1637
+ if i < (index + count):
1638
+ return False
1639
+
1640
+ else:
1641
+ status = 1
1642
+ return True
1643
+
1644
+ else:
1645
+ return True
1646
+
1647
+ ys: FSharpList[_T] = filter(f, xs)
1648
+ status_1: int = (1 if (((i + 1) == (index + count)) if (status == 0) else False) else status) or 0
1649
+ if status_1 < 1:
1650
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + ("index" if (status_1 < 0) else "count"))
1651
+
1652
+ return ys
1653
+
1654
+
1655
+ def update_at(index: int, y: Any, xs: FSharpList[Any]) -> FSharpList[Any]:
1656
+ is_done: bool = False
1657
+
1658
+ def mapping(i: int, x: _T, index: Any = index, y: Any = y, xs: Any = xs) -> _T:
1659
+ nonlocal is_done
1660
+ if i == index:
1661
+ is_done = True
1662
+ return y
1663
+
1664
+ else:
1665
+ return x
1666
+
1667
+ ys: FSharpList[_T] = map_indexed(mapping, xs)
1668
+ if not is_done:
1669
+ raise Exception((SR_indexOutOfBounds + "\\nParameter name: ") + "index")
1670
+
1671
+ return ys
1672
+
1673
+
1674
+ __all__ = [
1675
+ "FSharpList_reflection",
1676
+ "ListEnumerator_1_reflection",
1677
+ "FSharpList_get_Empty",
1678
+ "FSharpList_Cons_305B8EAC",
1679
+ "FSharpList__get_IsEmpty",
1680
+ "FSharpList__get_Length",
1681
+ "FSharpList__get_Head",
1682
+ "FSharpList__get_Tail",
1683
+ "FSharpList__get_Item_Z524259A4",
1684
+ "index_not_found",
1685
+ "empty",
1686
+ "cons",
1687
+ "singleton",
1688
+ "is_empty",
1689
+ "length",
1690
+ "head",
1691
+ "try_head",
1692
+ "tail",
1693
+ "try_last",
1694
+ "last",
1695
+ "compare_with",
1696
+ "to_array",
1697
+ "fold",
1698
+ "reverse",
1699
+ "fold_back",
1700
+ "fold_indexed",
1701
+ "fold2",
1702
+ "fold_back2",
1703
+ "unfold",
1704
+ "iterate",
1705
+ "iterate2",
1706
+ "iterate_indexed",
1707
+ "iterate_indexed2",
1708
+ "to_seq",
1709
+ "of_array_with_tail",
1710
+ "of_array",
1711
+ "of_seq",
1712
+ "concat",
1713
+ "scan",
1714
+ "scan_back",
1715
+ "append",
1716
+ "collect",
1717
+ "map_indexed",
1718
+ "map",
1719
+ "indexed",
1720
+ "map2",
1721
+ "map_indexed2",
1722
+ "map3",
1723
+ "map_fold",
1724
+ "map_fold_back",
1725
+ "try_pick",
1726
+ "pick",
1727
+ "try_find",
1728
+ "find",
1729
+ "try_find_back",
1730
+ "find_back",
1731
+ "try_find_index",
1732
+ "find_index",
1733
+ "try_find_index_back",
1734
+ "find_index_back",
1735
+ "try_item",
1736
+ "item",
1737
+ "filter",
1738
+ "partition",
1739
+ "choose",
1740
+ "contains",
1741
+ "initialize",
1742
+ "replicate",
1743
+ "reduce",
1744
+ "reduce_back",
1745
+ "for_all",
1746
+ "for_all2",
1747
+ "exists",
1748
+ "exists2",
1749
+ "unzip",
1750
+ "unzip3",
1751
+ "zip",
1752
+ "zip3",
1753
+ "sort_with",
1754
+ "sort",
1755
+ "sort_by",
1756
+ "sort_descending",
1757
+ "sort_by_descending",
1758
+ "sum",
1759
+ "sum_by",
1760
+ "max_by",
1761
+ "max",
1762
+ "min_by",
1763
+ "min",
1764
+ "average",
1765
+ "average_by",
1766
+ "permute",
1767
+ "chunk_by_size",
1768
+ "all_pairs",
1769
+ "skip",
1770
+ "skip_while",
1771
+ "take",
1772
+ "take_while",
1773
+ "truncate",
1774
+ "get_slice",
1775
+ "split_at",
1776
+ "exactly_one",
1777
+ "try_exactly_one",
1778
+ "where",
1779
+ "pairwise",
1780
+ "windowed",
1781
+ "split_into",
1782
+ "transpose",
1783
+ "insert_at",
1784
+ "insert_many_at",
1785
+ "remove_at",
1786
+ "remove_many_at",
1787
+ "update_at",
1788
+ ]