@pikaa-ai/pikaa 0.3.1 → 0.3.4
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.
- package/dist/cli.js +1169 -601
- package/dist/index.js +525 -204
- package/package.json +5 -3
- package/skills/adaptyv/references/api-endpoints.md +0 -690
- package/skills/aeon/references/anomaly_detection.md +0 -154
- package/skills/aeon/references/classification.md +0 -144
- package/skills/aeon/references/clustering.md +0 -123
- package/skills/aeon/references/datasets_benchmarking.md +0 -392
- package/skills/aeon/references/distances.md +0 -256
- package/skills/aeon/references/forecasting.md +0 -109
- package/skills/aeon/references/networks.md +0 -289
- package/skills/aeon/references/regression.md +0 -118
- package/skills/aeon/references/segmentation.md +0 -163
- package/skills/aeon/references/similarity_search.md +0 -187
- package/skills/aeon/references/transformations.md +0 -246
- package/skills/analytical-method-validation/assets/validation-protocol-template.md +0 -106
- package/skills/analytical-method-validation/assets/validation-report-template.md +0 -116
- package/skills/analytical-method-validation/references/compendial-and-clsi.md +0 -96
- package/skills/analytical-method-validation/references/framework-selection.md +0 -87
- package/skills/analytical-method-validation/references/ich-m10-bioanalytical.md +0 -123
- package/skills/analytical-method-validation/references/ich-q2r2.md +0 -229
- package/skills/analytical-method-validation/references/source-ledger.md +0 -125
- package/skills/analytical-method-validation/references/statistics.md +0 -209
- package/skills/analytical-method-validation/scripts/_catalog.py +0 -499
- package/skills/analytical-method-validation/scripts/_common.py +0 -955
- package/skills/analytical-method-validation/scripts/check_accuracy_precision.py +0 -328
- package/skills/analytical-method-validation/scripts/check_bioanalytical_run.py +0 -293
- package/skills/analytical-method-validation/scripts/check_detection_limits.py +0 -310
- package/skills/analytical-method-validation/scripts/check_response.py +0 -243
- package/skills/analytical-method-validation/scripts/compare_methods.py +0 -215
- package/skills/analytical-method-validation/scripts/plan_validation.py +0 -381
- package/skills/anndata/references/best_practices.md +0 -532
- package/skills/anndata/references/concatenation.md +0 -399
- package/skills/anndata/references/data_structure.md +0 -314
- package/skills/anndata/references/io_operations.md +0 -466
- package/skills/anndata/references/manipulation.md +0 -516
- package/skills/arbor/references/arbor-upstream.md +0 -91
- package/skills/arbor/references/executor-brief.md +0 -68
- package/skills/arbor/references/htr-methodology.md +0 -177
- package/skills/arbor/references/report-template.md +0 -39
- package/skills/arbor/scripts/tree.py +0 -564
- package/skills/arboreto/references/algorithms.md +0 -152
- package/skills/arboreto/references/basic_inference.md +0 -181
- package/skills/arboreto/references/distributed_computing.md +0 -242
- package/skills/arboreto/scripts/basic_grn_inference.py +0 -107
- package/skills/astropy/references/coordinates.md +0 -280
- package/skills/astropy/references/cosmology.md +0 -309
- package/skills/astropy/references/fits.md +0 -398
- package/skills/astropy/references/tables.md +0 -495
- package/skills/astropy/references/time.md +0 -412
- package/skills/astropy/references/units.md +0 -178
- package/skills/astropy/references/wcs_and_other_modules.md +0 -377
- package/skills/autoskill/config.yaml +0 -53
- package/skills/autoskill/references/https-proxy.md +0 -62
- package/skills/autoskill/references/screenpipe-config.yaml +0 -61
- package/skills/autoskill/scripts/autoskill.py +0 -35
- package/skills/autoskill/scripts/backends.py +0 -116
- package/skills/autoskill/scripts/cluster.py +0 -54
- package/skills/autoskill/scripts/doctor.py +0 -108
- package/skills/autoskill/scripts/fetch_window.py +0 -33
- package/skills/autoskill/scripts/match_skills.py +0 -46
- package/skills/autoskill/scripts/promote.py +0 -58
- package/skills/autoskill/scripts/redact.py +0 -40
- package/skills/autoskill/scripts/run.py +0 -194
- package/skills/autoskill/scripts/synthesize.py +0 -72
- package/skills/benchling-integration/references/api_endpoints.md +0 -883
- package/skills/benchling-integration/references/authentication.md +0 -390
- package/skills/benchling-integration/references/core_capabilities.md +0 -355
- package/skills/benchling-integration/references/eventbridge.md +0 -255
- package/skills/benchling-integration/references/sdk_reference.md +0 -772
- package/skills/bids/references/beps.yml +0 -637
- package/skills/bids/references/bids_schema.json +0 -21015
- package/skills/bids/references/bids_specification.md +0 -165
- package/skills/bids/references/conversion_tools.md +0 -475
- package/skills/bids/references/core_workflows.md +0 -552
- package/skills/bids/references/metadata_fields.md +0 -365
- package/skills/bids/scripts/update_schema.py +0 -89
- package/skills/biopython/references/advanced.md +0 -580
- package/skills/biopython/references/alignment.md +0 -377
- package/skills/biopython/references/blast.md +0 -463
- package/skills/biopython/references/databases.md +0 -492
- package/skills/biopython/references/phylogenetics.md +0 -566
- package/skills/biopython/references/sequence_io.md +0 -289
- package/skills/biopython/references/structure.md +0 -564
- package/skills/bioservices/references/identifier_mapping.md +0 -685
- package/skills/bioservices/references/services_reference.md +0 -638
- package/skills/bioservices/references/workflow_patterns.md +0 -813
- package/skills/bioservices/scripts/batch_id_converter.py +0 -347
- package/skills/bioservices/scripts/compound_cross_reference.py +0 -387
- package/skills/bioservices/scripts/pathway_analysis.py +0 -309
- package/skills/bioservices/scripts/protein_analysis_workflow.py +0 -441
- package/skills/bulk-rnaseq/references/counts-and-handoff.md +0 -91
- package/skills/bulk-rnaseq/references/design-and-qc.md +0 -68
- package/skills/bulk-rnaseq/references/upstream-manual.md +0 -128
- package/skills/bulk-rnaseq/references/upstream-nfcore.md +0 -108
- package/skills/bulk-rnaseq/scripts/build_counts_matrix.py +0 -203
- package/skills/bulk-rnaseq/scripts/validate_samplesheet.py +0 -206
- package/skills/cellxgene-census/references/census_schema.md +0 -218
- package/skills/cellxgene-census/references/common_patterns.md +0 -368
- package/skills/cellxgene-census/references/core_workflow_patterns.md +0 -297
- package/skills/cirq/references/building.md +0 -307
- package/skills/cirq/references/experiments.md +0 -572
- package/skills/cirq/references/hardware.md +0 -527
- package/skills/cirq/references/noise.md +0 -514
- package/skills/cirq/references/simulation.md +0 -353
- package/skills/cirq/references/transformation.md +0 -416
- package/skills/citation-management/assets/bibtex_template.bib +0 -264
- package/skills/citation-management/assets/citation_checklist.md +0 -386
- package/skills/citation-management/references/best_practices.md +0 -91
- package/skills/citation-management/references/bibtex_formatting.md +0 -908
- package/skills/citation-management/references/citation_validation.md +0 -835
- package/skills/citation-management/references/core_workflow.md +0 -569
- package/skills/citation-management/references/example_workflows.md +0 -126
- package/skills/citation-management/references/google_scholar_search.md +0 -732
- package/skills/citation-management/references/metadata_extraction.md +0 -870
- package/skills/citation-management/references/pubmed_search.md +0 -839
- package/skills/citation-management/references/script_reference.md +0 -250
- package/skills/citation-management/references/search_strategies.md +0 -110
- package/skills/citation-management/scripts/_common.py +0 -331
- package/skills/citation-management/scripts/doi_to_bibtex.py +0 -204
- package/skills/citation-management/scripts/extract_metadata.py +0 -690
- package/skills/citation-management/scripts/format_bibtex.py +0 -356
- package/skills/citation-management/scripts/search_google_scholar.py +0 -268
- package/skills/citation-management/scripts/search_openalex.py +0 -297
- package/skills/citation-management/scripts/search_pubmed.py +0 -419
- package/skills/citation-management/scripts/validate_citations.py +0 -688
- package/skills/clinical-decision-support/assets/aggregate_cohort_table_template.json +0 -114
- package/skills/clinical-decision-support/assets/aggregate_model_evaluation_template.json +0 -115
- package/skills/clinical-decision-support/assets/artifact_intended_use_template.json +0 -81
- package/skills/clinical-decision-support/assets/decision_logic_traceability_template.json +0 -108
- package/skills/clinical-decision-support/assets/deidentification_checklist_template.json +0 -176
- package/skills/clinical-decision-support/assets/evidence_profile_template.json +0 -139
- package/skills/clinical-decision-support/assets/survival_analysis_plan_template.json +0 -134
- package/skills/clinical-decision-support/references/cohort_evaluation.md +0 -142
- package/skills/clinical-decision-support/references/decision_logic_traceability.md +0 -146
- package/skills/clinical-decision-support/references/evidence_profiles.md +0 -153
- package/skills/clinical-decision-support/references/model_biomarker_evaluation.md +0 -152
- package/skills/clinical-decision-support/references/privacy_and_disclosure.md +0 -144
- package/skills/clinical-decision-support/references/regulatory_and_governance.md +0 -104
- package/skills/clinical-decision-support/references/safety_and_scope.md +0 -103
- package/skills/clinical-decision-support/references/security_validation.md +0 -60
- package/skills/clinical-decision-support/references/sources.md +0 -119
- package/skills/clinical-decision-support/references/study_reporting.md +0 -134
- package/skills/clinical-decision-support/references/survival_analysis.md +0 -156
- package/skills/clinical-decision-support/scripts/_common.py +0 -223
- package/skills/clinical-decision-support/scripts/cohort_table_generator.py +0 -288
- package/skills/clinical-decision-support/scripts/decision_logic_traceability.py +0 -313
- package/skills/clinical-decision-support/scripts/deidentification_checklist.py +0 -260
- package/skills/clinical-decision-support/scripts/evidence_profile_check.py +0 -259
- package/skills/clinical-decision-support/scripts/model_biomarker_evaluation.py +0 -345
- package/skills/clinical-decision-support/scripts/survival_plan_validator.py +0 -294
- package/skills/clinical-decision-support/scripts/validate_cds_artifact.py +0 -269
- package/skills/clinical-reports/assets/adverse_event_aggregate_input_template.csv +0 -1
- package/skills/clinical-reports/assets/case_report_template.json +0 -43
- package/skills/clinical-reports/assets/clinical_trial_csr_template.json +0 -51
- package/skills/clinical-reports/assets/clinical_trial_results_template.json +0 -66
- package/skills/clinical-reports/assets/clinical_trial_safety_aggregate_template.json +0 -49
- package/skills/clinical-reports/assets/consistency_manifest_template.json +0 -15
- package/skills/clinical-reports/assets/deidentification_process_checklist.json +0 -56
- package/skills/clinical-reports/assets/lab_report_template.json +0 -36
- package/skills/clinical-reports/assets/pathology_report_template.json +0 -36
- package/skills/clinical-reports/assets/provenance_manifest_template.json +0 -17
- package/skills/clinical-reports/assets/quality_review_checklist.json +0 -34
- package/skills/clinical-reports/assets/radiology_report_template.json +0 -34
- package/skills/clinical-reports/assets/research_summary_template.json +0 -36
- package/skills/clinical-reports/assets/terminology_manifest_template.json +0 -11
- package/skills/clinical-reports/assets/trial_protocol_reporting_checklist.json +0 -70
- package/skills/clinical-reports/references/case_report_guidelines.md +0 -72
- package/skills/clinical-reports/references/clinical_trial_reporting.md +0 -97
- package/skills/clinical-reports/references/data_presentation.md +0 -92
- package/skills/clinical-reports/references/diagnostic_reports_standards.md +0 -76
- package/skills/clinical-reports/references/medical_terminology.md +0 -84
- package/skills/clinical-reports/references/privacy_and_deidentification.md +0 -84
- package/skills/clinical-reports/references/professional_review.md +0 -78
- package/skills/clinical-reports/references/report_type_routing.md +0 -57
- package/skills/clinical-reports/references/safety_reporting.md +0 -109
- package/skills/clinical-reports/references/sources.md +0 -75
- package/skills/clinical-reports/scripts/_common.py +0 -263
- package/skills/clinical-reports/scripts/check_deidentification.py +0 -298
- package/skills/clinical-reports/scripts/consistency_checker.py +0 -390
- package/skills/clinical-reports/scripts/format_adverse_events.py +0 -455
- package/skills/clinical-reports/scripts/generate_report_template.py +0 -115
- package/skills/clinical-reports/scripts/provenance_validator.py +0 -263
- package/skills/clinical-reports/scripts/terminology_validator.py +0 -277
- package/skills/clinical-reports/scripts/validate_case_report.py +0 -278
- package/skills/clinical-reports/scripts/validate_trial_report.py +0 -534
- package/skills/cobrapy/references/api_quick_reference.md +0 -665
- package/skills/cobrapy/references/workflows.md +0 -600
- package/skills/consciousness-council/references/advanced-configurations.md +0 -96
- package/skills/dask/references/arrays.md +0 -495
- package/skills/dask/references/bags.md +0 -468
- package/skills/dask/references/best-practices.md +0 -277
- package/skills/dask/references/dataframes.md +0 -370
- package/skills/dask/references/futures.md +0 -541
- package/skills/dask/references/schedulers.md +0 -517
- package/skills/database-lookup/references/addgene.md +0 -38
- package/skills/database-lookup/references/alphafold.md +0 -52
- package/skills/database-lookup/references/alphavantage.md +0 -261
- package/skills/database-lookup/references/bea.md +0 -409
- package/skills/database-lookup/references/bindingdb.md +0 -85
- package/skills/database-lookup/references/biogrid.md +0 -110
- package/skills/database-lookup/references/bls.md +0 -235
- package/skills/database-lookup/references/brenda.md +0 -71
- package/skills/database-lookup/references/cbioportal.md +0 -206
- package/skills/database-lookup/references/census.md +0 -251
- package/skills/database-lookup/references/chebi.md +0 -103
- package/skills/database-lookup/references/chembl.md +0 -80
- package/skills/database-lookup/references/clinicaltrials.md +0 -86
- package/skills/database-lookup/references/clinpgx.md +0 -64
- package/skills/database-lookup/references/clinvar.md +0 -91
- package/skills/database-lookup/references/cod.md +0 -121
- package/skills/database-lookup/references/cosmic.md +0 -59
- package/skills/database-lookup/references/dailymed.md +0 -65
- package/skills/database-lookup/references/database_selection_guide.md +0 -166
- package/skills/database-lookup/references/datacommons.md +0 -237
- package/skills/database-lookup/references/dbsnp.md +0 -143
- package/skills/database-lookup/references/disgenet.md +0 -52
- package/skills/database-lookup/references/drugbank.md +0 -54
- package/skills/database-lookup/references/ecb.md +0 -191
- package/skills/database-lookup/references/emdb.md +0 -37
- package/skills/database-lookup/references/ena.md +0 -372
- package/skills/database-lookup/references/encode.md +0 -47
- package/skills/database-lookup/references/ensembl.md +0 -539
- package/skills/database-lookup/references/epa.md +0 -232
- package/skills/database-lookup/references/eurostat.md +0 -237
- package/skills/database-lookup/references/fda.md +0 -64
- package/skills/database-lookup/references/federal-reserve.md +0 -216
- package/skills/database-lookup/references/fred.md +0 -297
- package/skills/database-lookup/references/gene-ontology.md +0 -147
- package/skills/database-lookup/references/geo.md +0 -130
- package/skills/database-lookup/references/gnomad.md +0 -93
- package/skills/database-lookup/references/gtex.md +0 -136
- package/skills/database-lookup/references/gwas-catalog.md +0 -46
- package/skills/database-lookup/references/hca.md +0 -35
- package/skills/database-lookup/references/hpo.md +0 -48
- package/skills/database-lookup/references/human-protein-atlas.md +0 -57
- package/skills/database-lookup/references/interpro.md +0 -120
- package/skills/database-lookup/references/jaspar.md +0 -50
- package/skills/database-lookup/references/kegg.md +0 -78
- package/skills/database-lookup/references/lincs-l1000.md +0 -68
- package/skills/database-lookup/references/materials-project.md +0 -123
- package/skills/database-lookup/references/metabolomics-workbench.md +0 -98
- package/skills/database-lookup/references/monarch.md +0 -46
- package/skills/database-lookup/references/mousemine.md +0 -40
- package/skills/database-lookup/references/nasa-exoplanet-archive.md +0 -112
- package/skills/database-lookup/references/nasa.md +0 -121
- package/skills/database-lookup/references/ncbi-gene.md +0 -64
- package/skills/database-lookup/references/ncbi-protein.md +0 -104
- package/skills/database-lookup/references/ncbi-taxonomy.md +0 -121
- package/skills/database-lookup/references/nist.md +0 -105
- package/skills/database-lookup/references/noaa.md +0 -199
- package/skills/database-lookup/references/omim.md +0 -114
- package/skills/database-lookup/references/opentargets.md +0 -459
- package/skills/database-lookup/references/openweathermap.md +0 -255
- package/skills/database-lookup/references/pdb.md +0 -121
- package/skills/database-lookup/references/pride.md +0 -74
- package/skills/database-lookup/references/pubchem.md +0 -145
- package/skills/database-lookup/references/quickgo.md +0 -45
- package/skills/database-lookup/references/reactome.md +0 -140
- package/skills/database-lookup/references/retrieval-contract.md +0 -123
- package/skills/database-lookup/references/rummageo.md +0 -32
- package/skills/database-lookup/references/sdss.md +0 -130
- package/skills/database-lookup/references/sec-edgar.md +0 -315
- package/skills/database-lookup/references/simbad.md +0 -405
- package/skills/database-lookup/references/sra.md +0 -149
- package/skills/database-lookup/references/string.md +0 -283
- package/skills/database-lookup/references/tcga-gdc.md +0 -58
- package/skills/database-lookup/references/treasury.md +0 -215
- package/skills/database-lookup/references/ucsc-genome.md +0 -135
- package/skills/database-lookup/references/uniprot.md +0 -283
- package/skills/database-lookup/references/usgs.md +0 -260
- package/skills/database-lookup/references/uspto.md +0 -130
- package/skills/database-lookup/references/who.md +0 -283
- package/skills/database-lookup/references/worldbank.md +0 -239
- package/skills/database-lookup/references/zinc.md +0 -202
- package/skills/datamol/references/conformers_module.md +0 -131
- package/skills/datamol/references/core_api.md +0 -136
- package/skills/datamol/references/core_workflows.md +0 -451
- package/skills/datamol/references/descriptors_viz.md +0 -195
- package/skills/datamol/references/fragments_scaffolds.md +0 -174
- package/skills/datamol/references/io_module.md +0 -112
- package/skills/datamol/references/reactions_data.md +0 -218
- package/skills/datamol/references/workflow_patterns.md +0 -104
- package/skills/deepchem/references/api_reference.md +0 -305
- package/skills/deepchem/references/core_capabilities.md +0 -276
- package/skills/deepchem/references/typical_workflows.md +0 -109
- package/skills/deepchem/references/workflows.md +0 -491
- package/skills/deepchem/scripts/graph_neural_network.py +0 -350
- package/skills/deepchem/scripts/predict_solubility.py +0 -223
- package/skills/deepchem/scripts/transfer_learning.py +0 -443
- package/skills/deepspot-m/references/api.md +0 -186
- package/skills/deepspot-m/references/whole_slide.md +0 -174
- package/skills/deeptools/assets/quick_reference.md +0 -65
- package/skills/deeptools/references/core_workflows.md +0 -134
- package/skills/deeptools/references/effective_genome_sizes.md +0 -118
- package/skills/deeptools/references/normalization_methods.md +0 -424
- package/skills/deeptools/references/tools_reference.md +0 -569
- package/skills/deeptools/references/workflows.md +0 -476
- package/skills/deeptools/scripts/validate_files.py +0 -195
- package/skills/deeptools/scripts/workflow_generator.py +0 -520
- package/skills/depmap/references/dependency_analysis.md +0 -178
- package/skills/dhdna-profiler/references/advanced-profiling.md +0 -72
- package/skills/diffdock/assets/batch_template.csv +0 -4
- package/skills/diffdock/assets/custom_inference_config.yaml +0 -94
- package/skills/diffdock/references/confidence_and_limitations.md +0 -182
- package/skills/diffdock/references/parameters_reference.md +0 -173
- package/skills/diffdock/references/workflows_examples.md +0 -401
- package/skills/diffdock/scripts/analyze_results.py +0 -346
- package/skills/diffdock/scripts/prepare_batch_csv.py +0 -257
- package/skills/diffdock/scripts/setup_check.py +0 -283
- package/skills/dnanexus-integration/references/app-development.md +0 -371
- package/skills/dnanexus-integration/references/authentication.md +0 -226
- package/skills/dnanexus-integration/references/configuration.md +0 -444
- package/skills/dnanexus-integration/references/data-operations.md +0 -474
- package/skills/dnanexus-integration/references/job-execution.md +0 -482
- package/skills/dnanexus-integration/references/operations-and-troubleshooting.md +0 -506
- package/skills/dnanexus-integration/references/python-sdk.md +0 -548
- package/skills/dnanexus-integration/references/sources.md +0 -168
- package/skills/dnanexus-integration/references/workflow-languages.md +0 -292
- package/skills/dnanexus-integration/scripts/inspect_dxpy.py +0 -366
- package/skills/dnanexus-integration/scripts/validate_dxapp.py +0 -796
- package/skills/docx/LICENSE.txt +0 -30
- package/skills/docx/scripts/__init__.py +0 -1
- package/skills/docx/scripts/accept_changes.py +0 -135
- package/skills/docx/scripts/comment.py +0 -368
- package/skills/docx/scripts/merge_runs.py +0 -310
- package/skills/docx/scripts/office/helpers/__init__.py +0 -111
- package/skills/docx/scripts/office/helpers/pptx_chart.py +0 -170
- package/skills/docx/scripts/office/helpers/pptx_slide.py +0 -60
- package/skills/docx/scripts/office/helpers/pptx_theme.py +0 -114
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/skills/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/skills/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/skills/docx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/skills/docx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/skills/docx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/skills/docx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/skills/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/skills/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/skills/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/skills/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/skills/docx/scripts/office/soffice.py +0 -232
- package/skills/docx/scripts/office/validate.py +0 -173
- package/skills/docx/scripts/office/validators/__init__.py +0 -15
- package/skills/docx/scripts/office/validators/base.py +0 -875
- package/skills/docx/scripts/office/validators/docx.py +0 -466
- package/skills/docx/scripts/office/validators/pptx.py +0 -441
- package/skills/docx/scripts/office/validators/redlining.py +0 -299
- package/skills/docx/scripts/templates/comments.xml +0 -3
- package/skills/docx/scripts/templates/commentsExtended.xml +0 -3
- package/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
- package/skills/docx/scripts/templates/commentsIds.xml +0 -3
- package/skills/docx/scripts/templates/people.xml +0 -3
- package/skills/esm/references/biohub-platform.md +0 -111
- package/skills/esm/references/esm-c-api.md +0 -609
- package/skills/esm/references/esm3-api.md +0 -462
- package/skills/esm/references/forge-api.md +0 -675
- package/skills/esm/references/workflows.md +0 -685
- package/skills/etetoolkit/references/api_reference.md +0 -546
- package/skills/etetoolkit/references/migration-ete3-to-ete4.md +0 -579
- package/skills/etetoolkit/references/taxonomy.md +0 -362
- package/skills/etetoolkit/references/visualization.md +0 -516
- package/skills/etetoolkit/references/workflows.md +0 -537
- package/skills/etetoolkit/scripts/quick_visualize.py +0 -455
- package/skills/etetoolkit/scripts/tree_operations.py +0 -446
- package/skills/exa-search/references/web-extract.md +0 -53
- package/skills/exa-search/references/web-search.md +0 -119
- package/skills/exa-search/scripts/exa_extract.py +0 -117
- package/skills/exa-search/scripts/exa_search.py +0 -179
- package/skills/experimental-design/references/design_types.md +0 -129
- package/skills/experimental-design/references/factorial_and_doe.md +0 -130
- package/skills/experimental-design/references/randomization_and_blocking.md +0 -116
- package/skills/experimental-design/references/sequential_and_adaptive.md +0 -97
- package/skills/experimental-design/scripts/doe_designs.py +0 -183
- package/skills/experimental-design/scripts/randomization.py +0 -171
- package/skills/exploratory-data-analysis/assets/report_template.md +0 -202
- package/skills/exploratory-data-analysis/references/bioinformatics_genomics_formats.md +0 -192
- package/skills/exploratory-data-analysis/references/chemistry_molecular_formats.md +0 -183
- package/skills/exploratory-data-analysis/references/general_scientific_formats.md +0 -259
- package/skills/exploratory-data-analysis/references/microscopy_imaging_formats.md +0 -189
- package/skills/exploratory-data-analysis/references/proteomics_metabolomics_formats.md +0 -217
- package/skills/exploratory-data-analysis/references/spectroscopy_analytical_formats.md +0 -191
- package/skills/exploratory-data-analysis/scripts/__init__.py +0 -1
- package/skills/exploratory-data-analysis/scripts/_capabilities.py +0 -576
- package/skills/exploratory-data-analysis/scripts/_common.py +0 -460
- package/skills/exploratory-data-analysis/scripts/_structured.py +0 -391
- package/skills/exploratory-data-analysis/scripts/_tabular.py +0 -905
- package/skills/exploratory-data-analysis/scripts/capability_manifest.py +0 -184
- package/skills/exploratory-data-analysis/scripts/distribution_sensitivity.py +0 -117
- package/skills/exploratory-data-analysis/scripts/eda_analyzer.py +0 -345
- package/skills/exploratory-data-analysis/scripts/image_inspector.py +0 -214
- package/skills/exploratory-data-analysis/scripts/missingness_leakage_audit.py +0 -130
- package/skills/exploratory-data-analysis/scripts/report_scaffold.py +0 -143
- package/skills/exploratory-data-analysis/scripts/sequence_inspector.py +0 -255
- package/skills/exploratory-data-analysis/scripts/tabular_profile.py +0 -109
- package/skills/flowio/references/api_reference.md +0 -355
- package/skills/flowio/references/fcs_semantics.md +0 -315
- package/skills/flowio/references/sources.md +0 -89
- package/skills/flowio/references/troubleshooting.md +0 -399
- package/skills/flowio/references/workflows.md +0 -368
- package/skills/flowio/scripts/inspect_fcs.py +0 -439
- package/skills/fluidsim/references/advanced_features.md +0 -347
- package/skills/fluidsim/references/installation.md +0 -263
- package/skills/fluidsim/references/output_analysis.md +0 -314
- package/skills/fluidsim/references/parameters.md +0 -322
- package/skills/fluidsim/references/simulation_workflow.md +0 -329
- package/skills/fluidsim/references/solvers.md +0 -191
- package/skills/fluidsim/scripts/__init__.py +0 -1
- package/skills/fluidsim/scripts/_common.py +0 -491
- package/skills/fluidsim/scripts/_schema.py +0 -872
- package/skills/fluidsim/scripts/budget_summary.py +0 -396
- package/skills/fluidsim/scripts/grid_resource_estimator.py +0 -286
- package/skills/fluidsim/scripts/output_inventory.py +0 -353
- package/skills/fluidsim/scripts/restart_compatibility.py +0 -424
- package/skills/fluidsim/scripts/simulation_dry_run.py +0 -246
- package/skills/fluidsim/scripts/solver_config_validator.py +0 -70
- package/skills/generate-image/references/models.md +0 -173
- package/skills/generate-image/scripts/generate_image.py +0 -752
- package/skills/geniml/references/bedspace.md +0 -267
- package/skills/geniml/references/consensus_peaks.md +0 -334
- package/skills/geniml/references/region2vec.md +0 -289
- package/skills/geniml/references/scembed.md +0 -307
- package/skills/geniml/references/utilities.md +0 -385
- package/skills/geniml/scripts/__init__.py +0 -1
- package/skills/geniml/scripts/_common.py +0 -399
- package/skills/geniml/scripts/bed_validator.py +0 -363
- package/skills/geniml/scripts/consensus_plan.py +0 -416
- package/skills/geniml/scripts/corpus_auditor.py +0 -304
- package/skills/geniml/scripts/embedding_plan.py +0 -476
- package/skills/geniml/scripts/model_artifact_inspector.py +0 -358
- package/skills/geniml/scripts/tokenizer_compatibility.py +0 -321
- package/skills/genomic-coordinates/references/format-conventions.md +0 -205
- package/skills/genomic-coordinates/references/reference-builds.md +0 -154
- package/skills/genomic-coordinates/references/transcript-coordinates.md +0 -141
- package/skills/genomic-coordinates/references/variant-representation.md +0 -155
- package/skills/genomic-coordinates/scripts/_common.py +0 -335
- package/skills/genomic-coordinates/scripts/audit_intervals.py +0 -511
- package/skills/genomic-coordinates/scripts/check_contigs.py +0 -382
- package/skills/genomic-coordinates/scripts/convert_coords.py +0 -180
- package/skills/genomic-coordinates/scripts/normalize_variant.py +0 -290
- package/skills/genomic-intelligence/references/api-and-auth.md +0 -45
- package/skills/genomic-intelligence/references/mcp.md +0 -94
- package/skills/genomic-intelligence/references/sequence-acquisition.md +0 -52
- package/skills/genomic-intelligence/references/tasks.md +0 -75
- package/skills/geomaster/references/advanced-gis.md +0 -376
- package/skills/geomaster/references/big-data.md +0 -363
- package/skills/geomaster/references/code-examples.md +0 -531
- package/skills/geomaster/references/coordinate-systems.md +0 -364
- package/skills/geomaster/references/core-libraries.md +0 -273
- package/skills/geomaster/references/data-sources.md +0 -330
- package/skills/geomaster/references/gis-software.md +0 -369
- package/skills/geomaster/references/industry-applications.md +0 -420
- package/skills/geomaster/references/machine-learning.md +0 -462
- package/skills/geomaster/references/programming-languages.md +0 -456
- package/skills/geomaster/references/remote-sensing.md +0 -370
- package/skills/geomaster/references/scientific-domains.md +0 -416
- package/skills/geomaster/references/specialized-topics.md +0 -428
- package/skills/geomaster/references/troubleshooting.md +0 -439
- package/skills/geopandas/references/crs-management.md +0 -231
- package/skills/geopandas/references/data-io.md +0 -323
- package/skills/geopandas/references/data-structures.md +0 -207
- package/skills/geopandas/references/geometric-operations.md +0 -262
- package/skills/geopandas/references/spatial-analysis.md +0 -294
- package/skills/geopandas/references/visualization.md +0 -230
- package/skills/geopandas/scripts/_common.py +0 -605
- package/skills/geopandas/scripts/crs_reprojection_plan.py +0 -210
- package/skills/geopandas/scripts/export_plan.py +0 -305
- package/skills/geopandas/scripts/geometry_validity_report.py +0 -227
- package/skills/geopandas/scripts/sensitive_coordinates_checklist.py +0 -230
- package/skills/geopandas/scripts/spatial_join_audit.py +0 -368
- package/skills/geopandas/scripts/vector_inventory.py +0 -140
- package/skills/get-available-resources/references/resource_semantics.md +0 -206
- package/skills/get-available-resources/references/snapshot_schema.md +0 -172
- package/skills/get-available-resources/references/sources.md +0 -124
- package/skills/get-available-resources/scripts/_common.py +0 -190
- package/skills/get-available-resources/scripts/accelerator_diagnostics.py +0 -151
- package/skills/get-available-resources/scripts/detect_resources.py +0 -1767
- package/skills/get-available-resources/scripts/plan_workload.py +0 -311
- package/skills/get-available-resources/scripts/snapshot_tools.py +0 -486
- package/skills/gget/references/common_workflows.md +0 -120
- package/skills/gget/references/database_info.md +0 -336
- package/skills/gget/references/module_catalog.md +0 -733
- package/skills/gget/references/module_reference.md +0 -526
- package/skills/gget/references/workflows.md +0 -815
- package/skills/gget/scripts/batch_sequence_analysis.py +0 -192
- package/skills/gget/scripts/enrichment_pipeline.py +0 -235
- package/skills/gget/scripts/gene_analysis.py +0 -175
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-hibit.md +0 -53
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-optimization.md +0 -85
- package/skills/ginkgo-cloud-lab/references/cell-free-protein-expression-validation.md +0 -71
- package/skills/ginkgo-cloud-lab/references/cfps-expression-purification-quantification.md +0 -60
- package/skills/ginkgo-cloud-lab/references/cfps-strep-purification-thermal-shift.md +0 -63
- package/skills/ginkgo-cloud-lab/references/cfps-strep-tag-purification-a280.md +0 -55
- package/skills/ginkgo-cloud-lab/references/echo-ms-cfps-detection.md +0 -49
- package/skills/ginkgo-cloud-lab/references/echo-ms-method-onboarding.md +0 -56
- package/skills/ginkgo-cloud-lab/references/ecoli-expression-purification-quantification.md +0 -49
- package/skills/ginkgo-cloud-lab/references/ecoli-minibinder-expression-histag-a280.md +0 -62
- package/skills/ginkgo-cloud-lab/references/ecoli-protein-expression-hibit.md +0 -44
- package/skills/ginkgo-cloud-lab/references/ecoli-protein-expression-histag-a280.md +0 -47
- package/skills/ginkgo-cloud-lab/references/fluorescent-pixel-art-generation.md +0 -73
- package/skills/ginkgo-cloud-lab/references/ivt-rna-synthesis-qpcr.md +0 -67
- package/skills/ginkgo-cloud-lab/references/minibinder-strep-tag-a280.md +0 -58
- package/skills/ginkgo-cloud-lab/references/pichia-protein-expression-labchip.md +0 -43
- package/skills/ginkgo-cloud-lab/references/spr-target-onboarding.md +0 -58
- package/skills/glycoengineering/references/glycan_databases.md +0 -165
- package/skills/gtars/references/cli.md +0 -334
- package/skills/gtars/references/coverage.md +0 -224
- package/skills/gtars/references/overlap.md +0 -220
- package/skills/gtars/references/python-api.md +0 -280
- package/skills/gtars/references/refget.md +0 -318
- package/skills/gtars/references/tokenizers.md +0 -256
- package/skills/gtars/scripts/__init__.py +0 -1
- package/skills/gtars/scripts/_common.py +0 -461
- package/skills/gtars/scripts/artifact_inspector.py +0 -328
- package/skills/gtars/scripts/bed_validator.py +0 -183
- package/skills/gtars/scripts/coverage_preflight.py +0 -256
- package/skills/gtars/scripts/execution_plan.py +0 -365
- package/skills/gtars/scripts/refget_digest_plan.py +0 -311
- package/skills/gtars/scripts/tokenizer_manifest.py +0 -238
- package/skills/histolab/references/core_capabilities.md +0 -305
- package/skills/histolab/references/filters_preprocessing.md +0 -537
- package/skills/histolab/references/slide_management.md +0 -184
- package/skills/histolab/references/tile_extraction.md +0 -421
- package/skills/histolab/references/tissue_masks.md +0 -251
- package/skills/histolab/references/typical_workflows.md +0 -196
- package/skills/histolab/references/visualization.md +0 -548
- package/skills/hugging-science/references/flagship-resources.md +0 -81
- package/skills/hugging-science/references/topics-and-slugs.md +0 -82
- package/skills/hugging-science/references/using-datasets.md +0 -107
- package/skills/hugging-science/references/using-models.md +0 -122
- package/skills/hugging-science/references/using-spaces.md +0 -119
- package/skills/hugging-science/scripts/fetch_catalog.py +0 -358
- package/skills/hypogenic/assets/dataset_manifest.example.json +0 -30
- package/skills/hypogenic/assets/result.example.json +0 -18
- package/skills/hypogenic/assets/run_config.example.json +0 -46
- package/skills/hypogenic/assets/task_config.example.yaml +0 -38
- package/skills/hypogenic/references/configuration.md +0 -136
- package/skills/hypogenic/references/datasets.md +0 -146
- package/skills/hypogenic/references/evaluation.md +0 -155
- package/skills/hypogenic/references/security.md +0 -167
- package/skills/hypogenic/references/sources.md +0 -113
- package/skills/hypogenic/references/upstream.md +0 -188
- package/skills/hypogenic/scripts/__init__.py +0 -1
- package/skills/hypogenic/scripts/_common.py +0 -1312
- package/skills/hypogenic/scripts/audit_dataset.py +0 -410
- package/skills/hypogenic/scripts/evaluate_local.py +0 -250
- package/skills/hypogenic/scripts/inspect_outputs.py +0 -166
- package/skills/hypogenic/scripts/plan_run.py +0 -247
- package/skills/hypogenic/scripts/validate_config.py +0 -192
- package/skills/hypothesis-generation/assets/evidence_ledger_template.csv +0 -2
- package/skills/hypothesis-generation/assets/falsification_controls_template.json +0 -116
- package/skills/hypothesis-generation/assets/hypothesis_record_template.json +0 -331
- package/skills/hypothesis-generation/assets/operationalization_template.json +0 -56
- package/skills/hypothesis-generation/assets/prediction_rival_matrix_template.csv +0 -3
- package/skills/hypothesis-generation/assets/preregistration_scaffold_template.md +0 -137
- package/skills/hypothesis-generation/assets/search_boundary_template.json +0 -23
- package/skills/hypothesis-generation/assets/source_ledger.csv +0 -37
- package/skills/hypothesis-generation/references/causal_inference_and_claims.md +0 -190
- package/skills/hypothesis-generation/references/concepts_and_workflow.md +0 -173
- package/skills/hypothesis-generation/references/ethics_safety_and_ai.md +0 -216
- package/skills/hypothesis-generation/references/experimental_design_patterns.md +0 -301
- package/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +0 -203
- package/skills/hypothesis-generation/references/literature_search_strategies.md +0 -208
- package/skills/hypothesis-generation/references/preregistration_and_open_science.md +0 -205
- package/skills/hypothesis-generation/references/security_validation.md +0 -74
- package/skills/hypothesis-generation/references/source_ledger.md +0 -116
- package/skills/hypothesis-generation/references/tool_reference.md +0 -246
- package/skills/hypothesis-generation/scripts/_common.py +0 -412
- package/skills/hypothesis-generation/scripts/audit_evidence_ledger.py +0 -337
- package/skills/hypothesis-generation/scripts/check_falsification_controls.py +0 -455
- package/skills/hypothesis-generation/scripts/check_operationalization.py +0 -237
- package/skills/hypothesis-generation/scripts/generate_preregistration_scaffold.py +0 -384
- package/skills/hypothesis-generation/scripts/lint_causal_claims.py +0 -189
- package/skills/hypothesis-generation/scripts/validate_hypothesis_schema.py +0 -1078
- package/skills/hypothesis-generation/scripts/validate_prediction_matrix.py +0 -286
- package/skills/imaging-data-commons/references/bigquery_guide.md +0 -858
- package/skills/imaging-data-commons/references/cli_guide.md +0 -287
- package/skills/imaging-data-commons/references/clinical_data_guide.md +0 -328
- package/skills/imaging-data-commons/references/cloud_storage_guide.md +0 -333
- package/skills/imaging-data-commons/references/dicomweb_guide.md +0 -399
- package/skills/imaging-data-commons/references/digital_pathology_guide.md +0 -403
- package/skills/imaging-data-commons/references/index_tables_guide.md +0 -203
- package/skills/imaging-data-commons/references/licensing_and_citation.md +0 -230
- package/skills/imaging-data-commons/references/mcp_guide.md +0 -181
- package/skills/imaging-data-commons/references/parquet_access_guide.md +0 -200
- package/skills/imaging-data-commons/references/rest_api_guide.md +0 -612
- package/skills/imaging-data-commons/references/sql_patterns.md +0 -462
- package/skills/imaging-data-commons/references/use_cases.md +0 -277
- package/skills/imaging-data-commons/scripts/check_version.py +0 -132
- package/skills/infographics/references/color_palettes.md +0 -496
- package/skills/infographics/references/design_principles.md +0 -636
- package/skills/infographics/references/infographic_type_catalog.md +0 -158
- package/skills/infographics/references/infographic_types.md +0 -907
- package/skills/infographics/references/iterative_refinement.md +0 -119
- package/skills/infographics/scripts/generate_infographic.py +0 -291
- package/skills/infographics/scripts/generate_infographic_ai.py +0 -1446
- package/skills/iso-standards-readiness/assets/templates/capa-record-template.json +0 -99
- package/skills/iso-standards-readiness/assets/templates/document-register-template.json +0 -75
- package/skills/iso-standards-readiness/assets/templates/evidence-manifest-template.json +0 -65
- package/skills/iso-standards-readiness/assets/templates/laboratory-scope-intake-template.json +0 -111
- package/skills/iso-standards-readiness/assets/templates/medical-laboratory-scope-intake-template.json +0 -111
- package/skills/iso-standards-readiness/assets/templates/procedures/CAPA-procedure-template.md +0 -148
- package/skills/iso-standards-readiness/assets/templates/procedures/document-control-procedure-template.md +0 -132
- package/skills/iso-standards-readiness/assets/templates/qmsr-transition-template.json +0 -181
- package/skills/iso-standards-readiness/assets/templates/quality-manual-template.md +0 -182
- package/skills/iso-standards-readiness/assets/templates/scope-intake-template.json +0 -109
- package/skills/iso-standards-readiness/assets/templates/supplier-controls-template.json +0 -119
- package/skills/iso-standards-readiness/assets/templates/traceability-matrix-template.json +0 -154
- package/skills/iso-standards-readiness/references/assurance-lanes.md +0 -116
- package/skills/iso-standards-readiness/references/evidence-architecture.md +0 -282
- package/skills/iso-standards-readiness/references/gap-analysis-checklist.md +0 -346
- package/skills/iso-standards-readiness/references/iso-13485.md +0 -236
- package/skills/iso-standards-readiness/references/iso-14971.md +0 -172
- package/skills/iso-standards-readiness/references/iso-15189.md +0 -219
- package/skills/iso-standards-readiness/references/iso-17025.md +0 -208
- package/skills/iso-standards-readiness/references/quality-manual-guide.md +0 -282
- package/skills/iso-standards-readiness/references/source-ledger.md +0 -357
- package/skills/iso-standards-readiness/scripts/_catalog.py +0 -248
- package/skills/iso-standards-readiness/scripts/_common.py +0 -558
- package/skills/iso-standards-readiness/scripts/audit_document_records.py +0 -148
- package/skills/iso-standards-readiness/scripts/check_capa.py +0 -240
- package/skills/iso-standards-readiness/scripts/check_qmsr_transition.py +0 -164
- package/skills/iso-standards-readiness/scripts/check_supplier_controls.py +0 -166
- package/skills/iso-standards-readiness/scripts/check_traceability.py +0 -171
- package/skills/iso-standards-readiness/scripts/gap_analyzer.py +0 -167
- package/skills/iso-standards-readiness/scripts/validate_evidence_manifest.py +0 -246
- package/skills/iso-standards-readiness/scripts/validate_scope_intake.py +0 -209
- package/skills/lab-hardware-cad/assets/standards.json +0 -198
- package/skills/lab-hardware-cad/references/behavior-rigs.md +0 -136
- package/skills/lab-hardware-cad/references/build123d-patterns.md +0 -363
- package/skills/lab-hardware-cad/references/fabrication-limits.md +0 -156
- package/skills/lab-hardware-cad/references/labware-adapters.md +0 -190
- package/skills/lab-hardware-cad/references/microfluidics.md +0 -157
- package/skills/lab-hardware-cad/references/optomechanics.md +0 -148
- package/skills/lab-hardware-cad/references/validation.md +0 -132
- package/skills/lab-hardware-cad/scripts/_common.py +0 -650
- package/skills/lab-hardware-cad/scripts/check.py +0 -645
- package/skills/lab-hardware-cad/scripts/gen.py +0 -264
- package/skills/lab-hardware-cad/scripts/snapshot.py +0 -278
- package/skills/labarchive-integration/references/api_reference.md +0 -250
- package/skills/labarchive-integration/references/authentication_guide.md +0 -191
- package/skills/labarchive-integration/references/integrations.md +0 -162
- package/skills/labarchive-integration/references/sources.md +0 -213
- package/skills/labarchive-integration/scripts/entry_operations.py +0 -381
- package/skills/labarchive-integration/scripts/notebook_operations.py +0 -451
- package/skills/labarchive-integration/scripts/setup_config.py +0 -258
- package/skills/lamindb/references/annotation-validation.md +0 -510
- package/skills/lamindb/references/core-concepts.md +0 -383
- package/skills/lamindb/references/data-management.md +0 -432
- package/skills/lamindb/references/integrations.md +0 -663
- package/skills/lamindb/references/ontologies.md +0 -498
- package/skills/lamindb/references/setup-deployment.md +0 -755
- package/skills/latchbio-integration/references/data-management.md +0 -257
- package/skills/latchbio-integration/references/latch-mcp.md +0 -158
- package/skills/latchbio-integration/references/nextflow-snakemake.md +0 -258
- package/skills/latchbio-integration/references/operations-and-debugging.md +0 -320
- package/skills/latchbio-integration/references/registry.md +0 -275
- package/skills/latchbio-integration/references/resource-configuration.md +0 -274
- package/skills/latchbio-integration/references/ui-and-automation.md +0 -355
- package/skills/latchbio-integration/references/verified-workflows.md +0 -226
- package/skills/latchbio-integration/references/workflow-creation.md +0 -275
- package/skills/latchbio-integration/scripts/inspect_latch_sdk.py +0 -290
- package/skills/latex-posters/assets/baposter_template.tex +0 -257
- package/skills/latex-posters/assets/beamerposter_template.tex +0 -244
- package/skills/latex-posters/assets/poster_quality_checklist.md +0 -358
- package/skills/latex-posters/assets/tikzposter_template.tex +0 -251
- package/skills/latex-posters/references/ai_graphics_for_posters.md +0 -524
- package/skills/latex-posters/references/compilation_and_quality_control.md +0 -467
- package/skills/latex-posters/references/latex_poster_packages.md +0 -745
- package/skills/latex-posters/references/latex_poster_reference.md +0 -241
- package/skills/latex-posters/references/poster_content_guide.md +0 -748
- package/skills/latex-posters/references/poster_design_principles.md +0 -806
- package/skills/latex-posters/references/poster_layout_design.md +0 -900
- package/skills/latex-posters/references/poster_patterns_and_presentation.md +0 -81
- package/skills/latex-posters/scripts/generate_schematic.py +0 -198
- package/skills/latex-posters/scripts/generate_schematic_ai.py +0 -950
- package/skills/latex-posters/scripts/review_poster.sh +0 -214
- package/skills/liteparse/references/api_reference.md +0 -169
- package/skills/liteparse/references/choosing_a_parser.md +0 -70
- package/skills/liteparse/references/cli_reference.md +0 -118
- package/skills/liteparse/references/ocr_and_formats.md +0 -143
- package/skills/liteparse/references/output_formats.md +0 -146
- package/skills/liteparse/scripts/batch_parse_dir.py +0 -163
- package/skills/literature-review/assets/review_template.md +0 -412
- package/skills/literature-review/references/citation_styles.md +0 -166
- package/skills/literature-review/references/core_workflow.md +0 -260
- package/skills/literature-review/references/database_strategies.md +0 -455
- package/skills/literature-review/references/example_workflow.md +0 -68
- package/skills/literature-review/references/search_and_citation.md +0 -157
- package/skills/literature-review/scripts/generate_pdf.py +0 -176
- package/skills/literature-review/scripts/generate_schematic.py +0 -198
- package/skills/literature-review/scripts/generate_schematic_ai.py +0 -950
- package/skills/literature-review/scripts/search_databases.py +0 -303
- package/skills/literature-review/scripts/verify_citations.py +0 -222
- package/skills/markdown-mermaid-writing/assets/examples/example-research-report.md +0 -221
- package/skills/markdown-mermaid-writing/references/diagrams/architecture.md +0 -108
- package/skills/markdown-mermaid-writing/references/diagrams/block.md +0 -177
- package/skills/markdown-mermaid-writing/references/diagrams/c4.md +0 -136
- package/skills/markdown-mermaid-writing/references/diagrams/class.md +0 -246
- package/skills/markdown-mermaid-writing/references/diagrams/complex_examples.md +0 -384
- package/skills/markdown-mermaid-writing/references/diagrams/er.md +0 -222
- package/skills/markdown-mermaid-writing/references/diagrams/flowchart.md +0 -177
- package/skills/markdown-mermaid-writing/references/diagrams/gantt.md +0 -138
- package/skills/markdown-mermaid-writing/references/diagrams/git_graph.md +0 -74
- package/skills/markdown-mermaid-writing/references/diagrams/kanban.md +0 -107
- package/skills/markdown-mermaid-writing/references/diagrams/mindmap.md +0 -74
- package/skills/markdown-mermaid-writing/references/diagrams/packet.md +0 -55
- package/skills/markdown-mermaid-writing/references/diagrams/pie.md +0 -52
- package/skills/markdown-mermaid-writing/references/diagrams/quadrant.md +0 -66
- package/skills/markdown-mermaid-writing/references/diagrams/radar.md +0 -59
- package/skills/markdown-mermaid-writing/references/diagrams/requirement.md +0 -88
- package/skills/markdown-mermaid-writing/references/diagrams/sankey.md +0 -71
- package/skills/markdown-mermaid-writing/references/diagrams/sequence.md +0 -174
- package/skills/markdown-mermaid-writing/references/diagrams/state.md +0 -150
- package/skills/markdown-mermaid-writing/references/diagrams/timeline.md +0 -96
- package/skills/markdown-mermaid-writing/references/diagrams/treemap.md +0 -66
- package/skills/markdown-mermaid-writing/references/diagrams/user_journey.md +0 -108
- package/skills/markdown-mermaid-writing/references/diagrams/xy_chart.md +0 -53
- package/skills/markdown-mermaid-writing/references/diagrams/zenuml.md +0 -71
- package/skills/markdown-mermaid-writing/references/markdown_style_guide.md +0 -733
- package/skills/markdown-mermaid-writing/references/mermaid_style_guide.md +0 -458
- package/skills/markdown-mermaid-writing/templates/decision_record.md +0 -211
- package/skills/markdown-mermaid-writing/templates/how_to_guide.md +0 -275
- package/skills/markdown-mermaid-writing/templates/issue.md +0 -303
- package/skills/markdown-mermaid-writing/templates/kanban.md +0 -223
- package/skills/markdown-mermaid-writing/templates/presentation.md +0 -312
- package/skills/markdown-mermaid-writing/templates/project_documentation.md +0 -412
- package/skills/markdown-mermaid-writing/templates/pull_request.md +0 -319
- package/skills/markdown-mermaid-writing/templates/research_paper.md +0 -304
- package/skills/markdown-mermaid-writing/templates/status_report.md +0 -185
- package/skills/market-research-reports/assets/FORMATTING_GUIDE.md +0 -149
- package/skills/market-research-reports/assets/claims_ledger_template.csv +0 -4
- package/skills/market-research-reports/assets/competitor_feature_matrix_template.csv +0 -5
- package/skills/market-research-reports/assets/consistency_check_template.csv +0 -3
- package/skills/market-research-reports/assets/forecast_sensitivity_template.json +0 -90
- package/skills/market-research-reports/assets/market_report_template.tex +0 -279
- package/skills/market-research-reports/assets/market_research.sty +0 -241
- package/skills/market-research-reports/assets/market_sizing_scenarios_template.json +0 -129
- package/skills/market-research-reports/assets/report_manifest_template.json +0 -27
- package/skills/market-research-reports/assets/source_ledger_template.csv +0 -4
- package/skills/market-research-reports/references/data_analysis_patterns.md +0 -290
- package/skills/market-research-reports/references/evidence_model.md +0 -148
- package/skills/market-research-reports/references/methods_and_ethics.md +0 -162
- package/skills/market-research-reports/references/official_data_sources.md +0 -196
- package/skills/market-research-reports/references/report_structure_guide.md +0 -283
- package/skills/market-research-reports/references/sources.md +0 -73
- package/skills/market-research-reports/references/visual_generation_guide.md +0 -158
- package/skills/market-research-reports/scripts/_common.py +0 -312
- package/skills/market-research-reports/scripts/audit_claim_citations.py +0 -326
- package/skills/market-research-reports/scripts/calculate_market_sizing.py +0 -389
- package/skills/market-research-reports/scripts/check_unit_consistency.py +0 -217
- package/skills/market-research-reports/scripts/forecast_sensitivity.py +0 -326
- package/skills/market-research-reports/scripts/generate_report_scaffold.py +0 -444
- package/skills/market-research-reports/scripts/validate_competitor_matrix.py +0 -223
- package/skills/market-research-reports/scripts/validate_evidence_ledger.py +0 -291
- package/skills/markitdown/references/api_reference.md +0 -418
- package/skills/markitdown/references/cloud_and_ocr.md +0 -320
- package/skills/markitdown/references/file_formats.md +0 -281
- package/skills/markitdown/references/mcp_and_plugins.md +0 -243
- package/skills/markitdown/references/migration.md +0 -356
- package/skills/markitdown/references/security.md +0 -246
- package/skills/markitdown/references/workflows.md +0 -309
- package/skills/markitdown/scripts/batch_convert.py +0 -354
- package/skills/markitdown/scripts/convert_literature.py +0 -405
- package/skills/markitdown/scripts/inspect_installation.py +0 -162
- package/skills/matchms/references/filtering.md +0 -299
- package/skills/matchms/references/importing_exporting.md +0 -323
- package/skills/matchms/references/migration.md +0 -387
- package/skills/matchms/references/similarity.md +0 -413
- package/skills/matchms/references/sources.md +0 -113
- package/skills/matchms/references/workflows.md +0 -451
- package/skills/matchms/scripts/library_search.py +0 -593
- package/skills/matlab/assets/project_manifest_template.json +0 -33
- package/skills/matlab/assets/python_compatibility_r2026a.json +0 -27
- package/skills/matlab/assets/reproducibility_manifest_template.json +0 -32
- package/skills/matlab/references/data-import-export.md +0 -221
- package/skills/matlab/references/executing-scripts.md +0 -213
- package/skills/matlab/references/graphics-visualization.md +0 -181
- package/skills/matlab/references/mathematics.md +0 -208
- package/skills/matlab/references/matrices-arrays.md +0 -228
- package/skills/matlab/references/octave-compatibility.md +0 -212
- package/skills/matlab/references/programming.md +0 -225
- package/skills/matlab/references/python-integration.md +0 -248
- package/skills/matlab/scripts/_common.py +0 -263
- package/skills/matlab/scripts/generate_function_scaffold.py +0 -165
- package/skills/matlab/scripts/inventory_mat_file.py +0 -351
- package/skills/matlab/scripts/plan_batch_command.py +0 -257
- package/skills/matlab/scripts/plan_python_compatibility.py +0 -176
- package/skills/matlab/scripts/reproducibility_report.py +0 -233
- package/skills/matlab/scripts/scan_m_code.py +0 -433
- package/skills/matlab/scripts/validate_project_manifest.py +0 -348
- package/skills/matplotlib/references/api_reference.md +0 -409
- package/skills/matplotlib/references/common_issues.md +0 -562
- package/skills/matplotlib/references/plot_types.md +0 -469
- package/skills/matplotlib/references/styling_guide.md +0 -600
- package/skills/matplotlib/scripts/plot_template.py +0 -406
- package/skills/matplotlib/scripts/style_configurator.py +0 -412
- package/skills/medchem/references/api_guide.md +0 -331
- package/skills/medchem/references/rules_catalog.md +0 -328
- package/skills/medchem/scripts/filter_molecules.py +0 -302
- package/skills/modal/references/api_reference.md +0 -225
- package/skills/modal/references/examples.md +0 -276
- package/skills/modal/references/functions.md +0 -260
- package/skills/modal/references/getting-started.md +0 -171
- package/skills/modal/references/gpu.md +0 -177
- package/skills/modal/references/images.md +0 -266
- package/skills/modal/references/resources.md +0 -117
- package/skills/modal/references/scaling.md +0 -173
- package/skills/modal/references/scheduled-jobs.md +0 -147
- package/skills/modal/references/secrets.md +0 -119
- package/skills/modal/references/volumes.md +0 -247
- package/skills/modal/references/web-endpoints.md +0 -259
- package/skills/molecular-dynamics/references/mdanalysis_analysis.md +0 -208
- package/skills/molfeat/references/api_reference.md +0 -429
- package/skills/molfeat/references/available_featurizers.md +0 -335
- package/skills/molfeat/references/choosing_a_featurizer.md +0 -192
- package/skills/molfeat/references/examples.md +0 -720
- package/skills/ncats-arax/references/output-schema.md +0 -186
- package/skills/ncats-arax/references/query-contract.md +0 -140
- package/skills/ncats-arax/scripts/arax_client.py +0 -2087
- package/skills/networkx/references/algorithms.md +0 -384
- package/skills/networkx/references/generators.md +0 -385
- package/skills/networkx/references/graph-basics.md +0 -284
- package/skills/networkx/references/io.md +0 -457
- package/skills/networkx/references/visualization.md +0 -531
- package/skills/neurokit2/references/bio_module.md +0 -244
- package/skills/neurokit2/references/complexity.md +0 -212
- package/skills/neurokit2/references/ecg_cardiac.md +0 -193
- package/skills/neurokit2/references/eda.md +0 -185
- package/skills/neurokit2/references/eeg.md +0 -204
- package/skills/neurokit2/references/emg.md +0 -157
- package/skills/neurokit2/references/eog.md +0 -154
- package/skills/neurokit2/references/epochs_events.md +0 -199
- package/skills/neurokit2/references/hrv.md +0 -205
- package/skills/neurokit2/references/ppg.md +0 -191
- package/skills/neurokit2/references/rsp.md +0 -212
- package/skills/neurokit2/references/signal_processing.md +0 -160
- package/skills/neurokit2/scripts/_common.py +0 -567
- package/skills/neurokit2/scripts/ecg_hrv_pipeline.py +0 -303
- package/skills/neurokit2/scripts/eda_pipeline.py +0 -288
- package/skills/neurokit2/scripts/generate_synthetic.py +0 -221
- package/skills/neurokit2/scripts/inspect_signal.py +0 -362
- package/skills/neurokit2/scripts/plan_epochs.py +0 -281
- package/skills/neurokit2/scripts/validate_multimodal.py +0 -350
- package/skills/neuropixels-analysis/assets/analysis_template.py +0 -271
- package/skills/neuropixels-analysis/references/AI_CURATION.md +0 -164
- package/skills/neuropixels-analysis/references/ANALYSIS.md +0 -392
- package/skills/neuropixels-analysis/references/AUTOMATED_CURATION.md +0 -435
- package/skills/neuropixels-analysis/references/MOTION_CORRECTION.md +0 -323
- package/skills/neuropixels-analysis/references/PREPROCESSING.md +0 -273
- package/skills/neuropixels-analysis/references/QUALITY_METRICS.md +0 -359
- package/skills/neuropixels-analysis/references/SPIKE_SORTING.md +0 -339
- package/skills/neuropixels-analysis/references/api_reference.md +0 -229
- package/skills/neuropixels-analysis/references/plotting_guide.md +0 -454
- package/skills/neuropixels-analysis/references/standard_workflow.md +0 -305
- package/skills/neuropixels-analysis/scripts/compute_metrics.py +0 -182
- package/skills/neuropixels-analysis/scripts/explore_recording.py +0 -168
- package/skills/neuropixels-analysis/scripts/export_to_phy.py +0 -79
- package/skills/neuropixels-analysis/scripts/neuropixels_pipeline.py +0 -442
- package/skills/neuropixels-analysis/scripts/preprocess_recording.py +0 -122
- package/skills/neuropixels-analysis/scripts/run_sorting.py +0 -98
- package/skills/nextflow/references/configuration.md +0 -276
- package/skills/nextflow/references/containers.md +0 -92
- package/skills/nextflow/references/developing.md +0 -301
- package/skills/nextflow/references/language.md +0 -327
- package/skills/nextflow/references/nf-core-tools.md +0 -130
- package/skills/nextflow/references/running-pipelines.md +0 -131
- package/skills/nextflow/references/testing.md +0 -189
- package/skills/omero-integration/references/advanced.md +0 -273
- package/skills/omero-integration/references/connection.md +0 -293
- package/skills/omero-integration/references/data_access.md +0 -359
- package/skills/omero-integration/references/image_processing.md +0 -286
- package/skills/omero-integration/references/metadata.md +0 -313
- package/skills/omero-integration/references/rois.md +0 -291
- package/skills/omero-integration/references/scripts.md +0 -304
- package/skills/omero-integration/references/sources.md +0 -194
- package/skills/omero-integration/references/tables.md +0 -269
- package/skills/omero-integration/scripts/export_image_metadata.py +0 -560
- package/skills/omero-integration/scripts/inventory.py +0 -302
- package/skills/omero-integration/scripts/omero_common.py +0 -490
- package/skills/omero-integration/scripts/plan_transfer.py +0 -393
- package/skills/omero-integration/scripts/validate_config.py +0 -140
- package/skills/onekgpd/assets/kgpe.json +0 -48032
- package/skills/onekgpd/references/annotation_vocabularies.md +0 -187
- package/skills/onekgpd/references/onekgpd_commands.md +0 -296
- package/skills/onekgpd/scripts/onekgpd_api.py +0 -794
- package/skills/onekgpd/scripts/onekgpd_meta.py +0 -485
- package/skills/ontology-term-resolution/references/curation-rules.md +0 -110
- package/skills/ontology-term-resolution/references/ols4-api.md +0 -135
- package/skills/ontology-term-resolution/references/ontology-registry.md +0 -110
- package/skills/ontology-term-resolution/scripts/ols_client.py +0 -341
- package/skills/ontology-term-resolution/scripts/resolve_terms.py +0 -255
- package/skills/ontology-term-resolution/scripts/validate_terms.py +0 -297
- package/skills/open-notebook/references/api_reference.md +0 -715
- package/skills/open-notebook/references/architecture.md +0 -163
- package/skills/open-notebook/references/configuration.md +0 -226
- package/skills/open-notebook/references/examples.md +0 -290
- package/skills/open-notebook/scripts/chat_interaction.py +0 -190
- package/skills/open-notebook/scripts/notebook_management.py +0 -142
- package/skills/open-notebook/scripts/source_ingestion.py +0 -160
- package/skills/openpiv/references/advanced_algorithms.md +0 -233
- package/skills/openpiv/scripts/__init__.py +0 -1
- package/skills/openpiv/scripts/analyze.py +0 -143
- package/skills/openpiv/scripts/run_example.py +0 -78
- package/skills/openpiv/scripts/runner.py +0 -214
- package/skills/opentrons-integration/references/api_reference.md +0 -382
- package/skills/opentrons-integration/references/liquid_handling.md +0 -387
- package/skills/opentrons-integration/references/migration-api-2-19-to-2-29.md +0 -328
- package/skills/opentrons-integration/references/modules_and_deck.md +0 -409
- package/skills/opentrons-integration/references/protocol_authoring.md +0 -352
- package/skills/opentrons-integration/references/sources.md +0 -151
- package/skills/opentrons-integration/references/validation_and_operations.md +0 -314
- package/skills/opentrons-integration/requirements-flex.txt +0 -1
- package/skills/opentrons-integration/requirements-ot2.txt +0 -1
- package/skills/opentrons-integration/scripts/absorbance_reader_template.py +0 -82
- package/skills/opentrons-integration/scripts/basic_protocol_template.py +0 -68
- package/skills/opentrons-integration/scripts/ot2_basic_protocol_template.py +0 -63
- package/skills/opentrons-integration/scripts/pcr_setup_template.py +0 -146
- package/skills/opentrons-integration/scripts/runtime_parameters_template.py +0 -110
- package/skills/opentrons-integration/scripts/serial_dilution_template.py +0 -113
- package/skills/optimize-for-gpu/references/code_transformation_patterns.md +0 -301
- package/skills/optimize-for-gpu/references/cucim.md +0 -679
- package/skills/optimize-for-gpu/references/cudf.md +0 -762
- package/skills/optimize-for-gpu/references/cugraph.md +0 -733
- package/skills/optimize-for-gpu/references/cuml.md +0 -710
- package/skills/optimize-for-gpu/references/cupy.md +0 -668
- package/skills/optimize-for-gpu/references/cuspatial.md +0 -420
- package/skills/optimize-for-gpu/references/cuvs.md +0 -671
- package/skills/optimize-for-gpu/references/cuxfilter.md +0 -600
- package/skills/optimize-for-gpu/references/decision_framework.md +0 -234
- package/skills/optimize-for-gpu/references/installation.md +0 -121
- package/skills/optimize-for-gpu/references/kvikio.md +0 -612
- package/skills/optimize-for-gpu/references/numba.md +0 -808
- package/skills/optimize-for-gpu/references/raft.md +0 -312
- package/skills/optimize-for-gpu/references/warp.md +0 -623
- package/skills/pacsomatic/config.yaml +0 -42
- package/skills/pacsomatic/references/agent-playbook.md +0 -73
- package/skills/pacsomatic/references/config-and-output.md +0 -100
- package/skills/pacsomatic/references/pacsomatic_guide.md +0 -254
- package/skills/pacsomatic/scripts/run_pacsomatic.py +0 -794
- package/skills/paper-lookup/references/arxiv.md +0 -275
- package/skills/paper-lookup/references/biorxiv.md +0 -163
- package/skills/paper-lookup/references/core.md +0 -150
- package/skills/paper-lookup/references/crossref.md +0 -181
- package/skills/paper-lookup/references/europepmc.md +0 -226
- package/skills/paper-lookup/references/medrxiv.md +0 -126
- package/skills/paper-lookup/references/openalex.md +0 -174
- package/skills/paper-lookup/references/pmc.md +0 -228
- package/skills/paper-lookup/references/pubmed.md +0 -124
- package/skills/paper-lookup/references/semantic-scholar.md +0 -203
- package/skills/paper-lookup/references/unpaywall.md +0 -127
- package/skills/paper-lookup/scripts/_common.py +0 -227
- package/skills/paper-lookup/scripts/arxiv_atom.py +0 -200
- package/skills/paper-lookup/scripts/jats_to_text.py +0 -324
- package/skills/paper-lookup/scripts/openalex_abstract.py +0 -163
- package/skills/paper-lookup/scripts/paginate.py +0 -490
- package/skills/paperclip/references/cli-reference.md +0 -389
- package/skills/paperclip/references/installation.md +0 -341
- package/skills/paperclip/references/map-reduce.md +0 -252
- package/skills/paperclip/references/python-sdk.md +0 -323
- package/skills/paperclip/references/repos-and-workspace.md +0 -271
- package/skills/paperclip/references/search-and-retrieval.md +0 -281
- package/skills/parallel-web/references/data-enrichment.md +0 -104
- package/skills/parallel-web/references/deep-research.md +0 -91
- package/skills/parallel-web/references/findall.md +0 -81
- package/skills/parallel-web/references/monitor.md +0 -83
- package/skills/parallel-web/references/web-extract.md +0 -59
- package/skills/parallel-web/references/web-search.md +0 -100
- package/skills/pathml/references/data_management.md +0 -357
- package/skills/pathml/references/graphs.md +0 -335
- package/skills/pathml/references/image_loading.md +0 -301
- package/skills/pathml/references/machine_learning.md +0 -408
- package/skills/pathml/references/multiparametric.md +0 -352
- package/skills/pathml/references/preprocessing.md +0 -371
- package/skills/pathml/scripts/_common.py +0 -385
- package/skills/pathml/scripts/image_qc.py +0 -325
- package/skills/pathml/scripts/plan_inference.py +0 -282
- package/skills/pathml/scripts/plan_pipeline.py +0 -239
- package/skills/pathml/scripts/slide_manifest.py +0 -405
- package/skills/pathml/scripts/validate_spatial_schema.py +0 -420
- package/skills/pathogen-variant-surveillance/references/lapis-api.md +0 -209
- package/skills/pathogen-variant-surveillance/references/lineage-nomenclature.md +0 -126
- package/skills/pathogen-variant-surveillance/references/surveillance-caveats.md +0 -149
- package/skills/pathogen-variant-surveillance/scripts/lapis_client.py +0 -776
- package/skills/pathogen-variant-surveillance/scripts/lineage_prevalence.py +0 -310
- package/skills/pathogen-variant-surveillance/scripts/mutation_profile.py +0 -215
- package/skills/pathogen-variant-surveillance/scripts/reporting_lag.py +0 -217
- package/skills/pathogen-variant-surveillance/scripts/resolve_lineage.py +0 -198
- package/skills/pathway-enrichment/references/databases-and-gene-sets.md +0 -140
- package/skills/pathway-enrichment/references/gseapy.md +0 -189
- package/skills/pathway-enrichment/references/interpretation.md +0 -118
- package/skills/pathway-enrichment/scripts/run_enrichment.py +0 -231
- package/skills/pdf/LICENSE.txt +0 -30
- package/skills/pdf/forms.md +0 -294
- package/skills/pdf/reference.md +0 -612
- package/skills/pdf/scripts/check_bounding_boxes.py +0 -65
- package/skills/pdf/scripts/check_fillable_fields.py +0 -11
- package/skills/pdf/scripts/convert_pdf_to_images.py +0 -33
- package/skills/pdf/scripts/create_validation_image.py +0 -37
- package/skills/pdf/scripts/extract_form_field_info.py +0 -122
- package/skills/pdf/scripts/extract_form_structure.py +0 -115
- package/skills/pdf/scripts/fill_fillable_fields.py +0 -98
- package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -107
- package/skills/peer-review/assets/citation_references_template.csv +0 -2
- package/skills/peer-review/assets/claim_evidence_matrix_template.csv +0 -4
- package/skills/peer-review/assets/reporting_checklist_template.csv +0 -31
- package/skills/peer-review/assets/reporting_guidelines.json +0 -466
- package/skills/peer-review/assets/review_intake_template.json +0 -52
- package/skills/peer-review/assets/review_scaffold_template.md +0 -68
- package/skills/peer-review/assets/source_ledger.csv +0 -32
- package/skills/peer-review/assets/statistical_reproducibility_template.json +0 -210
- package/skills/peer-review/assets/study_profile_template.json +0 -12
- package/skills/peer-review/references/common_issues.md +0 -257
- package/skills/peer-review/references/ethical_review_practice.md +0 -233
- package/skills/peer-review/references/reporting_standards.md +0 -249
- package/skills/peer-review/references/security_validation.md +0 -75
- package/skills/peer-review/references/statistical_reproducibility.md +0 -329
- package/skills/peer-review/references/tool_reference.md +0 -253
- package/skills/peer-review/scripts/_common.py +0 -398
- package/skills/peer-review/scripts/audit_citations.py +0 -207
- package/skills/peer-review/scripts/audit_statistics_reproducibility.py +0 -305
- package/skills/peer-review/scripts/generate_review_scaffold.py +0 -81
- package/skills/peer-review/scripts/lint_review.py +0 -254
- package/skills/peer-review/scripts/select_reporting_guidelines.py +0 -383
- package/skills/peer-review/scripts/validate_claim_evidence.py +0 -221
- package/skills/peer-review/scripts/validate_review_intake.py +0 -452
- package/skills/pennylane/references/advanced_features.md +0 -667
- package/skills/pennylane/references/devices_backends.md +0 -562
- package/skills/pennylane/references/getting_started.md +0 -232
- package/skills/pennylane/references/optimization.md +0 -670
- package/skills/pennylane/references/quantum_chemistry.md +0 -576
- package/skills/pennylane/references/quantum_circuits.md +0 -443
- package/skills/pennylane/references/quantum_ml.md +0 -555
- package/skills/phylogenetics/references/iqtree_inference.md +0 -181
- package/skills/phylogenetics/scripts/phylogenetic_analysis.py +0 -272
- package/skills/pi-agent/references/compaction.md +0 -76
- package/skills/pi-agent/references/containerization.md +0 -80
- package/skills/pi-agent/references/custom-provider.md +0 -131
- package/skills/pi-agent/references/development.md +0 -61
- package/skills/pi-agent/references/environment-variables.md +0 -57
- package/skills/pi-agent/references/extensions.md +0 -185
- package/skills/pi-agent/references/json.md +0 -69
- package/skills/pi-agent/references/keybindings.md +0 -58
- package/skills/pi-agent/references/llama-cpp.md +0 -69
- package/skills/pi-agent/references/models.md +0 -114
- package/skills/pi-agent/references/overview.md +0 -37
- package/skills/pi-agent/references/packages.md +0 -103
- package/skills/pi-agent/references/pi-interview.md +0 -123
- package/skills/pi-agent/references/pi-mcp-adapter.md +0 -191
- package/skills/pi-agent/references/pi-subagents.md +0 -371
- package/skills/pi-agent/references/pi-web-access.md +0 -243
- package/skills/pi-agent/references/prompt-templates.md +0 -48
- package/skills/pi-agent/references/providers.md +0 -122
- package/skills/pi-agent/references/quickstart.md +0 -73
- package/skills/pi-agent/references/rpc.md +0 -95
- package/skills/pi-agent/references/sdk.md +0 -151
- package/skills/pi-agent/references/security.md +0 -52
- package/skills/pi-agent/references/session-format.md +0 -90
- package/skills/pi-agent/references/sessions.md +0 -56
- package/skills/pi-agent/references/settings.md +0 -102
- package/skills/pi-agent/references/shell-aliases.md +0 -15
- package/skills/pi-agent/references/skills.md +0 -83
- package/skills/pi-agent/references/terminal-setup.md +0 -87
- package/skills/pi-agent/references/termux.md +0 -31
- package/skills/pi-agent/references/themes.md +0 -69
- package/skills/pi-agent/references/tmux.md +0 -44
- package/skills/pi-agent/references/tui.md +0 -97
- package/skills/pi-agent/references/usage.md +0 -129
- package/skills/pi-agent/references/windows.md +0 -23
- package/skills/pkpd-modeling/assets/nca-reporting-checklist.md +0 -72
- package/skills/pkpd-modeling/assets/popk-analysis-plan.md +0 -136
- package/skills/pkpd-modeling/references/antimicrobial-and-tdm.md +0 -110
- package/skills/pkpd-modeling/references/bioequivalence.md +0 -132
- package/skills/pkpd-modeling/references/dataset-standards.md +0 -103
- package/skills/pkpd-modeling/references/ddi-and-qt.md +0 -132
- package/skills/pkpd-modeling/references/nca-conventions.md +0 -128
- package/skills/pkpd-modeling/references/pbpk.md +0 -103
- package/skills/pkpd-modeling/references/pd-and-exposure-response.md +0 -149
- package/skills/pkpd-modeling/references/population-pk.md +0 -133
- package/skills/pkpd-modeling/references/regulatory-guidance.md +0 -82
- package/skills/pkpd-modeling/references/software-ecosystem.md +0 -123
- package/skills/pkpd-modeling/references/source-ledger.md +0 -89
- package/skills/pkpd-modeling/references/special-populations.md +0 -126
- package/skills/pkpd-modeling/references/structural-models.md +0 -140
- package/skills/pkpd-modeling/references/tmdd-and-biologics.md +0 -115
- package/skills/pkpd-modeling/scripts/_common.py +0 -327
- package/skills/pkpd-modeling/scripts/_models.py +0 -673
- package/skills/pkpd-modeling/scripts/allometry_and_fih.py +0 -346
- package/skills/pkpd-modeling/scripts/bioequivalence.py +0 -480
- package/skills/pkpd-modeling/scripts/check_popk_dataset.py +0 -400
- package/skills/pkpd-modeling/scripts/ddi_static.py +0 -346
- package/skills/pkpd-modeling/scripts/exposure_response.py +0 -328
- package/skills/pkpd-modeling/scripts/fit_compartmental.py +0 -558
- package/skills/pkpd-modeling/scripts/nca.py +0 -587
- package/skills/pkpd-modeling/scripts/simulate_regimen.py +0 -323
- package/skills/pkpd-modeling/scripts/tdm_bayes.py +0 -312
- package/skills/polars/references/best_practices.md +0 -651
- package/skills/polars/references/core_concepts.md +0 -380
- package/skills/polars/references/io_guide.md +0 -564
- package/skills/polars/references/operations.md +0 -602
- package/skills/polars/references/pandas_migration.md +0 -417
- package/skills/polars/references/transformations.md +0 -549
- package/skills/polars-bio/references/bioframe_migration.md +0 -250
- package/skills/polars-bio/references/configuration.md +0 -187
- package/skills/polars-bio/references/file_io.md +0 -469
- package/skills/polars-bio/references/interval_operations.md +0 -370
- package/skills/polars-bio/references/pileup_operations.md +0 -176
- package/skills/polars-bio/references/sql_processing.md +0 -224
- package/skills/pptx/LICENSE.txt +0 -30
- package/skills/pptx/scripts/__init__.py +0 -0
- package/skills/pptx/scripts/add_slide.py +0 -367
- package/skills/pptx/scripts/clean.py +0 -309
- package/skills/pptx/scripts/office/helpers/__init__.py +0 -111
- package/skills/pptx/scripts/office/helpers/pptx_chart.py +0 -170
- package/skills/pptx/scripts/office/helpers/pptx_slide.py +0 -60
- package/skills/pptx/scripts/office/helpers/pptx_theme.py +0 -114
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/skills/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/skills/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/skills/pptx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/skills/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/skills/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/skills/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/skills/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/skills/pptx/scripts/office/soffice.py +0 -232
- package/skills/pptx/scripts/office/validate.py +0 -173
- package/skills/pptx/scripts/office/validators/__init__.py +0 -15
- package/skills/pptx/scripts/office/validators/base.py +0 -875
- package/skills/pptx/scripts/office/validators/docx.py +0 -466
- package/skills/pptx/scripts/office/validators/pptx.py +0 -441
- package/skills/pptx/scripts/office/validators/redlining.py +0 -299
- package/skills/pptx/scripts/thumbnail.py +0 -311
- package/skills/pptx-posters/assets/generation_dependencies.json +0 -5
- package/skills/pptx-posters/assets/poster_manifest_template.json +0 -154
- package/skills/pptx-posters/assets/poster_quality_checklist.md +0 -192
- package/skills/pptx-posters/references/manifest_spec.md +0 -297
- package/skills/pptx-posters/references/poster_content_guide.md +0 -176
- package/skills/pptx-posters/references/poster_design_principles.md +0 -226
- package/skills/pptx-posters/references/poster_layout_design.md +0 -189
- package/skills/pptx-posters/references/pptx_security.md +0 -202
- package/skills/pptx-posters/references/security_validation.md +0 -90
- package/skills/pptx-posters/references/source_ledger.md +0 -256
- package/skills/pptx-posters/scripts/_common.py +0 -396
- package/skills/pptx-posters/scripts/_manifest.py +0 -1318
- package/skills/pptx-posters/scripts/_pptx.py +0 -1484
- package/skills/pptx-posters/scripts/check_layout.py +0 -179
- package/skills/pptx-posters/scripts/check_palette.py +0 -142
- package/skills/pptx-posters/scripts/generate_poster.py +0 -427
- package/skills/pptx-posters/scripts/inspect_pptx.py +0 -40
- package/skills/pptx-posters/scripts/inventory_images.py +0 -252
- package/skills/pptx-posters/scripts/plan_export.py +0 -201
- package/skills/pptx-posters/scripts/validate_manifest.py +0 -55
- package/skills/primekg/scripts/query_primekg.py +0 -128
- package/skills/protocolsio-integration/assets/protocol-snapshot.schema.json +0 -179
- package/skills/protocolsio-integration/references/additional_features.md +0 -202
- package/skills/protocolsio-integration/references/authentication.md +0 -135
- package/skills/protocolsio-integration/references/discussions.md +0 -192
- package/skills/protocolsio-integration/references/file_manager.md +0 -256
- package/skills/protocolsio-integration/references/protocols_api.md +0 -256
- package/skills/protocolsio-integration/references/workspaces.md +0 -192
- package/skills/protocolsio-integration/scripts/__init__.py +0 -1
- package/skills/protocolsio-integration/scripts/_common.py +0 -613
- package/skills/protocolsio-integration/scripts/pagination_helper.py +0 -248
- package/skills/protocolsio-integration/scripts/plan_write_request.py +0 -657
- package/skills/protocolsio-integration/scripts/protocols_read.py +0 -493
- package/skills/protocolsio-integration/scripts/validate_auth_config.py +0 -128
- package/skills/protocolsio-integration/scripts/validate_protocol_json.py +0 -358
- package/skills/pufferlib/references/environments.md +0 -260
- package/skills/pufferlib/references/integration.md +0 -192
- package/skills/pufferlib/references/policies.md +0 -181
- package/skills/pufferlib/references/training.md +0 -287
- package/skills/pufferlib/references/vectorization.md +0 -210
- package/skills/pufferlib/scripts/__init__.py +0 -1
- package/skills/pufferlib/scripts/_common.py +0 -199
- package/skills/pufferlib/scripts/benchmark_vectorization.py +0 -244
- package/skills/pufferlib/scripts/env_contract_validator.py +0 -198
- package/skills/pufferlib/scripts/env_template.py +0 -210
- package/skills/pufferlib/scripts/inspect_checkpoint.py +0 -225
- package/skills/pufferlib/scripts/repro_plan.py +0 -177
- package/skills/pufferlib/scripts/train_template.py +0 -282
- package/skills/pufferlib/scripts/validate_plan.py +0 -570
- package/skills/pydeseq2/references/analysis_patterns.md +0 -70
- package/skills/pydeseq2/references/api_reference.md +0 -256
- package/skills/pydeseq2/references/core_workflow_steps.md +0 -162
- package/skills/pydeseq2/references/workflow_guide.md +0 -603
- package/skills/pydeseq2/scripts/run_deseq2_analysis.py +0 -388
- package/skills/pydicom/references/common_tags.md +0 -277
- package/skills/pydicom/references/transfer_syntaxes.md +0 -348
- package/skills/pydicom/scripts/__init__.py +0 -1
- package/skills/pydicom/scripts/_common.py +0 -916
- package/skills/pydicom/scripts/anonymize_dicom.py +0 -713
- package/skills/pydicom/scripts/deidentification_audit.py +0 -380
- package/skills/pydicom/scripts/dicom_inventory.py +0 -402
- package/skills/pydicom/scripts/dicom_to_image.py +0 -459
- package/skills/pydicom/scripts/extract_metadata.py +0 -330
- package/skills/pydicom/scripts/pixel_frame_planner.py +0 -303
- package/skills/pydicom/scripts/transfer_syntax_inspector.py +0 -245
- package/skills/pydicom/scripts/uid_mapping_validator.py +0 -240
- package/skills/pyhealth/assets/starter_pipeline.py +0 -58
- package/skills/pyhealth/references/datasets.md +0 -126
- package/skills/pyhealth/references/examples.md +0 -237
- package/skills/pyhealth/references/installation.md +0 -112
- package/skills/pyhealth/references/medcode.md +0 -94
- package/skills/pyhealth/references/models.md +0 -114
- package/skills/pyhealth/references/tasks.md +0 -143
- package/skills/pylabrobot/assets/protocol-manifest.schema.json +0 -367
- package/skills/pylabrobot/references/analytical-equipment.md +0 -200
- package/skills/pylabrobot/references/hardware-backends.md +0 -215
- package/skills/pylabrobot/references/liquid-handling.md +0 -223
- package/skills/pylabrobot/references/material-handling.md +0 -229
- package/skills/pylabrobot/references/resources.md +0 -238
- package/skills/pylabrobot/references/visualization.md +0 -187
- package/skills/pylabrobot/scripts/__init__.py +0 -1
- package/skills/pylabrobot/scripts/_common.py +0 -718
- package/skills/pylabrobot/scripts/check_deck_geometry.py +0 -52
- package/skills/pylabrobot/scripts/generate_simulation_plan.py +0 -140
- package/skills/pylabrobot/scripts/inspect_backends.py +0 -216
- package/skills/pylabrobot/scripts/plan_transfers.py +0 -59
- package/skills/pylabrobot/scripts/validate_manifest.py +0 -47
- package/skills/pymatgen/references/analysis_modules.md +0 -352
- package/skills/pymatgen/references/core_classes.md +0 -290
- package/skills/pymatgen/references/io_formats.md +0 -323
- package/skills/pymatgen/references/materials_project_api.md +0 -406
- package/skills/pymatgen/references/transformations_workflows.md +0 -385
- package/skills/pymatgen/scripts/_common.py +0 -316
- package/skills/pymatgen/scripts/artifact_manifest.py +0 -172
- package/skills/pymatgen/scripts/composition_structure_validator.py +0 -300
- package/skills/pymatgen/scripts/io_conversion_plan.py +0 -204
- package/skills/pymatgen/scripts/mp_query.py +0 -416
- package/skills/pymatgen/scripts/phase_diagram_generator.py +0 -415
- package/skills/pymatgen/scripts/structure_analyzer.py +0 -293
- package/skills/pymatgen/scripts/structure_converter.py +0 -219
- package/skills/pymatgen/scripts/symmetry_sensitivity_report.py +0 -212
- package/skills/pymc/assets/hierarchical_model_template.py +0 -332
- package/skills/pymc/assets/linear_regression_template.py +0 -244
- package/skills/pymc/references/distributions.md +0 -345
- package/skills/pymc/references/model_patterns.md +0 -130
- package/skills/pymc/references/sampling_inference.md +0 -432
- package/skills/pymc/references/standard_workflow.md +0 -176
- package/skills/pymc/references/workflows.md +0 -530
- package/skills/pymc/scripts/model_comparison.py +0 -409
- package/skills/pymc/scripts/model_diagnostics.py +0 -328
- package/skills/pymoo/references/algorithms.md +0 -232
- package/skills/pymoo/references/constraints_mcdm.md +0 -417
- package/skills/pymoo/references/operators.md +0 -345
- package/skills/pymoo/references/parallelization.md +0 -80
- package/skills/pymoo/references/problems.md +0 -265
- package/skills/pymoo/references/quick_start_workflows.md +0 -404
- package/skills/pymoo/references/visualization.md +0 -353
- package/skills/pymoo/scripts/custom_problem_example.py +0 -181
- package/skills/pymoo/scripts/decision_making_example.py +0 -161
- package/skills/pymoo/scripts/many_objective_example.py +0 -74
- package/skills/pymoo/scripts/multi_objective_example.py +0 -63
- package/skills/pymoo/scripts/single_objective_example.py +0 -59
- package/skills/pyopenms/references/data_structures.md +0 -498
- package/skills/pyopenms/references/feature_detection.md +0 -495
- package/skills/pyopenms/references/file_io.md +0 -359
- package/skills/pyopenms/references/identification.md +0 -431
- package/skills/pyopenms/references/metabolomics.md +0 -548
- package/skills/pyopenms/references/signal_processing.md +0 -444
- package/skills/pyopenms/scripts/accurate_mass_search.py +0 -111
- package/skills/pyopenms/scripts/align_link_quantify.py +0 -140
- package/skills/pyopenms/scripts/consensus_to_matrix.py +0 -70
- package/skills/pyopenms/scripts/convert_format.py +0 -95
- package/skills/pyopenms/scripts/detect_adducts.py +0 -90
- package/skills/pyopenms/scripts/detect_features_centroided.py +0 -80
- package/skills/pyopenms/scripts/detect_features_metabo.py +0 -110
- package/skills/pyopenms/scripts/digest_protein.py +0 -102
- package/skills/pyopenms/scripts/export_gnps_sirius.py +0 -90
- package/skills/pyopenms/scripts/extract_chromatograms.py +0 -105
- package/skills/pyopenms/scripts/inspect_ms_data.py +0 -167
- package/skills/pyopenms/scripts/mass_calculator.py +0 -92
- package/skills/pyopenms/scripts/plot_ms_data.py +0 -129
- package/skills/pyopenms/scripts/process_identifications.py +0 -111
- package/skills/pyopenms/scripts/process_spectra.py +0 -124
- package/skills/pyopenms/scripts/theoretical_spectrum.py +0 -75
- package/skills/pysam/references/alignment_files.md +0 -374
- package/skills/pysam/references/api_reference.md +0 -421
- package/skills/pysam/references/common_workflows.md +0 -442
- package/skills/pysam/references/coordinates_and_indexing.md +0 -318
- package/skills/pysam/references/cram_and_performance.md +0 -314
- package/skills/pysam/references/migration_to_0_24.md +0 -177
- package/skills/pysam/references/sequence_files.md +0 -316
- package/skills/pysam/references/sources.md +0 -132
- package/skills/pysam/references/variant_files.md +0 -396
- package/skills/pysam/scripts/alignment_qc.py +0 -326
- package/skills/pysam/scripts/filter_alignments.py +0 -359
- package/skills/pysam/scripts/inspect_hts.py +0 -485
- package/skills/pysam/scripts/variant_summary.py +0 -362
- package/skills/pytdc/references/datasets.md +0 -242
- package/skills/pytdc/references/oracles.md +0 -273
- package/skills/pytdc/references/sources.md +0 -165
- package/skills/pytdc/references/utilities.md +0 -364
- package/skills/pytdc/scripts/_common.py +0 -205
- package/skills/pytdc/scripts/benchmark_evaluation.py +0 -367
- package/skills/pytdc/scripts/cache_audit.py +0 -146
- package/skills/pytdc/scripts/discover_metadata.py +0 -174
- package/skills/pytdc/scripts/load_and_split_data.py +0 -374
- package/skills/pytdc/scripts/molecular_generation.py +0 -417
- package/skills/pytorch-lightning/references/best_practices.md +0 -724
- package/skills/pytorch-lightning/references/callbacks.md +0 -564
- package/skills/pytorch-lightning/references/data_module.md +0 -565
- package/skills/pytorch-lightning/references/distributed_training.md +0 -644
- package/skills/pytorch-lightning/references/lightning_module.md +0 -487
- package/skills/pytorch-lightning/references/logging.md +0 -636
- package/skills/pytorch-lightning/references/trainer.md +0 -641
- package/skills/pytorch-lightning/scripts/quick_trainer_setup.py +0 -473
- package/skills/pytorch-lightning/scripts/template_datamodule.py +0 -328
- package/skills/pytorch-lightning/scripts/template_lightning_module.py +0 -220
- package/skills/pyzotero/references/authentication.md +0 -105
- package/skills/pyzotero/references/cli.md +0 -102
- package/skills/pyzotero/references/collections.md +0 -113
- package/skills/pyzotero/references/error-handling.md +0 -108
- package/skills/pyzotero/references/exports.md +0 -102
- package/skills/pyzotero/references/files-attachments.md +0 -97
- package/skills/pyzotero/references/full-text.md +0 -68
- package/skills/pyzotero/references/mcp.md +0 -90
- package/skills/pyzotero/references/pagination.md +0 -79
- package/skills/pyzotero/references/read-api.md +0 -137
- package/skills/pyzotero/references/saved-searches.md +0 -77
- package/skills/pyzotero/references/search-params.md +0 -90
- package/skills/pyzotero/references/tags.md +0 -87
- package/skills/pyzotero/references/write-api.md +0 -123
- package/skills/qiskit/references/algorithms.md +0 -311
- package/skills/qiskit/references/backends.md +0 -382
- package/skills/qiskit/references/circuits.md +0 -319
- package/skills/qiskit/references/migration.md +0 -338
- package/skills/qiskit/references/patterns.md +0 -386
- package/skills/qiskit/references/primitives.md +0 -400
- package/skills/qiskit/references/setup.md +0 -253
- package/skills/qiskit/references/sources.md +0 -156
- package/skills/qiskit/references/testing.md +0 -428
- package/skills/qiskit/references/transpilation.md +0 -333
- package/skills/qiskit/references/visualization.md +0 -361
- package/skills/qiskit/scripts/check_environment.py +0 -260
- package/skills/qiskit/scripts/inspect_runtime.py +0 -224
- package/skills/qiskit/scripts/run_local_primitives.py +0 -200
- package/skills/qutip/references/advanced.md +0 -413
- package/skills/qutip/references/analysis.md +0 -319
- package/skills/qutip/references/core_concepts.md +0 -300
- package/skills/qutip/references/time_evolution.md +0 -373
- package/skills/qutip/references/visualization.md +0 -334
- package/skills/qutip/scripts/_common.py +0 -370
- package/skills/qutip/scripts/convergence_sweep.py +0 -358
- package/skills/qutip/scripts/qobj_model_validator.py +0 -327
- package/skills/qutip/scripts/result_audit.py +0 -395
- package/skills/qutip/scripts/solver_config_planner.py +0 -297
- package/skills/qutip/scripts/steady_state_spectrum_planner.py +0 -245
- package/skills/qutip/scripts/two_level_simulation.py +0 -394
- package/skills/rdkit/references/api_reference.md +0 -443
- package/skills/rdkit/references/core_capabilities.md +0 -604
- package/skills/rdkit/references/descriptors_reference.md +0 -595
- package/skills/rdkit/references/smarts_patterns.md +0 -668
- package/skills/rdkit/references/workflows_and_best_practices.md +0 -169
- package/skills/rdkit/scripts/molecular_properties.py +0 -243
- package/skills/rdkit/scripts/similarity_search.py +0 -297
- package/skills/rdkit/scripts/substructure_filter.py +0 -386
- package/skills/relsa-severity-assessment/assets/example_cohort.csv +0 -55
- package/skills/relsa-severity-assessment/references/forecasting.md +0 -155
- package/skills/relsa-severity-assessment/references/relsa-method.md +0 -175
- package/skills/relsa-severity-assessment/references/thresholds-and-zones.md +0 -154
- package/skills/relsa-severity-assessment/scripts/_common.py +0 -287
- package/skills/relsa-severity-assessment/scripts/forecast_relsa.py +0 -757
- package/skills/relsa-severity-assessment/scripts/kde_thresholds.py +0 -369
- package/skills/relsa-severity-assessment/scripts/relsa_score.py +0 -488
- package/skills/research-grants/assets/budget_justification_template.md +0 -453
- package/skills/research-grants/assets/nih_specific_aims_template.md +0 -166
- package/skills/research-grants/assets/nsf_project_summary_template.md +0 -92
- package/skills/research-grants/references/broader_impacts.md +0 -392
- package/skills/research-grants/references/core_components.md +0 -397
- package/skills/research-grants/references/darpa_guidelines.md +0 -636
- package/skills/research-grants/references/doe_guidelines.md +0 -586
- package/skills/research-grants/references/nih_guidelines.md +0 -853
- package/skills/research-grants/references/nsf_guidelines.md +0 -570
- package/skills/research-grants/references/nstc_guidelines.md +0 -733
- package/skills/research-grants/references/proposal_types_and_resubmission.md +0 -81
- package/skills/research-grants/references/review_criteria.md +0 -93
- package/skills/research-grants/references/specific_aims_guide.md +0 -458
- package/skills/research-grants/references/writing_principles.md +0 -94
- package/skills/research-lookup/scripts/manuscript_packet.py +0 -754
- package/skills/research-lookup/scripts/research_lookup.py +0 -1204
- package/skills/rowan/references/access_and_pricing.md +0 -37
- package/skills/rowan/references/batch_and_webhooks.md +0 -255
- package/skills/rowan/references/end_to_end_example.md +0 -119
- package/skills/rowan/references/troubleshooting.md +0 -106
- package/skills/rowan/references/workflow_catalog.md +0 -308
- package/skills/scanpy/assets/analysis_template.py +0 -301
- package/skills/scanpy/assets/celltype_mapping.json +0 -10
- package/skills/scanpy/assets/gene_signatures.json +0 -9
- package/skills/scanpy/assets/pipeline_config.json +0 -19
- package/skills/scanpy/references/analysis_workflow.md +0 -236
- package/skills/scanpy/references/api_reference.md +0 -267
- package/skills/scanpy/references/plotting_guide.md +0 -365
- package/skills/scanpy/references/r_interop.md +0 -292
- package/skills/scanpy/references/standard_workflow.md +0 -223
- package/skills/scanpy/scripts/_common.py +0 -127
- package/skills/scanpy/scripts/annotate.py +0 -84
- package/skills/scanpy/scripts/batch_correct.py +0 -65
- package/skills/scanpy/scripts/cluster.py +0 -63
- package/skills/scanpy/scripts/convert.py +0 -43
- package/skills/scanpy/scripts/find_markers.py +0 -75
- package/skills/scanpy/scripts/inspect_data.py +0 -81
- package/skills/scanpy/scripts/plot.py +0 -78
- package/skills/scanpy/scripts/preprocess.py +0 -88
- package/skills/scanpy/scripts/pseudobulk.py +0 -74
- package/skills/scanpy/scripts/qc_analysis.py +0 -104
- package/skills/scanpy/scripts/reduce_dimensions.py +0 -64
- package/skills/scanpy/scripts/run_pipeline.py +0 -182
- package/skills/scanpy/scripts/score_genes.py +0 -82
- package/skills/scanpy/scripts/subset.py +0 -64
- package/skills/scholar-evaluation/assets/evaluation_template.json +0 -50
- package/skills/scholar-evaluation/assets/evidence_manifest_template.json +0 -63
- package/skills/scholar-evaluation/assets/process_checklist_template.json +0 -70
- package/skills/scholar-evaluation/assets/ratings_template.csv +0 -21
- package/skills/scholar-evaluation/assets/rubric_template.json +0 -301
- package/skills/scholar-evaluation/references/evaluation_framework.md +0 -264
- package/skills/scholar-evaluation/references/local_tooling.md +0 -232
- package/skills/scholar-evaluation/references/responsible_assessment.md +0 -196
- package/skills/scholar-evaluation/references/security_validation.md +0 -95
- package/skills/scholar-evaluation/references/source_ledger.md +0 -222
- package/skills/scholar-evaluation/scripts/_common.py +0 -986
- package/skills/scholar-evaluation/scripts/calculate_scores.py +0 -57
- package/skills/scholar-evaluation/scripts/check_process.py +0 -231
- package/skills/scholar-evaluation/scripts/check_traceability.py +0 -233
- package/skills/scholar-evaluation/scripts/generate_report_scaffold.py +0 -231
- package/skills/scholar-evaluation/scripts/summarize_agreement.py +0 -235
- package/skills/scholar-evaluation/scripts/validate_rubric.py +0 -54
- package/skills/scholar-evaluation/scripts/weight_sensitivity.py +0 -251
- package/skills/scientific-brainstorming/references/brainstorming_methods.md +0 -292
- package/skills/scientific-brainstorming/references/facilitation_workflows.md +0 -284
- package/skills/scientific-brainstorming/references/idea_evaluation.md +0 -268
- package/skills/scientific-brainstorming/references/responsible_ai.md +0 -220
- package/skills/scientific-brainstorming/references/sources.md +0 -364
- package/skills/scientific-brainstorming/scripts/_common.py +0 -307
- package/skills/scientific-brainstorming/scripts/evaluate_matrix.py +0 -518
- package/skills/scientific-brainstorming/scripts/session_scaffold.py +0 -248
- package/skills/scientific-brainstorming/scripts/validate_register.py +0 -654
- package/skills/scientific-critical-thinking/references/common_biases.md +0 -364
- package/skills/scientific-critical-thinking/references/core_capabilities.md +0 -407
- package/skills/scientific-critical-thinking/references/evidence_hierarchy.md +0 -485
- package/skills/scientific-critical-thinking/references/experimental_design.md +0 -496
- package/skills/scientific-critical-thinking/references/logical_fallacies.md +0 -478
- package/skills/scientific-critical-thinking/references/scientific_method.md +0 -169
- package/skills/scientific-critical-thinking/references/statistical_pitfalls.md +0 -506
- package/skills/scientific-schematics/references/best_practices.md +0 -574
- package/skills/scientific-schematics/references/iterative_refinement.md +0 -315
- package/skills/scientific-schematics/scripts/example_usage.sh +0 -92
- package/skills/scientific-schematics/scripts/generate_schematic.py +0 -198
- package/skills/scientific-schematics/scripts/generate_schematic_ai.py +0 -950
- package/skills/scientific-slides/assets/beamer_template_conference.tex +0 -407
- package/skills/scientific-slides/assets/beamer_template_defense.tex +0 -906
- package/skills/scientific-slides/assets/beamer_template_seminar.tex +0 -870
- package/skills/scientific-slides/assets/powerpoint_design_guide.md +0 -662
- package/skills/scientific-slides/assets/timing_guidelines.md +0 -597
- package/skills/scientific-slides/references/beamer_guide.md +0 -1019
- package/skills/scientific-slides/references/common_pitfalls.md +0 -85
- package/skills/scientific-slides/references/data_visualization_slides.md +0 -708
- package/skills/scientific-slides/references/presentation_structure.md +0 -642
- package/skills/scientific-slides/references/presentation_workflow.md +0 -196
- package/skills/scientific-slides/references/prompt_writing.md +0 -42
- package/skills/scientific-slides/references/script_reference.md +0 -143
- package/skills/scientific-slides/references/slide_capabilities.md +0 -360
- package/skills/scientific-slides/references/slide_design_principles.md +0 -849
- package/skills/scientific-slides/references/talk_types_guide.md +0 -687
- package/skills/scientific-slides/references/visual_review_workflow.md +0 -775
- package/skills/scientific-slides/scripts/generate_schematic.py +0 -198
- package/skills/scientific-slides/scripts/generate_schematic_ai.py +0 -950
- package/skills/scientific-slides/scripts/generate_slide_image.py +0 -197
- package/skills/scientific-slides/scripts/generate_slide_image_ai.py +0 -877
- package/skills/scientific-slides/scripts/pdf_to_images.py +0 -221
- package/skills/scientific-slides/scripts/slides_to_pdf.py +0 -235
- package/skills/scientific-slides/scripts/validate_presentation.py +0 -408
- package/skills/scientific-visualization/assets/color_palettes.py +0 -263
- package/skills/scientific-visualization/assets/nature.mplstyle +0 -68
- package/skills/scientific-visualization/assets/presentation.mplstyle +0 -68
- package/skills/scientific-visualization/assets/publication.mplstyle +0 -77
- package/skills/scientific-visualization/assets/publisher_profiles.json +0 -269
- package/skills/scientific-visualization/references/color_palettes.md +0 -227
- package/skills/scientific-visualization/references/journal_requirements.md +0 -169
- package/skills/scientific-visualization/references/matplotlib_examples.md +0 -336
- package/skills/scientific-visualization/references/publication_guidelines.md +0 -196
- package/skills/scientific-visualization/references/sources.md +0 -76
- package/skills/scientific-visualization/scripts/_common.py +0 -136
- package/skills/scientific-visualization/scripts/export_plan.py +0 -493
- package/skills/scientific-visualization/scripts/figure_export.py +0 -642
- package/skills/scientific-visualization/scripts/image_metadata.py +0 -731
- package/skills/scientific-visualization/scripts/palette_audit.py +0 -327
- package/skills/scientific-visualization/scripts/style_presets.py +0 -501
- package/skills/scientific-visualization/scripts/style_preview.py +0 -232
- package/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +0 -60
- package/skills/scientific-writing/assets/authorship_template.json +0 -56
- package/skills/scientific-writing/assets/claim_evidence_template.csv +0 -2
- package/skills/scientific-writing/assets/consistency_manifest_template.json +0 -43
- package/skills/scientific-writing/assets/manuscript_manifest_template.json +0 -37
- package/skills/scientific-writing/assets/manuscript_scaffold.md +0 -65
- package/skills/scientific-writing/assets/reporting_coverage_template.json +0 -6
- package/skills/scientific-writing/assets/reporting_guidelines.json +0 -529
- package/skills/scientific-writing/assets/source_manifest_template.json +0 -27
- package/skills/scientific-writing/references/authorship_ai_confidentiality.md +0 -111
- package/skills/scientific-writing/references/citation_styles.md +0 -92
- package/skills/scientific-writing/references/cli_reference.md +0 -113
- package/skills/scientific-writing/references/evidence_workflow.md +0 -94
- package/skills/scientific-writing/references/figures_tables.md +0 -94
- package/skills/scientific-writing/references/imrad_structure.md +0 -114
- package/skills/scientific-writing/references/journal_policies.md +0 -56
- package/skills/scientific-writing/references/professional_report_formatting.md +0 -82
- package/skills/scientific-writing/references/reporting_guidelines.md +0 -107
- package/skills/scientific-writing/references/research_integrity_open_science.md +0 -97
- package/skills/scientific-writing/references/source_ledger.md +0 -268
- package/skills/scientific-writing/references/writing_principles.md +0 -97
- package/skills/scientific-writing/scripts/_common.py +0 -240
- package/skills/scientific-writing/scripts/audit_claims.py +0 -241
- package/skills/scientific-writing/scripts/check_consistency.py +0 -408
- package/skills/scientific-writing/scripts/check_references.py +0 -219
- package/skills/scientific-writing/scripts/lint_manuscript.py +0 -171
- package/skills/scientific-writing/scripts/scaffold_manuscript.py +0 -143
- package/skills/scientific-writing/scripts/select_reporting_guidelines.py +0 -214
- package/skills/scientific-writing/scripts/validate_authorship.py +0 -322
- package/skills/scientific-writing/scripts/validate_manifest.py +0 -460
- package/skills/scikit-bio/references/api_reference.md +0 -766
- package/skills/scikit-learn/references/common_workflows.md +0 -107
- package/skills/scikit-learn/references/core_capabilities.md +0 -133
- package/skills/scikit-learn/references/model_evaluation.md +0 -592
- package/skills/scikit-learn/references/pipelines_and_composition.md +0 -612
- package/skills/scikit-learn/references/preprocessing.md +0 -606
- package/skills/scikit-learn/references/quick_reference.md +0 -436
- package/skills/scikit-learn/references/supervised_learning.md +0 -379
- package/skills/scikit-learn/references/unsupervised_learning.md +0 -517
- package/skills/scikit-learn/scripts/classification_pipeline.py +0 -257
- package/skills/scikit-learn/scripts/clustering_analysis.py +0 -386
- package/skills/scikit-survival/references/competing-risks.md +0 -302
- package/skills/scikit-survival/references/cox-models.md +0 -252
- package/skills/scikit-survival/references/data-handling.md +0 -278
- package/skills/scikit-survival/references/ensemble-models.md +0 -287
- package/skills/scikit-survival/references/evaluation-metrics.md +0 -391
- package/skills/scikit-survival/references/svm-models.md +0 -277
- package/skills/scikit-survival/scripts/_common.py +0 -456
- package/skills/scikit-survival/scripts/competing_risk_cif.py +0 -286
- package/skills/scikit-survival/scripts/evaluate_survival_metrics.py +0 -296
- package/skills/scikit-survival/scripts/model_report.py +0 -297
- package/skills/scikit-survival/scripts/train_survival_model.py +0 -583
- package/skills/scikit-survival/scripts/validate_survival_csv.py +0 -172
- package/skills/scvelo/references/velocity_models.md +0 -168
- package/skills/scvelo/scripts/rna_velocity_workflow.py +0 -240
- package/skills/scvi-tools/references/differential-expression.md +0 -597
- package/skills/scvi-tools/references/models-atac-seq.md +0 -329
- package/skills/scvi-tools/references/models-multimodal.md +0 -400
- package/skills/scvi-tools/references/models-scrna-seq.md +0 -333
- package/skills/scvi-tools/references/models-spatial.md +0 -432
- package/skills/scvi-tools/references/models-specialized.md +0 -376
- package/skills/scvi-tools/references/theoretical-foundations.md +0 -438
- package/skills/scvi-tools/references/workflows.md +0 -559
- package/skills/seaborn/references/examples.md +0 -824
- package/skills/seaborn/references/function_reference.md +0 -772
- package/skills/seaborn/references/grids_and_levels.md +0 -85
- package/skills/seaborn/references/objects_interface.md +0 -963
- package/skills/seaborn/references/palettes_and_theming.md +0 -110
- package/skills/seaborn/references/patterns_and_troubleshooting.md +0 -114
- package/skills/seaborn/references/plotting_functions.md +0 -178
- package/skills/shap/references/data-maskers.md +0 -287
- package/skills/shap/references/explainers.md +0 -376
- package/skills/shap/references/migration.md +0 -415
- package/skills/shap/references/modalities.md +0 -353
- package/skills/shap/references/plots.md +0 -406
- package/skills/shap/references/theory.md +0 -352
- package/skills/shap/references/troubleshooting.md +0 -442
- package/skills/shap/references/workflows.md +0 -565
- package/skills/shap/scripts/tabular_report.py +0 -326
- package/skills/simpy/references/cli-guide.md +0 -266
- package/skills/simpy/references/events.md +0 -225
- package/skills/simpy/references/monitoring.md +0 -260
- package/skills/simpy/references/process-interaction.md +0 -269
- package/skills/simpy/references/real-time.md +0 -174
- package/skills/simpy/references/resources.md +0 -274
- package/skills/simpy/references/simulation-methodology.md +0 -293
- package/skills/simpy/references/sources.md +0 -167
- package/skills/simpy/scripts/_common.py +0 -473
- package/skills/simpy/scripts/basic_simulation_template.py +0 -415
- package/skills/simpy/scripts/bounded_queue_scenario.py +0 -126
- package/skills/simpy/scripts/event_trace_summary.py +0 -296
- package/skills/simpy/scripts/replication_runner.py +0 -194
- package/skills/simpy/scripts/resource_monitor.py +0 -474
- package/skills/simpy/scripts/validate_simulation_config.py +0 -111
- package/skills/stable-baselines3/references/algorithms.md +0 -348
- package/skills/stable-baselines3/references/callbacks.md +0 -571
- package/skills/stable-baselines3/references/custom_environments.md +0 -528
- package/skills/stable-baselines3/references/vectorized_envs.md +0 -580
- package/skills/stable-baselines3/scripts/custom_env_template.py +0 -314
- package/skills/stable-baselines3/scripts/evaluate_agent.py +0 -245
- package/skills/stable-baselines3/scripts/train_rl_agent.py +0 -165
- package/skills/statistical-analysis/references/assumptions_and_diagnostics.md +0 -379
- package/skills/statistical-analysis/references/bayesian_statistics.md +0 -686
- package/skills/statistical-analysis/references/effect_sizes_and_power.md +0 -649
- package/skills/statistical-analysis/references/reporting_standards.md +0 -482
- package/skills/statistical-analysis/references/test_selection_guide.md +0 -129
- package/skills/statistical-analysis/scripts/assumption_checks.py +0 -652
- package/skills/statistical-power/references/closed_form_recipes.md +0 -174
- package/skills/statistical-power/references/effect_sizes.md +0 -121
- package/skills/statistical-power/references/simulation_based_power.md +0 -101
- package/skills/statistical-power/scripts/power.py +0 -320
- package/skills/statistical-power/scripts/simulate_power.py +0 -217
- package/skills/statsmodels/references/discrete_choice.md +0 -669
- package/skills/statsmodels/references/glm.md +0 -619
- package/skills/statsmodels/references/linear_models.md +0 -447
- package/skills/statsmodels/references/model_selection.md +0 -99
- package/skills/statsmodels/references/modeling_capabilities.md +0 -168
- package/skills/statsmodels/references/quick_start_guide.md +0 -154
- package/skills/statsmodels/references/stats_diagnostics.md +0 -859
- package/skills/statsmodels/references/time_series.md +0 -723
- package/skills/sympy/references/advanced-topics.md +0 -635
- package/skills/sympy/references/code-generation-printing.md +0 -628
- package/skills/sympy/references/core-capabilities.md +0 -348
- package/skills/sympy/references/core_capabilities.md +0 -190
- package/skills/sympy/references/matrices-linear-algebra.md +0 -526
- package/skills/sympy/references/physics-mechanics.md +0 -592
- package/skills/tamarind/references/api_reference.md +0 -165
- package/skills/tamarind/references/examples.md +0 -132
- package/skills/tamarind/references/tool_catalog.md +0 -66
- package/skills/tamarind/references/workflows.md +0 -263
- package/skills/timesfm-forecasting/examples/anomaly-detection/detect_anomalies.py +0 -524
- package/skills/timesfm-forecasting/examples/anomaly-detection/output/anomaly_detection.json +0 -448
- package/skills/timesfm-forecasting/examples/anomaly-detection/output/anomaly_detection.png +0 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/demo_covariates.py +0 -568
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/covariates_data.png +0 -0
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/covariates_metadata.json +0 -59
- package/skills/timesfm-forecasting/examples/covariates-forecasting/output/sales_with_covariates.csv +0 -109
- package/skills/timesfm-forecasting/examples/global-temperature/generate_animation_data.py +0 -147
- package/skills/timesfm-forecasting/examples/global-temperature/generate_gif.py +0 -248
- package/skills/timesfm-forecasting/examples/global-temperature/generate_html.py +0 -544
- package/skills/timesfm-forecasting/examples/global-temperature/output/animation_data.json +0 -5441
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_animation.gif +0 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_output.csv +0 -13
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_output.json +0 -188
- package/skills/timesfm-forecasting/examples/global-temperature/output/forecast_visualization.png +0 -0
- package/skills/timesfm-forecasting/examples/global-temperature/output/interactive_forecast.html +0 -5939
- package/skills/timesfm-forecasting/examples/global-temperature/run_example.sh +0 -53
- package/skills/timesfm-forecasting/examples/global-temperature/run_forecast.py +0 -167
- package/skills/timesfm-forecasting/examples/global-temperature/temperature_anomaly.csv +0 -37
- package/skills/timesfm-forecasting/examples/global-temperature/visualize_forecast.py +0 -123
- package/skills/timesfm-forecasting/references/api_reference.md +0 -231
- package/skills/timesfm-forecasting/references/data_preparation.md +0 -272
- package/skills/timesfm-forecasting/references/examples_and_validation.md +0 -103
- package/skills/timesfm-forecasting/references/output_and_config.md +0 -93
- package/skills/timesfm-forecasting/references/performance_tuning.md +0 -80
- package/skills/timesfm-forecasting/references/system_requirements.md +0 -201
- package/skills/timesfm-forecasting/references/workflows.md +0 -126
- package/skills/timesfm-forecasting/scripts/check_system.py +0 -521
- package/skills/timesfm-forecasting/scripts/forecast_csv.py +0 -269
- package/skills/torch-geometric/references/custom_datasets.md +0 -239
- package/skills/torch-geometric/references/explainability.md +0 -208
- package/skills/torch-geometric/references/heterogeneous.md +0 -241
- package/skills/torch-geometric/references/link_prediction.md +0 -226
- package/skills/torch-geometric/references/message_passing.md +0 -121
- package/skills/torch-geometric/references/scaling.md +0 -269
- package/skills/torchdrug/references/core_concepts.md +0 -241
- package/skills/torchdrug/references/datasets.md +0 -179
- package/skills/torchdrug/references/knowledge_graphs.md +0 -226
- package/skills/torchdrug/references/models_architectures.md +0 -223
- package/skills/torchdrug/references/molecular_generation.md +0 -246
- package/skills/torchdrug/references/molecular_property_prediction.md +0 -239
- package/skills/torchdrug/references/protein_modeling.md +0 -221
- package/skills/torchdrug/references/retrosynthesis.md +0 -247
- package/skills/transformers/references/generation.md +0 -473
- package/skills/transformers/references/models.md +0 -371
- package/skills/transformers/references/pipelines.md +0 -334
- package/skills/transformers/references/tokenizers.md +0 -449
- package/skills/transformers/references/training.md +0 -504
- package/skills/treatment-plans/assets/clinician_authored_intervention_template.json +0 -11
- package/skills/treatment-plans/assets/goals_monitoring_checkpoint_template.json +0 -13
- package/skills/treatment-plans/assets/informed_preference_shared_decision_template.json +0 -11
- package/skills/treatment-plans/assets/intended_use_handoff_template.json +0 -83
- package/skills/treatment-plans/assets/source_fact_manifest_template.json +0 -11
- package/skills/treatment-plans/assets/transition_reconciliation_template.json +0 -27
- package/skills/treatment-plans/references/documentation_workflow.md +0 -165
- package/skills/treatment-plans/references/privacy_governance.md +0 -119
- package/skills/treatment-plans/references/safety_scope.md +0 -101
- package/skills/treatment-plans/references/security_validation.md +0 -68
- package/skills/treatment-plans/references/shared_decision_handoff.md +0 -138
- package/skills/treatment-plans/references/source_boundaries.md +0 -127
- package/skills/treatment-plans/references/source_ledger.md +0 -131
- package/skills/treatment-plans/scripts/_common.py +0 -1160
- package/skills/treatment-plans/scripts/check_completeness.py +0 -572
- package/skills/treatment-plans/scripts/check_consistency.py +0 -386
- package/skills/treatment-plans/scripts/generate_template.py +0 -133
- package/skills/treatment-plans/scripts/privacy_process_check.py +0 -213
- package/skills/treatment-plans/scripts/timeline_generator.py +0 -260
- package/skills/treatment-plans/scripts/validate_traceability.py +0 -147
- package/skills/treatment-plans/scripts/validate_treatment_plan.py +0 -95
- package/skills/umap-learn/references/api_reference.md +0 -574
- package/skills/uncertainty-and-units/references/domain-conversions.md +0 -188
- package/skills/uncertainty-and-units/references/gum-methodology.md +0 -219
- package/skills/uncertainty-and-units/references/pint-recipes.md +0 -228
- package/skills/uncertainty-and-units/references/plausibility-scales.md +0 -168
- package/skills/uncertainty-and-units/references/reporting-rules.md +0 -133
- package/skills/uncertainty-and-units/references/uncertainties-recipes.md +0 -167
- package/skills/uncertainty-and-units/scripts/_common.py +0 -666
- package/skills/uncertainty-and-units/scripts/audit_units.py +0 -575
- package/skills/uncertainty-and-units/scripts/check_plausibility.py +0 -894
- package/skills/uncertainty-and-units/scripts/convert_units.py +0 -280
- package/skills/uncertainty-and-units/scripts/format_result.py +0 -326
- package/skills/uncertainty-and-units/scripts/propagate_uncertainty.py +0 -662
- package/skills/uncertainty-and-units/scripts/uncertainty_budget.py +0 -363
- package/skills/usfiscaldata/references/api-basics.md +0 -105
- package/skills/usfiscaldata/references/datasets-debt.md +0 -166
- package/skills/usfiscaldata/references/datasets-fiscal.md +0 -212
- package/skills/usfiscaldata/references/datasets-interest-rates.md +0 -188
- package/skills/usfiscaldata/references/datasets-securities.md +0 -238
- package/skills/usfiscaldata/references/examples.md +0 -258
- package/skills/usfiscaldata/references/parameters.md +0 -182
- package/skills/usfiscaldata/references/response-format.md +0 -178
- package/skills/vaex/references/core_dataframes.md +0 -373
- package/skills/vaex/references/data_processing.md +0 -555
- package/skills/vaex/references/io_operations.md +0 -718
- package/skills/vaex/references/machine_learning.md +0 -728
- package/skills/vaex/references/performance.md +0 -571
- package/skills/vaex/references/visualization.md +0 -644
- package/skills/venue-templates/assets/examples/cell_summary_example.md +0 -247
- package/skills/venue-templates/assets/examples/medical_structured_abstract.md +0 -313
- package/skills/venue-templates/assets/examples/nature_abstract_examples.md +0 -213
- package/skills/venue-templates/assets/examples/neurips_introduction_example.md +0 -245
- package/skills/venue-templates/assets/grants/nih_specific_aims.tex +0 -237
- package/skills/venue-templates/assets/grants/nsf_proposal_template.tex +0 -384
- package/skills/venue-templates/assets/journals/elsarticle-harv.bst +0 -1598
- package/skills/venue-templates/assets/journals/elsarticle-num-names.bst +0 -1535
- package/skills/venue-templates/assets/journals/elsarticle-num.bst +0 -1509
- package/skills/venue-templates/assets/journals/elsarticle-template-harv.tex +0 -286
- package/skills/venue-templates/assets/journals/elsarticle-template-num-names.tex +0 -284
- package/skills/venue-templates/assets/journals/elsarticle-template-num.tex +0 -286
- package/skills/venue-templates/assets/journals/nature_article.tex +0 -174
- package/skills/venue-templates/assets/journals/neurips_article.tex +0 -292
- package/skills/venue-templates/assets/journals/plos_one.tex +0 -320
- package/skills/venue-templates/assets/posters/beamerposter_academic.tex +0 -312
- package/skills/venue-templates/references/cell_press_style.md +0 -486
- package/skills/venue-templates/references/conferences_formatting.md +0 -175
- package/skills/venue-templates/references/cs_conference_style.md +0 -465
- package/skills/venue-templates/references/grants_requirements.md +0 -267
- package/skills/venue-templates/references/journals_formatting.md +0 -200
- package/skills/venue-templates/references/medical_journal_styles.md +0 -536
- package/skills/venue-templates/references/ml_conference_style.md +0 -562
- package/skills/venue-templates/references/nature_science_style.md +0 -407
- package/skills/venue-templates/references/posters_guidelines.md +0 -630
- package/skills/venue-templates/references/reviewer_expectations.md +0 -422
- package/skills/venue-templates/references/venue_writing_styles.md +0 -323
- package/skills/venue-templates/scripts/customize_template.py +0 -206
- package/skills/venue-templates/scripts/query_template.py +0 -202
- package/skills/venue-templates/scripts/validate_format.py +0 -321
- package/skills/waypoint-bio/references/cli-reference.md +0 -210
- package/skills/waypoint-bio/references/compass-benchmark.md +0 -124
- package/skills/waypoint-bio/references/data-preparation.md +0 -200
- package/skills/waypoint-bio/references/python-api.md +0 -219
- package/skills/waypoint-bio/scripts/profiler_to_waypoint.py +0 -481
- package/skills/waypoint-bio/scripts/vocab_coverage.py +0 -235
- package/skills/what-if-oracle/references/scenario-templates.md +0 -137
- package/skills/xlsx/LICENSE.txt +0 -30
- package/skills/xlsx/scripts/office/helpers/__init__.py +0 -111
- package/skills/xlsx/scripts/office/helpers/pptx_chart.py +0 -170
- package/skills/xlsx/scripts/office/helpers/pptx_slide.py +0 -60
- package/skills/xlsx/scripts/office/helpers/pptx_theme.py +0 -114
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
- package/skills/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
- package/skills/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
- package/skills/xlsx/scripts/office/schemas/mce/mc.xsd +0 -75
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +0 -560
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +0 -67
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +0 -14
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +0 -20
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +0 -13
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
- package/skills/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +0 -8
- package/skills/xlsx/scripts/office/soffice.py +0 -232
- package/skills/xlsx/scripts/office/validate.py +0 -173
- package/skills/xlsx/scripts/office/validators/__init__.py +0 -15
- package/skills/xlsx/scripts/office/validators/base.py +0 -875
- package/skills/xlsx/scripts/office/validators/docx.py +0 -466
- package/skills/xlsx/scripts/office/validators/pptx.py +0 -441
- package/skills/xlsx/scripts/office/validators/redlining.py +0 -299
- package/skills/xlsx/scripts/recalc.py +0 -308
- package/skills/zarr-python/references/api_reference.md +0 -162
- package/skills/zarr-python/references/chunking_and_compression.md +0 -138
- package/skills/zarr-python/references/integration.md +0 -147
- package/skills/zarr-python/references/performance_and_patterns.md +0 -198
- package/skills/zarr-python/references/storage_backends.md +0 -91
- package/skills/zarr-python/references/v3_migration.md +0 -127
|
@@ -1,2087 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""Bounded, provenance-preserving client for the NCATS Translator ARAX API."""
|
|
3
|
-
|
|
4
|
-
from __future__ import annotations
|
|
5
|
-
|
|
6
|
-
import argparse
|
|
7
|
-
import email.utils
|
|
8
|
-
import hashlib
|
|
9
|
-
import ipaddress
|
|
10
|
-
import json
|
|
11
|
-
import os
|
|
12
|
-
import re
|
|
13
|
-
import socket
|
|
14
|
-
import sys
|
|
15
|
-
import tempfile
|
|
16
|
-
import time
|
|
17
|
-
import urllib.error
|
|
18
|
-
import urllib.parse
|
|
19
|
-
import urllib.request
|
|
20
|
-
import uuid
|
|
21
|
-
from dataclasses import dataclass
|
|
22
|
-
from datetime import datetime, timezone
|
|
23
|
-
from pathlib import Path
|
|
24
|
-
from typing import Any, Callable, Iterable, Mapping, Sequence
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
CLIENT_NAME = "ncats-arax"
|
|
28
|
-
CLIENT_VERSION = "1.0"
|
|
29
|
-
USER_AGENT = "scientific-agent-skills-ncats-arax/1.0"
|
|
30
|
-
SUBMITTER = "scientific-agent-skills-ncats-arax"
|
|
31
|
-
PRODUCTION_BASE_URL = "https://arax.transltr.io/api/arax/v1.4"
|
|
32
|
-
TESTED_ARAX_VERSION = "1.5.4"
|
|
33
|
-
TESTED_TRAPI_VERSION = "1.5.0"
|
|
34
|
-
SUPPORTED_TRAPI_SERIES = {"1.5", "1.6"}
|
|
35
|
-
|
|
36
|
-
GET_TIMEOUT_SECONDS = 30
|
|
37
|
-
LOOKUP_TIMEOUT_SECONDS = 120
|
|
38
|
-
FEDERATED_TIMEOUT_SECONDS = 180
|
|
39
|
-
KP_TIMEOUT_SECONDS = 30
|
|
40
|
-
LOOKUP_RESULT_LIMIT = 20
|
|
41
|
-
FEDERATED_RESULT_LIMIT = 50
|
|
42
|
-
MAX_RESULT_LIMIT = 50
|
|
43
|
-
MAX_PROVIDERS = 5
|
|
44
|
-
MIN_FEDERATED_PROVIDERS = 2
|
|
45
|
-
MAX_PREDICATES = 5
|
|
46
|
-
MAX_QUALIFIERS = 6
|
|
47
|
-
MAX_IDENTIFIER_LENGTH = 200
|
|
48
|
-
MAX_RESPONSE_BYTES = 25 * 1024 * 1024
|
|
49
|
-
MAX_WARNING_MESSAGE = 500
|
|
50
|
-
MAX_DISPLAY_TEXT = 500
|
|
51
|
-
PUBLICATION_PREVIEW = 10
|
|
52
|
-
|
|
53
|
-
RETRYABLE_GET_STATUS = {429, 502, 503, 504}
|
|
54
|
-
CURIE_RE = re.compile(r"^[A-Za-z][A-Za-z0-9._-]*:[^\s]+$")
|
|
55
|
-
BIOLINK_RE = re.compile(r"^biolink:[A-Za-z][A-Za-z0-9._-]*$")
|
|
56
|
-
PROVIDER_RE = re.compile(r"^infores:[A-Za-z0-9._-]+$")
|
|
57
|
-
TRAPI_VERSION_RE = re.compile(r"\bTRAPI\s+(\d+\.\d+(?:\.\d+)?)\b", re.IGNORECASE)
|
|
58
|
-
EXPAND_RE = re.compile(
|
|
59
|
-
r"^expand\(edge_key=(e[01]),kp=(.+),kp_timeout=30,"
|
|
60
|
-
r"return_minimal_metadata=false\)$"
|
|
61
|
-
)
|
|
62
|
-
FILTER_RE = re.compile(
|
|
63
|
-
r"^filter_results\(action=limit_number_of_results,max_results=(\d+),"
|
|
64
|
-
r"prune_kg=true\)$"
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
WARNING_CODES = {
|
|
68
|
-
"PUBLIC_QUERY",
|
|
69
|
-
"NORMALIZATION_REQUIRES_CONFIRMATION",
|
|
70
|
-
"NORMALIZATION_CATEGORY_MISMATCH",
|
|
71
|
-
"NO_RESULTS",
|
|
72
|
-
"NO_PUBLICATIONS_RETURNED",
|
|
73
|
-
"NO_PRIMARY_SOURCE_RETURNED",
|
|
74
|
-
"UNSCORED_RESPONSE_ORDER",
|
|
75
|
-
"RESULT_LIMIT_REACHED",
|
|
76
|
-
"INTERNAL_PRUNING_DETECTED",
|
|
77
|
-
"KP_TIMEOUT",
|
|
78
|
-
"KP_ERROR",
|
|
79
|
-
"MALFORMED_KP_RESPONSE",
|
|
80
|
-
"MISSING_AUXILIARY_GRAPH",
|
|
81
|
-
"REVERSED_EDGE_BINDING",
|
|
82
|
-
"UNTESTED_SERVICE_VERSION",
|
|
83
|
-
"NONPRODUCTION_ENDPOINT",
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class AraxClientError(Exception):
|
|
88
|
-
"""Base error carrying the documented CLI exit classification."""
|
|
89
|
-
|
|
90
|
-
def __init__(
|
|
91
|
-
self,
|
|
92
|
-
message: str,
|
|
93
|
-
*,
|
|
94
|
-
exit_code: int,
|
|
95
|
-
kind: str,
|
|
96
|
-
http_status: int | None = None,
|
|
97
|
-
response_body: bytes | None = None,
|
|
98
|
-
attempts: int = 0,
|
|
99
|
-
) -> None:
|
|
100
|
-
super().__init__(message)
|
|
101
|
-
self.exit_code = exit_code
|
|
102
|
-
self.kind = kind
|
|
103
|
-
self.http_status = http_status
|
|
104
|
-
self.response_body = response_body
|
|
105
|
-
self.attempts = attempts
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class UsageError(AraxClientError):
|
|
109
|
-
def __init__(self, message: str) -> None:
|
|
110
|
-
super().__init__(message, exit_code=2, kind="invalid_input")
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
class PreflightError(AraxClientError):
|
|
114
|
-
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
115
|
-
super().__init__(message, exit_code=3, kind="preflight", **kwargs)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class NormalizationError(AraxClientError):
|
|
119
|
-
def __init__(self, message: str) -> None:
|
|
120
|
-
super().__init__(message, exit_code=4, kind="normalization_no_result")
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
class TransportError(AraxClientError):
|
|
124
|
-
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
125
|
-
super().__init__(message, exit_code=5, kind="transport_or_http", **kwargs)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
class ResponseError(AraxClientError):
|
|
129
|
-
def __init__(self, message: str, **kwargs: Any) -> None:
|
|
130
|
-
super().__init__(message, exit_code=6, kind="invalid_response", **kwargs)
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
@dataclass(frozen=True)
|
|
134
|
-
class HttpResult:
|
|
135
|
-
status: int
|
|
136
|
-
body: bytes
|
|
137
|
-
headers: dict[str, str]
|
|
138
|
-
elapsed_ms: int
|
|
139
|
-
attempts: int
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
@dataclass(frozen=True)
|
|
143
|
-
class ServiceInfo:
|
|
144
|
-
base_url: str
|
|
145
|
-
openapi_url: str
|
|
146
|
-
arax_version: str | None
|
|
147
|
-
trapi_version: str | None
|
|
148
|
-
warnings: tuple[dict[str, Any], ...]
|
|
149
|
-
|
|
150
|
-
def as_dict(self, *, biolink_version: str | None = None) -> dict[str, Any]:
|
|
151
|
-
return {
|
|
152
|
-
"base_url": self.base_url,
|
|
153
|
-
"openapi_url": self.openapi_url,
|
|
154
|
-
"arax_version": self.arax_version,
|
|
155
|
-
"trapi_version": self.trapi_version,
|
|
156
|
-
"biolink_version": biolink_version,
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
@dataclass(frozen=True)
|
|
161
|
-
class QueryContract:
|
|
162
|
-
kind: str
|
|
163
|
-
mode: str
|
|
164
|
-
provider_ids: tuple[str, ...]
|
|
165
|
-
expand_order: str | None
|
|
166
|
-
qnode_ids: dict[str, list[str]]
|
|
167
|
-
result_limit: int
|
|
168
|
-
query_edges: dict[str, tuple[str, str]]
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
class RejectRepeatedValueAction(argparse.Action):
|
|
172
|
-
"""Reject repeated scalar flags instead of silently accepting the last value."""
|
|
173
|
-
|
|
174
|
-
def __call__(
|
|
175
|
-
self,
|
|
176
|
-
parser: argparse.ArgumentParser,
|
|
177
|
-
namespace: argparse.Namespace,
|
|
178
|
-
values: Any,
|
|
179
|
-
option_string: str | None = None,
|
|
180
|
-
) -> None:
|
|
181
|
-
if getattr(namespace, self.dest, None) is not None:
|
|
182
|
-
parser.error(f"{option_string} may be supplied only once")
|
|
183
|
-
setattr(namespace, self.dest, values)
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
def _sanitize_text(value: Any, limit: int = MAX_DISPLAY_TEXT) -> str:
|
|
187
|
-
text = str(value)
|
|
188
|
-
text = "".join(" " if ord(char) < 32 or ord(char) == 127 else char for char in text)
|
|
189
|
-
text = " ".join(text.split())
|
|
190
|
-
if len(text) > limit:
|
|
191
|
-
return text[: max(0, limit - 1)] + "…"
|
|
192
|
-
return text
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
def make_warning(
|
|
196
|
-
code: str,
|
|
197
|
-
message: str,
|
|
198
|
-
context: Mapping[str, Any] | None = None,
|
|
199
|
-
) -> dict[str, Any]:
|
|
200
|
-
if code not in WARNING_CODES:
|
|
201
|
-
raise ValueError(f"unknown warning code: {code}")
|
|
202
|
-
safe_context: dict[str, Any] = {}
|
|
203
|
-
for key, value in (context or {}).items():
|
|
204
|
-
if value is None or isinstance(value, (bool, int, float)):
|
|
205
|
-
safe_context[str(key)] = value
|
|
206
|
-
else:
|
|
207
|
-
safe_context[str(key)] = _sanitize_text(value, 200)
|
|
208
|
-
return {
|
|
209
|
-
"code": code,
|
|
210
|
-
"message": _sanitize_text(message, MAX_WARNING_MESSAGE),
|
|
211
|
-
"context": safe_context,
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
def _append_warning(
|
|
216
|
-
warnings: list[dict[str, Any]],
|
|
217
|
-
code: str,
|
|
218
|
-
message: str,
|
|
219
|
-
context: Mapping[str, Any] | None = None,
|
|
220
|
-
) -> None:
|
|
221
|
-
warning = make_warning(code, message, context)
|
|
222
|
-
identity = (warning["code"], json.dumps(warning["context"], sort_keys=True), warning["message"])
|
|
223
|
-
existing = {
|
|
224
|
-
(item.get("code"), json.dumps(item.get("context", {}), sort_keys=True), item.get("message"))
|
|
225
|
-
for item in warnings
|
|
226
|
-
}
|
|
227
|
-
if identity not in existing:
|
|
228
|
-
warnings.append(warning)
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
def _has_control(value: str) -> bool:
|
|
232
|
-
return any(ord(char) < 32 or ord(char) == 127 for char in value)
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
def validate_curie(value: str) -> str:
|
|
236
|
-
if not isinstance(value, str) or not value or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
237
|
-
raise UsageError("CURIE must be a nonempty string of at most 200 characters")
|
|
238
|
-
if _has_control(value) or not CURIE_RE.fullmatch(value):
|
|
239
|
-
raise UsageError(f"invalid CURIE: {_sanitize_text(value, 80)}")
|
|
240
|
-
return value
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
def _looks_like_curie(value: str) -> bool:
|
|
244
|
-
try:
|
|
245
|
-
validate_curie(value)
|
|
246
|
-
except UsageError:
|
|
247
|
-
return False
|
|
248
|
-
return True
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
def validate_biolink_term(value: str, label: str = "Biolink term") -> str:
|
|
252
|
-
if not isinstance(value, str) or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
253
|
-
raise UsageError(f"{label} must be at most 200 characters")
|
|
254
|
-
if _has_control(value) or not BIOLINK_RE.fullmatch(value):
|
|
255
|
-
raise UsageError(f"invalid {label.lower()}: {_sanitize_text(value, 80)}")
|
|
256
|
-
return value
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
def validate_provider_id(value: str) -> str:
|
|
260
|
-
if not isinstance(value, str) or len(value) > MAX_IDENTIFIER_LENGTH:
|
|
261
|
-
raise UsageError("provider identifier must be at most 200 characters")
|
|
262
|
-
if _has_control(value) or not PROVIDER_RE.fullmatch(value):
|
|
263
|
-
raise UsageError(f"invalid provider identifier: {_sanitize_text(value, 80)}")
|
|
264
|
-
if value.lower() == "infores:all":
|
|
265
|
-
raise UsageError("all-provider federation is not supported")
|
|
266
|
-
return value
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
def _unique(values: Sequence[str], label: str) -> list[str]:
|
|
270
|
-
if len(set(values)) != len(values):
|
|
271
|
-
raise UsageError(f"duplicate {label} values are not allowed")
|
|
272
|
-
return list(values)
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
def validate_predicates(values: Sequence[str]) -> list[str]:
|
|
276
|
-
if not 1 <= len(values) <= MAX_PREDICATES:
|
|
277
|
-
raise UsageError("each query edge requires one to five predicates")
|
|
278
|
-
return _unique([validate_biolink_term(value, "Biolink predicate") for value in values], "predicate")
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
def parse_qualifiers(values: Sequence[str]) -> list[tuple[str, str]]:
|
|
282
|
-
if len(values) > MAX_QUALIFIERS:
|
|
283
|
-
raise UsageError("each query edge accepts at most six qualifiers")
|
|
284
|
-
parsed: list[tuple[str, str]] = []
|
|
285
|
-
seen_types: set[str] = set()
|
|
286
|
-
for raw in values:
|
|
287
|
-
if "=" not in raw:
|
|
288
|
-
raise UsageError("qualifiers must use TYPE=VALUE")
|
|
289
|
-
qualifier_type, qualifier_value = raw.split("=", 1)
|
|
290
|
-
validate_biolink_term(qualifier_type, "Biolink qualifier type")
|
|
291
|
-
if (
|
|
292
|
-
not qualifier_value
|
|
293
|
-
or len(qualifier_value) > MAX_IDENTIFIER_LENGTH
|
|
294
|
-
or _has_control(qualifier_value)
|
|
295
|
-
):
|
|
296
|
-
raise UsageError("qualifier values must be nonempty, control-free, and at most 200 characters")
|
|
297
|
-
if qualifier_type in seen_types:
|
|
298
|
-
raise UsageError("a qualifier type may appear only once per edge")
|
|
299
|
-
seen_types.add(qualifier_type)
|
|
300
|
-
parsed.append((qualifier_type, qualifier_value))
|
|
301
|
-
return parsed
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
def validate_result_limit(value: int) -> int:
|
|
305
|
-
if not 1 <= value <= MAX_RESULT_LIMIT:
|
|
306
|
-
raise UsageError("result limit must be between 1 and 50")
|
|
307
|
-
return value
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
def validate_base_url(value: str, allow_nonproduction: bool) -> tuple[str, list[dict[str, Any]]]:
|
|
311
|
-
raw = value.rstrip("/")
|
|
312
|
-
parts = urllib.parse.urlsplit(raw)
|
|
313
|
-
try:
|
|
314
|
-
parts.port
|
|
315
|
-
except ValueError as exc:
|
|
316
|
-
raise UsageError("base URL contains an invalid port") from exc
|
|
317
|
-
if parts.scheme.lower() != "https" or not parts.hostname:
|
|
318
|
-
raise UsageError("base URL must be an absolute HTTPS URL")
|
|
319
|
-
if parts.username or parts.password or parts.query or parts.fragment:
|
|
320
|
-
raise UsageError("base URL may not contain credentials, a query string, or a fragment")
|
|
321
|
-
hostname = parts.hostname.lower()
|
|
322
|
-
if hostname == "localhost" or hostname.endswith(".localhost"):
|
|
323
|
-
raise UsageError("localhost endpoints are not allowed")
|
|
324
|
-
try:
|
|
325
|
-
address = ipaddress.ip_address(hostname)
|
|
326
|
-
except ValueError:
|
|
327
|
-
address = None
|
|
328
|
-
if address is not None and not address.is_global:
|
|
329
|
-
raise UsageError("private, loopback, link-local, and reserved endpoint addresses are not allowed")
|
|
330
|
-
normalized = urllib.parse.urlunsplit(("https", parts.netloc, parts.path.rstrip("/"), "", ""))
|
|
331
|
-
warnings: list[dict[str, Any]] = []
|
|
332
|
-
if normalized != PRODUCTION_BASE_URL:
|
|
333
|
-
if not allow_nonproduction:
|
|
334
|
-
raise PreflightError(
|
|
335
|
-
"nonproduction endpoint requires --allow-nonproduction-endpoint"
|
|
336
|
-
)
|
|
337
|
-
_append_warning(
|
|
338
|
-
warnings,
|
|
339
|
-
"NONPRODUCTION_ENDPOINT",
|
|
340
|
-
"An explicitly selected nonproduction ARAX endpoint is in use.",
|
|
341
|
-
{"base_url": normalized},
|
|
342
|
-
)
|
|
343
|
-
return normalized, warnings
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
def resolve_mode(
|
|
347
|
-
mode: str,
|
|
348
|
-
provider_values: Sequence[str],
|
|
349
|
-
result_limit: int | None,
|
|
350
|
-
) -> tuple[list[str], int]:
|
|
351
|
-
if mode == "lookup":
|
|
352
|
-
if provider_values:
|
|
353
|
-
raise UsageError("--kp is allowed only with --mode federated")
|
|
354
|
-
providers = ["infores:rtx-kg2"]
|
|
355
|
-
limit = LOOKUP_RESULT_LIMIT if result_limit is None else result_limit
|
|
356
|
-
elif mode == "federated":
|
|
357
|
-
providers = _unique([validate_provider_id(value) for value in provider_values], "provider")
|
|
358
|
-
if not MIN_FEDERATED_PROVIDERS <= len(providers) <= MAX_PROVIDERS:
|
|
359
|
-
raise UsageError("federated mode requires two to five explicit providers")
|
|
360
|
-
limit = FEDERATED_RESULT_LIMIT if result_limit is None else result_limit
|
|
361
|
-
else:
|
|
362
|
-
raise UsageError(f"unsupported mode: {mode}")
|
|
363
|
-
return providers, validate_result_limit(limit)
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
def build_query_edge(
|
|
367
|
-
subject: str,
|
|
368
|
-
object_: str,
|
|
369
|
-
predicates: Sequence[str],
|
|
370
|
-
qualifiers: Sequence[tuple[str, str]],
|
|
371
|
-
) -> dict[str, Any]:
|
|
372
|
-
edge: dict[str, Any] = {
|
|
373
|
-
"subject": subject,
|
|
374
|
-
"object": object_,
|
|
375
|
-
"predicates": list(predicates),
|
|
376
|
-
}
|
|
377
|
-
if qualifiers:
|
|
378
|
-
edge["qualifier_constraints"] = [
|
|
379
|
-
{
|
|
380
|
-
"qualifier_set": [
|
|
381
|
-
{"qualifier_type_id": qualifier_type, "qualifier_value": qualifier_value}
|
|
382
|
-
for qualifier_type, qualifier_value in qualifiers
|
|
383
|
-
]
|
|
384
|
-
}
|
|
385
|
-
]
|
|
386
|
-
return edge
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
def _provider_parameter(mode: str, provider_ids: Sequence[str]) -> str:
|
|
390
|
-
if mode == "lookup":
|
|
391
|
-
return "infores:rtx-kg2"
|
|
392
|
-
return "[" + ",".join(provider_ids) + "]"
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
def build_operations(
|
|
396
|
-
edge_keys: Sequence[str],
|
|
397
|
-
mode: str,
|
|
398
|
-
provider_ids: Sequence[str],
|
|
399
|
-
result_limit: int,
|
|
400
|
-
) -> dict[str, list[str]]:
|
|
401
|
-
kp_value = _provider_parameter(mode, provider_ids)
|
|
402
|
-
actions = [
|
|
403
|
-
f"expand(edge_key={edge_key},kp={kp_value},kp_timeout={KP_TIMEOUT_SECONDS},"
|
|
404
|
-
"return_minimal_metadata=false)"
|
|
405
|
-
for edge_key in edge_keys
|
|
406
|
-
]
|
|
407
|
-
actions.extend(
|
|
408
|
-
[
|
|
409
|
-
"scoreless_resultify(ignore_edge_direction=true)",
|
|
410
|
-
f"filter_results(action=limit_number_of_results,max_results={result_limit},prune_kg=true)",
|
|
411
|
-
"return(response=true,store=false)",
|
|
412
|
-
]
|
|
413
|
-
)
|
|
414
|
-
return {"actions": actions}
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
def build_one_hop_query(
|
|
418
|
-
*,
|
|
419
|
-
subject_id: str | None,
|
|
420
|
-
subject_category: str,
|
|
421
|
-
predicates: Sequence[str],
|
|
422
|
-
object_id: str | None,
|
|
423
|
-
object_category: str,
|
|
424
|
-
qualifiers: Sequence[tuple[str, str]],
|
|
425
|
-
mode: str,
|
|
426
|
-
provider_ids: Sequence[str],
|
|
427
|
-
result_limit: int,
|
|
428
|
-
) -> dict[str, Any]:
|
|
429
|
-
if subject_id is None and object_id is None:
|
|
430
|
-
raise UsageError("one-hop queries require at least one pinned endpoint")
|
|
431
|
-
nodes: dict[str, dict[str, Any]] = {
|
|
432
|
-
"n0": {"categories": [validate_biolink_term(subject_category, "Biolink category")]},
|
|
433
|
-
"n1": {"categories": [validate_biolink_term(object_category, "Biolink category")]},
|
|
434
|
-
}
|
|
435
|
-
if subject_id is not None:
|
|
436
|
-
nodes["n0"]["ids"] = [validate_curie(subject_id)]
|
|
437
|
-
if object_id is not None:
|
|
438
|
-
nodes["n1"]["ids"] = [validate_curie(object_id)]
|
|
439
|
-
body = {
|
|
440
|
-
"message": {
|
|
441
|
-
"query_graph": {
|
|
442
|
-
"nodes": nodes,
|
|
443
|
-
"edges": {
|
|
444
|
-
"e0": build_query_edge("n0", "n1", validate_predicates(predicates), qualifiers)
|
|
445
|
-
},
|
|
446
|
-
}
|
|
447
|
-
},
|
|
448
|
-
"operations": build_operations(["e0"], mode, provider_ids, result_limit),
|
|
449
|
-
"stream_progress": False,
|
|
450
|
-
"submitter": SUBMITTER,
|
|
451
|
-
}
|
|
452
|
-
return body
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
def build_two_hop_query(
|
|
456
|
-
*,
|
|
457
|
-
subject_id: str,
|
|
458
|
-
subject_category: str,
|
|
459
|
-
predicates_1: Sequence[str],
|
|
460
|
-
intermediate_category: str,
|
|
461
|
-
predicates_2: Sequence[str],
|
|
462
|
-
object_id: str,
|
|
463
|
-
object_category: str,
|
|
464
|
-
qualifiers_1: Sequence[tuple[str, str]],
|
|
465
|
-
qualifiers_2: Sequence[tuple[str, str]],
|
|
466
|
-
mode: str,
|
|
467
|
-
provider_ids: Sequence[str],
|
|
468
|
-
expand_order: str,
|
|
469
|
-
result_limit: int,
|
|
470
|
-
) -> dict[str, Any]:
|
|
471
|
-
if expand_order not in {"right-first", "left-first"}:
|
|
472
|
-
raise UsageError("expand order must be right-first or left-first")
|
|
473
|
-
nodes = {
|
|
474
|
-
"n0": {
|
|
475
|
-
"ids": [validate_curie(subject_id)],
|
|
476
|
-
"categories": [validate_biolink_term(subject_category, "Biolink category")],
|
|
477
|
-
},
|
|
478
|
-
"n1": {
|
|
479
|
-
"categories": [validate_biolink_term(intermediate_category, "Biolink category")]
|
|
480
|
-
},
|
|
481
|
-
"n2": {
|
|
482
|
-
"ids": [validate_curie(object_id)],
|
|
483
|
-
"categories": [validate_biolink_term(object_category, "Biolink category")],
|
|
484
|
-
},
|
|
485
|
-
}
|
|
486
|
-
edge_order = ["e1", "e0"] if expand_order == "right-first" else ["e0", "e1"]
|
|
487
|
-
return {
|
|
488
|
-
"message": {
|
|
489
|
-
"query_graph": {
|
|
490
|
-
"nodes": nodes,
|
|
491
|
-
"edges": {
|
|
492
|
-
"e0": build_query_edge(
|
|
493
|
-
"n0", "n1", validate_predicates(predicates_1), qualifiers_1
|
|
494
|
-
),
|
|
495
|
-
"e1": build_query_edge(
|
|
496
|
-
"n1", "n2", validate_predicates(predicates_2), qualifiers_2
|
|
497
|
-
),
|
|
498
|
-
},
|
|
499
|
-
}
|
|
500
|
-
},
|
|
501
|
-
"operations": build_operations(edge_order, mode, provider_ids, result_limit),
|
|
502
|
-
"stream_progress": False,
|
|
503
|
-
"submitter": SUBMITTER,
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
def serialize_request(body: Mapping[str, Any]) -> bytes:
|
|
508
|
-
try:
|
|
509
|
-
return json.dumps(
|
|
510
|
-
body,
|
|
511
|
-
sort_keys=True,
|
|
512
|
-
separators=(",", ":"),
|
|
513
|
-
ensure_ascii=False,
|
|
514
|
-
allow_nan=False,
|
|
515
|
-
).encode("utf-8")
|
|
516
|
-
except (TypeError, ValueError) as exc:
|
|
517
|
-
raise UsageError("request contains a value that cannot be represented as strict JSON") from exc
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
def _origin(url: str) -> tuple[str, str | None, int | None]:
|
|
521
|
-
parts = urllib.parse.urlsplit(url)
|
|
522
|
-
try:
|
|
523
|
-
port = parts.port
|
|
524
|
-
except ValueError as exc:
|
|
525
|
-
raise ValueError("URL contains an invalid port") from exc
|
|
526
|
-
if port is None and parts.scheme.lower() == "https":
|
|
527
|
-
port = 443
|
|
528
|
-
return parts.scheme.lower(), parts.hostname.lower() if parts.hostname else None, port
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
class SameOriginHttpsRedirectHandler(urllib.request.HTTPRedirectHandler):
|
|
532
|
-
def redirect_request(
|
|
533
|
-
self,
|
|
534
|
-
req: urllib.request.Request,
|
|
535
|
-
fp: Any,
|
|
536
|
-
code: int,
|
|
537
|
-
msg: str,
|
|
538
|
-
headers: Any,
|
|
539
|
-
newurl: str,
|
|
540
|
-
) -> urllib.request.Request | None:
|
|
541
|
-
try:
|
|
542
|
-
original_origin = _origin(req.full_url)
|
|
543
|
-
redirect_origin = _origin(newurl)
|
|
544
|
-
except ValueError:
|
|
545
|
-
original_origin = _origin(req.full_url)
|
|
546
|
-
redirect_origin = ("", None, None)
|
|
547
|
-
if original_origin != redirect_origin or redirect_origin[0] != "https":
|
|
548
|
-
raise urllib.error.HTTPError(
|
|
549
|
-
newurl,
|
|
550
|
-
code,
|
|
551
|
-
"cross-origin or protocol-downgrade redirect rejected",
|
|
552
|
-
headers,
|
|
553
|
-
fp,
|
|
554
|
-
)
|
|
555
|
-
return super().redirect_request(req, fp, code, msg, headers, newurl)
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
def _open_url(request: urllib.request.Request, timeout: int) -> Any:
|
|
559
|
-
opener = urllib.request.build_opener(SameOriginHttpsRedirectHandler())
|
|
560
|
-
return opener.open(request, timeout=timeout)
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
def read_bounded_response(response: Any, byte_limit: int = MAX_RESPONSE_BYTES) -> bytes:
|
|
564
|
-
body = response.read(byte_limit + 1)
|
|
565
|
-
if len(body) > byte_limit:
|
|
566
|
-
raise ResponseError("response exceeded the 25 MiB byte limit")
|
|
567
|
-
return body
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
def _response_status(response: Any) -> int:
|
|
571
|
-
status = getattr(response, "status", None)
|
|
572
|
-
return int(status if status is not None else response.getcode())
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
def _headers_dict(headers: Any) -> dict[str, str]:
|
|
576
|
-
if headers is None:
|
|
577
|
-
return {}
|
|
578
|
-
try:
|
|
579
|
-
return {str(key): str(value) for key, value in headers.items()}
|
|
580
|
-
except AttributeError:
|
|
581
|
-
return {}
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
def _retry_delay(headers: Mapping[str, str], now: Callable[[], datetime] | None = None) -> float:
|
|
585
|
-
raw = next((value for key, value in headers.items() if key.lower() == "retry-after"), None)
|
|
586
|
-
if raw is None:
|
|
587
|
-
return 1.0
|
|
588
|
-
try:
|
|
589
|
-
return min(10.0, max(0.0, float(raw)))
|
|
590
|
-
except ValueError:
|
|
591
|
-
try:
|
|
592
|
-
parsed = email.utils.parsedate_to_datetime(raw)
|
|
593
|
-
current = (now or (lambda: datetime.now(timezone.utc)))()
|
|
594
|
-
if parsed.tzinfo is None:
|
|
595
|
-
parsed = parsed.replace(tzinfo=timezone.utc)
|
|
596
|
-
return min(10.0, max(0.0, (parsed - current).total_seconds()))
|
|
597
|
-
except (TypeError, ValueError, OverflowError):
|
|
598
|
-
return 1.0
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
def _is_timeout_error(error: BaseException) -> bool:
|
|
602
|
-
if isinstance(error, (TimeoutError, socket.timeout)):
|
|
603
|
-
return True
|
|
604
|
-
return isinstance(error, urllib.error.URLError) and isinstance(
|
|
605
|
-
getattr(error, "reason", None), (TimeoutError, socket.timeout)
|
|
606
|
-
)
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
def request_get_with_retry(
|
|
610
|
-
url: str,
|
|
611
|
-
*,
|
|
612
|
-
timeout: int = GET_TIMEOUT_SECONDS,
|
|
613
|
-
sleep: Callable[[float], None] = time.sleep,
|
|
614
|
-
) -> HttpResult:
|
|
615
|
-
request = urllib.request.Request(
|
|
616
|
-
url,
|
|
617
|
-
method="GET",
|
|
618
|
-
headers={
|
|
619
|
-
"Accept": "application/json",
|
|
620
|
-
"Accept-Encoding": "identity",
|
|
621
|
-
"User-Agent": USER_AGENT,
|
|
622
|
-
},
|
|
623
|
-
)
|
|
624
|
-
started = time.monotonic()
|
|
625
|
-
for attempt in (1, 2):
|
|
626
|
-
try:
|
|
627
|
-
with _open_url(request, timeout) as response:
|
|
628
|
-
try:
|
|
629
|
-
body = read_bounded_response(response)
|
|
630
|
-
except ResponseError as exc:
|
|
631
|
-
exc.attempts = attempt
|
|
632
|
-
exc.http_status = _response_status(response)
|
|
633
|
-
raise
|
|
634
|
-
return HttpResult(
|
|
635
|
-
status=_response_status(response),
|
|
636
|
-
body=body,
|
|
637
|
-
headers=_headers_dict(getattr(response, "headers", None)),
|
|
638
|
-
elapsed_ms=round((time.monotonic() - started) * 1000),
|
|
639
|
-
attempts=attempt,
|
|
640
|
-
)
|
|
641
|
-
except urllib.error.HTTPError as exc:
|
|
642
|
-
headers = _headers_dict(exc.headers)
|
|
643
|
-
if exc.code in RETRYABLE_GET_STATUS and attempt == 1:
|
|
644
|
-
try:
|
|
645
|
-
exc.close()
|
|
646
|
-
finally:
|
|
647
|
-
sleep(_retry_delay(headers))
|
|
648
|
-
continue
|
|
649
|
-
try:
|
|
650
|
-
body = read_bounded_response(exc)
|
|
651
|
-
except ResponseError as oversized:
|
|
652
|
-
oversized.http_status = exc.code
|
|
653
|
-
oversized.attempts = attempt
|
|
654
|
-
raise oversized from exc
|
|
655
|
-
raise TransportError(
|
|
656
|
-
f"GET failed with HTTP {exc.code}",
|
|
657
|
-
http_status=exc.code,
|
|
658
|
-
response_body=body,
|
|
659
|
-
attempts=attempt,
|
|
660
|
-
) from exc
|
|
661
|
-
except (urllib.error.URLError, TimeoutError, socket.timeout) as exc:
|
|
662
|
-
if _is_timeout_error(exc) and attempt == 1:
|
|
663
|
-
sleep(1.0)
|
|
664
|
-
continue
|
|
665
|
-
raise TransportError(f"GET transport failure: {_sanitize_text(exc)}", attempts=attempt) from exc
|
|
666
|
-
raise AssertionError("unreachable")
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
def post_query(url: str, request_bytes: bytes, *, timeout: int) -> HttpResult:
|
|
670
|
-
request = urllib.request.Request(
|
|
671
|
-
url,
|
|
672
|
-
data=request_bytes,
|
|
673
|
-
method="POST",
|
|
674
|
-
headers={
|
|
675
|
-
"Accept": "application/json",
|
|
676
|
-
"Accept-Encoding": "identity",
|
|
677
|
-
"Content-Type": "application/json",
|
|
678
|
-
"User-Agent": USER_AGENT,
|
|
679
|
-
},
|
|
680
|
-
)
|
|
681
|
-
started = time.monotonic()
|
|
682
|
-
try:
|
|
683
|
-
with _open_url(request, timeout) as response:
|
|
684
|
-
try:
|
|
685
|
-
body = read_bounded_response(response)
|
|
686
|
-
except ResponseError as exc:
|
|
687
|
-
exc.attempts = 1
|
|
688
|
-
exc.http_status = _response_status(response)
|
|
689
|
-
raise
|
|
690
|
-
return HttpResult(
|
|
691
|
-
status=_response_status(response),
|
|
692
|
-
body=body,
|
|
693
|
-
headers=_headers_dict(getattr(response, "headers", None)),
|
|
694
|
-
elapsed_ms=round((time.monotonic() - started) * 1000),
|
|
695
|
-
attempts=1,
|
|
696
|
-
)
|
|
697
|
-
except urllib.error.HTTPError as exc:
|
|
698
|
-
try:
|
|
699
|
-
body = read_bounded_response(exc)
|
|
700
|
-
except ResponseError as oversized:
|
|
701
|
-
oversized.http_status = exc.code
|
|
702
|
-
oversized.attempts = 1
|
|
703
|
-
raise oversized from exc
|
|
704
|
-
raise TransportError(
|
|
705
|
-
f"POST failed with HTTP {exc.code}",
|
|
706
|
-
http_status=exc.code,
|
|
707
|
-
response_body=body,
|
|
708
|
-
attempts=1,
|
|
709
|
-
) from exc
|
|
710
|
-
except ResponseError:
|
|
711
|
-
raise
|
|
712
|
-
except (urllib.error.URLError, TimeoutError, socket.timeout) as exc:
|
|
713
|
-
raise TransportError(f"POST transport failure: {_sanitize_text(exc)}", attempts=1) from exc
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
def _decode_json(body: bytes, label: str) -> Any:
|
|
717
|
-
def reject_constant(value: str) -> None:
|
|
718
|
-
raise ValueError(f"non-finite JSON number: {value}")
|
|
719
|
-
|
|
720
|
-
try:
|
|
721
|
-
return json.loads(body.decode("utf-8"), parse_constant=reject_constant)
|
|
722
|
-
except (UnicodeDecodeError, json.JSONDecodeError, ValueError) as exc:
|
|
723
|
-
raise ResponseError(f"{label} was not valid strict UTF-8 JSON") from exc
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
def _version_series(version: str | None) -> str | None:
|
|
727
|
-
if not version:
|
|
728
|
-
return None
|
|
729
|
-
parts = version.split(".")
|
|
730
|
-
if len(parts) < 2 or not all(part.isdigit() for part in parts[:2]):
|
|
731
|
-
return None
|
|
732
|
-
return ".".join(parts[:2])
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
def _check_trapi_version(
|
|
736
|
-
trapi_version: str | None,
|
|
737
|
-
allow_untested: bool,
|
|
738
|
-
warnings: list[dict[str, Any]],
|
|
739
|
-
) -> None:
|
|
740
|
-
series = _version_series(trapi_version)
|
|
741
|
-
if series not in SUPPORTED_TRAPI_SERIES and not allow_untested:
|
|
742
|
-
raise PreflightError(
|
|
743
|
-
"service reports an unknown or missing TRAPI series; use --allow-untested-version to continue"
|
|
744
|
-
)
|
|
745
|
-
if trapi_version != TESTED_TRAPI_VERSION:
|
|
746
|
-
_append_warning(
|
|
747
|
-
warnings,
|
|
748
|
-
"UNTESTED_SERVICE_VERSION",
|
|
749
|
-
"The service TRAPI version differs from the tested production version.",
|
|
750
|
-
{"reported": trapi_version, "tested": TESTED_TRAPI_VERSION},
|
|
751
|
-
)
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
def parse_openapi_service_info(
|
|
755
|
-
payload: Any,
|
|
756
|
-
*,
|
|
757
|
-
base_url: str,
|
|
758
|
-
openapi_url: str,
|
|
759
|
-
allow_untested_version: bool,
|
|
760
|
-
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
761
|
-
) -> ServiceInfo:
|
|
762
|
-
if not isinstance(payload, dict):
|
|
763
|
-
raise PreflightError("OpenAPI document is not an object")
|
|
764
|
-
info = payload.get("info")
|
|
765
|
-
paths = payload.get("paths")
|
|
766
|
-
if not isinstance(info, dict) or not isinstance(paths, dict):
|
|
767
|
-
raise PreflightError("OpenAPI document is missing info or paths")
|
|
768
|
-
title = info.get("title")
|
|
769
|
-
if not isinstance(title, str) or "arax" not in title.lower():
|
|
770
|
-
raise PreflightError("OpenAPI title does not identify ARAX")
|
|
771
|
-
if "/query" not in paths:
|
|
772
|
-
raise PreflightError("OpenAPI document does not expose /query")
|
|
773
|
-
version_match = TRAPI_VERSION_RE.search(title)
|
|
774
|
-
trapi_version = version_match.group(1) if version_match else None
|
|
775
|
-
arax_version = str(info["version"]) if info.get("version") is not None else None
|
|
776
|
-
warnings = list(initial_warnings)
|
|
777
|
-
_check_trapi_version(trapi_version, allow_untested_version, warnings)
|
|
778
|
-
if arax_version != TESTED_ARAX_VERSION:
|
|
779
|
-
_append_warning(
|
|
780
|
-
warnings,
|
|
781
|
-
"UNTESTED_SERVICE_VERSION",
|
|
782
|
-
"The ARAX version differs from the tested production version.",
|
|
783
|
-
{"reported": arax_version, "tested": TESTED_ARAX_VERSION},
|
|
784
|
-
)
|
|
785
|
-
return ServiceInfo(
|
|
786
|
-
base_url=base_url,
|
|
787
|
-
openapi_url=openapi_url,
|
|
788
|
-
arax_version=arax_version,
|
|
789
|
-
trapi_version=trapi_version,
|
|
790
|
-
warnings=tuple(warnings),
|
|
791
|
-
)
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
def fetch_openapi(
|
|
795
|
-
base_url: str,
|
|
796
|
-
*,
|
|
797
|
-
allow_untested_version: bool,
|
|
798
|
-
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
799
|
-
) -> tuple[ServiceInfo, HttpResult]:
|
|
800
|
-
openapi_url = base_url + "/openapi.json"
|
|
801
|
-
try:
|
|
802
|
-
result = request_get_with_retry(openapi_url)
|
|
803
|
-
except TransportError as exc:
|
|
804
|
-
raise PreflightError(
|
|
805
|
-
str(exc),
|
|
806
|
-
http_status=exc.http_status,
|
|
807
|
-
response_body=exc.response_body,
|
|
808
|
-
attempts=exc.attempts,
|
|
809
|
-
) from exc
|
|
810
|
-
try:
|
|
811
|
-
payload = _decode_json(result.body, "OpenAPI response")
|
|
812
|
-
service = parse_openapi_service_info(
|
|
813
|
-
payload,
|
|
814
|
-
base_url=base_url,
|
|
815
|
-
openapi_url=openapi_url,
|
|
816
|
-
allow_untested_version=allow_untested_version,
|
|
817
|
-
initial_warnings=initial_warnings,
|
|
818
|
-
)
|
|
819
|
-
except (PreflightError, ResponseError) as exc:
|
|
820
|
-
if isinstance(exc, ResponseError):
|
|
821
|
-
wrapped = PreflightError(str(exc))
|
|
822
|
-
else:
|
|
823
|
-
wrapped = exc
|
|
824
|
-
wrapped.http_status = result.status
|
|
825
|
-
wrapped.response_body = result.body
|
|
826
|
-
wrapped.attempts = result.attempts
|
|
827
|
-
raise wrapped
|
|
828
|
-
return service, result
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
def normalize_entity_request(base_url: str, term: str) -> HttpResult:
|
|
832
|
-
query = urllib.parse.urlencode({"q": term})
|
|
833
|
-
return request_get_with_retry(base_url + "/entity?" + query)
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
def parse_normalization_response(
|
|
837
|
-
payload: Any,
|
|
838
|
-
*,
|
|
839
|
-
term: str,
|
|
840
|
-
expected_category: str | None,
|
|
841
|
-
max_synonyms: int,
|
|
842
|
-
service: ServiceInfo,
|
|
843
|
-
) -> tuple[dict[str, Any], bool]:
|
|
844
|
-
warnings = [make_warning("PUBLIC_QUERY", "The normalization request was sent to a public service.")]
|
|
845
|
-
requires_confirmation = not _looks_like_curie(term)
|
|
846
|
-
if requires_confirmation:
|
|
847
|
-
_append_warning(
|
|
848
|
-
warnings,
|
|
849
|
-
"NORMALIZATION_REQUIRES_CONFIRMATION",
|
|
850
|
-
"Review the normalized identifier and category before constructing a graph query.",
|
|
851
|
-
)
|
|
852
|
-
record: Any = payload.get(term) if isinstance(payload, dict) else None
|
|
853
|
-
if record is None and isinstance(payload, dict) and len(payload) == 1:
|
|
854
|
-
record = next(iter(payload.values()))
|
|
855
|
-
usable = isinstance(record, dict) and isinstance(record.get("id"), dict)
|
|
856
|
-
identifier_record = record.get("id", {}) if usable else {}
|
|
857
|
-
identifier = identifier_record.get("identifier") if isinstance(identifier_record, dict) else None
|
|
858
|
-
if not isinstance(identifier, str) or not _looks_like_curie(identifier):
|
|
859
|
-
usable = False
|
|
860
|
-
identifier = None
|
|
861
|
-
category = identifier_record.get("category") if isinstance(identifier_record, dict) else None
|
|
862
|
-
if expected_category is not None and category != expected_category and usable:
|
|
863
|
-
_append_warning(
|
|
864
|
-
warnings,
|
|
865
|
-
"NORMALIZATION_CATEGORY_MISMATCH",
|
|
866
|
-
"The canonical category differs from the expected category.",
|
|
867
|
-
{"expected": expected_category, "returned": category},
|
|
868
|
-
)
|
|
869
|
-
nodes = record.get("nodes", []) if isinstance(record, dict) else []
|
|
870
|
-
preview: list[dict[str, Any]] = []
|
|
871
|
-
if isinstance(nodes, list):
|
|
872
|
-
for node in nodes[:max_synonyms]:
|
|
873
|
-
if not isinstance(node, dict):
|
|
874
|
-
continue
|
|
875
|
-
preview.append(
|
|
876
|
-
{
|
|
877
|
-
"identifier": node.get("identifier", node.get("id")),
|
|
878
|
-
"name": node.get("name"),
|
|
879
|
-
"category": node.get("category"),
|
|
880
|
-
}
|
|
881
|
-
)
|
|
882
|
-
if not usable:
|
|
883
|
-
_append_warning(
|
|
884
|
-
warnings,
|
|
885
|
-
"NO_RESULTS",
|
|
886
|
-
"Normalization returned no usable canonical CURIE.",
|
|
887
|
-
)
|
|
888
|
-
summary = {
|
|
889
|
-
"schema_version": "1.0",
|
|
890
|
-
"kind": "normalization",
|
|
891
|
-
"query": {
|
|
892
|
-
"input": term,
|
|
893
|
-
"expected_category": expected_category,
|
|
894
|
-
"requires_user_confirmation": requires_confirmation,
|
|
895
|
-
},
|
|
896
|
-
"service": service.as_dict(),
|
|
897
|
-
"canonical": {
|
|
898
|
-
"identifier": identifier,
|
|
899
|
-
"name": identifier_record.get("name") if isinstance(identifier_record, dict) else None,
|
|
900
|
-
"category": category,
|
|
901
|
-
},
|
|
902
|
-
"category_counts": record.get("categories", {}) if isinstance(record, dict) else {},
|
|
903
|
-
"total_synonyms": record.get("total_synonyms", 0) if isinstance(record, dict) else 0,
|
|
904
|
-
"synonym_preview": preview,
|
|
905
|
-
"warnings": warnings,
|
|
906
|
-
}
|
|
907
|
-
return summary, usable
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
def _require_exact_keys(value: Mapping[str, Any], allowed: set[str], label: str) -> None:
|
|
911
|
-
extras = set(value) - allowed
|
|
912
|
-
missing = allowed - set(value)
|
|
913
|
-
if extras or missing:
|
|
914
|
-
details: list[str] = []
|
|
915
|
-
if missing:
|
|
916
|
-
details.append("missing " + ", ".join(sorted(missing)))
|
|
917
|
-
if extras:
|
|
918
|
-
details.append("unsupported " + ", ".join(sorted(extras)))
|
|
919
|
-
raise UsageError(f"{label} has " + "; ".join(details))
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
def _validate_edge_contract(edge: Any) -> tuple[str, str]:
|
|
923
|
-
if not isinstance(edge, dict):
|
|
924
|
-
raise UsageError("saved request contains an invalid query edge")
|
|
925
|
-
allowed = {"subject", "object", "predicates"}
|
|
926
|
-
if "qualifier_constraints" in edge:
|
|
927
|
-
allowed.add("qualifier_constraints")
|
|
928
|
-
_require_exact_keys(edge, allowed, "saved query edge")
|
|
929
|
-
subject = edge.get("subject")
|
|
930
|
-
object_ = edge.get("object")
|
|
931
|
-
if not isinstance(subject, str) or not isinstance(object_, str):
|
|
932
|
-
raise UsageError("saved query edge lacks subject or object")
|
|
933
|
-
predicates = edge.get("predicates")
|
|
934
|
-
if not isinstance(predicates, list):
|
|
935
|
-
raise UsageError("saved query edge lacks predicates")
|
|
936
|
-
validate_predicates(predicates)
|
|
937
|
-
constraints = edge.get("qualifier_constraints")
|
|
938
|
-
if constraints is not None:
|
|
939
|
-
if not isinstance(constraints, list) or len(constraints) != 1:
|
|
940
|
-
raise UsageError("saved query edge must have one AND qualifier set")
|
|
941
|
-
if not isinstance(constraints[0], dict):
|
|
942
|
-
raise UsageError("saved query edge has invalid qualifiers")
|
|
943
|
-
_require_exact_keys(constraints[0], {"qualifier_set"}, "qualifier constraint")
|
|
944
|
-
qualifier_set = constraints[0].get("qualifier_set")
|
|
945
|
-
if not isinstance(qualifier_set, list):
|
|
946
|
-
raise UsageError("saved query edge has invalid qualifiers")
|
|
947
|
-
raw = []
|
|
948
|
-
for qualifier in qualifier_set:
|
|
949
|
-
if not isinstance(qualifier, dict):
|
|
950
|
-
raise UsageError("saved query edge has invalid qualifiers")
|
|
951
|
-
_require_exact_keys(
|
|
952
|
-
qualifier,
|
|
953
|
-
{"qualifier_type_id", "qualifier_value"},
|
|
954
|
-
"saved qualifier",
|
|
955
|
-
)
|
|
956
|
-
raw.append(f"{qualifier.get('qualifier_type_id')}={qualifier.get('qualifier_value')}")
|
|
957
|
-
parse_qualifiers(raw)
|
|
958
|
-
return subject, object_
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
def _parse_kp_parameter(value: str) -> tuple[str, tuple[str, ...]]:
|
|
962
|
-
if value == "infores:rtx-kg2":
|
|
963
|
-
return "lookup", (value,)
|
|
964
|
-
if not value.startswith("[") or not value.endswith("]"):
|
|
965
|
-
raise UsageError("saved request does not use lookup or selected-provider federation")
|
|
966
|
-
providers = tuple(validate_provider_id(item) for item in value[1:-1].split(",") if item)
|
|
967
|
-
if not MIN_FEDERATED_PROVIDERS <= len(providers) <= MAX_PROVIDERS:
|
|
968
|
-
raise UsageError("saved federated request must name two to five providers")
|
|
969
|
-
_unique(list(providers), "provider")
|
|
970
|
-
return "federated", providers
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
def validate_saved_request_contract(payload: Any) -> QueryContract:
|
|
974
|
-
if not isinstance(payload, dict) or "workflow" in payload:
|
|
975
|
-
raise UsageError("saved request is not a supported fixed-operation request")
|
|
976
|
-
_require_exact_keys(
|
|
977
|
-
payload,
|
|
978
|
-
{"message", "operations", "stream_progress", "submitter"},
|
|
979
|
-
"saved request",
|
|
980
|
-
)
|
|
981
|
-
if payload["stream_progress"] is not False or payload["submitter"] != SUBMITTER:
|
|
982
|
-
raise UsageError("saved request changes fixed submission controls")
|
|
983
|
-
message = payload.get("message")
|
|
984
|
-
if not isinstance(message, dict):
|
|
985
|
-
raise UsageError("saved request lacks a query graph")
|
|
986
|
-
_require_exact_keys(message, {"query_graph"}, "saved message")
|
|
987
|
-
graph = message.get("query_graph") if isinstance(message, dict) else None
|
|
988
|
-
if not isinstance(graph, dict):
|
|
989
|
-
raise UsageError("saved request lacks a query graph")
|
|
990
|
-
_require_exact_keys(graph, {"nodes", "edges"}, "saved query graph")
|
|
991
|
-
nodes = graph.get("nodes") if isinstance(graph, dict) else None
|
|
992
|
-
edges = graph.get("edges") if isinstance(graph, dict) else None
|
|
993
|
-
if not isinstance(nodes, dict) or not isinstance(edges, dict):
|
|
994
|
-
raise UsageError("saved request lacks a query graph")
|
|
995
|
-
if set(nodes) == {"n0", "n1"} and set(edges) == {"e0"}:
|
|
996
|
-
kind = "one-hop"
|
|
997
|
-
elif set(nodes) == {"n0", "n1", "n2"} and set(edges) == {"e0", "e1"}:
|
|
998
|
-
kind = "two-hop"
|
|
999
|
-
else:
|
|
1000
|
-
raise UsageError("saved request must be exactly one hop or endpoint-pinned two hop")
|
|
1001
|
-
qnode_ids: dict[str, list[str]] = {}
|
|
1002
|
-
for key, node in nodes.items():
|
|
1003
|
-
if not isinstance(node, dict):
|
|
1004
|
-
raise UsageError("saved request contains an invalid qnode")
|
|
1005
|
-
allowed_node_keys = {"categories"}
|
|
1006
|
-
if "ids" in node:
|
|
1007
|
-
allowed_node_keys.add("ids")
|
|
1008
|
-
_require_exact_keys(node, allowed_node_keys, "saved qnode")
|
|
1009
|
-
categories = node.get("categories")
|
|
1010
|
-
if not isinstance(categories, list) or len(categories) != 1:
|
|
1011
|
-
raise UsageError("every saved qnode must have exactly one category")
|
|
1012
|
-
validate_biolink_term(categories[0], "Biolink category")
|
|
1013
|
-
ids = node.get("ids", [])
|
|
1014
|
-
if not isinstance(ids, list) or len(ids) > 1:
|
|
1015
|
-
raise UsageError("saved qnodes may have at most one CURIE")
|
|
1016
|
-
qnode_ids[key] = [validate_curie(value) for value in ids]
|
|
1017
|
-
if kind == "one-hop" and not (qnode_ids["n0"] or qnode_ids["n1"]):
|
|
1018
|
-
raise UsageError("saved one-hop request has no pinned endpoint")
|
|
1019
|
-
if kind == "two-hop" and not (
|
|
1020
|
-
len(qnode_ids["n0"]) == 1 and not qnode_ids["n1"] and len(qnode_ids["n2"]) == 1
|
|
1021
|
-
):
|
|
1022
|
-
raise UsageError("saved two-hop request is not endpoint pinned")
|
|
1023
|
-
query_edges = {key: _validate_edge_contract(edge) for key, edge in edges.items()}
|
|
1024
|
-
expected_edges = {"e0": ("n0", "n1")}
|
|
1025
|
-
if kind == "two-hop":
|
|
1026
|
-
expected_edges["e1"] = ("n1", "n2")
|
|
1027
|
-
if query_edges != expected_edges:
|
|
1028
|
-
raise UsageError("saved query edge topology is unsupported")
|
|
1029
|
-
operations = payload.get("operations")
|
|
1030
|
-
if not isinstance(operations, dict):
|
|
1031
|
-
raise UsageError("saved request lacks operations")
|
|
1032
|
-
_require_exact_keys(operations, {"actions"}, "saved operations")
|
|
1033
|
-
actions = operations.get("actions") if isinstance(operations, dict) else None
|
|
1034
|
-
expected_count = 4 if kind == "one-hop" else 5
|
|
1035
|
-
if not isinstance(actions, list) or len(actions) != expected_count:
|
|
1036
|
-
raise UsageError("saved request does not contain the fixed action sequence")
|
|
1037
|
-
if actions[-3] != "scoreless_resultify(ignore_edge_direction=true)":
|
|
1038
|
-
raise UsageError("saved request does not use scoreless resultification")
|
|
1039
|
-
filter_match = FILTER_RE.fullmatch(actions[-2]) if isinstance(actions[-2], str) else None
|
|
1040
|
-
if filter_match is None or actions[-1] != "return(response=true,store=false)":
|
|
1041
|
-
raise UsageError("saved request does not use the fixed filter and return actions")
|
|
1042
|
-
result_limit = validate_result_limit(int(filter_match.group(1)))
|
|
1043
|
-
expand_actions = actions[:-3]
|
|
1044
|
-
expand_keys: list[str] = []
|
|
1045
|
-
mode: str | None = None
|
|
1046
|
-
provider_ids: tuple[str, ...] | None = None
|
|
1047
|
-
for action in expand_actions:
|
|
1048
|
-
match = EXPAND_RE.fullmatch(action) if isinstance(action, str) else None
|
|
1049
|
-
if match is None:
|
|
1050
|
-
raise UsageError("saved request contains an unsupported expansion action")
|
|
1051
|
-
current_mode, current_providers = _parse_kp_parameter(match.group(2))
|
|
1052
|
-
if mode is not None and (current_mode, current_providers) != (mode, provider_ids):
|
|
1053
|
-
raise UsageError("saved request changes providers between edges")
|
|
1054
|
-
mode, provider_ids = current_mode, current_providers
|
|
1055
|
-
expand_keys.append(match.group(1))
|
|
1056
|
-
if kind == "one-hop":
|
|
1057
|
-
if expand_keys != ["e0"]:
|
|
1058
|
-
raise UsageError("saved one-hop request has invalid expansion order")
|
|
1059
|
-
expand_order = None
|
|
1060
|
-
elif expand_keys == ["e1", "e0"]:
|
|
1061
|
-
expand_order = "right-first"
|
|
1062
|
-
elif expand_keys == ["e0", "e1"]:
|
|
1063
|
-
expand_order = "left-first"
|
|
1064
|
-
else:
|
|
1065
|
-
raise UsageError("saved two-hop request has invalid expansion order")
|
|
1066
|
-
return QueryContract(
|
|
1067
|
-
kind=kind,
|
|
1068
|
-
mode=mode or "lookup",
|
|
1069
|
-
provider_ids=provider_ids or ("infores:rtx-kg2",),
|
|
1070
|
-
expand_order=expand_order,
|
|
1071
|
-
qnode_ids=qnode_ids,
|
|
1072
|
-
result_limit=result_limit,
|
|
1073
|
-
query_edges=query_edges,
|
|
1074
|
-
)
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
def _normalize_node_bindings(value: Any) -> tuple[dict[str, list[dict[str, Any]]], dict[str, set[str]]]:
|
|
1078
|
-
if not isinstance(value, dict):
|
|
1079
|
-
raise ResponseError("result node_bindings is not an object")
|
|
1080
|
-
normalized: dict[str, list[dict[str, Any]]] = {}
|
|
1081
|
-
identifiers: dict[str, set[str]] = {}
|
|
1082
|
-
for qnode_key, bindings in value.items():
|
|
1083
|
-
if not isinstance(bindings, list):
|
|
1084
|
-
raise ResponseError("node binding list is malformed")
|
|
1085
|
-
normalized[qnode_key] = []
|
|
1086
|
-
identifiers[qnode_key] = set()
|
|
1087
|
-
for binding in bindings:
|
|
1088
|
-
if not isinstance(binding, dict) or not isinstance(binding.get("id"), str):
|
|
1089
|
-
raise ResponseError("node binding is missing an identifier")
|
|
1090
|
-
identifiers[qnode_key].add(binding["id"])
|
|
1091
|
-
normalized[qnode_key].append(
|
|
1092
|
-
{
|
|
1093
|
-
"id": binding["id"],
|
|
1094
|
-
"query_id": binding.get("query_id"),
|
|
1095
|
-
"attributes": binding.get("attributes", []),
|
|
1096
|
-
}
|
|
1097
|
-
)
|
|
1098
|
-
return normalized, identifiers
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
def _resource_ids_for_role(sources: Sequence[dict[str, Any]], role: str) -> list[str]:
|
|
1102
|
-
found: list[str] = []
|
|
1103
|
-
for source in sources:
|
|
1104
|
-
resource_role = source.get("resource_role")
|
|
1105
|
-
if isinstance(resource_role, str) and resource_role.removeprefix("biolink:") == role:
|
|
1106
|
-
resource_id = source.get("resource_id")
|
|
1107
|
-
if isinstance(resource_id, str) and resource_id not in found:
|
|
1108
|
-
found.append(resource_id)
|
|
1109
|
-
return found
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
def extract_publications(edge: Mapping[str, Any]) -> list[str]:
|
|
1113
|
-
publications: list[str] = []
|
|
1114
|
-
attributes = edge.get("attributes", [])
|
|
1115
|
-
if not isinstance(attributes, list):
|
|
1116
|
-
return publications
|
|
1117
|
-
for attribute in attributes:
|
|
1118
|
-
if not isinstance(attribute, dict) or attribute.get("attribute_type_id") != "biolink:publications":
|
|
1119
|
-
continue
|
|
1120
|
-
value = attribute.get("value")
|
|
1121
|
-
candidates: Iterable[Any] = value if isinstance(value, list) else [value]
|
|
1122
|
-
for candidate in candidates:
|
|
1123
|
-
if isinstance(candidate, str) and candidate not in publications:
|
|
1124
|
-
publications.append(candidate)
|
|
1125
|
-
return publications
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
def _classify_logs(
|
|
1129
|
-
payload: Mapping[str, Any],
|
|
1130
|
-
contract: QueryContract,
|
|
1131
|
-
warnings: list[dict[str, Any]],
|
|
1132
|
-
) -> bool:
|
|
1133
|
-
partial = False
|
|
1134
|
-
logs = payload.get("logs", [])
|
|
1135
|
-
if not isinstance(logs, list):
|
|
1136
|
-
return partial
|
|
1137
|
-
for log in logs:
|
|
1138
|
-
if not isinstance(log, dict):
|
|
1139
|
-
continue
|
|
1140
|
-
message = _sanitize_text(log.get("message", ""), MAX_WARNING_MESSAGE)
|
|
1141
|
-
code = _sanitize_text(log.get("code", ""), 100)
|
|
1142
|
-
level = _sanitize_text(log.get("level", ""), 30).lower()
|
|
1143
|
-
combined = f"{code} {message}".lower()
|
|
1144
|
-
provider = next((item for item in contract.provider_ids if item.lower() in combined), None)
|
|
1145
|
-
context = {"provider_id": provider} if provider else {}
|
|
1146
|
-
failure_level = level in {"warning", "error", "critical", "fatal"}
|
|
1147
|
-
timeout_failure = failure_level and (
|
|
1148
|
-
"timed out" in combined
|
|
1149
|
-
or "timeout error" in combined
|
|
1150
|
-
or "timeout failure" in combined
|
|
1151
|
-
or "timeout" in code.lower()
|
|
1152
|
-
)
|
|
1153
|
-
malformed_failure = failure_level and any(
|
|
1154
|
-
token in combined for token in ("malformed", "deserial", "invalid trapi")
|
|
1155
|
-
)
|
|
1156
|
-
if timeout_failure:
|
|
1157
|
-
_append_warning(warnings, "KP_TIMEOUT", message or "A provider timed out.", context)
|
|
1158
|
-
partial = partial or contract.mode == "federated"
|
|
1159
|
-
elif malformed_failure:
|
|
1160
|
-
_append_warning(
|
|
1161
|
-
warnings,
|
|
1162
|
-
"MALFORMED_KP_RESPONSE",
|
|
1163
|
-
message or "A provider returned a malformed response.",
|
|
1164
|
-
context,
|
|
1165
|
-
)
|
|
1166
|
-
partial = partial or contract.mode == "federated"
|
|
1167
|
-
elif contract.mode == "federated" and level in {"warning", "error", "critical"} and (
|
|
1168
|
-
"kp" in combined or provider is not None
|
|
1169
|
-
):
|
|
1170
|
-
_append_warning(warnings, "KP_ERROR", message or "A provider reported an error.", context)
|
|
1171
|
-
partial = True
|
|
1172
|
-
result_pruning = (
|
|
1173
|
-
"result_limit" in code.lower()
|
|
1174
|
-
or "result_prun" in code.lower()
|
|
1175
|
-
or "pruned result" in combined
|
|
1176
|
-
or ("removed" in combined and "result" in combined)
|
|
1177
|
-
)
|
|
1178
|
-
if result_pruning:
|
|
1179
|
-
_append_warning(
|
|
1180
|
-
warnings,
|
|
1181
|
-
"INTERNAL_PRUNING_DETECTED",
|
|
1182
|
-
message or "ARAX reported internal pruning or result removal.",
|
|
1183
|
-
)
|
|
1184
|
-
return partial
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
def parse_trapi_response(
|
|
1188
|
-
payload: Any,
|
|
1189
|
-
contract: QueryContract,
|
|
1190
|
-
*,
|
|
1191
|
-
service: ServiceInfo | None = None,
|
|
1192
|
-
initial_warnings: Sequence[dict[str, Any]] = (),
|
|
1193
|
-
) -> dict[str, Any]:
|
|
1194
|
-
if not isinstance(payload, dict):
|
|
1195
|
-
raise ResponseError("TRAPI response is not an object")
|
|
1196
|
-
message = payload.get("message")
|
|
1197
|
-
if not isinstance(message, dict):
|
|
1198
|
-
raise ResponseError("TRAPI response is missing message")
|
|
1199
|
-
knowledge_graph = message.get("knowledge_graph")
|
|
1200
|
-
if not isinstance(knowledge_graph, dict):
|
|
1201
|
-
raise ResponseError("TRAPI response is missing knowledge_graph")
|
|
1202
|
-
kg_nodes = knowledge_graph.get("nodes")
|
|
1203
|
-
kg_edges = knowledge_graph.get("edges")
|
|
1204
|
-
results = message.get("results")
|
|
1205
|
-
if not isinstance(kg_nodes, dict) or not isinstance(kg_edges, dict) or not isinstance(results, list):
|
|
1206
|
-
raise ResponseError("TRAPI response has malformed nodes, edges, or results")
|
|
1207
|
-
auxiliary_graphs = message.get("auxiliary_graphs", {})
|
|
1208
|
-
if not isinstance(auxiliary_graphs, dict):
|
|
1209
|
-
auxiliary_graphs = {}
|
|
1210
|
-
warnings = [dict(item) for item in initial_warnings]
|
|
1211
|
-
_append_warning(
|
|
1212
|
-
warnings,
|
|
1213
|
-
"UNSCORED_RESPONSE_ORDER",
|
|
1214
|
-
"Result positions are preserved from the unscored ARAX response.",
|
|
1215
|
-
)
|
|
1216
|
-
partial = _classify_logs(payload, contract, warnings)
|
|
1217
|
-
summarized_results: list[dict[str, Any]] = []
|
|
1218
|
-
analyses_count = 0
|
|
1219
|
-
bound_edges_count = 0
|
|
1220
|
-
for position, result in enumerate(results[: contract.result_limit], start=1):
|
|
1221
|
-
if not isinstance(result, dict):
|
|
1222
|
-
raise ResponseError("TRAPI result is not an object")
|
|
1223
|
-
node_bindings, binding_ids = _normalize_node_bindings(result.get("node_bindings"))
|
|
1224
|
-
if set(node_bindings) != set(contract.qnode_ids):
|
|
1225
|
-
raise ResponseError("result node_bindings do not match the supported query graph")
|
|
1226
|
-
analyses = result.get("analyses")
|
|
1227
|
-
if not isinstance(analyses, list):
|
|
1228
|
-
raise ResponseError("TRAPI result analyses is not a list")
|
|
1229
|
-
normalized_analyses: list[dict[str, Any]] = []
|
|
1230
|
-
for analysis in analyses:
|
|
1231
|
-
if not isinstance(analysis, dict):
|
|
1232
|
-
raise ResponseError("TRAPI analysis is not an object")
|
|
1233
|
-
edge_bindings = analysis.get("edge_bindings")
|
|
1234
|
-
if not isinstance(edge_bindings, dict):
|
|
1235
|
-
raise ResponseError("TRAPI analysis edge_bindings is not an object")
|
|
1236
|
-
if set(edge_bindings) != set(contract.query_edges):
|
|
1237
|
-
raise ResponseError("TRAPI analysis edge_bindings do not match the supported query graph")
|
|
1238
|
-
support_graph_ids = analysis.get("support_graphs", [])
|
|
1239
|
-
if not isinstance(support_graph_ids, list):
|
|
1240
|
-
support_graph_ids = []
|
|
1241
|
-
missing_support = [item for item in support_graph_ids if item not in auxiliary_graphs]
|
|
1242
|
-
if support_graph_ids and missing_support:
|
|
1243
|
-
support_status = "missing"
|
|
1244
|
-
for graph_id in missing_support:
|
|
1245
|
-
_append_warning(
|
|
1246
|
-
warnings,
|
|
1247
|
-
"MISSING_AUXILIARY_GRAPH",
|
|
1248
|
-
"A referenced auxiliary graph was not returned.",
|
|
1249
|
-
{"support_graph_id": graph_id},
|
|
1250
|
-
)
|
|
1251
|
-
elif support_graph_ids:
|
|
1252
|
-
support_status = "available"
|
|
1253
|
-
else:
|
|
1254
|
-
support_status = "not_returned"
|
|
1255
|
-
normalized_edges: dict[str, list[dict[str, Any]]] = {}
|
|
1256
|
-
for qedge_key in contract.query_edges:
|
|
1257
|
-
bindings = edge_bindings.get(qedge_key, [])
|
|
1258
|
-
if not isinstance(bindings, list):
|
|
1259
|
-
raise ResponseError("query-edge binding list is malformed")
|
|
1260
|
-
normalized_edges[qedge_key] = []
|
|
1261
|
-
qsubject, qobject = contract.query_edges[qedge_key]
|
|
1262
|
-
expected_subjects = binding_ids.get(qsubject, set())
|
|
1263
|
-
expected_objects = binding_ids.get(qobject, set())
|
|
1264
|
-
for binding in bindings:
|
|
1265
|
-
if not isinstance(binding, dict) or not isinstance(binding.get("id"), str):
|
|
1266
|
-
raise ResponseError("query-edge binding is missing an edge identifier")
|
|
1267
|
-
edge_id = binding["id"]
|
|
1268
|
-
edge = kg_edges.get(edge_id)
|
|
1269
|
-
if not isinstance(edge, dict):
|
|
1270
|
-
raise ResponseError(f"bound knowledge-graph edge is missing: {edge_id}")
|
|
1271
|
-
subject = edge.get("subject")
|
|
1272
|
-
object_ = edge.get("object")
|
|
1273
|
-
predicate = edge.get("predicate")
|
|
1274
|
-
if not all(isinstance(item, str) for item in (subject, object_, predicate)):
|
|
1275
|
-
raise ResponseError(f"bound edge is malformed: {edge_id}")
|
|
1276
|
-
matches_direction = subject in expected_subjects and object_ in expected_objects
|
|
1277
|
-
matches_reverse = subject in expected_objects and object_ in expected_subjects
|
|
1278
|
-
if not matches_direction and not matches_reverse:
|
|
1279
|
-
raise ResponseError(
|
|
1280
|
-
f"bound edge endpoints do not match result node bindings: {edge_id}"
|
|
1281
|
-
)
|
|
1282
|
-
if matches_reverse:
|
|
1283
|
-
_append_warning(
|
|
1284
|
-
warnings,
|
|
1285
|
-
"REVERSED_EDGE_BINDING",
|
|
1286
|
-
"A bound edge does not match the query's physical direction; it was preserved.",
|
|
1287
|
-
{"edge_id": edge_id, "query_edge": qedge_key},
|
|
1288
|
-
)
|
|
1289
|
-
sources_value = edge.get("sources", [])
|
|
1290
|
-
sources = [dict(item) for item in sources_value if isinstance(item, dict)] if isinstance(sources_value, list) else []
|
|
1291
|
-
primary = _resource_ids_for_role(sources, "primary_knowledge_source")
|
|
1292
|
-
aggregators = _resource_ids_for_role(sources, "aggregator_knowledge_source")
|
|
1293
|
-
supporting = _resource_ids_for_role(sources, "supporting_data_source")
|
|
1294
|
-
if not primary:
|
|
1295
|
-
_append_warning(
|
|
1296
|
-
warnings,
|
|
1297
|
-
"NO_PRIMARY_SOURCE_RETURNED",
|
|
1298
|
-
"No primary knowledge source was returned for a bound edge.",
|
|
1299
|
-
{"edge_id": edge_id},
|
|
1300
|
-
)
|
|
1301
|
-
publications = extract_publications(edge)
|
|
1302
|
-
if not publications:
|
|
1303
|
-
_append_warning(
|
|
1304
|
-
warnings,
|
|
1305
|
-
"NO_PUBLICATIONS_RETURNED",
|
|
1306
|
-
"No recognized publication metadata was returned for a bound edge.",
|
|
1307
|
-
{"edge_id": edge_id},
|
|
1308
|
-
)
|
|
1309
|
-
qualifiers_value = edge.get("qualifiers", [])
|
|
1310
|
-
qualifiers = []
|
|
1311
|
-
if isinstance(qualifiers_value, list):
|
|
1312
|
-
qualifiers = [
|
|
1313
|
-
{
|
|
1314
|
-
"qualifier_type_id": item.get("qualifier_type_id"),
|
|
1315
|
-
"qualifier_value": item.get("qualifier_value"),
|
|
1316
|
-
}
|
|
1317
|
-
for item in qualifiers_value
|
|
1318
|
-
if isinstance(item, dict)
|
|
1319
|
-
]
|
|
1320
|
-
subject_node = kg_nodes.get(subject, {})
|
|
1321
|
-
object_node = kg_nodes.get(object_, {})
|
|
1322
|
-
normalized_edges[qedge_key].append(
|
|
1323
|
-
{
|
|
1324
|
-
"edge_id": edge_id,
|
|
1325
|
-
"subject": subject,
|
|
1326
|
-
"subject_name": subject_node.get("name") if isinstance(subject_node, dict) else None,
|
|
1327
|
-
"predicate": predicate,
|
|
1328
|
-
"object": object_,
|
|
1329
|
-
"object_name": object_node.get("name") if isinstance(object_node, dict) else None,
|
|
1330
|
-
"matches_query_direction": matches_direction,
|
|
1331
|
-
"qualifiers": qualifiers,
|
|
1332
|
-
"sources": sources,
|
|
1333
|
-
"primary_knowledge_sources": primary,
|
|
1334
|
-
"aggregator_knowledge_sources": aggregators,
|
|
1335
|
-
"supporting_data_sources": supporting,
|
|
1336
|
-
"publication_ids": publications,
|
|
1337
|
-
"publication_availability": "available" if publications else "not_returned",
|
|
1338
|
-
"support_graph_ids": list(support_graph_ids),
|
|
1339
|
-
"support_graph_status": support_status,
|
|
1340
|
-
}
|
|
1341
|
-
)
|
|
1342
|
-
bound_edges_count += 1
|
|
1343
|
-
normalized_analyses.append(
|
|
1344
|
-
{
|
|
1345
|
-
"resource_id": analysis.get("resource_id"),
|
|
1346
|
-
"score": analysis.get("score"),
|
|
1347
|
-
"support_graphs": list(support_graph_ids),
|
|
1348
|
-
"edge_bindings": normalized_edges,
|
|
1349
|
-
}
|
|
1350
|
-
)
|
|
1351
|
-
analyses_count += 1
|
|
1352
|
-
summarized_results.append(
|
|
1353
|
-
{
|
|
1354
|
-
"position": position,
|
|
1355
|
-
"description": _sanitize_text(result.get("description"), MAX_DISPLAY_TEXT)
|
|
1356
|
-
if result.get("description") is not None
|
|
1357
|
-
else None,
|
|
1358
|
-
"node_bindings": node_bindings,
|
|
1359
|
-
"analyses": normalized_analyses,
|
|
1360
|
-
}
|
|
1361
|
-
)
|
|
1362
|
-
raw_count = len(results)
|
|
1363
|
-
total_results_count = payload.get("total_results_count")
|
|
1364
|
-
if not isinstance(total_results_count, int) or isinstance(total_results_count, bool):
|
|
1365
|
-
total_results_count = None
|
|
1366
|
-
pruning = any(item.get("code") == "INTERNAL_PRUNING_DETECTED" for item in warnings)
|
|
1367
|
-
if raw_count > contract.result_limit or pruning or (
|
|
1368
|
-
total_results_count is not None and total_results_count > raw_count
|
|
1369
|
-
):
|
|
1370
|
-
truncation_status = "confirmed"
|
|
1371
|
-
elif raw_count == contract.result_limit:
|
|
1372
|
-
truncation_status = "possible"
|
|
1373
|
-
else:
|
|
1374
|
-
truncation_status = "no"
|
|
1375
|
-
if raw_count >= contract.result_limit:
|
|
1376
|
-
_append_warning(
|
|
1377
|
-
warnings,
|
|
1378
|
-
"RESULT_LIMIT_REACHED",
|
|
1379
|
-
"The response reached or exceeded the requested result limit.",
|
|
1380
|
-
{"result_limit": contract.result_limit},
|
|
1381
|
-
)
|
|
1382
|
-
if raw_count == 0:
|
|
1383
|
-
_append_warning(
|
|
1384
|
-
warnings,
|
|
1385
|
-
"NO_RESULTS",
|
|
1386
|
-
"ARAX returned no results under these constraints.",
|
|
1387
|
-
)
|
|
1388
|
-
if service is None:
|
|
1389
|
-
service_data = {
|
|
1390
|
-
"base_url": None,
|
|
1391
|
-
"openapi_url": None,
|
|
1392
|
-
"arax_version": payload.get("tool_version"),
|
|
1393
|
-
"trapi_version": payload.get("schema_version"),
|
|
1394
|
-
"biolink_version": payload.get("biolink_version"),
|
|
1395
|
-
}
|
|
1396
|
-
else:
|
|
1397
|
-
service_data = service.as_dict(biolink_version=payload.get("biolink_version"))
|
|
1398
|
-
return {
|
|
1399
|
-
"schema_version": "1.0",
|
|
1400
|
-
"query": {
|
|
1401
|
-
"kind": contract.kind,
|
|
1402
|
-
"mode": contract.mode,
|
|
1403
|
-
"provider_ids": list(contract.provider_ids),
|
|
1404
|
-
"expand_order": contract.expand_order,
|
|
1405
|
-
"qnode_ids": contract.qnode_ids,
|
|
1406
|
-
"result_limit": contract.result_limit,
|
|
1407
|
-
},
|
|
1408
|
-
"service": service_data,
|
|
1409
|
-
"counts": {
|
|
1410
|
-
"results_returned": raw_count,
|
|
1411
|
-
"results_summarized": len(summarized_results),
|
|
1412
|
-
"analyses_summarized": analyses_count,
|
|
1413
|
-
"bound_edges_summarized": bound_edges_count,
|
|
1414
|
-
"knowledge_graph_nodes": len(kg_nodes),
|
|
1415
|
-
"knowledge_graph_edges": len(kg_edges),
|
|
1416
|
-
"server_total_results_count": total_results_count,
|
|
1417
|
-
},
|
|
1418
|
-
"truncation_status": truncation_status,
|
|
1419
|
-
"completeness": "partial" if partial else "complete",
|
|
1420
|
-
"results": summarized_results,
|
|
1421
|
-
"warnings": warnings,
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
def render_text_summary(
|
|
1426
|
-
summary: Mapping[str, Any],
|
|
1427
|
-
*,
|
|
1428
|
-
summary_path: str = "summary.json",
|
|
1429
|
-
response_path: str = "response.json",
|
|
1430
|
-
) -> str:
|
|
1431
|
-
def rendered(value: Any, limit: int = 200) -> str:
|
|
1432
|
-
return _sanitize_text(value, limit)
|
|
1433
|
-
|
|
1434
|
-
def rendered_list(values: Any, *, limit: int = 200) -> str:
|
|
1435
|
-
if not isinstance(values, list) or not values:
|
|
1436
|
-
return "not returned"
|
|
1437
|
-
return ", ".join(rendered(value, limit) for value in values)
|
|
1438
|
-
|
|
1439
|
-
lines: list[str] = []
|
|
1440
|
-
query = summary.get("query", {})
|
|
1441
|
-
counts = summary.get("counts", {})
|
|
1442
|
-
lines.append(
|
|
1443
|
-
f"ARAX returned {counts.get('results_returned', 0)} result(s); "
|
|
1444
|
-
f"showing {counts.get('results_summarized', 0)} in unscored response order."
|
|
1445
|
-
)
|
|
1446
|
-
lines.append(
|
|
1447
|
-
f"Query: {rendered(query.get('kind'))} / {rendered(query.get('mode'))}; "
|
|
1448
|
-
f"limit {rendered(query.get('result_limit'))}; "
|
|
1449
|
-
f"truncation {rendered(summary.get('truncation_status'))}; "
|
|
1450
|
-
f"completeness {rendered(summary.get('completeness'))}."
|
|
1451
|
-
)
|
|
1452
|
-
warnings = summary.get("warnings", [])
|
|
1453
|
-
if isinstance(warnings, list) and warnings:
|
|
1454
|
-
lines.append("Warnings:")
|
|
1455
|
-
for warning in warnings:
|
|
1456
|
-
if isinstance(warning, dict):
|
|
1457
|
-
lines.append(
|
|
1458
|
-
f" - {rendered(warning.get('code'), 100)}: "
|
|
1459
|
-
f"{rendered(warning.get('message', ''), MAX_WARNING_MESSAGE)}"
|
|
1460
|
-
)
|
|
1461
|
-
results = summary.get("results", [])
|
|
1462
|
-
if not results:
|
|
1463
|
-
lines.append("Not returned under these constraints.")
|
|
1464
|
-
for result in results if isinstance(results, list) else []:
|
|
1465
|
-
if not isinstance(result, dict):
|
|
1466
|
-
continue
|
|
1467
|
-
lines.append(
|
|
1468
|
-
f"Unscored position {rendered(result.get('position'))}: "
|
|
1469
|
-
f"{rendered(result.get('description') or 'candidate path', MAX_DISPLAY_TEXT)}"
|
|
1470
|
-
)
|
|
1471
|
-
node_bindings = result.get("node_bindings", {})
|
|
1472
|
-
if isinstance(node_bindings, dict):
|
|
1473
|
-
for qnode, bindings in node_bindings.items():
|
|
1474
|
-
ids = [item.get("id") for item in bindings if isinstance(item, dict)] if isinstance(bindings, list) else []
|
|
1475
|
-
lines.append(f" {rendered(qnode, 100)}: {rendered_list(ids)}")
|
|
1476
|
-
analyses = result.get("analyses", [])
|
|
1477
|
-
for analysis_index, analysis in enumerate(analyses if isinstance(analyses, list) else [], start=1):
|
|
1478
|
-
if not isinstance(analysis, dict):
|
|
1479
|
-
continue
|
|
1480
|
-
lines.append(
|
|
1481
|
-
f" Analysis {analysis_index}: resource {rendered(analysis.get('resource_id'))}; "
|
|
1482
|
-
f"score {rendered(analysis.get('score'))}"
|
|
1483
|
-
)
|
|
1484
|
-
edge_bindings = analysis.get("edge_bindings", {})
|
|
1485
|
-
if not isinstance(edge_bindings, dict):
|
|
1486
|
-
continue
|
|
1487
|
-
for qedge, edges in edge_bindings.items():
|
|
1488
|
-
for edge in edges if isinstance(edges, list) else []:
|
|
1489
|
-
if not isinstance(edge, dict):
|
|
1490
|
-
continue
|
|
1491
|
-
subject = edge.get("subject")
|
|
1492
|
-
subject_name = edge.get("subject_name")
|
|
1493
|
-
object_ = edge.get("object")
|
|
1494
|
-
object_name = edge.get("object_name")
|
|
1495
|
-
lines.append(
|
|
1496
|
-
f" {rendered(qedge, 100)}/{rendered(edge.get('edge_id'))}: "
|
|
1497
|
-
f"{rendered(subject)} ({rendered(subject_name)}) "
|
|
1498
|
-
f"--{rendered(edge.get('predicate'))}--> "
|
|
1499
|
-
f"{rendered(object_)} ({rendered(object_name)})"
|
|
1500
|
-
)
|
|
1501
|
-
if not edge.get("matches_query_direction"):
|
|
1502
|
-
lines.append(" Direction warning: physical edge orientation differs from the query.")
|
|
1503
|
-
qualifiers = edge.get("qualifiers", [])
|
|
1504
|
-
if qualifiers:
|
|
1505
|
-
rendered_qualifiers = ", ".join(
|
|
1506
|
-
f"{_sanitize_text(item.get('qualifier_type_id'), 200)}="
|
|
1507
|
-
f"{_sanitize_text(item.get('qualifier_value'), 200)}"
|
|
1508
|
-
for item in qualifiers
|
|
1509
|
-
if isinstance(item, dict)
|
|
1510
|
-
)
|
|
1511
|
-
lines.append(f" Qualifiers: {rendered_qualifiers}")
|
|
1512
|
-
for label, field in (
|
|
1513
|
-
("Primary sources", "primary_knowledge_sources"),
|
|
1514
|
-
("Aggregator sources", "aggregator_knowledge_sources"),
|
|
1515
|
-
("Supporting sources", "supporting_data_sources"),
|
|
1516
|
-
):
|
|
1517
|
-
values = edge.get(field, [])
|
|
1518
|
-
lines.append(f" {label}: {rendered_list(values)}")
|
|
1519
|
-
publications = edge.get("publication_ids", [])
|
|
1520
|
-
preview = publications[:PUBLICATION_PREVIEW] if isinstance(publications, list) else []
|
|
1521
|
-
lines.append(
|
|
1522
|
-
f" Publications: {len(publications) if isinstance(publications, list) else 0}; "
|
|
1523
|
-
f"preview {rendered_list(preview)}"
|
|
1524
|
-
)
|
|
1525
|
-
lines.append(f"Complete bounded publication and source lists: {rendered(summary_path, 500)}")
|
|
1526
|
-
lines.append(f"Exact TRAPI payload: {rendered(response_path, 500)}")
|
|
1527
|
-
lines.append("Candidate paths require subsequent scientific verification.")
|
|
1528
|
-
return "\n".join(lines)
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
def sha256_bytes(value: bytes) -> str:
|
|
1532
|
-
return hashlib.sha256(value).hexdigest()
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
def prepare_output_directory(value: str | Path) -> Path:
|
|
1536
|
-
path = Path(value)
|
|
1537
|
-
try:
|
|
1538
|
-
if path.exists():
|
|
1539
|
-
if not path.is_dir():
|
|
1540
|
-
raise UsageError("output path exists and is not a directory")
|
|
1541
|
-
if any(path.iterdir()):
|
|
1542
|
-
raise UsageError("output directory must be new or empty")
|
|
1543
|
-
else:
|
|
1544
|
-
path.mkdir(parents=True)
|
|
1545
|
-
except UsageError:
|
|
1546
|
-
raise
|
|
1547
|
-
except OSError as exc:
|
|
1548
|
-
raise ResponseError(f"could not prepare output directory: {_sanitize_text(exc)}") from exc
|
|
1549
|
-
return path
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
def atomic_write_bytes(path: Path, value: bytes) -> None:
|
|
1553
|
-
try:
|
|
1554
|
-
if path.exists():
|
|
1555
|
-
raise ResponseError(f"refusing to overwrite existing artifact: {path.name}")
|
|
1556
|
-
except ResponseError:
|
|
1557
|
-
raise
|
|
1558
|
-
except OSError as exc:
|
|
1559
|
-
raise ResponseError(f"could not inspect artifact path {path.name}: {_sanitize_text(exc)}") from exc
|
|
1560
|
-
descriptor: int | None = None
|
|
1561
|
-
temporary: Path | None = None
|
|
1562
|
-
try:
|
|
1563
|
-
descriptor, temporary_name = tempfile.mkstemp(
|
|
1564
|
-
prefix=".ncats-arax-", dir=str(path.parent)
|
|
1565
|
-
)
|
|
1566
|
-
temporary = Path(temporary_name)
|
|
1567
|
-
try:
|
|
1568
|
-
os.chmod(temporary, 0o600)
|
|
1569
|
-
except OSError:
|
|
1570
|
-
pass
|
|
1571
|
-
handle = os.fdopen(descriptor, "wb")
|
|
1572
|
-
descriptor = None
|
|
1573
|
-
with handle:
|
|
1574
|
-
handle.write(value)
|
|
1575
|
-
handle.flush()
|
|
1576
|
-
os.fsync(handle.fileno())
|
|
1577
|
-
if path.exists():
|
|
1578
|
-
raise ResponseError(f"refusing to overwrite concurrently created artifact: {path.name}")
|
|
1579
|
-
os.replace(temporary, path)
|
|
1580
|
-
except ResponseError:
|
|
1581
|
-
raise
|
|
1582
|
-
except OSError as exc:
|
|
1583
|
-
raise ResponseError(f"could not write artifact {path.name}: {_sanitize_text(exc)}") from exc
|
|
1584
|
-
finally:
|
|
1585
|
-
if descriptor is not None:
|
|
1586
|
-
try:
|
|
1587
|
-
os.close(descriptor)
|
|
1588
|
-
except OSError:
|
|
1589
|
-
pass
|
|
1590
|
-
try:
|
|
1591
|
-
if temporary is not None:
|
|
1592
|
-
temporary.unlink(missing_ok=True)
|
|
1593
|
-
except OSError:
|
|
1594
|
-
pass
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
def atomic_write_json(path: Path, value: Mapping[str, Any]) -> bytes:
|
|
1598
|
-
try:
|
|
1599
|
-
encoded = (
|
|
1600
|
-
json.dumps(value, indent=2, sort_keys=True, ensure_ascii=False, allow_nan=False) + "\n"
|
|
1601
|
-
).encode("utf-8")
|
|
1602
|
-
except (TypeError, ValueError) as exc:
|
|
1603
|
-
raise ResponseError("artifact data cannot be represented as strict JSON") from exc
|
|
1604
|
-
atomic_write_bytes(path, encoded)
|
|
1605
|
-
return encoded
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
def _utc_now() -> str:
|
|
1609
|
-
return datetime.now(timezone.utc).isoformat().replace("+00:00", "Z")
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
def new_manifest(
|
|
1613
|
-
command: str,
|
|
1614
|
-
*,
|
|
1615
|
-
base_url: str,
|
|
1616
|
-
privacy_acknowledged: bool,
|
|
1617
|
-
http_timeout: int,
|
|
1618
|
-
result_limit: int | None = None,
|
|
1619
|
-
) -> dict[str, Any]:
|
|
1620
|
-
return {
|
|
1621
|
-
"manifest_version": "1.0",
|
|
1622
|
-
"run_id": str(uuid.uuid4()),
|
|
1623
|
-
"command": command,
|
|
1624
|
-
"started_at": _utc_now(),
|
|
1625
|
-
"finished_at": None,
|
|
1626
|
-
"execution_status": "client_error",
|
|
1627
|
-
"result_status": "not_available",
|
|
1628
|
-
"privacy_acknowledged": privacy_acknowledged,
|
|
1629
|
-
"client": {"name": CLIENT_NAME, "version": CLIENT_VERSION},
|
|
1630
|
-
"service": {
|
|
1631
|
-
"base_url": base_url,
|
|
1632
|
-
"openapi_url": base_url + "/openapi.json",
|
|
1633
|
-
"arax_version": None,
|
|
1634
|
-
"trapi_version": None,
|
|
1635
|
-
"biolink_version": None,
|
|
1636
|
-
},
|
|
1637
|
-
"request": {
|
|
1638
|
-
"method": "GET",
|
|
1639
|
-
"url": base_url + "/openapi.json",
|
|
1640
|
-
"file": None,
|
|
1641
|
-
"bytes": None,
|
|
1642
|
-
"sha256": None,
|
|
1643
|
-
},
|
|
1644
|
-
"response": {
|
|
1645
|
-
"http_status": None,
|
|
1646
|
-
"file": None,
|
|
1647
|
-
"bytes": None,
|
|
1648
|
-
"sha256": None,
|
|
1649
|
-
"elapsed_ms": None,
|
|
1650
|
-
},
|
|
1651
|
-
"limits": {
|
|
1652
|
-
"result_limit": result_limit,
|
|
1653
|
-
"response_byte_limit": MAX_RESPONSE_BYTES,
|
|
1654
|
-
"kp_timeout_seconds": KP_TIMEOUT_SECONDS if command in {"one-hop", "two-hop"} else None,
|
|
1655
|
-
"http_timeout_seconds": http_timeout,
|
|
1656
|
-
},
|
|
1657
|
-
"attempts": {"openapi_get": 0, "entity_get": 0, "query_post": 0},
|
|
1658
|
-
"artifacts": {"request": None, "response": None, "summary": None},
|
|
1659
|
-
"error": None,
|
|
1660
|
-
"warnings": [],
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
def _apply_service_to_manifest(manifest: dict[str, Any], service: ServiceInfo) -> None:
|
|
1665
|
-
manifest["service"].update(service.as_dict())
|
|
1666
|
-
manifest["warnings"] = [dict(item) for item in service.warnings]
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
def _record_response(manifest: dict[str, Any], result: HttpResult, filename: str = "response.json") -> None:
|
|
1670
|
-
manifest["response"].update(
|
|
1671
|
-
{
|
|
1672
|
-
"http_status": result.status,
|
|
1673
|
-
"file": filename,
|
|
1674
|
-
"bytes": len(result.body),
|
|
1675
|
-
"sha256": sha256_bytes(result.body),
|
|
1676
|
-
"elapsed_ms": result.elapsed_ms,
|
|
1677
|
-
}
|
|
1678
|
-
)
|
|
1679
|
-
manifest["artifacts"]["response"] = filename
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
def _write_manifest(output_dir: Path, manifest: dict[str, Any]) -> None:
|
|
1683
|
-
manifest["finished_at"] = _utc_now()
|
|
1684
|
-
atomic_write_json(output_dir / "manifest.json", manifest)
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
def _retain_failure(
|
|
1688
|
-
output_dir: Path | None,
|
|
1689
|
-
manifest: dict[str, Any] | None,
|
|
1690
|
-
error: AraxClientError,
|
|
1691
|
-
stage: str,
|
|
1692
|
-
) -> None:
|
|
1693
|
-
if output_dir is None or manifest is None:
|
|
1694
|
-
return
|
|
1695
|
-
try:
|
|
1696
|
-
manifest["execution_status"] = "http_error" if error.exit_code == 5 else "client_error"
|
|
1697
|
-
manifest["result_status"] = "not_available"
|
|
1698
|
-
manifest["error"] = {"kind": error.kind, "message": _sanitize_text(error)}
|
|
1699
|
-
if error.http_status is not None:
|
|
1700
|
-
manifest["response"]["http_status"] = error.http_status
|
|
1701
|
-
attempt_key = {
|
|
1702
|
-
"openapi": "openapi_get",
|
|
1703
|
-
"entity": "entity_get",
|
|
1704
|
-
"query": "query_post",
|
|
1705
|
-
}.get(stage)
|
|
1706
|
-
if error.attempts and attempt_key is not None:
|
|
1707
|
-
manifest["attempts"][attempt_key] = error.attempts
|
|
1708
|
-
if error.response_body is not None and not (output_dir / "response.json").exists():
|
|
1709
|
-
atomic_write_bytes(output_dir / "response.json", error.response_body)
|
|
1710
|
-
failed = HttpResult(
|
|
1711
|
-
status=error.http_status or 0,
|
|
1712
|
-
body=error.response_body,
|
|
1713
|
-
headers={},
|
|
1714
|
-
elapsed_ms=0,
|
|
1715
|
-
attempts=error.attempts,
|
|
1716
|
-
)
|
|
1717
|
-
_record_response(manifest, failed)
|
|
1718
|
-
if not (output_dir / "manifest.json").exists():
|
|
1719
|
-
_write_manifest(output_dir, manifest)
|
|
1720
|
-
except Exception as manifest_error:
|
|
1721
|
-
print(
|
|
1722
|
-
f"warning: could not retain failure artifacts: {_sanitize_text(manifest_error)}",
|
|
1723
|
-
file=sys.stderr,
|
|
1724
|
-
)
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
def _json_from_http(result: HttpResult, label: str) -> Any:
|
|
1728
|
-
return _decode_json(result.body, label)
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
def _preflight_summary(service: ServiceInfo) -> dict[str, Any]:
|
|
1732
|
-
return {
|
|
1733
|
-
"schema_version": "1.0",
|
|
1734
|
-
"kind": "preflight",
|
|
1735
|
-
"service": service.as_dict(),
|
|
1736
|
-
"checks": {
|
|
1737
|
-
"title_identifies_arax": True,
|
|
1738
|
-
"query_path_present": True,
|
|
1739
|
-
"version_supported": _version_series(service.trapi_version) in SUPPORTED_TRAPI_SERIES,
|
|
1740
|
-
},
|
|
1741
|
-
"warnings": [dict(item) for item in service.warnings],
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
def handle_preflight(args: argparse.Namespace) -> int:
|
|
1746
|
-
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1747
|
-
output_dir = prepare_output_directory(args.output_dir) if args.output_dir else None
|
|
1748
|
-
manifest = new_manifest(
|
|
1749
|
-
"preflight", base_url=base_url, privacy_acknowledged=False, http_timeout=GET_TIMEOUT_SECONDS
|
|
1750
|
-
) if output_dir else None
|
|
1751
|
-
stage = "openapi"
|
|
1752
|
-
try:
|
|
1753
|
-
service, result = fetch_openapi(
|
|
1754
|
-
base_url,
|
|
1755
|
-
allow_untested_version=args.allow_untested_version,
|
|
1756
|
-
initial_warnings=endpoint_warnings,
|
|
1757
|
-
)
|
|
1758
|
-
summary = _preflight_summary(service)
|
|
1759
|
-
if output_dir is not None and manifest is not None:
|
|
1760
|
-
_apply_service_to_manifest(manifest, service)
|
|
1761
|
-
manifest["attempts"]["openapi_get"] = result.attempts
|
|
1762
|
-
atomic_write_bytes(output_dir / "response.json", result.body)
|
|
1763
|
-
_record_response(manifest, result)
|
|
1764
|
-
atomic_write_json(output_dir / "summary.json", summary)
|
|
1765
|
-
manifest["artifacts"]["summary"] = "summary.json"
|
|
1766
|
-
manifest["execution_status"] = "success"
|
|
1767
|
-
manifest["result_status"] = "not_available"
|
|
1768
|
-
_write_manifest(output_dir, manifest)
|
|
1769
|
-
print(
|
|
1770
|
-
f"ARAX {service.arax_version or 'unknown'}; TRAPI {service.trapi_version or 'unknown'}; "
|
|
1771
|
-
f"/query available at {service.base_url}"
|
|
1772
|
-
)
|
|
1773
|
-
for warning in service.warnings:
|
|
1774
|
-
print(f"warning {warning['code']}: {warning['message']}", file=sys.stderr)
|
|
1775
|
-
return 0
|
|
1776
|
-
except AraxClientError as exc:
|
|
1777
|
-
_retain_failure(output_dir, manifest, exc, stage)
|
|
1778
|
-
raise
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
def handle_normalize(args: argparse.Namespace) -> int:
|
|
1782
|
-
if not 0 <= args.max_synonyms <= 50:
|
|
1783
|
-
raise UsageError("--max-synonyms must be between 0 and 50")
|
|
1784
|
-
expected_category = (
|
|
1785
|
-
validate_biolink_term(args.expected_category, "Biolink category")
|
|
1786
|
-
if args.expected_category
|
|
1787
|
-
else None
|
|
1788
|
-
)
|
|
1789
|
-
if not args.term or len(args.term) > MAX_IDENTIFIER_LENGTH or _has_control(args.term):
|
|
1790
|
-
raise UsageError("normalization term must be control-free and at most 200 characters")
|
|
1791
|
-
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1792
|
-
output_dir = prepare_output_directory(args.output_dir)
|
|
1793
|
-
manifest = new_manifest(
|
|
1794
|
-
"normalize", base_url=base_url, privacy_acknowledged=True, http_timeout=GET_TIMEOUT_SECONDS
|
|
1795
|
-
)
|
|
1796
|
-
stage = "openapi"
|
|
1797
|
-
try:
|
|
1798
|
-
service, preflight_result = fetch_openapi(
|
|
1799
|
-
base_url,
|
|
1800
|
-
allow_untested_version=args.allow_untested_version,
|
|
1801
|
-
initial_warnings=endpoint_warnings,
|
|
1802
|
-
)
|
|
1803
|
-
_apply_service_to_manifest(manifest, service)
|
|
1804
|
-
manifest["attempts"]["openapi_get"] = preflight_result.attempts
|
|
1805
|
-
stage = "entity"
|
|
1806
|
-
manifest["request"].update(
|
|
1807
|
-
{
|
|
1808
|
-
"method": "GET",
|
|
1809
|
-
"url": base_url + "/entity?" + urllib.parse.urlencode({"q": args.term}),
|
|
1810
|
-
}
|
|
1811
|
-
)
|
|
1812
|
-
entity_result = normalize_entity_request(base_url, args.term)
|
|
1813
|
-
manifest["attempts"]["entity_get"] = entity_result.attempts
|
|
1814
|
-
atomic_write_bytes(output_dir / "response.json", entity_result.body)
|
|
1815
|
-
_record_response(manifest, entity_result)
|
|
1816
|
-
payload = _json_from_http(entity_result, "entity response")
|
|
1817
|
-
summary, usable = parse_normalization_response(
|
|
1818
|
-
payload,
|
|
1819
|
-
term=args.term,
|
|
1820
|
-
expected_category=expected_category,
|
|
1821
|
-
max_synonyms=args.max_synonyms,
|
|
1822
|
-
service=service,
|
|
1823
|
-
)
|
|
1824
|
-
atomic_write_json(output_dir / "summary.json", summary)
|
|
1825
|
-
manifest["artifacts"]["summary"] = "summary.json"
|
|
1826
|
-
manifest["warnings"] = summary["warnings"]
|
|
1827
|
-
manifest["execution_status"] = "success"
|
|
1828
|
-
manifest["result_status"] = "results" if usable else "no_results"
|
|
1829
|
-
_write_manifest(output_dir, manifest)
|
|
1830
|
-
if not usable:
|
|
1831
|
-
raise NormalizationError("normalization returned no usable canonical CURIE")
|
|
1832
|
-
canonical = summary["canonical"]
|
|
1833
|
-
print(
|
|
1834
|
-
f"Canonical: {canonical['identifier']} ({canonical.get('name') or 'name not returned'}; "
|
|
1835
|
-
f"{canonical.get('category') or 'category not returned'})"
|
|
1836
|
-
)
|
|
1837
|
-
if summary["query"]["requires_user_confirmation"]:
|
|
1838
|
-
print("Review and confirm this normalization before constructing a graph query.")
|
|
1839
|
-
return 0
|
|
1840
|
-
except NormalizationError:
|
|
1841
|
-
raise
|
|
1842
|
-
except AraxClientError as exc:
|
|
1843
|
-
_retain_failure(output_dir, manifest, exc, stage)
|
|
1844
|
-
raise
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
def _build_from_args(args: argparse.Namespace) -> tuple[dict[str, Any], QueryContract, int]:
|
|
1848
|
-
providers, limit = resolve_mode(args.mode, args.kp or [], args.result_limit)
|
|
1849
|
-
if args.command == "one-hop":
|
|
1850
|
-
body = build_one_hop_query(
|
|
1851
|
-
subject_id=args.subject_id,
|
|
1852
|
-
subject_category=args.subject_category,
|
|
1853
|
-
predicates=args.predicate,
|
|
1854
|
-
object_id=args.object_id,
|
|
1855
|
-
object_category=args.object_category,
|
|
1856
|
-
qualifiers=parse_qualifiers(args.qualifier or []),
|
|
1857
|
-
mode=args.mode,
|
|
1858
|
-
provider_ids=providers,
|
|
1859
|
-
result_limit=limit,
|
|
1860
|
-
)
|
|
1861
|
-
timeout = LOOKUP_TIMEOUT_SECONDS if args.mode == "lookup" else FEDERATED_TIMEOUT_SECONDS
|
|
1862
|
-
else:
|
|
1863
|
-
body = build_two_hop_query(
|
|
1864
|
-
subject_id=args.subject_id,
|
|
1865
|
-
subject_category=args.subject_category,
|
|
1866
|
-
predicates_1=args.predicate_1,
|
|
1867
|
-
intermediate_category=args.intermediate_category,
|
|
1868
|
-
predicates_2=args.predicate_2,
|
|
1869
|
-
object_id=args.object_id,
|
|
1870
|
-
object_category=args.object_category,
|
|
1871
|
-
qualifiers_1=parse_qualifiers(args.qualifier_1 or []),
|
|
1872
|
-
qualifiers_2=parse_qualifiers(args.qualifier_2 or []),
|
|
1873
|
-
mode=args.mode,
|
|
1874
|
-
provider_ids=providers,
|
|
1875
|
-
expand_order=args.expand_order,
|
|
1876
|
-
result_limit=limit,
|
|
1877
|
-
)
|
|
1878
|
-
timeout = LOOKUP_TIMEOUT_SECONDS if args.mode == "lookup" else FEDERATED_TIMEOUT_SECONDS
|
|
1879
|
-
return body, validate_saved_request_contract(body), timeout
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
def _validate_query_response_version(
|
|
1883
|
-
payload: Mapping[str, Any],
|
|
1884
|
-
allow_untested_version: bool,
|
|
1885
|
-
warnings: list[dict[str, Any]],
|
|
1886
|
-
) -> None:
|
|
1887
|
-
try:
|
|
1888
|
-
_check_trapi_version(
|
|
1889
|
-
payload.get("schema_version") if isinstance(payload.get("schema_version"), str) else None,
|
|
1890
|
-
allow_untested_version,
|
|
1891
|
-
warnings,
|
|
1892
|
-
)
|
|
1893
|
-
except PreflightError:
|
|
1894
|
-
raise
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
def handle_graph_query(args: argparse.Namespace) -> int:
|
|
1898
|
-
body, contract, timeout = _build_from_args(args)
|
|
1899
|
-
request_bytes = serialize_request(body)
|
|
1900
|
-
base_url, endpoint_warnings = validate_base_url(args.base_url, args.allow_nonproduction_endpoint)
|
|
1901
|
-
output_dir = prepare_output_directory(args.output_dir)
|
|
1902
|
-
manifest = new_manifest(
|
|
1903
|
-
args.command,
|
|
1904
|
-
base_url=base_url,
|
|
1905
|
-
privacy_acknowledged=True,
|
|
1906
|
-
http_timeout=timeout,
|
|
1907
|
-
result_limit=contract.result_limit,
|
|
1908
|
-
)
|
|
1909
|
-
stage = "openapi"
|
|
1910
|
-
try:
|
|
1911
|
-
service, preflight_result = fetch_openapi(
|
|
1912
|
-
base_url,
|
|
1913
|
-
allow_untested_version=args.allow_untested_version,
|
|
1914
|
-
initial_warnings=endpoint_warnings,
|
|
1915
|
-
)
|
|
1916
|
-
_apply_service_to_manifest(manifest, service)
|
|
1917
|
-
manifest["attempts"]["openapi_get"] = preflight_result.attempts
|
|
1918
|
-
stage = "query"
|
|
1919
|
-
atomic_write_bytes(output_dir / "request.json", request_bytes)
|
|
1920
|
-
manifest["request"].update(
|
|
1921
|
-
{
|
|
1922
|
-
"method": "POST",
|
|
1923
|
-
"url": base_url + "/query",
|
|
1924
|
-
"file": "request.json",
|
|
1925
|
-
"bytes": len(request_bytes),
|
|
1926
|
-
"sha256": sha256_bytes(request_bytes),
|
|
1927
|
-
}
|
|
1928
|
-
)
|
|
1929
|
-
manifest["artifacts"]["request"] = "request.json"
|
|
1930
|
-
result = post_query(base_url + "/query", request_bytes, timeout=timeout)
|
|
1931
|
-
manifest["attempts"]["query_post"] = result.attempts
|
|
1932
|
-
atomic_write_bytes(output_dir / "response.json", result.body)
|
|
1933
|
-
_record_response(manifest, result)
|
|
1934
|
-
payload = _json_from_http(result, "TRAPI response")
|
|
1935
|
-
if not isinstance(payload, dict):
|
|
1936
|
-
raise ResponseError("TRAPI response is not an object")
|
|
1937
|
-
warnings = [dict(item) for item in service.warnings]
|
|
1938
|
-
_append_warning(warnings, "PUBLIC_QUERY", "The graph query was sent to a public service.")
|
|
1939
|
-
_validate_query_response_version(payload, args.allow_untested_version, warnings)
|
|
1940
|
-
summary = parse_trapi_response(payload, contract, service=service, initial_warnings=warnings)
|
|
1941
|
-
atomic_write_json(output_dir / "summary.json", summary)
|
|
1942
|
-
manifest["artifacts"]["summary"] = "summary.json"
|
|
1943
|
-
manifest["service"]["biolink_version"] = payload.get("biolink_version")
|
|
1944
|
-
manifest["warnings"] = summary["warnings"]
|
|
1945
|
-
manifest["execution_status"] = "success"
|
|
1946
|
-
if summary["completeness"] == "partial":
|
|
1947
|
-
manifest["result_status"] = "partial"
|
|
1948
|
-
exit_code = 7
|
|
1949
|
-
elif summary["counts"]["results_returned"] == 0:
|
|
1950
|
-
manifest["result_status"] = "no_results"
|
|
1951
|
-
exit_code = 0
|
|
1952
|
-
else:
|
|
1953
|
-
manifest["result_status"] = "results"
|
|
1954
|
-
exit_code = 0
|
|
1955
|
-
_write_manifest(output_dir, manifest)
|
|
1956
|
-
print(
|
|
1957
|
-
render_text_summary(
|
|
1958
|
-
summary,
|
|
1959
|
-
summary_path=str(output_dir / "summary.json"),
|
|
1960
|
-
response_path=str(output_dir / "response.json"),
|
|
1961
|
-
)
|
|
1962
|
-
)
|
|
1963
|
-
return exit_code
|
|
1964
|
-
except AraxClientError as exc:
|
|
1965
|
-
_retain_failure(output_dir, manifest, exc, stage)
|
|
1966
|
-
raise
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
def handle_summarize(args: argparse.Namespace) -> int:
|
|
1970
|
-
request_path = Path(args.request)
|
|
1971
|
-
response_path = Path(args.response)
|
|
1972
|
-
try:
|
|
1973
|
-
request_bytes = request_path.read_bytes()
|
|
1974
|
-
response_bytes = response_path.read_bytes()
|
|
1975
|
-
except OSError as exc:
|
|
1976
|
-
raise UsageError(f"could not read saved artifact: {_sanitize_text(exc)}") from exc
|
|
1977
|
-
if len(response_bytes) > MAX_RESPONSE_BYTES:
|
|
1978
|
-
raise ResponseError("saved response exceeded the 25 MiB byte limit")
|
|
1979
|
-
request_payload = _decode_json(request_bytes, "saved request")
|
|
1980
|
-
response_payload = _decode_json(response_bytes, "saved response")
|
|
1981
|
-
contract = validate_saved_request_contract(request_payload)
|
|
1982
|
-
warnings: list[dict[str, Any]] = []
|
|
1983
|
-
if isinstance(response_payload, dict):
|
|
1984
|
-
_validate_query_response_version(response_payload, False, warnings)
|
|
1985
|
-
summary = parse_trapi_response(
|
|
1986
|
-
response_payload,
|
|
1987
|
-
contract,
|
|
1988
|
-
service=None,
|
|
1989
|
-
initial_warnings=warnings,
|
|
1990
|
-
)
|
|
1991
|
-
if args.format == "json":
|
|
1992
|
-
print(json.dumps(summary, indent=2, sort_keys=True, ensure_ascii=False))
|
|
1993
|
-
else:
|
|
1994
|
-
print(
|
|
1995
|
-
render_text_summary(
|
|
1996
|
-
summary,
|
|
1997
|
-
summary_path="standard output with --format json",
|
|
1998
|
-
response_path=str(response_path),
|
|
1999
|
-
)
|
|
2000
|
-
)
|
|
2001
|
-
return 7 if summary["completeness"] == "partial" else 0
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
def _add_network_policy_options(parser: argparse.ArgumentParser) -> None:
|
|
2005
|
-
parser.add_argument("--base-url", default=PRODUCTION_BASE_URL)
|
|
2006
|
-
parser.add_argument("--allow-nonproduction-endpoint", action="store_true")
|
|
2007
|
-
parser.add_argument("--allow-untested-version", action="store_true")
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
def _add_query_common(parser: argparse.ArgumentParser) -> None:
|
|
2011
|
-
parser.add_argument("--mode", choices=("lookup", "federated"), default="lookup")
|
|
2012
|
-
parser.add_argument("--kp", action="append", default=[])
|
|
2013
|
-
parser.add_argument("--result-limit", type=int)
|
|
2014
|
-
parser.add_argument("--acknowledge-public-query", action="store_true", required=True)
|
|
2015
|
-
parser.add_argument("--output-dir", required=True)
|
|
2016
|
-
_add_network_policy_options(parser)
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
def build_parser() -> argparse.ArgumentParser:
|
|
2020
|
-
parser = argparse.ArgumentParser(
|
|
2021
|
-
description="Bounded NCATS Translator ARAX lookup and provenance inspection"
|
|
2022
|
-
)
|
|
2023
|
-
subparsers = parser.add_subparsers(dest="command", required=True)
|
|
2024
|
-
|
|
2025
|
-
preflight = subparsers.add_parser("preflight", help="verify the ARAX OpenAPI and versions")
|
|
2026
|
-
preflight.add_argument("--output-dir")
|
|
2027
|
-
_add_network_policy_options(preflight)
|
|
2028
|
-
|
|
2029
|
-
normalize = subparsers.add_parser("normalize", help="normalize one term or CURIE for review")
|
|
2030
|
-
normalize.add_argument("term")
|
|
2031
|
-
normalize.add_argument("--expected-category")
|
|
2032
|
-
normalize.add_argument("--max-synonyms", type=int, default=10)
|
|
2033
|
-
normalize.add_argument("--acknowledge-public-query", action="store_true", required=True)
|
|
2034
|
-
normalize.add_argument("--output-dir", required=True)
|
|
2035
|
-
_add_network_policy_options(normalize)
|
|
2036
|
-
|
|
2037
|
-
one_hop = subparsers.add_parser("one-hop", help="run a typed one-hop lookup")
|
|
2038
|
-
one_hop.add_argument("--subject-id", action=RejectRepeatedValueAction)
|
|
2039
|
-
one_hop.add_argument("--subject-category", required=True)
|
|
2040
|
-
one_hop.add_argument("--predicate", action="append", required=True)
|
|
2041
|
-
one_hop.add_argument("--object-id", action=RejectRepeatedValueAction)
|
|
2042
|
-
one_hop.add_argument("--object-category", required=True)
|
|
2043
|
-
one_hop.add_argument("--qualifier", action="append", default=[])
|
|
2044
|
-
_add_query_common(one_hop)
|
|
2045
|
-
|
|
2046
|
-
two_hop = subparsers.add_parser("two-hop", help="run an endpoint-pinned two-hop lookup")
|
|
2047
|
-
two_hop.add_argument("--subject-id", required=True, action=RejectRepeatedValueAction)
|
|
2048
|
-
two_hop.add_argument("--subject-category", required=True)
|
|
2049
|
-
two_hop.add_argument("--predicate-1", action="append", required=True)
|
|
2050
|
-
two_hop.add_argument("--intermediate-category", required=True)
|
|
2051
|
-
two_hop.add_argument("--predicate-2", action="append", required=True)
|
|
2052
|
-
two_hop.add_argument("--object-id", required=True, action=RejectRepeatedValueAction)
|
|
2053
|
-
two_hop.add_argument("--object-category", required=True)
|
|
2054
|
-
two_hop.add_argument("--qualifier-1", action="append", default=[])
|
|
2055
|
-
two_hop.add_argument("--qualifier-2", action="append", default=[])
|
|
2056
|
-
two_hop.add_argument(
|
|
2057
|
-
"--expand-order", choices=("right-first", "left-first"), default="right-first"
|
|
2058
|
-
)
|
|
2059
|
-
_add_query_common(two_hop)
|
|
2060
|
-
|
|
2061
|
-
summarize = subparsers.add_parser("summarize", help="inspect a saved supported ARAX response")
|
|
2062
|
-
summarize.add_argument("--request", required=True)
|
|
2063
|
-
summarize.add_argument("--response", required=True)
|
|
2064
|
-
summarize.add_argument("--format", choices=("text", "json"), default="text")
|
|
2065
|
-
return parser
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
def main(argv: Sequence[str] | None = None) -> int:
|
|
2069
|
-
parser = build_parser()
|
|
2070
|
-
args = parser.parse_args(argv)
|
|
2071
|
-
try:
|
|
2072
|
-
if args.command == "preflight":
|
|
2073
|
-
return handle_preflight(args)
|
|
2074
|
-
if args.command == "normalize":
|
|
2075
|
-
return handle_normalize(args)
|
|
2076
|
-
if args.command in {"one-hop", "two-hop"}:
|
|
2077
|
-
return handle_graph_query(args)
|
|
2078
|
-
if args.command == "summarize":
|
|
2079
|
-
return handle_summarize(args)
|
|
2080
|
-
raise UsageError(f"unsupported command: {args.command}")
|
|
2081
|
-
except AraxClientError as exc:
|
|
2082
|
-
print(f"error: {exc}", file=sys.stderr)
|
|
2083
|
-
return exc.exit_code
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
if __name__ == "__main__":
|
|
2087
|
-
raise SystemExit(main())
|