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,1308 @@
1
+ from __future__ import annotations
2
+ from collections.abc import Callable
3
+ from typing import Any
4
+ from ...fable_modules.fable_library.int32 import op_unary_negation_int32
5
+ from ...fable_modules.fable_library.list import (cons, is_empty as is_empty_1, tail as tail_1, head, FSharpList, empty as empty_1, of_seq, length as length_1, exists, pick, map_indexed)
6
+ from ...fable_modules.fable_library.map_util import (add_to_dict, get_item_from_dict, remove_from_dict, try_get_value)
7
+ from ...fable_modules.fable_library.option import (value as value_3, bind)
8
+ from ...fable_modules.fable_library.range import range_big_int
9
+ from ...fable_modules.fable_library.reflection import (TypeInfo, int32_type, class_type, union_type)
10
+ from ...fable_modules.fable_library.seq import (max_by, iterate, length, item, iterate_indexed, max, is_empty, to_list, delay, collect, singleton, empty, map, try_find_index, filter)
11
+ from ...fable_modules.fable_library.string_ import (to_fail, printf, to_console)
12
+ from ...fable_modules.fable_library.types import (Array, Union, to_string)
13
+ from ...fable_modules.fable_library.util import (safe_hash, compare_primitives, get_enumerator, dispose, ignore, IEnumerable_1, IEnumerator, to_iterator, equals, compare, max as max_1)
14
+ from ...fable_modules.fable_library.types import FSharpRef
15
+ from ..Helper.collections_ import (ResizeArray_init, ResizeArray_create, ResizeArray_map, ResizeArray_iteri, List_tryPickAndRemove)
16
+ from .composite_cell import CompositeCell
17
+ from .composite_column import CompositeColumn
18
+ from .composite_header import CompositeHeader
19
+
20
+ def get_empty_cell_for_header(header: CompositeHeader, colum_cell_option: CompositeCell | None=None) -> CompositeCell:
21
+ match_value: bool = header.IsTermColumn
22
+ if match_value:
23
+ (pattern_matching_result,) = (None,)
24
+ if colum_cell_option is None:
25
+ pattern_matching_result = 0
26
+
27
+ elif colum_cell_option.tag == 0:
28
+ pattern_matching_result = 0
29
+
30
+ elif colum_cell_option.tag == 2:
31
+ pattern_matching_result = 1
32
+
33
+ else:
34
+ pattern_matching_result = 2
35
+
36
+ if pattern_matching_result == 0:
37
+ return CompositeCell.empty_term()
38
+
39
+ elif pattern_matching_result == 1:
40
+ return CompositeCell.empty_unitized()
41
+
42
+ elif pattern_matching_result == 2:
43
+ raise Exception("[extendBodyCells] This should never happen, IsTermColumn header must be paired with either term or unitized cell.")
44
+
45
+
46
+ else:
47
+ return CompositeCell.empty_free_text()
48
+
49
+
50
+
51
+ def ensure_cell_hash_in_value_map(value: CompositeCell, value_map: Any) -> int:
52
+ hash_1: int = safe_hash(value) or 0
53
+ if hash_1 in value_map:
54
+ return hash_1
55
+
56
+ else:
57
+ add_to_dict(value_map, hash_1, value)
58
+ return hash_1
59
+
60
+
61
+
62
+ def _expr1148() -> TypeInfo:
63
+ return union_type("ARCtrl.ArcTableAux.ColumnValueRefs", [], ColumnValueRefs, lambda: [[("Item", int32_type)], [("Item", class_type("System.Collections.Generic.Dictionary`2", [int32_type, int32_type]))]])
64
+
65
+
66
+ class ColumnValueRefs(Union):
67
+ def __init__(self, tag: int, *fields: Any) -> None:
68
+ super().__init__()
69
+ self.tag: int = tag or 0
70
+ self.fields: Array[Any] = list(fields)
71
+
72
+ @staticmethod
73
+ def cases() -> list[str]:
74
+ return ["Constant", "Sparse"]
75
+
76
+
77
+ ColumnValueRefs_reflection = _expr1148
78
+
79
+ def ColumnValueRefs__get_RowCount(this: ColumnValueRefs) -> Any | None:
80
+ if this.tag == 1:
81
+ def projection(kv: Any, this: Any=this) -> int:
82
+ return kv[0]
83
+
84
+ class ObjectExpr1149:
85
+ @property
86
+ def Compare(self) -> Callable[[int, int], int]:
87
+ return compare_primitives
88
+
89
+ return max_by(projection, this.fields[0], ObjectExpr1149())
90
+
91
+ else:
92
+ return None
93
+
94
+
95
+
96
+ def ColumnValueRefs__Copy(this: ColumnValueRefs) -> ColumnValueRefs:
97
+ if this.tag == 1:
98
+ d: Any = dict([])
99
+ def action(v: Any, this: Any=this) -> None:
100
+ add_to_dict(d, v[0], v[1])
101
+
102
+ iterate(action, this.fields[0])
103
+ return ColumnValueRefs(1, d)
104
+
105
+ else:
106
+ return ColumnValueRefs(0, this.fields[0])
107
+
108
+
109
+
110
+ def ColumnValueRefs__ToSparse_Z524259A4(this: ColumnValueRefs, row_count: int) -> ColumnValueRefs:
111
+ if this.tag == 1:
112
+ return ColumnValueRefs(1, this.fields[0])
113
+
114
+ else:
115
+ d: Any = dict([])
116
+ for i in range(0, (row_count - 1) + 1, 1):
117
+ add_to_dict(d, i, this.fields[0])
118
+ return ColumnValueRefs(1, d)
119
+
120
+
121
+
122
+ def ColumnValueRefs__AsSparse(this: ColumnValueRefs) -> Any:
123
+ if this.tag == 1:
124
+ return this.fields[0]
125
+
126
+ else:
127
+ raise Exception("Cannot convert a constant column to sparse. Use ToSparse first.")
128
+
129
+
130
+
131
+ def ColumnValueRefs__AsConstant(this: ColumnValueRefs) -> int:
132
+ if this.tag == 1:
133
+ raise Exception("Cannot convert a sparse column to constant. Use ToSparse first.")
134
+
135
+ else:
136
+ return this.fields[0]
137
+
138
+
139
+
140
+ def ColumnValueRefs_fromCellColumn_14896151(column: Any, previous_row_count: int, value_map: Any) -> ColumnValueRefs:
141
+ l: int = length(column) or 0
142
+ cells: Any = dict([])
143
+ if l == 0:
144
+ return ColumnValueRefs(1, cells)
145
+
146
+ else:
147
+ current: ColumnValueRefs
148
+ hash_1: int = ensure_cell_hash_in_value_map(item(0, column), value_map) or 0
149
+ if l >= previous_row_count:
150
+ current = ColumnValueRefs(0, hash_1)
151
+
152
+ else:
153
+ add_to_dict(cells, 0, hash_1)
154
+ current = ColumnValueRefs(1, cells)
155
+
156
+ def action(i: int, cell: CompositeCell, column: Any=column, previous_row_count: Any=previous_row_count, value_map: Any=value_map) -> None:
157
+ nonlocal current
158
+ hash_2: int = ensure_cell_hash_in_value_map(cell, value_map) or 0
159
+ if current.tag == 1:
160
+ cells_2: Any = current.fields[0]
161
+ cells_2[i] = hash_2
162
+
163
+ elif current.fields[0] == hash_2:
164
+ cell_hash_1: int = current.fields[0] or 0
165
+
166
+ else:
167
+ cell_hash_2: int = current.fields[0] or 0
168
+ cells_1: Any = dict([])
169
+ for j in range(0, (i - 1) + 1, 1):
170
+ cells_1[j] = cell_hash_2
171
+ cells_1[i] = hash_2
172
+ current = ColumnValueRefs(1, cells_1)
173
+
174
+
175
+ iterate_indexed(action, column)
176
+ return current
177
+
178
+
179
+
180
+ def ColumnValueRefs__ToCellColumn_Z2609C9DD(this: ColumnValueRefs, value_map: Any, row_count: int, header: CompositeHeader) -> Array[CompositeCell]:
181
+ if this.tag == 1:
182
+ values: Any = this.fields[0]
183
+ class ObjectExpr1150:
184
+ @property
185
+ def Compare(self) -> Callable[[int, int], int]:
186
+ return compare_primitives
187
+
188
+ default_cell: CompositeCell = get_empty_cell_for_header(header, None) if (len(values) == 0) else get_empty_cell_for_header(header, get_item_from_dict(value_map, get_item_from_dict(values, max(values.keys(), ObjectExpr1150()) - 1)))
189
+ def _arrow1151(i_1: int, this: Any=this, value_map: Any=value_map, row_count: Any=row_count, header: Any=header) -> CompositeCell:
190
+ return get_item_from_dict(value_map, get_item_from_dict(values, i_1)) if (i_1 in values) else default_cell
191
+
192
+ return ResizeArray_init(row_count, _arrow1151)
193
+
194
+ else:
195
+ return ResizeArray_create(row_count, get_item_from_dict(value_map, this.fields[0]))
196
+
197
+
198
+
199
+ def _expr1165() -> TypeInfo:
200
+ return class_type("ARCtrl.ArcTableAux.ArcTableValues", None, ArcTableValues)
201
+
202
+
203
+ class ArcTableValues:
204
+ def __init__(self, cols: Any, value_map: Any, row_count: int) -> None:
205
+ self._columns: Any = cols
206
+ self._valueMap: Any = value_map
207
+ self._rowCount: int = row_count or 0
208
+
209
+ @property
210
+ def Columns(self, __unit: None=None) -> Any:
211
+ this: ArcTableValues = self
212
+ return this._columns
213
+
214
+ @Columns.setter
215
+ def Columns(self, columns: Any) -> None:
216
+ this: ArcTableValues = self
217
+ this._columns = columns
218
+
219
+ @property
220
+ def ColumnCount(self, __unit: None=None) -> int:
221
+ this: ArcTableValues = self
222
+ class ObjectExpr1152:
223
+ @property
224
+ def Compare(self) -> Callable[[int, int], int]:
225
+ return compare_primitives
226
+
227
+ return 0 if is_empty(this._columns) else (1 + max(this._columns.keys(), ObjectExpr1152()))
228
+
229
+ @property
230
+ def ValueMap(self, __unit: None=None) -> Any:
231
+ this: ArcTableValues = self
232
+ return this._valueMap
233
+
234
+ @ValueMap.setter
235
+ def ValueMap(self, value_map: Any) -> None:
236
+ this: ArcTableValues = self
237
+ this._valueMap = value_map
238
+
239
+ @property
240
+ def RowCount(self, __unit: None=None) -> int:
241
+ this: ArcTableValues = self
242
+ return this._rowCount
243
+
244
+ @RowCount.setter
245
+ def RowCount(self, row_count: int) -> None:
246
+ this: ArcTableValues = self
247
+ if (row_count < this._rowCount) if (row_count > 0) else False:
248
+ enumerator: Any = get_enumerator(this._columns)
249
+ try:
250
+ while enumerator.System_Collections_IEnumerator_MoveNext():
251
+ match_value: ColumnValueRefs = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()[1]
252
+ if match_value.tag == 1:
253
+ values: Any = match_value.fields[0]
254
+ with get_enumerator(to_list(values.keys())) as enumerator_1:
255
+ while enumerator_1.System_Collections_IEnumerator_MoveNext():
256
+ key: int = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current() or 0
257
+ if key >= row_count:
258
+ ignore(remove_from_dict(values, key))
259
+
260
+
261
+
262
+ finally:
263
+ dispose(enumerator)
264
+
265
+
266
+ this._rowCount = row_count or 0
267
+
268
+ @staticmethod
269
+ def from_cell_columns(columns: Array[Array[CompositeCell]]) -> ArcTableValues:
270
+ class ObjectExpr1153:
271
+ @property
272
+ def Compare(self) -> Callable[[int, int], int]:
273
+ return compare_primitives
274
+
275
+ row_count: int = (0 if (len(columns) == 0) else max(ResizeArray_map(len, columns), ObjectExpr1153())) or 0
276
+ value_map: Any = dict([])
277
+ parsed_columns: Any = dict([])
278
+ def action(i: int, column: Array[CompositeCell]) -> None:
279
+ add_to_dict(parsed_columns, i, ColumnValueRefs_fromCellColumn_14896151(column, row_count, value_map))
280
+
281
+ iterate_indexed(action, columns)
282
+ return ArcTableValues(parsed_columns, value_map, row_count)
283
+
284
+ @staticmethod
285
+ def from_ref_columns(columns: Any, value_map: Any, row_count: int) -> ArcTableValues:
286
+ parsed_columns: Any = dict([])
287
+ def action(i: int, column: ColumnValueRefs) -> None:
288
+ add_to_dict(parsed_columns, i, column)
289
+
290
+ iterate_indexed(action, columns)
291
+ return ArcTableValues(parsed_columns, value_map, row_count)
292
+
293
+ @staticmethod
294
+ def init(__unit: None=None) -> ArcTableValues:
295
+ value_map: Any = dict([])
296
+ return ArcTableValues(dict([]), value_map, 0)
297
+
298
+ def ToCellColumns(self, headers: Array[CompositeHeader]) -> Array[Array[CompositeCell]]:
299
+ this: ArcTableValues = self
300
+ def _arrow1154(i: int) -> Array[CompositeCell]:
301
+ header: CompositeHeader = headers[i]
302
+ return ColumnValueRefs__ToCellColumn_Z2609C9DD(get_item_from_dict(this._columns, i), this._valueMap, this._rowCount, header)
303
+
304
+ return ResizeArray_init(len(headers), _arrow1154)
305
+
306
+ def RescanValueMap(self, __unit: None=None) -> None:
307
+ this: ArcTableValues = self
308
+ new_value_map: Any = dict([])
309
+ enumerator: Any = get_enumerator(this._columns)
310
+ try:
311
+ while enumerator.System_Collections_IEnumerator_MoveNext():
312
+ kv: Any = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
313
+ match_value: ColumnValueRefs = kv[1]
314
+ if match_value.tag == 1:
315
+ values: Any = match_value.fields[0]
316
+ enumerator_1: Any = get_enumerator(values)
317
+ try:
318
+ while enumerator_1.System_Collections_IEnumerator_MoveNext():
319
+ ckv: Any = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
320
+ hash_2: int = ensure_cell_hash_in_value_map(get_item_from_dict(this._valueMap, ckv[1]), new_value_map) or 0
321
+ values[ckv[0]] = hash_2
322
+
323
+ finally:
324
+ dispose(enumerator_1)
325
+
326
+
327
+ else:
328
+ hash_1: int = ensure_cell_hash_in_value_map(get_item_from_dict(this._valueMap, match_value.fields[0]), new_value_map) or 0
329
+ this._columns[kv[0]] = ColumnValueRefs(0, hash_1)
330
+
331
+
332
+ finally:
333
+ dispose(enumerator)
334
+
335
+ this._valueMap = new_value_map
336
+
337
+ def Copy(self, __unit: None=None) -> ArcTableValues:
338
+ this: ArcTableValues = self
339
+ next_value_map: Any = dict([])
340
+ def action(kv: Any) -> None:
341
+ add_to_dict(next_value_map, kv[0], kv[1].Copy())
342
+
343
+ iterate(action, this._valueMap)
344
+ next_columns: Any = dict([])
345
+ def action_1(kv_1: Any) -> None:
346
+ add_to_dict(next_columns, kv_1[0], ColumnValueRefs__Copy(kv_1[1]))
347
+
348
+ iterate(action_1, this._columns)
349
+ return ArcTableValues(next_columns, next_value_map, this._rowCount)
350
+
351
+ def __hash__(self, __unit: None=None) -> int:
352
+ this: ArcTableValues = self
353
+ hash_1: int = 0
354
+ for i in range(0, (this.ColumnCount - 1) + 1, 1):
355
+ match_value: ColumnValueRefs | None
356
+ pattern_input: tuple[bool, ColumnValueRefs]
357
+ out_arg: ColumnValueRefs = None
358
+ def _arrow1155(__unit: None=None) -> ColumnValueRefs:
359
+ return out_arg
360
+
361
+ def _arrow1156(v: ColumnValueRefs) -> None:
362
+ nonlocal out_arg
363
+ out_arg = v
364
+
365
+ pattern_input = (try_get_value(this._columns, i, FSharpRef(_arrow1155, _arrow1156)), out_arg)
366
+ match_value = pattern_input[1] if pattern_input[0] else None
367
+ if match_value is not None:
368
+ if match_value.tag == 1:
369
+ values: Any = match_value.fields[0]
370
+ enumerator: Any = get_enumerator(values)
371
+ try:
372
+ while enumerator.System_Collections_IEnumerator_MoveNext():
373
+ kv: Any = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
374
+ hash_1 = (((-1640531527 + kv[0]) + (hash_1 << 6)) + (hash_1 >> 2)) or 0
375
+ hash_1 = (((-1640531527 + kv[1]) + (hash_1 << 6)) + (hash_1 >> 2)) or 0
376
+
377
+ finally:
378
+ dispose(enumerator)
379
+
380
+
381
+ else:
382
+ value_hash: int = match_value.fields[0] or 0
383
+ for i_1 in range(0, (this._rowCount - 1) + 1, 1):
384
+ hash_1 = (((-1640531527 + i_1) + (hash_1 << 6)) + (hash_1 >> 2)) or 0
385
+ hash_1 = (((-1640531527 + value_hash) + (hash_1 << 6)) + (hash_1 >> 2)) or 0
386
+
387
+
388
+ return hash_1
389
+
390
+ def __eq__(self, other: Any=None) -> bool:
391
+ this: ArcTableValues = self
392
+ return (safe_hash(this) == safe_hash(other)) if isinstance(other, ArcTableValues) else False
393
+
394
+ def Item(self, cr_indices: tuple[int, int]) -> CompositeCell:
395
+ this: ArcTableValues = self
396
+ row: int = cr_indices[1] or 0
397
+ col: int = cr_indices[0] or 0
398
+ if row > (this.RowCount - 1):
399
+ arg_1: int = this.RowCount or 0
400
+ to_fail(printf("Row index %d is out of bounds for ArcTableValues with row count %d."))(row)(arg_1)
401
+
402
+ if col > (this.ColumnCount - 1):
403
+ arg_3: int = this.ColumnCount or 0
404
+ to_fail(printf("Column index %d is out of bounds for ArcTableValues with column count %d."))(col)(arg_3)
405
+
406
+ match_value: ColumnValueRefs | None
407
+ pattern_input: tuple[bool, ColumnValueRefs]
408
+ out_arg: ColumnValueRefs = None
409
+ def _arrow1157(__unit: None=None) -> ColumnValueRefs:
410
+ return out_arg
411
+
412
+ def _arrow1158(v: ColumnValueRefs) -> None:
413
+ nonlocal out_arg
414
+ out_arg = v
415
+
416
+ pattern_input = (try_get_value(this._columns, col, FSharpRef(_arrow1157, _arrow1158)), out_arg)
417
+ match_value = pattern_input[1] if pattern_input[0] else None
418
+ if match_value is not None:
419
+ col_value_refs: ColumnValueRefs = match_value
420
+ if col_value_refs.tag == 1:
421
+ values: Any = col_value_refs.fields[0]
422
+ return get_item_from_dict(this._valueMap, get_item_from_dict(values, row)) if (row in values) else to_fail(printf("Row value for index %d does not exist in column %d of ArcTableValues."))(row)(col)
423
+
424
+ else:
425
+ return get_item_from_dict(this._valueMap, col_value_refs.fields[0])
426
+
427
+
428
+ else:
429
+ return to_fail(printf("Column %d does not exist in ArcTableValues."))(col)
430
+
431
+
432
+ def GetEnumerator(self, __unit: None=None) -> IEnumerator[Any]:
433
+ this: ArcTableValues = self
434
+ def _arrow1164(__unit: None=None) -> IEnumerable_1[Any]:
435
+ def _arrow1163(col_i: int) -> IEnumerable_1[Any]:
436
+ match_value: ColumnValueRefs | None
437
+ pattern_input: tuple[bool, ColumnValueRefs]
438
+ out_arg: ColumnValueRefs = None
439
+ def _arrow1159(__unit: None=None) -> ColumnValueRefs:
440
+ return out_arg
441
+
442
+ def _arrow1160(v: ColumnValueRefs) -> None:
443
+ nonlocal out_arg
444
+ out_arg = v
445
+
446
+ pattern_input = (try_get_value(this._columns, col_i, FSharpRef(_arrow1159, _arrow1160)), out_arg)
447
+ match_value = pattern_input[1] if pattern_input[0] else None
448
+ if match_value is not None:
449
+ match_value_1: ColumnValueRefs = match_value
450
+ if match_value_1.tag == 1:
451
+ values: Any = match_value_1.fields[0]
452
+ def _arrow1161(row_i_1: int) -> IEnumerable_1[Any]:
453
+ return singleton(((col_i, row_i_1), get_item_from_dict(this._valueMap, get_item_from_dict(values, row_i_1)))) if (row_i_1 in values) else empty()
454
+
455
+ return collect(_arrow1161, range_big_int(0, 1, this._rowCount - 1))
456
+
457
+ else:
458
+ def _arrow1162(row_i: int) -> tuple[tuple[int, int], CompositeCell]:
459
+ return ((col_i, row_i), get_item_from_dict(this._valueMap, match_value_1.fields[0]))
460
+
461
+ return map(_arrow1162, range_big_int(0, 1, this._rowCount - 1))
462
+
463
+
464
+ else:
465
+ return empty()
466
+
467
+
468
+ return collect(_arrow1163, range_big_int(0, 1, this.ColumnCount - 1))
469
+
470
+ return get_enumerator(delay(_arrow1164))
471
+
472
+ def __iter__(self) -> IEnumerator[Any]:
473
+ return to_iterator(self.GetEnumerator())
474
+
475
+ def System_Collections_IEnumerable_GetEnumerator(self, __unit: None=None) -> IEnumerator[Any]:
476
+ this: ArcTableValues = self
477
+ return get_enumerator(this)
478
+
479
+
480
+ ArcTableValues_reflection = _expr1165
481
+
482
+ def ArcTableValues__ctor_39436F7C(cols: Any, value_map: Any, row_count: int) -> ArcTableValues:
483
+ return ArcTableValues(cols, value_map, row_count)
484
+
485
+
486
+ def _007CIsUniqueExistingHeader_007C__007C(existing_headers: IEnumerable_1[CompositeHeader], input: CompositeHeader) -> int | None:
487
+ if ((((input.tag == 3) or (input.tag == 2)) or (input.tag == 1)) or (input.tag == 0)) or (input.tag == 13):
488
+ return None
489
+
490
+ elif input.tag == 12:
491
+ def _arrow1166(h: CompositeHeader, existing_headers: Any=existing_headers, input: Any=input) -> bool:
492
+ return True if (h.tag == 12) else False
493
+
494
+ return try_find_index(_arrow1166, existing_headers)
495
+
496
+ elif input.tag == 11:
497
+ def _arrow1167(h_1: CompositeHeader, existing_headers: Any=existing_headers, input: Any=input) -> bool:
498
+ return True if (h_1.tag == 11) else False
499
+
500
+ return try_find_index(_arrow1167, existing_headers)
501
+
502
+ else:
503
+ def _arrow1168(h_2: CompositeHeader, existing_headers: Any=existing_headers, input: Any=input) -> bool:
504
+ return equals(h_2, input)
505
+
506
+ return try_find_index(_arrow1168, existing_headers)
507
+
508
+
509
+
510
+ def try_find_duplicate_unique(new_header: CompositeHeader, existing_headers: IEnumerable_1[CompositeHeader]) -> int | None:
511
+ active_pattern_result: int | None = _007CIsUniqueExistingHeader_007C__007C(existing_headers, new_header)
512
+ if active_pattern_result is not None:
513
+ index: int = active_pattern_result or 0
514
+ return index
515
+
516
+ else:
517
+ return None
518
+
519
+
520
+
521
+ def try_find_duplicate_unique_in_array(existing_headers: IEnumerable_1[CompositeHeader]) -> FSharpList[dict[str, Any]]:
522
+ def loop(i_mut: int, duplicate_list_mut: FSharpList[dict[str, Any]], header_list_mut: FSharpList[CompositeHeader], existing_headers: Any=existing_headers) -> FSharpList[dict[str, Any]]:
523
+ while True:
524
+ (i, duplicate_list, header_list) = (i_mut, duplicate_list_mut, header_list_mut)
525
+ (pattern_matching_result, header, tail) = (None, None, None)
526
+ if is_empty_1(header_list):
527
+ pattern_matching_result = 0
528
+
529
+ elif is_empty_1(tail_1(header_list)):
530
+ pattern_matching_result = 0
531
+
532
+ else:
533
+ pattern_matching_result = 1
534
+ header = head(header_list)
535
+ tail = tail_1(header_list)
536
+
537
+ if pattern_matching_result == 0:
538
+ return duplicate_list
539
+
540
+ elif pattern_matching_result == 1:
541
+ has_duplicate: int | None = try_find_duplicate_unique(header, tail)
542
+ i_mut = i + 1
543
+ duplicate_list_mut = cons({
544
+ "HeaderType": header,
545
+ "Index1": i,
546
+ "Index2": value_3(has_duplicate)
547
+ }, duplicate_list) if (has_duplicate is not None) else duplicate_list
548
+ header_list_mut = tail
549
+ continue
550
+
551
+ break
552
+
553
+ def predicate(x: CompositeHeader, existing_headers: Any=existing_headers) -> bool:
554
+ return not x.IsTermColumn
555
+
556
+ return loop(0, empty_1(), of_seq(filter(predicate, existing_headers)))
557
+
558
+
559
+ def SanityChecks_validateColumnIndex(index: int, column_count: int, allow_append: bool) -> None:
560
+ if index < 0:
561
+ raise Exception("Cannot insert CompositeColumn at index < 0.")
562
+
563
+ def _arrow1169(__unit: None=None, index: Any=index, column_count: Any=column_count, allow_append: Any=allow_append) -> bool:
564
+ x: int = index or 0
565
+ y: int = column_count or 0
566
+ return (compare(x, y) > 0) if allow_append else (compare(x, y) >= 0)
567
+
568
+ if _arrow1169():
569
+ raise Exception(("Specified index is out of table range! Table contains only " + str(column_count)) + " columns.")
570
+
571
+
572
+
573
+ def SanityChecks_validateRowIndex(index: int, row_count: int, allow_append: bool) -> None:
574
+ if index < 0:
575
+ raise Exception("Cannot insert CompositeColumn at index < 0.")
576
+
577
+ def _arrow1170(__unit: None=None, index: Any=index, row_count: Any=row_count, allow_append: Any=allow_append) -> bool:
578
+ x: int = index or 0
579
+ y: int = row_count or 0
580
+ return (compare(x, y) > 0) if allow_append else (compare(x, y) >= 0)
581
+
582
+ if _arrow1170():
583
+ raise Exception(("Specified index is out of table range! Table contains only " + str(row_count)) + " rows.")
584
+
585
+
586
+
587
+ def SanityChecks_validateColumn(column: CompositeColumn) -> None:
588
+ ignore(column.Validate(True))
589
+
590
+
591
+ def SanityChecks_validateCellColumns(headers: Array[CompositeHeader], columns: Array[Array[CompositeCell]], raise_exception: bool) -> bool:
592
+ is_valid: bool = True
593
+ en: Any = get_enumerator(headers)
594
+ col_index: int = 0
595
+ if (len(columns) != 0) if (len(headers) != len(columns)) else False:
596
+ def _arrow1171(message: str, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> None:
597
+ raise Exception(message)
598
+
599
+ def _arrow1173(__unit: None=None, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> Callable[[str], None]:
600
+ clo: Callable[[str], None] = to_console(printf("%s"))
601
+ def _arrow1172(arg: str) -> None:
602
+ clo(arg)
603
+
604
+ return _arrow1172
605
+
606
+ (_arrow1171 if raise_exception else _arrow1173())(((("Invalid table. Number of headers (" + str(len(headers))) + ") does not match number of columns (") + str(len(columns))) + ").")
607
+ is_valid = False
608
+
609
+ while (len(columns) != 0) if (en.System_Collections_IEnumerator_MoveNext() if is_valid else False) else False:
610
+ header: CompositeHeader = en.System_Collections_Generic_IEnumerator_1_get_Current()
611
+ col_en: Any = get_enumerator(columns[col_index])
612
+ col_index = (col_index + 1) or 0
613
+ while col_en.System_Collections_IEnumerator_MoveNext() if is_valid else False:
614
+ cell: CompositeCell = col_en.System_Collections_Generic_IEnumerator_1_get_Current()
615
+ header_is_data: bool = header.IsDataColumn
616
+ header_is_freetext: bool = (not header.IsDataColumn) if (not header.IsTermColumn) else False
617
+ cell_is_not_freetext: bool = not cell.is_free_text
618
+ if (cell_is_not_freetext if (not cell.is_data) else False) if header_is_data else False:
619
+ def _arrow1174(message_1: str, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> None:
620
+ raise Exception(message_1)
621
+
622
+ def _arrow1176(__unit: None=None, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> Callable[[str], None]:
623
+ clo_1: Callable[[str], None] = to_console(printf("%s"))
624
+ def _arrow1175(arg_1: str) -> None:
625
+ clo_1(arg_1)
626
+
627
+ return _arrow1175
628
+
629
+ (_arrow1174 if raise_exception else _arrow1176())(((("Invalid combination of header `" + str(header)) + "` and cell `") + str(cell)) + "`. Data header should contain either Data or Freetext cells.")
630
+ is_valid = False
631
+
632
+ if cell_is_not_freetext if header_is_freetext else False:
633
+ def _arrow1177(message_2: str, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> None:
634
+ raise Exception(message_2)
635
+
636
+ def _arrow1179(__unit: None=None, headers: Any=headers, columns: Any=columns, raise_exception: Any=raise_exception) -> Callable[[str], None]:
637
+ clo_2: Callable[[str], None] = to_console(printf("%s"))
638
+ def _arrow1178(arg_2: str) -> None:
639
+ clo_2(arg_2)
640
+
641
+ return _arrow1178
642
+
643
+ (_arrow1177 if raise_exception else _arrow1179())(((("Invalid combination of header `" + str(header)) + "` and cell `") + str(cell)) + "`. Freetext header should not contain non-freetext cells.")
644
+ is_valid = False
645
+
646
+ return is_valid
647
+
648
+
649
+ def SanityChecks_validateArcTableValues(headers: Array[CompositeHeader], values: ArcTableValues, raise_exception: bool) -> bool:
650
+ is_valid: bool = True
651
+ col_index: int = 0
652
+ if (values.ColumnCount != 0) if (len(headers) != values.ColumnCount) else False:
653
+ def _arrow1180(message: str, headers: Any=headers, values: Any=values, raise_exception: Any=raise_exception) -> None:
654
+ raise Exception(message)
655
+
656
+ def _arrow1182(__unit: None=None, headers: Any=headers, values: Any=values, raise_exception: Any=raise_exception) -> Callable[[str], None]:
657
+ clo: Callable[[str], None] = to_console(printf("%s"))
658
+ def _arrow1181(arg: str) -> None:
659
+ clo(arg)
660
+
661
+ return _arrow1181
662
+
663
+ (_arrow1180 if raise_exception else _arrow1182())(((("Invalid table. Number of headers (" + str(len(headers))) + ") does not match number of columns (") + str(values.ColumnCount)) + ").")
664
+ is_valid = False
665
+
666
+ if (values.ColumnCount != 0) if (values.RowCount != 0) else False:
667
+ while (col_index < values.ColumnCount) if is_valid else False:
668
+ header: CompositeHeader = headers[col_index]
669
+ match_value: ColumnValueRefs | None
670
+ key: int = col_index or 0
671
+ pattern_input: tuple[bool, ColumnValueRefs]
672
+ out_arg: ColumnValueRefs = None
673
+ def _arrow1183(__unit: None=None, headers: Any=headers, values: Any=values, raise_exception: Any=raise_exception) -> ColumnValueRefs:
674
+ return out_arg
675
+
676
+ def _arrow1184(v: ColumnValueRefs, headers: Any=headers, values: Any=values, raise_exception: Any=raise_exception) -> None:
677
+ nonlocal out_arg
678
+ out_arg = v
679
+
680
+ pattern_input = (try_get_value(values.Columns, key, FSharpRef(_arrow1183, _arrow1184)), out_arg)
681
+ match_value = pattern_input[1] if pattern_input[0] else None
682
+ if match_value is not None:
683
+ if match_value.tag == 1:
684
+ column: Any = match_value.fields[0]
685
+ enumerator: Any = get_enumerator(column)
686
+ try:
687
+ while enumerator.System_Collections_IEnumerator_MoveNext():
688
+ kv: Any = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
689
+ cell_1: CompositeCell = get_item_from_dict(values.ValueMap, kv[1])
690
+ if not cell_1.ValidateAgainstHeader(header, raise_exception):
691
+ is_valid = False
692
+
693
+
694
+ finally:
695
+ dispose(enumerator)
696
+
697
+
698
+ else:
699
+ hash_1: int = match_value.fields[0] or 0
700
+ cell: CompositeCell = get_item_from_dict(values.ValueMap, hash_1)
701
+ if not cell.ValidateAgainstHeader(header, raise_exception):
702
+ is_valid = False
703
+
704
+
705
+
706
+ col_index = (col_index + 1) or 0
707
+
708
+ return is_valid
709
+
710
+
711
+ def Unchecked_tryGetCellAt(column: int, row: int, values: ArcTableValues) -> CompositeCell | None:
712
+ def binder(col: ColumnValueRefs, column: Any=column, row: Any=row, values: Any=values) -> CompositeCell | None:
713
+ if col.tag == 1:
714
+ vals: Any = col.fields[0]
715
+ if row in vals:
716
+ return get_item_from_dict(values.ValueMap, get_item_from_dict(vals, row))
717
+
718
+ else:
719
+ return None
720
+
721
+
722
+ else:
723
+ return get_item_from_dict(values.ValueMap, col.fields[0])
724
+
725
+
726
+ def _arrow1187(__unit: None=None, column: Any=column, row: Any=row, values: Any=values) -> ColumnValueRefs | None:
727
+ pattern_input: tuple[bool, ColumnValueRefs]
728
+ out_arg: ColumnValueRefs = None
729
+ def _arrow1185(__unit: None=None) -> ColumnValueRefs:
730
+ return out_arg
731
+
732
+ def _arrow1186(v: ColumnValueRefs) -> None:
733
+ nonlocal out_arg
734
+ out_arg = v
735
+
736
+ pattern_input = (try_get_value(values.Columns, column, FSharpRef(_arrow1185, _arrow1186)), out_arg)
737
+ return pattern_input[1] if pattern_input[0] else None
738
+
739
+ return bind(binder, _arrow1187())
740
+
741
+
742
+ def Unchecked_getCellWithDefault(column: int, row: int, headers: Array[CompositeHeader], values: ArcTableValues) -> CompositeCell:
743
+ if len(headers) <= column:
744
+ arg_1: int = len(headers) or 0
745
+ to_fail(printf("Column index %d is out of bounds for ArcTableValues with column count %d."))(column)(arg_1)
746
+
747
+ match_value: ColumnValueRefs | None
748
+ pattern_input: tuple[bool, ColumnValueRefs]
749
+ out_arg: ColumnValueRefs = None
750
+ def _arrow1188(__unit: None=None, column: Any=column, row: Any=row, headers: Any=headers, values: Any=values) -> ColumnValueRefs:
751
+ return out_arg
752
+
753
+ def _arrow1189(v: ColumnValueRefs, column: Any=column, row: Any=row, headers: Any=headers, values: Any=values) -> None:
754
+ nonlocal out_arg
755
+ out_arg = v
756
+
757
+ pattern_input = (try_get_value(values.Columns, column, FSharpRef(_arrow1188, _arrow1189)), out_arg)
758
+ match_value = pattern_input[1] if pattern_input[0] else None
759
+ if match_value is None:
760
+ if row < values.RowCount:
761
+ return CompositeCell.empty_free_text()
762
+
763
+ else:
764
+ return get_empty_cell_for_header(headers[column], None)
765
+
766
+
767
+ else:
768
+ col: ColumnValueRefs = match_value
769
+ if col.tag == 1:
770
+ vals: Any = col.fields[0]
771
+ if row in vals:
772
+ return get_item_from_dict(values.ValueMap, get_item_from_dict(vals, row))
773
+
774
+ elif len(vals) == 0:
775
+ return get_empty_cell_for_header(headers[column], None)
776
+
777
+ else:
778
+ header_1: CompositeHeader = headers[column]
779
+ class ObjectExpr1190:
780
+ @property
781
+ def Compare(self) -> Callable[[int, int], int]:
782
+ return compare_primitives
783
+
784
+ max_i: int = max(vals.keys(), ObjectExpr1190()) or 0
785
+ return get_empty_cell_for_header(header_1, get_item_from_dict(values.ValueMap, get_item_from_dict(vals, max_i)))
786
+
787
+
788
+ else:
789
+ return get_item_from_dict(values.ValueMap, col.fields[0])
790
+
791
+
792
+
793
+
794
+ def Unchecked_setCellAt(column_index: int, row_index: int, c: CompositeCell, values: ArcTableValues) -> None:
795
+ if (row_index + 1) > values.RowCount:
796
+ values.RowCount = (row_index + 1) or 0
797
+
798
+ match_value: ColumnValueRefs | None
799
+ pattern_input: tuple[bool, ColumnValueRefs]
800
+ out_arg: ColumnValueRefs = None
801
+ def _arrow1191(__unit: None=None, column_index: Any=column_index, row_index: Any=row_index, c: Any=c, values: Any=values) -> ColumnValueRefs:
802
+ return out_arg
803
+
804
+ def _arrow1192(v: ColumnValueRefs, column_index: Any=column_index, row_index: Any=row_index, c: Any=c, values: Any=values) -> None:
805
+ nonlocal out_arg
806
+ out_arg = v
807
+
808
+ pattern_input = (try_get_value(values.Columns, column_index, FSharpRef(_arrow1191, _arrow1192)), out_arg)
809
+ match_value = pattern_input[1] if pattern_input[0] else None
810
+ if match_value is not None:
811
+ col: ColumnValueRefs = match_value
812
+ if col.tag == 1:
813
+ key_1: int = row_index or 0
814
+ value: int = ensure_cell_hash_in_value_map(c, values.ValueMap) or 0
815
+ dict_1_1: Any = col.fields[0]
816
+ if key_1 in dict_1_1:
817
+ dict_1_1[key_1] = value
818
+
819
+ else:
820
+ add_to_dict(dict_1_1, key_1, value)
821
+
822
+
823
+ else:
824
+ value_hash: int = col.fields[0] or 0
825
+ hash_3: int = ensure_cell_hash_in_value_map(c, values.ValueMap) or 0
826
+ if hash_3 == value_hash:
827
+ pass
828
+
829
+ else:
830
+ d: Any = dict([])
831
+ for i in range(0, (values.RowCount - 1) + 1, 1):
832
+ if i == row_index:
833
+ add_to_dict(d, i, hash_3)
834
+
835
+ else:
836
+ add_to_dict(d, i, value_hash)
837
+
838
+ values.Columns[column_index] = ColumnValueRefs(1, d)
839
+
840
+
841
+
842
+ elif (row_index == 0) if (values.RowCount <= 1) else False:
843
+ hash_1: int = ensure_cell_hash_in_value_map(c, values.ValueMap) or 0
844
+ add_to_dict(values.Columns, column_index, ColumnValueRefs(0, hash_1))
845
+
846
+ else:
847
+ new_column: Any = dict([])
848
+ add_to_dict(new_column, row_index, ensure_cell_hash_in_value_map(c, values.ValueMap))
849
+ add_to_dict(values.Columns, column_index, ColumnValueRefs(1, new_column))
850
+
851
+
852
+
853
+ def Unchecked_removeCellAt(column_index: int, row_index: int, values: ArcTableValues) -> None:
854
+ match_value: ColumnValueRefs | None
855
+ pattern_input: tuple[bool, ColumnValueRefs]
856
+ out_arg: ColumnValueRefs = None
857
+ def _arrow1193(__unit: None=None, column_index: Any=column_index, row_index: Any=row_index, values: Any=values) -> ColumnValueRefs:
858
+ return out_arg
859
+
860
+ def _arrow1194(v: ColumnValueRefs, column_index: Any=column_index, row_index: Any=row_index, values: Any=values) -> None:
861
+ nonlocal out_arg
862
+ out_arg = v
863
+
864
+ pattern_input = (try_get_value(values.Columns, column_index, FSharpRef(_arrow1193, _arrow1194)), out_arg)
865
+ match_value = pattern_input[1] if pattern_input[0] else None
866
+ if match_value is not None:
867
+ col: ColumnValueRefs = match_value
868
+ if col.tag == 1:
869
+ vals: Any = col.fields[0]
870
+ if row_index in vals:
871
+ ignore(remove_from_dict(vals, row_index))
872
+ if len(vals) == 0:
873
+ ignore(remove_from_dict(values.Columns, column_index))
874
+
875
+
876
+
877
+ elif (values.RowCount == 1) if (row_index == 0) else False:
878
+ ignore(remove_from_dict(values.Columns, column_index))
879
+
880
+
881
+
882
+
883
+ def Unchecked_moveCellTo(from_col: int, from_row: int, to_col: int, to_row: int, values: ArcTableValues) -> None:
884
+ match_value: CompositeCell | None = Unchecked_tryGetCellAt(from_col, from_row, values)
885
+ if match_value is None:
886
+ pass
887
+
888
+ else:
889
+ cell: CompositeCell = match_value
890
+ Unchecked_removeCellAt(from_col, from_row, values)
891
+ Unchecked_setCellAt(to_col, to_row, cell, values)
892
+
893
+
894
+
895
+ def Unchecked_removeHeader(index: int, headers: Array[CompositeHeader]) -> None:
896
+ headers.pop(index)
897
+
898
+
899
+ def Unchecked_removeColumnCells(col_index: int, values: ArcTableValues) -> None:
900
+ ignore(remove_from_dict(values.Columns, col_index))
901
+
902
+
903
+ def Unchecked_removeColumnCells_withIndexChange(col_index: int, column_count: int, values: ArcTableValues) -> None:
904
+ if col_index < (column_count - 1):
905
+ cols: Any = dict([])
906
+ def action(kv: Any, col_index: Any=col_index, column_count: Any=column_count, values: Any=values) -> None:
907
+ c_i: int = kv[0] or 0
908
+ if c_i > col_index:
909
+ add_to_dict(cols, c_i - 1, kv[1])
910
+
911
+ elif c_i < col_index:
912
+ add_to_dict(cols, c_i, kv[1])
913
+
914
+
915
+ iterate(action, values.Columns)
916
+ values.Columns = cols
917
+
918
+ else:
919
+ value: None = Unchecked_removeColumnCells(col_index, values)
920
+ ignore(None)
921
+
922
+
923
+
924
+ def Unchecked_removeRowCells(row_index: int, column_count: int, values: ArcTableValues) -> None:
925
+ for c in range(0, (column_count - 1) + 1, 1):
926
+ Unchecked_removeCellAt(c, row_index, values)
927
+
928
+
929
+ def Unchecked_removeRowCells_withIndexChange(row_index: int, values: ArcTableValues) -> None:
930
+ if (values.RowCount == 1) if (row_index == 0) else False:
931
+ values.RowCount = 0
932
+ values.Columns = dict([])
933
+
934
+ else:
935
+ def action_1(kv: Any, row_index: Any=row_index, values: Any=values) -> None:
936
+ match_value: ColumnValueRefs = kv[1]
937
+ if match_value.tag == 1:
938
+ vals: Any = match_value.fields[0]
939
+ if row_index < (values.RowCount - 1):
940
+ col: Any = dict([])
941
+ def action(kv_1: Any, kv: Any=kv) -> None:
942
+ r_i: int = kv_1[0] or 0
943
+ if r_i > row_index:
944
+ add_to_dict(col, r_i - 1, kv_1[1])
945
+
946
+ elif r_i < row_index:
947
+ add_to_dict(col, r_i, kv_1[1])
948
+
949
+
950
+ iterate(action, vals)
951
+ values.Columns[kv[0]] = ColumnValueRefs(1, col)
952
+
953
+ else:
954
+ ignore(remove_from_dict(vals, row_index))
955
+
956
+
957
+
958
+ iterate(action_1, values.Columns)
959
+ values.RowCount = (values.RowCount - 1) or 0
960
+
961
+
962
+
963
+ def Unchecked_removeRowRange_withIndexChange(row_start_index: int, row_end_index: int, values: ArcTableValues) -> None:
964
+ if (values.RowCount == row_end_index) if (row_start_index == 0) else False:
965
+ values.RowCount = 0
966
+ values.Columns = dict([])
967
+
968
+ else:
969
+ def action_1(kv: Any, row_start_index: Any=row_start_index, row_end_index: Any=row_end_index, values: Any=values) -> None:
970
+ match_value: ColumnValueRefs = kv[1]
971
+ if match_value.tag == 1:
972
+ vals: Any = match_value.fields[0]
973
+ range: int = ((row_end_index - row_start_index) + 1) or 0
974
+ if row_end_index < (values.RowCount - 1):
975
+ col: Any = dict([])
976
+ def action(kv_1: Any, kv: Any=kv) -> None:
977
+ r_i: int = kv_1[0] or 0
978
+ if r_i > row_end_index:
979
+ add_to_dict(col, r_i - range, kv_1[1])
980
+
981
+ elif r_i < row_start_index:
982
+ add_to_dict(col, r_i, kv_1[1])
983
+
984
+
985
+ iterate(action, vals)
986
+ values.Columns[kv[0]] = ColumnValueRefs(1, col)
987
+
988
+ else:
989
+ for row_index in range(row_start_index, row_end_index + 1, 1):
990
+ ignore(remove_from_dict(vals, row_index))
991
+
992
+
993
+
994
+ iterate(action_1, values.Columns)
995
+ values.RowCount = (values.RowCount - ((row_end_index - row_start_index) + 1)) or 0
996
+
997
+
998
+
999
+ def Unchecked_moveColumnCellsTo(from_col: int, to_col: int, values: ArcTableValues) -> None:
1000
+ match_value: ColumnValueRefs | None
1001
+ pattern_input: tuple[bool, ColumnValueRefs]
1002
+ out_arg: ColumnValueRefs = None
1003
+ def _arrow1195(__unit: None=None, from_col: Any=from_col, to_col: Any=to_col, values: Any=values) -> ColumnValueRefs:
1004
+ return out_arg
1005
+
1006
+ def _arrow1196(v: ColumnValueRefs, from_col: Any=from_col, to_col: Any=to_col, values: Any=values) -> None:
1007
+ nonlocal out_arg
1008
+ out_arg = v
1009
+
1010
+ pattern_input = (try_get_value(values.Columns, from_col, FSharpRef(_arrow1195, _arrow1196)), out_arg)
1011
+ match_value = pattern_input[1] if pattern_input[0] else None
1012
+ if match_value is not None:
1013
+ col: ColumnValueRefs = match_value
1014
+ Unchecked_removeColumnCells(from_col, values)
1015
+ key_1: int = to_col or 0
1016
+ value: ColumnValueRefs = col
1017
+ dict_1_1: Any = values.Columns
1018
+ if key_1 in dict_1_1:
1019
+ dict_1_1[key_1] = value
1020
+
1021
+ else:
1022
+ add_to_dict(dict_1_1, key_1, value)
1023
+
1024
+
1025
+
1026
+
1027
+ def Unchecked_addRefColumn(new_header: CompositeHeader, new_col: ColumnValueRefs, row_count: int, index: int, force_replace: bool, only_headers: bool, headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1028
+ number_of_new_columns: int = 1
1029
+ index_1: int = index or 0
1030
+ has_duplicate_unique: int | None = try_find_duplicate_unique(new_header, headers)
1031
+ if (has_duplicate_unique is not None) if (not force_replace) else False:
1032
+ raise Exception(((("Invalid new column `" + str(new_header)) + "`. Table already contains header of the same type on index `") + str(value_3(has_duplicate_unique))) + "`")
1033
+
1034
+ if row_count > values.RowCount:
1035
+ values.RowCount = row_count or 0
1036
+ enumerator: Any = get_enumerator(values.Columns)
1037
+ try:
1038
+ while enumerator.System_Collections_IEnumerator_MoveNext():
1039
+ kv: Any = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
1040
+ values.Columns[kv[0]] = ColumnValueRefs__ToSparse_Z524259A4(kv[1], values.RowCount)
1041
+
1042
+ finally:
1043
+ dispose(enumerator)
1044
+
1045
+
1046
+ if (len(values.Columns) == 1) if (force_replace if ((has_duplicate_unique is not None) if (row_count < values.RowCount) else False) else False) else False:
1047
+ values.RowCount = row_count or 0
1048
+
1049
+ if has_duplicate_unique is not None:
1050
+ number_of_new_columns = 0
1051
+ index_1 = value_3(has_duplicate_unique) or 0
1052
+
1053
+ match_value: int = len(headers) or 0
1054
+ match_value_1: int = values.RowCount or 0
1055
+ start_col_count: int = match_value or 0
1056
+ if has_duplicate_unique is not None:
1057
+ Unchecked_removeHeader(index_1, headers)
1058
+
1059
+ headers.insert(index_1, new_header)
1060
+ if (has_duplicate_unique is None) if (index_1 < start_col_count) else False:
1061
+ def _arrow1197(x: int, y: int, new_header: Any=new_header, new_col: Any=new_col, row_count: Any=row_count, index: Any=index, force_replace: Any=force_replace, only_headers: Any=only_headers, headers: Any=headers, values: Any=values) -> int:
1062
+ return compare_primitives(x, y)
1063
+
1064
+ last_column_index: int = max_1(_arrow1197, start_col_count - 1, 0) or 0
1065
+ for column_index in range(last_column_index, index_1 - 1, -1):
1066
+ Unchecked_moveColumnCellsTo(column_index, column_index + number_of_new_columns, values)
1067
+
1068
+ if not only_headers:
1069
+ key: int = index_1 or 0
1070
+ value: ColumnValueRefs = new_col
1071
+ dict_1: Any = values.Columns
1072
+ if key in dict_1:
1073
+ dict_1[key] = value
1074
+
1075
+ else:
1076
+ add_to_dict(dict_1, key, value)
1077
+
1078
+
1079
+
1080
+
1081
+ def Unchecked_addColumn(new_header: CompositeHeader, new_cells: Any, index: int, force_replace: bool, only_headers: bool, headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1082
+ Unchecked_addRefColumn(new_header, ColumnValueRefs_fromCellColumn_14896151(new_cells, values.RowCount, values.ValueMap), length(new_cells), index, force_replace, only_headers, headers, values)
1083
+
1084
+
1085
+ def Unchecked_addColumnFill(new_header: CompositeHeader, new_cell: CompositeCell, index: int, force_replace: bool, only_headers: bool, headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1086
+ Unchecked_addRefColumn(new_header, ColumnValueRefs(0, ensure_cell_hash_in_value_map(new_cell, values.ValueMap)), 1, index, force_replace, only_headers, headers, values)
1087
+
1088
+
1089
+ def Unchecked_fillMissingCells(headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1090
+ if values.RowCount == 0:
1091
+ pass
1092
+
1093
+ else:
1094
+ for i in range(0, (values.ColumnCount - 1) + 1, 1):
1095
+ match_value: ColumnValueRefs | None
1096
+ pattern_input: tuple[bool, ColumnValueRefs]
1097
+ out_arg: ColumnValueRefs = None
1098
+ def _arrow1198(__unit: None=None, headers: Any=headers, values: Any=values) -> ColumnValueRefs:
1099
+ return out_arg
1100
+
1101
+ def _arrow1199(v: ColumnValueRefs, headers: Any=headers, values: Any=values) -> None:
1102
+ nonlocal out_arg
1103
+ out_arg = v
1104
+
1105
+ pattern_input = (try_get_value(values.Columns, i, FSharpRef(_arrow1198, _arrow1199)), out_arg)
1106
+ match_value = pattern_input[1] if pattern_input[0] else None
1107
+ if match_value is not None:
1108
+ if match_value.tag == 1:
1109
+ vals: Any = match_value.fields[0]
1110
+ if len(vals) < values.RowCount:
1111
+ header: CompositeHeader = headers[i]
1112
+ def _arrow1201(__unit: None=None, headers: Any=headers, values: Any=values) -> CompositeCell:
1113
+ class ObjectExpr1200:
1114
+ @property
1115
+ def Compare(self) -> Callable[[int, int], int]:
1116
+ return compare_primitives
1117
+
1118
+ i_1: int = max(vals.keys(), ObjectExpr1200()) or 0
1119
+ return get_empty_cell_for_header(header, get_item_from_dict(values.ValueMap, get_item_from_dict(vals, i_1)))
1120
+
1121
+ default_hash: int = ensure_cell_hash_in_value_map(get_empty_cell_for_header(header, None) if (len(vals) == 0) else _arrow1201(), values.ValueMap) or 0
1122
+ for j in range(len(vals), (values.RowCount - 1) + 1, 1):
1123
+ if not (j in vals):
1124
+ add_to_dict(vals, j, default_hash)
1125
+
1126
+
1127
+
1128
+
1129
+ else:
1130
+ col: ColumnValueRefs = ColumnValueRefs(0, ensure_cell_hash_in_value_map(get_empty_cell_for_header(headers[i], None), values.ValueMap))
1131
+ value: None = add_to_dict(values.Columns, i, col)
1132
+ ignore(None)
1133
+
1134
+
1135
+
1136
+
1137
+ def Unchecked_addEmptyRow(index: int, values: ArcTableValues) -> None:
1138
+ if (values.ColumnCount != 0) if (index < values.RowCount) else False:
1139
+ enumerator: Any = get_enumerator(values.Columns)
1140
+ try:
1141
+ while enumerator.System_Collections_IEnumerator_MoveNext():
1142
+ match_value: ColumnValueRefs = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()[1]
1143
+ if match_value.tag == 1:
1144
+ dict_1: Any = match_value.fields[0]
1145
+ class ObjectExpr1202:
1146
+ @property
1147
+ def Compare(self) -> Callable[[int, int], int]:
1148
+ return compare_primitives
1149
+
1150
+ max_index: int = max(dict_1.keys(), ObjectExpr1202()) or 0
1151
+ for i in range(max_index, ((index + 1) - 1) - 1, -1):
1152
+ if i in dict_1:
1153
+ v: int = get_item_from_dict(dict_1, i) or 0
1154
+ ignore(remove_from_dict(dict_1, i))
1155
+ add_to_dict(dict_1, i + 1, v)
1156
+
1157
+
1158
+
1159
+ finally:
1160
+ dispose(enumerator)
1161
+
1162
+
1163
+ values.RowCount = (values.RowCount + 1) or 0
1164
+
1165
+
1166
+ def Unchecked_addRow(index: int, new_cells: Array[CompositeCell], headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1167
+ row_count: int = values.RowCount or 0
1168
+ column_count: int = values.ColumnCount or 0
1169
+ increase_row_indices: None
1170
+ if index < row_count:
1171
+ def _arrow1203(x: int, y: int, index: Any=index, new_cells: Any=new_cells, headers: Any=headers, values: Any=values) -> int:
1172
+ return compare_primitives(x, y)
1173
+
1174
+ last_row_index: int = max_1(_arrow1203, row_count - 1, 0) or 0
1175
+ for row_index in range(last_row_index, index - 1, -1):
1176
+ for column_index in range(0, (column_count - 1) + 1, 1):
1177
+ Unchecked_moveCellTo(column_index, row_index, column_index, row_index + 1, values)
1178
+
1179
+ else:
1180
+ increase_row_indices = None
1181
+
1182
+ def f(column_index_1: int, cell: CompositeCell, index: Any=index, new_cells: Any=new_cells, headers: Any=headers, values: Any=values) -> None:
1183
+ Unchecked_setCellAt(column_index_1, index, cell, values)
1184
+
1185
+ set_new_cells: None = ResizeArray_iteri(f, new_cells)
1186
+
1187
+
1188
+ def Unchecked_addRows(index: int, new_rows: Array[Array[CompositeCell]], headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1189
+ row_count: int = values.RowCount or 0
1190
+ column_count: int = values.ColumnCount or 0
1191
+ num_new_rows: int = len(new_rows) or 0
1192
+ increase_row_indices: None
1193
+ if index < row_count:
1194
+ def _arrow1204(x: int, y: int, index: Any=index, new_rows: Any=new_rows, headers: Any=headers, values: Any=values) -> int:
1195
+ return compare_primitives(x, y)
1196
+
1197
+ last_row_index: int = max_1(_arrow1204, row_count - 1, 0) or 0
1198
+ for row_index in range(last_row_index, index - 1, -1):
1199
+ for column_index in range(0, (column_count - 1) + 1, 1):
1200
+ Unchecked_moveCellTo(column_index, row_index, column_index, row_index + num_new_rows, values)
1201
+
1202
+ else:
1203
+ increase_row_indices = None
1204
+
1205
+ current_row_index: int = index or 0
1206
+ enumerator: Any = get_enumerator(new_rows)
1207
+ try:
1208
+ while enumerator.System_Collections_IEnumerator_MoveNext():
1209
+ def f(column_index_1: int, cell: CompositeCell) -> None:
1210
+ Unchecked_setCellAt(column_index_1, current_row_index, cell, values)
1211
+
1212
+ set_new_cells: None = ResizeArray_iteri(f, enumerator.System_Collections_Generic_IEnumerator_1_get_Current())
1213
+ current_row_index = (current_row_index + 1) or 0
1214
+
1215
+ finally:
1216
+ dispose(enumerator)
1217
+
1218
+
1219
+
1220
+ def Unchecked_compositeHeaderMainColumnEqual(ch1: CompositeHeader, ch2: CompositeHeader) -> bool:
1221
+ return to_string(ch1) == to_string(ch2)
1222
+
1223
+
1224
+ def Unchecked_moveColumnTo(from_col: int, to_col: int, headers: Array[CompositeHeader], values: ArcTableValues) -> None:
1225
+ pattern_input: tuple[int, int, int] = ((-1, from_col + 1, to_col)) if (from_col < to_col) else ((1, from_col - 1, to_col))
1226
+ shift_start: int = pattern_input[1] or 0
1227
+ shift_end: int = pattern_input[2] or 0
1228
+ shift: int = pattern_input[0] or 0
1229
+ header: CompositeHeader = headers[from_col]
1230
+ with get_enumerator(to_list(range_big_int(shift_start, op_unary_negation_int32(shift), shift_end))) as enumerator:
1231
+ while enumerator.System_Collections_IEnumerator_MoveNext():
1232
+ c: int = enumerator.System_Collections_Generic_IEnumerator_1_get_Current() or 0
1233
+ headers[c + shift] = headers[c]
1234
+ headers[to_col] = header
1235
+ col: ColumnValueRefs = get_item_from_dict(values.Columns, from_col)
1236
+ with get_enumerator(to_list(range_big_int(shift_start, op_unary_negation_int32(shift), shift_end))) as enumerator_1:
1237
+ while enumerator_1.System_Collections_IEnumerator_MoveNext():
1238
+ c_1: int = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current() or 0
1239
+ values.Columns[c_1 + shift] = get_item_from_dict(values.Columns, c_1)
1240
+ values.Columns[to_col] = col
1241
+
1242
+
1243
+ def Unchecked_alignByHeaders(keep_order: bool, rows: FSharpList[FSharpList[tuple[CompositeHeader, CompositeCell]]]) -> tuple[Array[CompositeHeader], ArcTableValues]:
1244
+ headers: Array[CompositeHeader] = []
1245
+ values: ArcTableValues = ArcTableValues.init()
1246
+ values.RowCount = length_1(rows) or 0
1247
+ def loop(col_i_mut: int, rows_2_mut: FSharpList[FSharpList[tuple[CompositeHeader, CompositeCell]]], keep_order: Any=keep_order, rows: Any=rows) -> tuple[Array[CompositeHeader], ArcTableValues]:
1248
+ while True:
1249
+ (col_i, rows_2) = (col_i_mut, rows_2_mut)
1250
+ def _arrow1205(arg: FSharpList[tuple[CompositeHeader, CompositeCell]], col_i: Any=col_i, rows_2: Any=rows_2) -> bool:
1251
+ return not is_empty_1(arg)
1252
+
1253
+ if not exists(_arrow1205, rows_2):
1254
+ return (headers, values)
1255
+
1256
+ else:
1257
+ def _arrow1206(l: FSharpList[tuple[CompositeHeader, CompositeCell]], col_i: Any=col_i, rows_2: Any=rows_2) -> tuple[CompositeHeader, CompositeCell] | None:
1258
+ return None if is_empty_1(l) else head(l)
1259
+
1260
+ first_elem: CompositeHeader = pick(_arrow1206, rows_2)[0]
1261
+ (headers.append(first_elem))
1262
+ col_i_mut = col_i + 1
1263
+ def mapping(row_i: int, l_1: FSharpList[tuple[CompositeHeader, CompositeCell]], col_i: Any=col_i, rows_2: Any=rows_2) -> FSharpList[tuple[CompositeHeader, CompositeCell]]:
1264
+ if keep_order:
1265
+ if not is_empty_1(l_1):
1266
+ if Unchecked_compositeHeaderMainColumnEqual(head(l_1)[0], first_elem):
1267
+ Unchecked_setCellAt(col_i, row_i, head(l_1)[1], values)
1268
+ return tail_1(l_1)
1269
+
1270
+ else:
1271
+ return l_1
1272
+
1273
+
1274
+ else:
1275
+ return empty_1()
1276
+
1277
+
1278
+ else:
1279
+ def f(tupled_arg: tuple[CompositeHeader, CompositeCell], row_i: Any=row_i, l_1: Any=l_1) -> CompositeCell | None:
1280
+ if Unchecked_compositeHeaderMainColumnEqual(tupled_arg[0], first_elem):
1281
+ return tupled_arg[1]
1282
+
1283
+ else:
1284
+ return None
1285
+
1286
+
1287
+ pattern_input: tuple[CompositeCell | None, FSharpList[tuple[CompositeHeader, CompositeCell]]] = List_tryPickAndRemove(f, l_1)
1288
+ new_l: FSharpList[tuple[CompositeHeader, CompositeCell]] = pattern_input[1]
1289
+ first_match: CompositeCell | None = pattern_input[0]
1290
+ if first_match is None:
1291
+ return new_l
1292
+
1293
+ else:
1294
+ Unchecked_setCellAt(col_i, row_i, first_match, values)
1295
+ return new_l
1296
+
1297
+
1298
+
1299
+ rows_2_mut = map_indexed(mapping, rows_2)
1300
+ continue
1301
+
1302
+ break
1303
+
1304
+ return loop(0, rows)
1305
+
1306
+
1307
+ __all__ = ["get_empty_cell_for_header", "ensure_cell_hash_in_value_map", "ColumnValueRefs_reflection", "ColumnValueRefs__get_RowCount", "ColumnValueRefs__Copy", "ColumnValueRefs__ToSparse_Z524259A4", "ColumnValueRefs__AsSparse", "ColumnValueRefs__AsConstant", "ColumnValueRefs_fromCellColumn_14896151", "ColumnValueRefs__ToCellColumn_Z2609C9DD", "ArcTableValues_reflection", "_007CIsUniqueExistingHeader_007C__007C", "try_find_duplicate_unique", "try_find_duplicate_unique_in_array", "SanityChecks_validateColumnIndex", "SanityChecks_validateRowIndex", "SanityChecks_validateColumn", "SanityChecks_validateCellColumns", "SanityChecks_validateArcTableValues", "Unchecked_tryGetCellAt", "Unchecked_getCellWithDefault", "Unchecked_setCellAt", "Unchecked_removeCellAt", "Unchecked_moveCellTo", "Unchecked_removeHeader", "Unchecked_removeColumnCells", "Unchecked_removeColumnCells_withIndexChange", "Unchecked_removeRowCells", "Unchecked_removeRowCells_withIndexChange", "Unchecked_removeRowRange_withIndexChange", "Unchecked_moveColumnCellsTo", "Unchecked_addRefColumn", "Unchecked_addColumn", "Unchecked_addColumnFill", "Unchecked_fillMissingCells", "Unchecked_addEmptyRow", "Unchecked_addRow", "Unchecked_addRows", "Unchecked_compositeHeaderMainColumnEqual", "Unchecked_moveColumnTo", "Unchecked_alignByHeaders"]
1308
+