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.
- arctrl/__init__.py +23 -0
- arctrl/cwl.py +12 -0
- arctrl/py/CWL/__init__.py +0 -0
- arctrl/py/CWL/cwlprocessing_unit.py +221 -0
- arctrl/py/CWL/cwltypes.py +364 -0
- arctrl/py/CWL/decode.py +3532 -0
- arctrl/py/CWL/encode.py +1905 -0
- arctrl/py/CWL/expression_tool_description.py +192 -0
- arctrl/py/CWL/hash_helpers.py +60 -0
- arctrl/py/CWL/inputs.py +122 -0
- arctrl/py/CWL/operation_description.py +169 -0
- arctrl/py/CWL/outputs.py +171 -0
- arctrl/py/CWL/parameter_reference.py +74 -0
- arctrl/py/CWL/requirements.py +350 -0
- arctrl/py/CWL/tool_description.py +192 -0
- arctrl/py/CWL/workflow_description.py +181 -0
- arctrl/py/CWL/workflow_steps.py +354 -0
- arctrl/py/Contract/__init__.py +0 -0
- arctrl/py/Contract/arc.py +89 -0
- arctrl/py/Contract/arc_assay.py +125 -0
- arctrl/py/Contract/arc_investigation.py +88 -0
- arctrl/py/Contract/arc_run.py +291 -0
- arctrl/py/Contract/arc_study.py +126 -0
- arctrl/py/Contract/arc_workflow.py +213 -0
- arctrl/py/Contract/contract.py +153 -0
- arctrl/py/Contract/datamap.py +396 -0
- arctrl/py/Contract/git.py +116 -0
- arctrl/py/Contract/license.py +58 -0
- arctrl/py/Contract/validation_packages_config.py +107 -0
- arctrl/py/ContractIO/__init__.py +0 -0
- arctrl/py/ContractIO/contract_io.py +350 -0
- arctrl/py/ContractIO/file_system_helper.py +264 -0
- arctrl/py/Conversion/__init__.py +0 -0
- arctrl/py/Conversion/assay.py +151 -0
- arctrl/py/Conversion/basic.py +559 -0
- arctrl/py/Conversion/column_index.py +91 -0
- arctrl/py/Conversion/datamap.py +36 -0
- arctrl/py/Conversion/date_time.py +32 -0
- arctrl/py/Conversion/investigation.py +171 -0
- arctrl/py/Conversion/person.py +148 -0
- arctrl/py/Conversion/process.py +828 -0
- arctrl/py/Conversion/run.py +367 -0
- arctrl/py/Conversion/scholarly_article.py +163 -0
- arctrl/py/Conversion/study.py +99 -0
- arctrl/py/Conversion/table.py +229 -0
- arctrl/py/Conversion/workflow.py +680 -0
- arctrl/py/Core/Helper/__init__.py +0 -0
- arctrl/py/Core/Helper/collections_.py +512 -0
- arctrl/py/Core/Helper/date_time.py +26 -0
- arctrl/py/Core/Helper/hash_codes.py +60 -0
- arctrl/py/Core/Helper/identifier.py +290 -0
- arctrl/py/Core/Helper/orcid.py +42 -0
- arctrl/py/Core/Helper/printer.py +13 -0
- arctrl/py/Core/Helper/regex.py +554 -0
- arctrl/py/Core/Helper/sem_ver.py +71 -0
- arctrl/py/Core/Helper/url.py +148 -0
- arctrl/py/Core/Process/__init__.py +0 -0
- arctrl/py/Core/Process/column_index.py +280 -0
- arctrl/py/Core/Process/component.py +200 -0
- arctrl/py/Core/Process/factor.py +151 -0
- arctrl/py/Core/Process/factor_value.py +182 -0
- arctrl/py/Core/Process/material.py +74 -0
- arctrl/py/Core/Process/material_attribute.py +95 -0
- arctrl/py/Core/Process/material_attribute_value.py +184 -0
- arctrl/py/Core/Process/material_type.py +45 -0
- arctrl/py/Core/Process/process.py +477 -0
- arctrl/py/Core/Process/process_input.py +265 -0
- arctrl/py/Core/Process/process_output.py +235 -0
- arctrl/py/Core/Process/process_parameter_value.py +200 -0
- arctrl/py/Core/Process/process_sequence.py +435 -0
- arctrl/py/Core/Process/protocol.py +175 -0
- arctrl/py/Core/Process/protocol_parameter.py +98 -0
- arctrl/py/Core/Process/sample.py +82 -0
- arctrl/py/Core/Process/source.py +62 -0
- arctrl/py/Core/Table/__init__.py +0 -0
- arctrl/py/Core/Table/arc_table.py +1206 -0
- arctrl/py/Core/Table/arc_table_aux.py +1308 -0
- arctrl/py/Core/Table/arc_tables.py +574 -0
- arctrl/py/Core/Table/composite_cell.py +319 -0
- arctrl/py/Core/Table/composite_column.py +73 -0
- arctrl/py/Core/Table/composite_header.py +739 -0
- arctrl/py/Core/__init__.py +0 -0
- arctrl/py/Core/arc_types.py +5312 -0
- arctrl/py/Core/comment.py +128 -0
- arctrl/py/Core/comment_list.py +127 -0
- arctrl/py/Core/conversion.py +1375 -0
- arctrl/py/Core/data.py +247 -0
- arctrl/py/Core/data_context.py +157 -0
- arctrl/py/Core/data_file.py +112 -0
- arctrl/py/Core/datamap.py +217 -0
- arctrl/py/Core/identifier_setters.py +43 -0
- arctrl/py/Core/iproperty_value.py +36 -0
- arctrl/py/Core/ontology_annotation.py +298 -0
- arctrl/py/Core/ontology_source_reference.py +114 -0
- arctrl/py/Core/person.py +259 -0
- arctrl/py/Core/publication.py +161 -0
- arctrl/py/Core/template.py +231 -0
- arctrl/py/Core/templates.py +148 -0
- arctrl/py/Core/uri.py +11 -0
- arctrl/py/Core/value.py +188 -0
- arctrl/py/FileSystem/__init__.py +0 -0
- arctrl/py/FileSystem/commit.py +21 -0
- arctrl/py/FileSystem/default_gitattributes.py +1 -0
- arctrl/py/FileSystem/default_gitignore.py +1 -0
- arctrl/py/FileSystem/default_license.py +1 -0
- arctrl/py/FileSystem/file_system.py +58 -0
- arctrl/py/FileSystem/file_system_tree.py +483 -0
- arctrl/py/FileSystem/path.py +266 -0
- arctrl/py/Json/Datamap/__init__.py +0 -0
- arctrl/py/Json/Datamap/data_context.py +101 -0
- arctrl/py/Json/Datamap/datamap.py +53 -0
- arctrl/py/Json/Process/__init__.py +0 -0
- arctrl/py/Json/Process/assay_materials.py +46 -0
- arctrl/py/Json/Process/component.py +125 -0
- arctrl/py/Json/Process/factor.py +107 -0
- arctrl/py/Json/Process/factor_value.py +101 -0
- arctrl/py/Json/Process/material.py +226 -0
- arctrl/py/Json/Process/material_attribute.py +79 -0
- arctrl/py/Json/Process/material_attribute_value.py +101 -0
- arctrl/py/Json/Process/material_type.py +53 -0
- arctrl/py/Json/Process/process.py +296 -0
- arctrl/py/Json/Process/process_input.py +83 -0
- arctrl/py/Json/Process/process_output.py +67 -0
- arctrl/py/Json/Process/process_parameter_value.py +81 -0
- arctrl/py/Json/Process/protocol.py +354 -0
- arctrl/py/Json/Process/protocol_parameter.py +91 -0
- arctrl/py/Json/Process/sample.py +277 -0
- arctrl/py/Json/Process/source.py +214 -0
- arctrl/py/Json/Process/study_materials.py +52 -0
- arctrl/py/Json/Process/value.py +56 -0
- arctrl/py/Json/ROCrate/__init__.py +0 -0
- arctrl/py/Json/ROCrate/ldcontext.py +143 -0
- arctrl/py/Json/ROCrate/ldgraph.py +117 -0
- arctrl/py/Json/ROCrate/ldnode.py +304 -0
- arctrl/py/Json/ROCrate/ldref.py +44 -0
- arctrl/py/Json/ROCrate/ldvalue.py +102 -0
- arctrl/py/Json/Table/__init__.py +0 -0
- arctrl/py/Json/Table/arc_table.py +375 -0
- arctrl/py/Json/Table/cell_table.py +83 -0
- arctrl/py/Json/Table/composite_cell.py +136 -0
- arctrl/py/Json/Table/composite_header.py +67 -0
- arctrl/py/Json/Table/iotype.py +24 -0
- arctrl/py/Json/Table/oatable.py +82 -0
- arctrl/py/Json/Table/templates.py +281 -0
- arctrl/py/Json/__init__.py +0 -0
- arctrl/py/Json/assay.py +600 -0
- arctrl/py/Json/comment.py +206 -0
- arctrl/py/Json/context/rocrate/__init__.py +0 -0
- arctrl/py/Json/context/rocrate/isa_assay_context.py +101 -0
- arctrl/py/Json/context/rocrate/isa_comment_context.py +60 -0
- arctrl/py/Json/context/rocrate/isa_component_context.py +77 -0
- arctrl/py/Json/context/rocrate/isa_data_context.py +74 -0
- arctrl/py/Json/context/rocrate/isa_factor_context.py +74 -0
- arctrl/py/Json/context/rocrate/isa_factor_value_context.py +84 -0
- arctrl/py/Json/context/rocrate/isa_investigation_context.py +110 -0
- arctrl/py/Json/context/rocrate/isa_material_attribute_context.py +64 -0
- arctrl/py/Json/context/rocrate/isa_material_attribute_value_context.py +80 -0
- arctrl/py/Json/context/rocrate/isa_material_context.py +71 -0
- arctrl/py/Json/context/rocrate/isa_ontology_annotation_context.py +68 -0
- arctrl/py/Json/context/rocrate/isa_ontology_source_reference_context.py +75 -0
- arctrl/py/Json/context/rocrate/isa_organization_context.py +55 -0
- arctrl/py/Json/context/rocrate/isa_person_context.py +131 -0
- arctrl/py/Json/context/rocrate/isa_process_context.py +94 -0
- arctrl/py/Json/context/rocrate/isa_process_parameter_value_context.py +80 -0
- arctrl/py/Json/context/rocrate/isa_protocol_context.py +97 -0
- arctrl/py/Json/context/rocrate/isa_protocol_parameter_context.py +64 -0
- arctrl/py/Json/context/rocrate/isa_publication_context.py +78 -0
- arctrl/py/Json/context/rocrate/isa_sample_context.py +65 -0
- arctrl/py/Json/context/rocrate/isa_source_context.py +66 -0
- arctrl/py/Json/context/rocrate/isa_study_context.py +125 -0
- arctrl/py/Json/context/rocrate/property_value_context.py +73 -0
- arctrl/py/Json/context/rocrate/rocrate_context.py +81 -0
- arctrl/py/Json/converter_options.py +23 -0
- arctrl/py/Json/data.py +356 -0
- arctrl/py/Json/data_file.py +63 -0
- arctrl/py/Json/decode.py +271 -0
- arctrl/py/Json/encode.py +140 -0
- arctrl/py/Json/idtable.py +44 -0
- arctrl/py/Json/investigation.py +695 -0
- arctrl/py/Json/ontology_annotation.py +404 -0
- arctrl/py/Json/ontology_source_reference.py +255 -0
- arctrl/py/Json/person.py +658 -0
- arctrl/py/Json/property_value.py +359 -0
- arctrl/py/Json/publication.py +279 -0
- arctrl/py/Json/run.py +275 -0
- arctrl/py/Json/string_table.py +87 -0
- arctrl/py/Json/study.py +793 -0
- arctrl/py/Json/workflow.py +307 -0
- arctrl/py/JsonIO/Process/__init__.py +0 -0
- arctrl/py/JsonIO/Process/component.py +60 -0
- arctrl/py/JsonIO/Process/factor.py +36 -0
- arctrl/py/JsonIO/Process/factor_value.py +38 -0
- arctrl/py/JsonIO/Process/material.py +60 -0
- arctrl/py/JsonIO/Process/material_attribute.py +38 -0
- arctrl/py/JsonIO/Process/material_attribute_value.py +60 -0
- arctrl/py/JsonIO/Process/material_type.py +36 -0
- arctrl/py/JsonIO/Process/process.py +60 -0
- arctrl/py/JsonIO/Process/process_input.py +38 -0
- arctrl/py/JsonIO/Process/process_output.py +60 -0
- arctrl/py/JsonIO/Process/process_parameter_value.py +60 -0
- arctrl/py/JsonIO/Process/process_sequence.py +71 -0
- arctrl/py/JsonIO/Process/protocol.py +60 -0
- arctrl/py/JsonIO/Process/protocol_parameter.py +36 -0
- arctrl/py/JsonIO/Process/sample.py +60 -0
- arctrl/py/JsonIO/Process/source.py +60 -0
- arctrl/py/JsonIO/Process/study_materials.py +52 -0
- arctrl/py/JsonIO/Process/value.py +32 -0
- arctrl/py/JsonIO/Table/__init__.py +0 -0
- arctrl/py/JsonIO/Table/arc_table.py +103 -0
- arctrl/py/JsonIO/Table/composite_cell.py +36 -0
- arctrl/py/JsonIO/Table/composite_header.py +36 -0
- arctrl/py/JsonIO/Table/compression.py +67 -0
- arctrl/py/JsonIO/Table/iotype.py +36 -0
- arctrl/py/JsonIO/Table/templates.py +113 -0
- arctrl/py/JsonIO/__init__.py +0 -0
- arctrl/py/JsonIO/assay.py +113 -0
- arctrl/py/JsonIO/comment.py +80 -0
- arctrl/py/JsonIO/data.py +60 -0
- arctrl/py/JsonIO/data_file.py +58 -0
- arctrl/py/JsonIO/datamap.py +36 -0
- arctrl/py/JsonIO/decode.py +9 -0
- arctrl/py/JsonIO/encode.py +1 -0
- arctrl/py/JsonIO/investigation.py +91 -0
- arctrl/py/JsonIO/ldobject.py +106 -0
- arctrl/py/JsonIO/ontology_annotation.py +80 -0
- arctrl/py/JsonIO/ontology_source_reference.py +80 -0
- arctrl/py/JsonIO/person.py +82 -0
- arctrl/py/JsonIO/publication.py +82 -0
- arctrl/py/JsonIO/run.py +68 -0
- arctrl/py/JsonIO/study.py +114 -0
- arctrl/py/JsonIO/workflow.py +68 -0
- arctrl/py/ROCrate/ISAProfile/__init__.py +0 -0
- arctrl/py/ROCrate/ISAProfile/assay.py +70 -0
- arctrl/py/ROCrate/ISAProfile/data.py +65 -0
- arctrl/py/ROCrate/ISAProfile/dataset.py +24 -0
- arctrl/py/ROCrate/ISAProfile/investigation.py +73 -0
- arctrl/py/ROCrate/ISAProfile/lab_process.py +162 -0
- arctrl/py/ROCrate/ISAProfile/lab_protocol.py +37 -0
- arctrl/py/ROCrate/ISAProfile/person.py +72 -0
- arctrl/py/ROCrate/ISAProfile/property_value.py +98 -0
- arctrl/py/ROCrate/ISAProfile/sample.py +64 -0
- arctrl/py/ROCrate/ISAProfile/scholarly_article.py +98 -0
- arctrl/py/ROCrate/ISAProfile/study.py +74 -0
- arctrl/py/ROCrate/LDTypes/__init__.py +0 -0
- arctrl/py/ROCrate/LDTypes/comment.py +131 -0
- arctrl/py/ROCrate/LDTypes/computational_workflow.py +455 -0
- arctrl/py/ROCrate/LDTypes/computer_language.py +269 -0
- arctrl/py/ROCrate/LDTypes/create_action.py +303 -0
- arctrl/py/ROCrate/LDTypes/creative_work.py +566 -0
- arctrl/py/ROCrate/LDTypes/dataset.py +943 -0
- arctrl/py/ROCrate/LDTypes/defined_term.py +131 -0
- arctrl/py/ROCrate/LDTypes/file.py +281 -0
- arctrl/py/ROCrate/LDTypes/formal_parameter.py +431 -0
- arctrl/py/ROCrate/LDTypes/lab_process.py +352 -0
- arctrl/py/ROCrate/LDTypes/lab_protocol.py +395 -0
- arctrl/py/ROCrate/LDTypes/organization.py +83 -0
- arctrl/py/ROCrate/LDTypes/person.py +484 -0
- arctrl/py/ROCrate/LDTypes/postal_address.py +195 -0
- arctrl/py/ROCrate/LDTypes/property_value.py +952 -0
- arctrl/py/ROCrate/LDTypes/sample.py +202 -0
- arctrl/py/ROCrate/LDTypes/scholarly_article.py +229 -0
- arctrl/py/ROCrate/LDTypes/software_source_code.py +310 -0
- arctrl/py/ROCrate/LDTypes/workflow_invocation.py +48 -0
- arctrl/py/ROCrate/LDTypes/workflow_protocol.py +52 -0
- arctrl/py/ROCrate/__init__.py +0 -0
- arctrl/py/ROCrate/arc_rocrate_metadata.py +39 -0
- arctrl/py/ROCrate/dyn_obj_extensions.py +1 -0
- arctrl/py/ROCrate/helper.py +8 -0
- arctrl/py/ROCrate/ldcontext.py +406 -0
- arctrl/py/ROCrate/ldobject.py +1247 -0
- arctrl/py/ROCrate/rocrate_context.py +51 -0
- arctrl/py/Spreadsheet/AnnotationTable/__init__.py +0 -0
- arctrl/py/Spreadsheet/AnnotationTable/arc_table.py +203 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_cell.py +78 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_column.py +305 -0
- arctrl/py/Spreadsheet/AnnotationTable/composite_header.py +623 -0
- arctrl/py/Spreadsheet/DatamapTable/__init__.py +0 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_column.py +114 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_header.py +621 -0
- arctrl/py/Spreadsheet/DatamapTable/datamap_table.py +118 -0
- arctrl/py/Spreadsheet/Metadata/__init__.py +0 -0
- arctrl/py/Spreadsheet/Metadata/assays.py +125 -0
- arctrl/py/Spreadsheet/Metadata/comment.py +77 -0
- arctrl/py/Spreadsheet/Metadata/contacts.py +134 -0
- arctrl/py/Spreadsheet/Metadata/conversions.py +190 -0
- arctrl/py/Spreadsheet/Metadata/design_descriptors.py +34 -0
- arctrl/py/Spreadsheet/Metadata/factors.py +107 -0
- arctrl/py/Spreadsheet/Metadata/ontology_annotation.py +88 -0
- arctrl/py/Spreadsheet/Metadata/ontology_source_reference.py +96 -0
- arctrl/py/Spreadsheet/Metadata/protocols.py +146 -0
- arctrl/py/Spreadsheet/Metadata/publication.py +122 -0
- arctrl/py/Spreadsheet/Metadata/run.py +122 -0
- arctrl/py/Spreadsheet/Metadata/sparse_table.py +499 -0
- arctrl/py/Spreadsheet/Metadata/study.py +312 -0
- arctrl/py/Spreadsheet/Metadata/workflow.py +159 -0
- arctrl/py/Spreadsheet/__init__.py +0 -0
- arctrl/py/Spreadsheet/arc_assay.py +233 -0
- arctrl/py/Spreadsheet/arc_investigation.py +435 -0
- arctrl/py/Spreadsheet/arc_run.py +190 -0
- arctrl/py/Spreadsheet/arc_study.py +144 -0
- arctrl/py/Spreadsheet/arc_workflow.py +177 -0
- arctrl/py/Spreadsheet/assembly_info.py +1 -0
- arctrl/py/Spreadsheet/collection_aux.py +167 -0
- arctrl/py/Spreadsheet/datamap.py +43 -0
- arctrl/py/Spreadsheet/template.py +460 -0
- arctrl/py/ValidationPackages/__init__.py +0 -0
- arctrl/py/ValidationPackages/validation_package.py +82 -0
- arctrl/py/ValidationPackages/validation_packages_config.py +132 -0
- arctrl/py/WebRequest/__init__.py +0 -0
- arctrl/py/WebRequest/web_request.py +9 -0
- arctrl/py/WebRequest/web_request_py.py +135 -0
- arctrl/py/WorkflowGraph/__init__.py +0 -0
- arctrl/py/WorkflowGraph/adapters.py +141 -0
- arctrl/py/WorkflowGraph/build_options.py +45 -0
- arctrl/py/WorkflowGraph/builder.py +720 -0
- arctrl/py/WorkflowGraph/graph_types.py +260 -0
- arctrl/py/WorkflowGraph/query_helpers.py +76 -0
- arctrl/py/WorkflowGraph/reference_parsing.py +59 -0
- arctrl/py/WorkflowGraph/visualization_siren.py +574 -0
- arctrl/py/WorkflowGraph/workflow_graph.py +119 -0
- arctrl/py/Yaml/__init__.py +0 -0
- arctrl/py/Yaml/decode.py +1 -0
- arctrl/py/Yaml/encode.py +10 -0
- arctrl/py/Yaml/validation_package.py +77 -0
- arctrl/py/Yaml/validation_packages_config.py +86 -0
- arctrl/py/__init__.py +0 -0
- arctrl/py/arc.py +1891 -0
- arctrl/py/column_index.py +280 -0
- arctrl/py/conversion.py +142 -0
- arctrl/py/cross_async.py +76 -0
- arctrl/py/cwlrun_resolver.py +228 -0
- arctrl/py/fable_modules/dynamic_obj/__init__.py +0 -0
- arctrl/py/fable_modules/dynamic_obj/dyn_obj.py +136 -0
- arctrl/py/fable_modules/dynamic_obj/dynamic_obj.py +415 -0
- arctrl/py/fable_modules/dynamic_obj/fable_js.py +1 -0
- arctrl/py/fable_modules/dynamic_obj/fable_py.py +288 -0
- arctrl/py/fable_modules/dynamic_obj/hash_codes.py +82 -0
- arctrl/py/fable_modules/dynamic_obj/property_helper.py +25 -0
- arctrl/py/fable_modules/dynamic_obj/reflection_utils.py +87 -0
- arctrl/py/fable_modules/fable_library/__init__.py +0 -0
- arctrl/py/fable_modules/fable_library/array_.py +1528 -0
- arctrl/py/fable_modules/fable_library/async_.py +377 -0
- arctrl/py/fable_modules/fable_library/async_builder.py +379 -0
- arctrl/py/fable_modules/fable_library/big_int.py +330 -0
- arctrl/py/fable_modules/fable_library/bit_converter.py +131 -0
- arctrl/py/fable_modules/fable_library/boolean.py +26 -0
- arctrl/py/fable_modules/fable_library/char.py +237 -0
- arctrl/py/fable_modules/fable_library/choice.py +212 -0
- arctrl/py/fable_modules/fable_library/date.py +779 -0
- arctrl/py/fable_modules/fable_library/date_offset.py +79 -0
- arctrl/py/fable_modules/fable_library/decimal_.py +190 -0
- arctrl/py/fable_modules/fable_library/diagnostics.py +54 -0
- arctrl/py/fable_modules/fable_library/double.py +87 -0
- arctrl/py/fable_modules/fable_library/encoding.py +41 -0
- arctrl/py/fable_modules/fable_library/event.py +206 -0
- arctrl/py/fable_modules/fable_library/file.py +107 -0
- arctrl/py/fable_modules/fable_library/fsharp_collections.py +52 -0
- arctrl/py/fable_modules/fable_library/fsharp_core.py +123 -0
- arctrl/py/fable_modules/fable_library/global_.py +63 -0
- arctrl/py/fable_modules/fable_library/guid.py +41 -0
- arctrl/py/fable_modules/fable_library/int32.py +73 -0
- arctrl/py/fable_modules/fable_library/list.py +1788 -0
- arctrl/py/fable_modules/fable_library/long.py +240 -0
- arctrl/py/fable_modules/fable_library/mailbox_processor.py +179 -0
- arctrl/py/fable_modules/fable_library/map.py +1854 -0
- arctrl/py/fable_modules/fable_library/map_util.py +148 -0
- arctrl/py/fable_modules/fable_library/mutable_map.py +397 -0
- arctrl/py/fable_modules/fable_library/mutable_set.py +279 -0
- arctrl/py/fable_modules/fable_library/native.py +45 -0
- arctrl/py/fable_modules/fable_library/numeric.py +46 -0
- arctrl/py/fable_modules/fable_library/observable.py +222 -0
- arctrl/py/fable_modules/fable_library/option.py +128 -0
- arctrl/py/fable_modules/fable_library/path.py +62 -0
- arctrl/py/fable_modules/fable_library/range.py +117 -0
- arctrl/py/fable_modules/fable_library/reflection.py +463 -0
- arctrl/py/fable_modules/fable_library/reg_exp.py +137 -0
- arctrl/py/fable_modules/fable_library/resize_array.py +31 -0
- arctrl/py/fable_modules/fable_library/result.py +212 -0
- arctrl/py/fable_modules/fable_library/seq.py +1979 -0
- arctrl/py/fable_modules/fable_library/seq2.py +221 -0
- arctrl/py/fable_modules/fable_library/set.py +2414 -0
- arctrl/py/fable_modules/fable_library/singleton_local_time_zone.py +36 -0
- arctrl/py/fable_modules/fable_library/string_.py +573 -0
- arctrl/py/fable_modules/fable_library/system_collections_generic.py +462 -0
- arctrl/py/fable_modules/fable_library/system_text.py +237 -0
- arctrl/py/fable_modules/fable_library/task.py +116 -0
- arctrl/py/fable_modules/fable_library/task_builder.py +122 -0
- arctrl/py/fable_modules/fable_library/thread.py +5 -0
- arctrl/py/fable_modules/fable_library/time_span.py +283 -0
- arctrl/py/fable_modules/fable_library/timer.py +24 -0
- arctrl/py/fable_modules/fable_library/types.py +401 -0
- arctrl/py/fable_modules/fable_library/uri.py +109 -0
- arctrl/py/fable_modules/fable_library/util.py +2735 -0
- arctrl/py/fable_modules/fable_openpyxl/__init__.py +0 -0
- arctrl/py/fable_modules/fable_openpyxl/openpyxl.py +362 -0
- arctrl/py/fable_modules/fable_python/cognite-sdk/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/cognite-sdk/cognite_sdk.py +22 -0
- arctrl/py/fable_modules/fable_python/flask/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/flask/flask.py +34 -0
- arctrl/py/fable_modules/fable_python/jupyter/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/jupyter/ipy_widgets.py +47 -0
- arctrl/py/fable_modules/fable_python/jupyter/ipython.py +13 -0
- arctrl/py/fable_modules/fable_python/stdlib/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/stdlib/ast.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/__init__.py +0 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/events.py +17 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/futures.py +52 -0
- arctrl/py/fable_modules/fable_python/stdlib/asyncio/tasks.py +38 -0
- arctrl/py/fable_modules/fable_python/stdlib/base64_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/builtins_.py +38 -0
- arctrl/py/fable_modules/fable_python/stdlib/html.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/json.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/math_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/os_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/queue_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/string_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/sys_.py +30 -0
- arctrl/py/fable_modules/fable_python/stdlib/time_.py +1 -0
- arctrl/py/fable_modules/fable_python/stdlib/tk_inter.py +1 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cell.py +340 -0
- arctrl/py/fable_modules/fs_spreadsheet/Cells/fs_cells_collection.py +466 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/cell_builder.py +214 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/column_builder.py +139 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/dsl.py +50 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/expression.py +65 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/operators.py +9 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/row_builder.py +139 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/sheet_builder.py +118 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/table_builder.py +122 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/transform.py +463 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/types.py +314 -0
- arctrl/py/fable_modules/fs_spreadsheet/DSL/workbook_builder.py +106 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/cell.py +103 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/column.py +70 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/row.py +70 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/table.py +54 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/value.py +93 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/workbook.py +71 -0
- arctrl/py/fable_modules/fs_spreadsheet/Json/worksheet.py +216 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range.py +43 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_address.py +190 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_base.py +92 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_column.py +77 -0
- arctrl/py/fable_modules/fs_spreadsheet/Ranges/fs_range_row.py +48 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table.py +461 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_field.py +117 -0
- arctrl/py/fable_modules/fs_spreadsheet/Tables/fs_table_row.py +23 -0
- arctrl/py/fable_modules/fs_spreadsheet/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_address.py +236 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_column.py +172 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_row.py +183 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_workbook.py +192 -0
- arctrl/py/fable_modules/fs_spreadsheet/fs_worksheet.py +610 -0
- arctrl/py/fable_modules/fs_spreadsheet/hash_codes.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet/sheet_builder.py +329 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/__init__.py +0 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/cell.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/cell_type.py +50 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/fs_extension.py +60 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/json.py +47 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/table.py +54 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/workbook.py +41 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/worksheet.py +52 -0
- arctrl/py/fable_modules/fs_spreadsheet_py/xlsx.py +37 -0
- arctrl/py/fable_modules/siren/__init__.py +0 -0
- arctrl/py/fable_modules/siren/config.py +1038 -0
- arctrl/py/fable_modules/siren/formatting.py +1121 -0
- arctrl/py/fable_modules/siren/siren.py +1941 -0
- arctrl/py/fable_modules/siren/siren_types.py +1229 -0
- arctrl/py/fable_modules/siren/theme_variables.py +517 -0
- arctrl/py/fable_modules/siren/util.py +37 -0
- arctrl/py/fable_modules/siren/yaml.py +101 -0
- arctrl/py/fable_modules/thoth_json_core/__init__.py +0 -0
- arctrl/py/fable_modules/thoth_json_core/decode.py +1614 -0
- arctrl/py/fable_modules/thoth_json_core/encode.py +305 -0
- arctrl/py/fable_modules/thoth_json_core/types.py +181 -0
- arctrl/py/fable_modules/thoth_json_python/__init__.py +0 -0
- arctrl/py/fable_modules/thoth_json_python/decode.py +112 -0
- arctrl/py/fable_modules/thoth_json_python/encode.py +72 -0
- arctrl/py/fable_modules/thoth_json_python/python.py +1 -0
- arctrl/py/fable_modules/yamlicious/Interop/__init__.py +0 -0
- arctrl/py/fable_modules/yamlicious/Interop/js_interop.py +1 -0
- arctrl/py/fable_modules/yamlicious/Interop/py_interop.py +7 -0
- arctrl/py/fable_modules/yamlicious/__init__.py +0 -0
- arctrl/py/fable_modules/yamlicious/decode.py +1784 -0
- arctrl/py/fable_modules/yamlicious/encode.py +84 -0
- arctrl/py/fable_modules/yamlicious/flow_to_block.py +994 -0
- arctrl/py/fable_modules/yamlicious/library.py +10 -0
- arctrl/py/fable_modules/yamlicious/persil.py +57 -0
- arctrl/py/fable_modules/yamlicious/preprocessing.py +99 -0
- arctrl/py/fable_modules/yamlicious/reader.py +739 -0
- arctrl/py/fable_modules/yamlicious/regex.py +29 -0
- arctrl/py/fable_modules/yamlicious/regex_active_patterns.py +265 -0
- arctrl/py/fable_modules/yamlicious/writer.py +175 -0
- arctrl/py/fable_modules/yamlicious/yamlicious_types.py +128 -0
- arctrl/py/json.py +389 -0
- arctrl/py/license.py +169 -0
- arctrl/py/rocrate_io.py +242 -0
- arctrl/py/template_web.py +23 -0
- arctrl/py/xlsx.py +212 -0
- arctrl/py/yaml.py +79 -0
- arctrl/rocrate.py +21 -0
- arctrl-3.0.0.dist-info/METADATA +157 -0
- arctrl-3.0.0.dist-info/RECORD +511 -0
- arctrl-3.0.0.dist-info/WHEEL +4 -0
- arctrl-3.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import (Any, TypeVar)
|
|
3
|
+
from ...fable_modules.fable_library.list import (FSharpList, is_empty, length, head)
|
|
4
|
+
from ...fable_modules.fable_library.result import FSharpResult_2
|
|
5
|
+
from ...fable_modules.fable_library.seq import (map, append, to_list, delay, singleton, empty)
|
|
6
|
+
from ...fable_modules.fable_library.types import Array
|
|
7
|
+
from ...fable_modules.fable_library.util import (IEnumerable_1, get_enumerator)
|
|
8
|
+
from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IRequiredGetter, string, Getters_2__get_Errors, resize_array)
|
|
9
|
+
from ...fable_modules.thoth_json_core.encode import seq
|
|
10
|
+
from ...fable_modules.thoth_json_core.types import (Decoder_1, ErrorReason_1, IDecoderHelpers_1, IEncodable, IEncoderHelpers_1)
|
|
11
|
+
from ...ROCrate.ldcontext import LDContext
|
|
12
|
+
from ...ROCrate.rocrate_context import (init_v1_2, init_v1_1)
|
|
13
|
+
|
|
14
|
+
__A_ = TypeVar("__A_")
|
|
15
|
+
|
|
16
|
+
class ObjectExpr2571(Decoder_1[LDContext]):
|
|
17
|
+
def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any) -> FSharpResult_2[LDContext, tuple[str, ErrorReason_1[__A_]]]:
|
|
18
|
+
this: Decoder_1[LDContext] = self
|
|
19
|
+
if helpers.is_object(value):
|
|
20
|
+
getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
|
|
21
|
+
properties: IEnumerable_1[str] = helpers.get_properties(value)
|
|
22
|
+
result: LDContext
|
|
23
|
+
o: LDContext = LDContext()
|
|
24
|
+
with get_enumerator(properties) as enumerator:
|
|
25
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
26
|
+
property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
27
|
+
if (property != "@type") if (property != "@id") else False:
|
|
28
|
+
def _arrow2570(__unit: None=None) -> str:
|
|
29
|
+
object_arg: IRequiredGetter = getters.Required
|
|
30
|
+
return object_arg.Field(property, string)
|
|
31
|
+
|
|
32
|
+
o.AddMapping(property, _arrow2570())
|
|
33
|
+
|
|
34
|
+
result = o
|
|
35
|
+
match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
|
|
36
|
+
if not is_empty(match_value):
|
|
37
|
+
errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
|
|
38
|
+
return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
|
|
39
|
+
|
|
40
|
+
else:
|
|
41
|
+
return FSharpResult_2(0, result)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
elif helpers.is_string(value):
|
|
45
|
+
s: str = helpers.as_string(value)
|
|
46
|
+
return FSharpResult_2(0, init_v1_2()) if (True if (s == "https://w3id.org/ro/crate/1.2-DRAFT/context") else (s == "https://w3id.org/ro/crate/1.2/context")) else (FSharpResult_2(0, init_v1_1()) if (s == "https://w3id.org/ro/crate/1.1/context") else FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value))))
|
|
47
|
+
|
|
48
|
+
elif helpers.is_array(value):
|
|
49
|
+
match_value_1: FSharpResult_2[Array[LDContext], tuple[str, ErrorReason_1[__A_]]] = resize_array(this).Decode(helpers, value)
|
|
50
|
+
return FSharpResult_2(1, match_value_1.fields[0]) if (match_value_1.tag == 1) else FSharpResult_2(0, LDContext(None, match_value_1.fields[0]))
|
|
51
|
+
|
|
52
|
+
else:
|
|
53
|
+
return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
decoder: Decoder_1[LDContext] = ObjectExpr2571()
|
|
58
|
+
|
|
59
|
+
def encoder(ctx_mut: LDContext) -> IEncodable:
|
|
60
|
+
while True:
|
|
61
|
+
(ctx,) = (ctx_mut,)
|
|
62
|
+
match_value: str | None = ctx.Name
|
|
63
|
+
(pattern_matching_result,) = (None,)
|
|
64
|
+
if match_value is not None:
|
|
65
|
+
if match_value == "https://w3id.org/ro/crate/1.2-DRAFT/context":
|
|
66
|
+
pattern_matching_result = 0
|
|
67
|
+
|
|
68
|
+
elif match_value == "https://w3id.org/ro/crate/1.2/context":
|
|
69
|
+
pattern_matching_result = 1
|
|
70
|
+
|
|
71
|
+
elif match_value == "https://w3id.org/ro/crate/1.1/context":
|
|
72
|
+
pattern_matching_result = 2
|
|
73
|
+
|
|
74
|
+
else:
|
|
75
|
+
pattern_matching_result = 3
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
else:
|
|
79
|
+
pattern_matching_result = 3
|
|
80
|
+
|
|
81
|
+
if pattern_matching_result == 0:
|
|
82
|
+
class ObjectExpr2572(IEncodable):
|
|
83
|
+
def Encode(self, helpers: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
|
|
84
|
+
return helpers.encode_string("https://w3id.org/ro/crate/1.2-DRAFT/context")
|
|
85
|
+
|
|
86
|
+
return ObjectExpr2572()
|
|
87
|
+
|
|
88
|
+
elif pattern_matching_result == 1:
|
|
89
|
+
class ObjectExpr2573(IEncodable):
|
|
90
|
+
def Encode(self, helpers_1: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
|
|
91
|
+
return helpers_1.encode_string("https://w3id.org/ro/crate/1.2/context")
|
|
92
|
+
|
|
93
|
+
return ObjectExpr2573()
|
|
94
|
+
|
|
95
|
+
elif pattern_matching_result == 2:
|
|
96
|
+
class ObjectExpr2574(IEncodable):
|
|
97
|
+
def Encode(self, helpers_2: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
|
|
98
|
+
return helpers_2.encode_string("https://w3id.org/ro/crate/1.1/context")
|
|
99
|
+
|
|
100
|
+
return ObjectExpr2574()
|
|
101
|
+
|
|
102
|
+
elif pattern_matching_result == 3:
|
|
103
|
+
mappings: IEncodable
|
|
104
|
+
def mapping(kv: Any, ctx: Any=ctx) -> tuple[str, IEncodable]:
|
|
105
|
+
class ObjectExpr2575(IEncodable):
|
|
106
|
+
def Encode(self, helpers_3: IEncoderHelpers_1[Any], kv: Any=kv) -> Any:
|
|
107
|
+
return helpers_3.encode_string(kv[1])
|
|
108
|
+
|
|
109
|
+
return (kv[0], ObjectExpr2575())
|
|
110
|
+
|
|
111
|
+
values: IEnumerable_1[tuple[str, IEncodable]] = map(mapping, ctx.Mappings)
|
|
112
|
+
class ObjectExpr2576(IEncodable):
|
|
113
|
+
def Encode(self, helpers_4: IEncoderHelpers_1[Any], ctx: Any=ctx) -> Any:
|
|
114
|
+
def mapping_1(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
|
|
115
|
+
return (tupled_arg[0], tupled_arg[1].Encode(helpers_4))
|
|
116
|
+
|
|
117
|
+
arg: IEnumerable_1[tuple[str, __A_]] = map(mapping_1, values)
|
|
118
|
+
return helpers_4.encode_object(arg)
|
|
119
|
+
|
|
120
|
+
mappings = ObjectExpr2576()
|
|
121
|
+
if len(ctx.BaseContexts) == 0:
|
|
122
|
+
return mappings
|
|
123
|
+
|
|
124
|
+
elif (len(ctx.Mappings) == 0) if (len(ctx.BaseContexts) == 1) else False:
|
|
125
|
+
ctx_mut = ctx.BaseContexts[0]
|
|
126
|
+
continue
|
|
127
|
+
|
|
128
|
+
else:
|
|
129
|
+
def _arrow2578(__unit: None=None, ctx: Any=ctx) -> IEnumerable_1[IEncodable]:
|
|
130
|
+
source_4: IEnumerable_1[IEncodable] = map(encoder, ctx.BaseContexts)
|
|
131
|
+
def _arrow2577(__unit: None=None) -> IEnumerable_1[IEncodable]:
|
|
132
|
+
return singleton(mappings) if (len(ctx.Mappings) != 0) else empty()
|
|
133
|
+
|
|
134
|
+
return append(to_list(delay(_arrow2577)), source_4)
|
|
135
|
+
|
|
136
|
+
return seq(_arrow2578())
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
break
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
__all__ = ["decoder", "encoder"]
|
|
143
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import (Any, TypeVar)
|
|
3
|
+
from ...fable_modules.fable_library.list import (choose, FSharpList, is_empty, length, head)
|
|
4
|
+
from ...fable_modules.fable_library.option import map
|
|
5
|
+
from ...fable_modules.fable_library.result import FSharpResult_2
|
|
6
|
+
from ...fable_modules.fable_library.seq import (to_list, delay, append, singleton, collect, empty, map as map_1)
|
|
7
|
+
from ...fable_modules.fable_library.types import Array
|
|
8
|
+
from ...fable_modules.fable_library.util import (IEnumerable_1, get_enumerator, dispose)
|
|
9
|
+
from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IGetters, IOptionalGetter, string, resize_array, IRequiredGetter, Getters_2__get_Errors)
|
|
10
|
+
from ...fable_modules.thoth_json_core.encode import seq
|
|
11
|
+
from ...fable_modules.thoth_json_core.types import (IEncodable, IEncoderHelpers_1, Decoder_1, ErrorReason_1, IDecoderHelpers_1)
|
|
12
|
+
from ...ROCrate.ldcontext import LDContext
|
|
13
|
+
from ...ROCrate.ldobject import (LDNode, LDGraph)
|
|
14
|
+
from ..encode import try_include
|
|
15
|
+
from .ldcontext import (encoder as encoder_1, decoder as decoder_1)
|
|
16
|
+
from .ldnode import (generic_encoder, encoder as encoder_2, decoder as decoder_2, generic_decoder)
|
|
17
|
+
|
|
18
|
+
__A_ = TypeVar("__A_")
|
|
19
|
+
|
|
20
|
+
def encoder(obj: LDGraph) -> IEncodable:
|
|
21
|
+
def chooser(tupled_arg: tuple[str, IEncodable | None], obj: Any=obj) -> tuple[str, IEncodable] | None:
|
|
22
|
+
def mapping_1(v_1: IEncodable, tupled_arg: Any=tupled_arg) -> tuple[str, IEncodable]:
|
|
23
|
+
return (tupled_arg[0], v_1)
|
|
24
|
+
|
|
25
|
+
return map(mapping_1, tupled_arg[1])
|
|
26
|
+
|
|
27
|
+
def _arrow2627(__unit: None=None, obj: Any=obj) -> IEnumerable_1[tuple[str, IEncodable | None]]:
|
|
28
|
+
def _arrow2622(value: str) -> IEncodable:
|
|
29
|
+
class ObjectExpr2621(IEncodable):
|
|
30
|
+
def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
|
|
31
|
+
return helpers.encode_string(value)
|
|
32
|
+
|
|
33
|
+
return ObjectExpr2621()
|
|
34
|
+
|
|
35
|
+
def _arrow2626(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
|
|
36
|
+
def _arrow2625(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
|
|
37
|
+
def _arrow2623(kv: Any) -> IEnumerable_1[tuple[str, IEncodable | None]]:
|
|
38
|
+
l: str = kv[0].lower()
|
|
39
|
+
return singleton((kv[0], generic_encoder(kv[1]))) if ((l != "mappings") if ((l != "nodes") if ((l != "@context") if (l != "id") else False) else False) else False) else empty()
|
|
40
|
+
|
|
41
|
+
def _arrow2624(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable | None]]:
|
|
42
|
+
return singleton(("@graph", seq(map_1(encoder_2, obj.Nodes))))
|
|
43
|
+
|
|
44
|
+
return append(collect(_arrow2623, obj.GetProperties(True)), delay(_arrow2624))
|
|
45
|
+
|
|
46
|
+
return append(singleton(try_include("@context", encoder_1, obj.TryGetContext())), delay(_arrow2625))
|
|
47
|
+
|
|
48
|
+
return append(singleton(try_include("@id", _arrow2622, obj.Id)), delay(_arrow2626))
|
|
49
|
+
|
|
50
|
+
values_1: FSharpList[tuple[str, IEncodable]] = choose(chooser, to_list(delay(_arrow2627)))
|
|
51
|
+
class ObjectExpr2628(IEncodable):
|
|
52
|
+
def Encode(self, helpers_1: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
53
|
+
def mapping_2(tupled_arg_1: tuple[str, IEncodable]) -> tuple[str, __A_]:
|
|
54
|
+
return (tupled_arg_1[0], tupled_arg_1[1].Encode(helpers_1))
|
|
55
|
+
|
|
56
|
+
arg: IEnumerable_1[tuple[str, __A_]] = map_1(mapping_2, values_1)
|
|
57
|
+
return helpers_1.encode_object(arg)
|
|
58
|
+
|
|
59
|
+
return ObjectExpr2628()
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class ObjectExpr2630(Decoder_1[LDGraph]):
|
|
63
|
+
def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any) -> FSharpResult_2[LDGraph, tuple[str, ErrorReason_1[__A_]]]:
|
|
64
|
+
if helpers.is_object(value):
|
|
65
|
+
getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
|
|
66
|
+
properties: IEnumerable_1[str] = helpers.get_properties(value)
|
|
67
|
+
result: LDGraph
|
|
68
|
+
get: IGetters = getters
|
|
69
|
+
id: str | None
|
|
70
|
+
object_arg: IOptionalGetter = get.Optional
|
|
71
|
+
id = object_arg.Field("@id", string)
|
|
72
|
+
context: LDContext | None
|
|
73
|
+
object_arg_1: IOptionalGetter = get.Optional
|
|
74
|
+
context = object_arg_1.Field("@context", decoder_1)
|
|
75
|
+
nodes: Array[LDNode]
|
|
76
|
+
arg_5: Decoder_1[Array[LDNode]] = resize_array(decoder_2)
|
|
77
|
+
object_arg_2: IRequiredGetter = get.Required
|
|
78
|
+
nodes = object_arg_2.Field("@graph", arg_5)
|
|
79
|
+
o: LDGraph = LDGraph(id, None, context)
|
|
80
|
+
with get_enumerator(properties) as enumerator:
|
|
81
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
82
|
+
property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
83
|
+
if (property != "@context") if ((property != "@graph") if (property != "@id") else False) else False:
|
|
84
|
+
def _arrow2629(__unit: None=None) -> Any:
|
|
85
|
+
object_arg_3: IRequiredGetter = get.Required
|
|
86
|
+
return object_arg_3.Field(property, generic_decoder)
|
|
87
|
+
|
|
88
|
+
o.SetProperty(property, _arrow2629())
|
|
89
|
+
|
|
90
|
+
enumerator_1: Any = get_enumerator(nodes)
|
|
91
|
+
try:
|
|
92
|
+
while enumerator_1.System_Collections_IEnumerator_MoveNext():
|
|
93
|
+
node: LDNode = enumerator_1.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
94
|
+
o.AddNode(node)
|
|
95
|
+
|
|
96
|
+
finally:
|
|
97
|
+
dispose(enumerator_1)
|
|
98
|
+
|
|
99
|
+
result = o
|
|
100
|
+
match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
|
|
101
|
+
if not is_empty(match_value):
|
|
102
|
+
errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
|
|
103
|
+
return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
|
|
104
|
+
|
|
105
|
+
else:
|
|
106
|
+
return FSharpResult_2(0, result)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
else:
|
|
110
|
+
return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
decoder: Decoder_1[LDGraph] = ObjectExpr2630()
|
|
115
|
+
|
|
116
|
+
__all__ = ["encoder", "decoder"]
|
|
117
|
+
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from collections.abc import Callable
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from decimal import Decimal
|
|
5
|
+
from typing import (Any, TypeVar)
|
|
6
|
+
from ...fable_modules.fable_library.array_ import fold
|
|
7
|
+
from ...fable_modules.fable_library.list import (FSharpList, is_empty, length, head, of_array)
|
|
8
|
+
from ...fable_modules.fable_library.option import value as value_14
|
|
9
|
+
from ...fable_modules.fable_library.result import FSharpResult_2
|
|
10
|
+
from ...fable_modules.fable_library.seq import (to_list, delay, map, enumerate_from_functions, append, singleton, empty, collect)
|
|
11
|
+
from ...fable_modules.fable_library.string_ import starts_with_exact
|
|
12
|
+
from ...fable_modules.fable_library.types import Array
|
|
13
|
+
from ...fable_modules.fable_library.util import (equals, is_iterable, get_enumerator, IEnumerator, IEnumerable_1, int32_to_string)
|
|
14
|
+
from ...fable_modules.thoth_json_core.decode import (Getters_2__ctor_Z4BE6C149, Getters_2, IGetters, string, IRequiredGetter, IOptionalGetter, Getters_2__get_Errors, map as map_1, one_of, int_1, decimal, bool_1)
|
|
15
|
+
from ...fable_modules.thoth_json_core.encode import list_1
|
|
16
|
+
from ...fable_modules.thoth_json_core.types import (IEncodable, IEncoderHelpers_1, Decoder_1, ErrorReason_1, IDecoderHelpers_1)
|
|
17
|
+
from ...ROCrate.ldcontext import LDContext
|
|
18
|
+
from ...ROCrate.ldobject import (LDValue, LDRef, LDNode)
|
|
19
|
+
from ..decode import (Decode_resizeArrayOrSingleton, Helpers_prependPath)
|
|
20
|
+
from ..encode import (date_time, resize_array_or_singleton)
|
|
21
|
+
from .ldcontext import (encoder as encoder_3, decoder as decoder_1)
|
|
22
|
+
from .ldref import (encoder as encoder_2, decoder as decoder_3)
|
|
23
|
+
from .ldvalue import (encoder as encoder_1, decoder as decoder_2)
|
|
24
|
+
|
|
25
|
+
__A_ = TypeVar("__A_")
|
|
26
|
+
|
|
27
|
+
def generic_encoder(obj: Any=None) -> IEncodable:
|
|
28
|
+
if str(type(obj)) == "<class \'str\'>":
|
|
29
|
+
class ObjectExpr2579(IEncodable):
|
|
30
|
+
def Encode(self, helpers: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
31
|
+
return helpers.encode_string(obj)
|
|
32
|
+
|
|
33
|
+
return ObjectExpr2579()
|
|
34
|
+
|
|
35
|
+
elif str(type(obj)) == "<class \'int\'>":
|
|
36
|
+
class ObjectExpr2580(IEncodable):
|
|
37
|
+
def Encode(self, helpers_1: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
38
|
+
return helpers_1.encode_signed_integral_number(obj)
|
|
39
|
+
|
|
40
|
+
return ObjectExpr2580()
|
|
41
|
+
|
|
42
|
+
elif str(type(obj)) == "<class \'bool\'>":
|
|
43
|
+
class ObjectExpr2581(IEncodable):
|
|
44
|
+
def Encode(self, helpers_2: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
45
|
+
return helpers_2.encode_bool(obj)
|
|
46
|
+
|
|
47
|
+
return ObjectExpr2581()
|
|
48
|
+
|
|
49
|
+
elif str(type(obj)) == "<class \'float\'>":
|
|
50
|
+
class ObjectExpr2582(IEncodable):
|
|
51
|
+
def Encode(self, helpers_3: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
52
|
+
return helpers_3.encode_decimal_number(obj)
|
|
53
|
+
|
|
54
|
+
return ObjectExpr2582()
|
|
55
|
+
|
|
56
|
+
elif isinstance(obj, datetime):
|
|
57
|
+
return date_time(obj)
|
|
58
|
+
|
|
59
|
+
elif isinstance(obj, LDValue):
|
|
60
|
+
return encoder_1(obj)
|
|
61
|
+
|
|
62
|
+
elif isinstance(obj, LDRef):
|
|
63
|
+
return encoder_2(obj)
|
|
64
|
+
|
|
65
|
+
elif isinstance(obj, LDNode):
|
|
66
|
+
return encoder(obj)
|
|
67
|
+
|
|
68
|
+
elif equals(obj, None):
|
|
69
|
+
class ObjectExpr2583(IEncodable):
|
|
70
|
+
def Encode(self, helpers_4: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
71
|
+
return helpers_4.encode_null()
|
|
72
|
+
|
|
73
|
+
return ObjectExpr2583()
|
|
74
|
+
|
|
75
|
+
elif is_iterable(obj):
|
|
76
|
+
def _arrow2587(__unit: None=None, obj: Any=obj) -> IEnumerable_1[IEncodable]:
|
|
77
|
+
def _arrow2584(__unit: None=None) -> IEnumerator[Any]:
|
|
78
|
+
return get_enumerator(obj)
|
|
79
|
+
|
|
80
|
+
def _arrow2585(enumerator: IEnumerator[Any]) -> bool:
|
|
81
|
+
return enumerator.System_Collections_IEnumerator_MoveNext()
|
|
82
|
+
|
|
83
|
+
def _arrow2586(enumerator_1: IEnumerator[Any]) -> Any:
|
|
84
|
+
return enumerator_1.System_Collections_IEnumerator_get_Current()
|
|
85
|
+
|
|
86
|
+
return map(generic_encoder, enumerate_from_functions(_arrow2584, _arrow2585, _arrow2586))
|
|
87
|
+
|
|
88
|
+
return list_1(to_list(delay(_arrow2587)))
|
|
89
|
+
|
|
90
|
+
else:
|
|
91
|
+
raise Exception("Unknown type")
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def encoder(obj: LDNode) -> IEncodable:
|
|
96
|
+
def _arrow2600(__unit: None=None, obj: Any=obj) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
97
|
+
def _arrow2589(__unit: None=None) -> IEncodable:
|
|
98
|
+
value: str = obj.Id
|
|
99
|
+
class ObjectExpr2588(IEncodable):
|
|
100
|
+
def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
|
|
101
|
+
return helpers.encode_string(value)
|
|
102
|
+
|
|
103
|
+
return ObjectExpr2588()
|
|
104
|
+
|
|
105
|
+
def _arrow2599(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
106
|
+
def _arrow2591(value_1: str) -> IEncodable:
|
|
107
|
+
class ObjectExpr2590(IEncodable):
|
|
108
|
+
def Encode(self, helpers_1: IEncoderHelpers_1[Any]) -> Any:
|
|
109
|
+
return helpers_1.encode_string(value_1)
|
|
110
|
+
|
|
111
|
+
return ObjectExpr2590()
|
|
112
|
+
|
|
113
|
+
def _arrow2598(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
114
|
+
def _arrow2593(value_3: str) -> IEncodable:
|
|
115
|
+
class ObjectExpr2592(IEncodable):
|
|
116
|
+
def Encode(self, helpers_2: IEncoderHelpers_1[Any]) -> Any:
|
|
117
|
+
return helpers_2.encode_string(value_3)
|
|
118
|
+
|
|
119
|
+
return ObjectExpr2592()
|
|
120
|
+
|
|
121
|
+
def _arrow2597(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
122
|
+
def _arrow2594(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
123
|
+
match_value: LDContext | None = obj.TryGetContext()
|
|
124
|
+
if match_value is not None:
|
|
125
|
+
return singleton(("@context", encoder_3(match_value)))
|
|
126
|
+
|
|
127
|
+
else:
|
|
128
|
+
return empty()
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _arrow2596(__unit: None=None) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
132
|
+
def _arrow2595(kv: Any) -> IEnumerable_1[tuple[str, IEncodable]]:
|
|
133
|
+
l: str = kv[0].lower()
|
|
134
|
+
return singleton((kv[0], generic_encoder(kv[1]))) if ((not starts_with_exact(l, "init_")) if ((not starts_with_exact(l, "init@")) if ((l != "@context") if ((l != "additionaltype") if ((l != "schematype") if (l != "id") else False) else False) else False) else False) else False) else empty()
|
|
135
|
+
|
|
136
|
+
return collect(_arrow2595, obj.GetProperties(True))
|
|
137
|
+
|
|
138
|
+
return append(_arrow2594(), delay(_arrow2596))
|
|
139
|
+
|
|
140
|
+
return append(singleton(("additionalType", resize_array_or_singleton(_arrow2593, obj.AdditionalType))) if (len(obj.AdditionalType) != 0) else empty(), delay(_arrow2597))
|
|
141
|
+
|
|
142
|
+
return append(singleton(("@type", resize_array_or_singleton(_arrow2591, obj.SchemaType))), delay(_arrow2598))
|
|
143
|
+
|
|
144
|
+
return append(singleton(("@id", _arrow2589())), delay(_arrow2599))
|
|
145
|
+
|
|
146
|
+
values: FSharpList[tuple[str, IEncodable]] = to_list(delay(_arrow2600))
|
|
147
|
+
class ObjectExpr2601(IEncodable):
|
|
148
|
+
def Encode(self, helpers_3: IEncoderHelpers_1[Any], obj: Any=obj) -> Any:
|
|
149
|
+
def mapping(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
|
|
150
|
+
return (tupled_arg[0], tupled_arg[1].Encode(helpers_3))
|
|
151
|
+
|
|
152
|
+
arg: IEnumerable_1[tuple[str, __A_]] = map(mapping, values)
|
|
153
|
+
return helpers_3.encode_object(arg)
|
|
154
|
+
|
|
155
|
+
return ObjectExpr2601()
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
class ObjectExpr2602(Decoder_1[None]):
|
|
159
|
+
def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any) -> FSharpResult_2[None, tuple[str, ErrorReason_1[__A_]]]:
|
|
160
|
+
return FSharpResult_2(0, None) if helpers.is_null_value(value) else FSharpResult_2(1, ("", ErrorReason_1(0, "null", value)))
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
null_decoder: Decoder_1[None] = ObjectExpr2602()
|
|
164
|
+
|
|
165
|
+
def get_decoder(expect_object: bool) -> Decoder_1[Any]:
|
|
166
|
+
def decode(expect_object_1: bool, expect_object: Any=expect_object) -> Decoder_1[Any]:
|
|
167
|
+
class ObjectExpr2604(Decoder_1[LDNode]):
|
|
168
|
+
def Decode(self, helpers: IDecoderHelpers_1[Any], value: Any, expect_object_1: Any=expect_object_1) -> FSharpResult_2[LDNode, tuple[str, ErrorReason_1[__A_]]]:
|
|
169
|
+
if helpers.is_object(value):
|
|
170
|
+
getters: Getters_2[__A_, Any] = Getters_2__ctor_Z4BE6C149(helpers, value)
|
|
171
|
+
properties: IEnumerable_1[str] = helpers.get_properties(value)
|
|
172
|
+
result: LDNode
|
|
173
|
+
get: IGetters = getters
|
|
174
|
+
t: Array[str]
|
|
175
|
+
arg_1: Decoder_1[Array[str]] = Decode_resizeArrayOrSingleton(string)
|
|
176
|
+
object_arg: IRequiredGetter = get.Required
|
|
177
|
+
t = object_arg.Field("@type", arg_1)
|
|
178
|
+
id: str
|
|
179
|
+
object_arg_1: IRequiredGetter = get.Required
|
|
180
|
+
id = object_arg_1.Field("@id", string)
|
|
181
|
+
context: LDContext | None
|
|
182
|
+
object_arg_2: IOptionalGetter = get.Optional
|
|
183
|
+
context = object_arg_2.Field("@context", decoder_1)
|
|
184
|
+
def _arrow2603(__unit: None=None) -> Array[str] | None:
|
|
185
|
+
arg_7: Decoder_1[Array[str]] = Decode_resizeArrayOrSingleton(string)
|
|
186
|
+
object_arg_3: IOptionalGetter = get.Optional
|
|
187
|
+
return object_arg_3.Field("additionalType", arg_7)
|
|
188
|
+
|
|
189
|
+
o: LDNode = LDNode(id, t, _arrow2603())
|
|
190
|
+
with get_enumerator(properties) as enumerator:
|
|
191
|
+
while enumerator.System_Collections_IEnumerator_MoveNext():
|
|
192
|
+
property: str = enumerator.System_Collections_Generic_IEnumerator_1_get_Current()
|
|
193
|
+
if (property != "@context") if ((property != "@type") if (property != "@id") else False) else False:
|
|
194
|
+
r: Any
|
|
195
|
+
arg_9: Decoder_1[Any] = decode(False)
|
|
196
|
+
object_arg_4: IRequiredGetter = get.Required
|
|
197
|
+
r = object_arg_4.Field(property, arg_9)
|
|
198
|
+
if not equals(r, None):
|
|
199
|
+
o.SetProperty(property, r)
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
if context is not None:
|
|
203
|
+
o.SetContext(value_14(context))
|
|
204
|
+
|
|
205
|
+
result = o
|
|
206
|
+
match_value: FSharpList[tuple[str, ErrorReason_1[__A_]]] = Getters_2__get_Errors(getters)
|
|
207
|
+
if not is_empty(match_value):
|
|
208
|
+
errors: FSharpList[tuple[str, ErrorReason_1[__A_]]] = match_value
|
|
209
|
+
return FSharpResult_2(1, ("", ErrorReason_1(7, errors))) if (length(errors) > 1) else FSharpResult_2(1, head(match_value))
|
|
210
|
+
|
|
211
|
+
else:
|
|
212
|
+
return FSharpResult_2(0, result)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
else:
|
|
216
|
+
return FSharpResult_2(1, ("", ErrorReason_1(0, "an object", value)))
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
decode_object: Decoder_1[LDNode] = ObjectExpr2604()
|
|
220
|
+
class ObjectExpr2606(Decoder_1[Array[Any]]):
|
|
221
|
+
def Decode(self, helpers_1: IDecoderHelpers_1[Any], value_1: Any, expect_object_1: Any=expect_object_1) -> FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]]:
|
|
222
|
+
if helpers_1.is_array(value_1):
|
|
223
|
+
i: int = -1
|
|
224
|
+
def folder(acc: FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]], value_2: __A_) -> FSharpResult_2[Array[Any], tuple[str, ErrorReason_1[__A_]]]:
|
|
225
|
+
nonlocal i
|
|
226
|
+
i = (i + 1) or 0
|
|
227
|
+
if acc.tag == 0:
|
|
228
|
+
acc_1: Array[Any] = acc.fields[0]
|
|
229
|
+
match_value_1: FSharpResult_2[Any, tuple[str, ErrorReason_1[__A_]]]
|
|
230
|
+
copy_of_struct: Decoder_1[Any] = decode(False)
|
|
231
|
+
match_value_1 = copy_of_struct.Decode(helpers_1, value_2)
|
|
232
|
+
if match_value_1.tag == 0:
|
|
233
|
+
(acc_1.append(match_value_1.fields[0]))
|
|
234
|
+
return FSharpResult_2(0, acc_1)
|
|
235
|
+
|
|
236
|
+
else:
|
|
237
|
+
def _arrow2605(__unit: None=None, acc: Any=acc, value_2: Any=value_2) -> tuple[str, ErrorReason_1[__A_]]:
|
|
238
|
+
tupled_arg: tuple[str, ErrorReason_1[__A_]] = match_value_1.fields[0]
|
|
239
|
+
return Helpers_prependPath((".[" + int32_to_string(i)) + "]", tupled_arg[0], tupled_arg[1])
|
|
240
|
+
|
|
241
|
+
return FSharpResult_2(1, _arrow2605())
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
else:
|
|
245
|
+
return acc
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
return fold(folder, FSharpResult_2(0, []), helpers_1.as_array(value_1))
|
|
249
|
+
|
|
250
|
+
else:
|
|
251
|
+
return FSharpResult_2(1, ("", ErrorReason_1(0, "an array", value_1)))
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
resize_array: Decoder_1[Array[Any]] = ObjectExpr2606()
|
|
255
|
+
if expect_object_1:
|
|
256
|
+
def _arrow2607(value_4: LDNode, expect_object_1: Any=expect_object_1) -> Any:
|
|
257
|
+
return value_4
|
|
258
|
+
|
|
259
|
+
return map_1(_arrow2607, decode_object)
|
|
260
|
+
|
|
261
|
+
else:
|
|
262
|
+
def _arrow2609(value_5: LDValue, expect_object_1: Any=expect_object_1) -> Any:
|
|
263
|
+
return value_5
|
|
264
|
+
|
|
265
|
+
def _arrow2610(value_6: LDNode, expect_object_1: Any=expect_object_1) -> Any:
|
|
266
|
+
return value_6
|
|
267
|
+
|
|
268
|
+
def _arrow2611(value_7: LDRef, expect_object_1: Any=expect_object_1) -> Any:
|
|
269
|
+
return value_7
|
|
270
|
+
|
|
271
|
+
def _arrow2612(value_8: Array[Any], expect_object_1: Any=expect_object_1) -> Any:
|
|
272
|
+
return value_8
|
|
273
|
+
|
|
274
|
+
def _arrow2613(value_9: str, expect_object_1: Any=expect_object_1) -> Any:
|
|
275
|
+
return value_9
|
|
276
|
+
|
|
277
|
+
def _arrow2614(value_10: int, expect_object_1: Any=expect_object_1) -> Any:
|
|
278
|
+
return value_10
|
|
279
|
+
|
|
280
|
+
def _arrow2615(value_11: Decimal, expect_object_1: Any=expect_object_1) -> Any:
|
|
281
|
+
return value_11
|
|
282
|
+
|
|
283
|
+
def _arrow2616(value_12: bool, expect_object_1: Any=expect_object_1) -> Any:
|
|
284
|
+
return value_12
|
|
285
|
+
|
|
286
|
+
def _arrow2617(__unit: None=None, expect_object_1: Any=expect_object_1) -> Any:
|
|
287
|
+
return None
|
|
288
|
+
|
|
289
|
+
return one_of(of_array([map_1(_arrow2609, decoder_2), map_1(_arrow2610, decode_object), map_1(_arrow2611, decoder_3), map_1(_arrow2612, resize_array), map_1(_arrow2613, string), map_1(_arrow2614, int_1), map_1(_arrow2615, decimal), map_1(_arrow2616, bool_1), map_1(_arrow2617, null_decoder)]))
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
return decode(expect_object)
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
def _arrow2618(value: Any=None) -> LDNode:
|
|
296
|
+
return value
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
decoder: Decoder_1[LDNode] = map_1(_arrow2618, get_decoder(True))
|
|
300
|
+
|
|
301
|
+
generic_decoder: Decoder_1[Any] = get_decoder(False)
|
|
302
|
+
|
|
303
|
+
__all__ = ["generic_encoder", "encoder", "null_decoder", "get_decoder", "decoder", "generic_decoder"]
|
|
304
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
from typing import (Any, TypeVar)
|
|
3
|
+
from ...fable_modules.fable_library.list import (singleton, FSharpList)
|
|
4
|
+
from ...fable_modules.fable_library.seq import map
|
|
5
|
+
from ...fable_modules.fable_library.util import IEnumerable_1
|
|
6
|
+
from ...fable_modules.thoth_json_core.decode import (object, IRequiredGetter, string, IGetters)
|
|
7
|
+
from ...fable_modules.thoth_json_core.types import (Decoder_1, IEncodable, IEncoderHelpers_1)
|
|
8
|
+
from ...ROCrate.ldobject import LDRef
|
|
9
|
+
|
|
10
|
+
__A_ = TypeVar("__A_")
|
|
11
|
+
|
|
12
|
+
def _arrow2552(decoders: IGetters) -> LDRef:
|
|
13
|
+
def _arrow2551(__unit: None=None) -> str:
|
|
14
|
+
object_arg: IRequiredGetter = decoders.Required
|
|
15
|
+
return object_arg.Field("@id", string)
|
|
16
|
+
|
|
17
|
+
return LDRef(_arrow2551())
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
decoder: Decoder_1[LDRef] = object(_arrow2552)
|
|
21
|
+
|
|
22
|
+
def encoder(r: LDRef) -> IEncodable:
|
|
23
|
+
def _arrow2554(__unit: None=None, r: Any=r) -> IEncodable:
|
|
24
|
+
value: str = r.Id
|
|
25
|
+
class ObjectExpr2553(IEncodable):
|
|
26
|
+
def Encode(self, helpers: IEncoderHelpers_1[Any]) -> Any:
|
|
27
|
+
return helpers.encode_string(value)
|
|
28
|
+
|
|
29
|
+
return ObjectExpr2553()
|
|
30
|
+
|
|
31
|
+
values: FSharpList[tuple[str, IEncodable]] = singleton(("@id", _arrow2554()))
|
|
32
|
+
class ObjectExpr2555(IEncodable):
|
|
33
|
+
def Encode(self, helpers_1: IEncoderHelpers_1[Any], r: Any=r) -> Any:
|
|
34
|
+
def mapping(tupled_arg: tuple[str, IEncodable]) -> tuple[str, __A_]:
|
|
35
|
+
return (tupled_arg[0], tupled_arg[1].Encode(helpers_1))
|
|
36
|
+
|
|
37
|
+
arg: IEnumerable_1[tuple[str, __A_]] = map(mapping, values)
|
|
38
|
+
return helpers_1.encode_object(arg)
|
|
39
|
+
|
|
40
|
+
return ObjectExpr2555()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
__all__ = ["decoder", "encoder"]
|
|
44
|
+
|