text stringlengths 185 73.3k | repo stringlengths 7 100 | path stringlengths 4 146 | language stringclasses 7
values | hash stringlengths 16 16 | score float64 7 8.5 | stars int64 0 237k |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
"""
Imports CancerInFocus (CIF) data from the set of CSVs CIF makes available into the database.
"""
import csv
import sys
sys.path.append("/app")
import click
import asyncio
from typing import get_type_hints
from tqdm import tqdm
from sqlmodel import delete
from sqlalchemy.orm import session... | colorado-cancer-center/ecco | backend/app/commands/import_cif_data.py | .py | 9cedb263142edada | 7.3 | 3 |
#!/usr/bin/env python
import csv
from pathlib import Path
import sys
sys.path.append("/app")
import click
import asyncio
from tqdm import tqdm
from sqlmodel import delete
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.asyncio import AsyncSession
from db import engine
from models.scp import (
SCPD... | colorado-cancer-center/ecco | backend/app/commands/import_scp_data.py | .py | a8a39ec2f081da65 | 7.3 | 3 |
from contextlib import contextmanager
import os
from typing import AsyncGenerator, Generator
from settings import DATABASE_URL
from sqlalchemy import create_engine
from sqlalchemy.ext.asyncio import create_async_engine
from sqlalchemy.orm import sessionmaker, Session
from sqlalchemy.pool import NullPool
from sqlmod... | colorado-cancer-center/ecco | backend/app/db.py | .py | f5e825dd90eb836a | 7.3 | 3 |
import os
import asyncio
from json import loads
from logging.config import fileConfig
from sqlalchemy import pool
from sqlalchemy.engine import Connection
from sqlalchemy.ext.asyncio import create_async_engine
from sqlmodel import SQLModel
import geoalchemy2
from alembic import context
from settings import DATABASE_... | colorado-cancer-center/ecco | backend/app/migrations/env.py | .py | 14e4138ddf149e8f | 7.3 | 3 |
"""added locations
Revision ID: 2f3ac89e6ffe
Revises: 40972f34ab5b
Create Date: 2024-07-19 17:05:30.730679
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '2f3ac89e6ffe'
down_revision: Union[str, None] = ... | colorado-cancer-center/ecco | backend/app/migrations/versions/2f3ac89e6ffe_added_locations.py | .py | 207dbb5c551aea49 | 7.3 | 3 |
"""Added Radon county, tract tables
Revision ID: 40972f34ab5b
Revises: 614c25756e6b
Create Date: 2024-06-20 17:27:17.528577
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '40972f34ab5b'
down_revision: Un... | colorado-cancer-center/ecco | backend/app/migrations/versions/40972f34ab5b_added_radon_county_tract_tables.py | .py | 159fa2de6704cf68 | 7.3 | 3 |
"""Merging CIF disparities w/disparity index
Revision ID: 491f02babf92
Revises: 63a524442a63, ac38d640299a
Create Date: 2024-03-18 19:33:49.327308
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '491f02ba... | colorado-cancer-center/ecco | backend/app/migrations/versions/491f02babf92_merging_cif_disparities_w_disparity_.py | .py | e132152c248c02bd | 7.3 | 3 |
"""added state-level table for youth vaping data
Revision ID: 4c47c1001dc4
Revises: 5c847826cf93
Create Date: 2025-01-23 17:55:25.147820
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '4c47c1001dc4'
down... | colorado-cancer-center/ecco | backend/app/migrations/versions/4c47c1001dc4_added_state_level_table_for_youth_.py | .py | 0bade62a63d4dfe5 | 7.3 | 3 |
"""Adds 'trend' field to SCP models
Revision ID: 54f089a75019
Revises: adb04bc6d4dd
Create Date: 2024-04-25 23:34:23.529188
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '54f089a75019'
down_revision: Un... | colorado-cancer-center/ecco | backend/app/migrations/versions/54f089a75019_adds_trend_field_to_scp_models.py | .py | ddd45c1866df109d | 7.3 | 3 |
"""Added RE, Sex fields to cancer models
Revision ID: 56c1a3bb17d7
Revises: aefecd73a242
Create Date: 2024-02-22 17:37:00.482750
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '56c1a3bb17d7'
down_revisio... | colorado-cancer-center/ecco | backend/app/migrations/versions/56c1a3bb17d7_added_re_sex_fields_to_cancer_models.py | .py | f4b5e7592496c805 | 7.3 | 3 |
"""general factor field for vaping data
Revision ID: 5c847826cf93
Revises: b1ed4c973c11
Create Date: 2025-01-23 17:41:51.812794
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '5c847826cf93'
down_revision... | colorado-cancer-center/ecco | backend/app/migrations/versions/5c847826cf93_general_factor_field_for_vaping_data.py | .py | fd0965427aa35689 | 7.3 | 3 |
"""Refactors SCP models to be based on CancerStatsModels
Revision ID: 614c25756e6b
Revises: 238ba426fade
Create Date: 2024-04-26 17:18:57.456398
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
from sqlalchemy.dialects import postgresql
# revision identifiers, us... | colorado-cancer-center/ecco | backend/app/migrations/versions/614c25756e6b_refactors_scp_models_to_be_based_on_.py | .py | deace43d97aac35f | 7.3 | 3 |
"""added CiF disparities tables
Revision ID: 63a524442a63
Revises: 56c1a3bb17d7
Create Date: 2024-03-04 23:42:19.656250
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '63a524442a63'
down_revision: Union[... | colorado-cancer-center/ecco | backend/app/migrations/versions/63a524442a63_added_cif_disparities_tables.py | .py | 32c90318fad81d73 | 7.3 | 3 |
"""Adds UV exposure model
Revision ID: 7214c6efee37
Revises: d3447339ba7b
Create Date: 2025-09-16 11:39:59.611481
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '7214c6efee37'
down_revision: Union[str, N... | colorado-cancer-center/ecco | backend/app/migrations/versions/7214c6efee37_adds_uv_exposure_model.py | .py | cea7449f199af2d2 | 7.3 | 3 |
"""merge vaping into head
Revision ID: 8a40c04c107c
Revises: 4c47c1001dc4, 7214c6efee37
Create Date: 2025-09-30 10:22:40.854491
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '8a40c04c107c'
down_revision... | colorado-cancer-center/ecco | backend/app/migrations/versions/8a40c04c107c_merge_vaping_into_head.py | .py | b242955f3adfbf0e | 7.3 | 3 |
"""added disparity index table
Revision ID: ac38d640299a
Revises: 56c1a3bb17d7
Create Date: 2024-03-15 22:16:22.920436
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'ac38d640299a'
down_revision: Union[s... | colorado-cancer-center/ecco | backend/app/migrations/versions/ac38d640299a_added_disparity_index_table.py | .py | c13c2324f02325b1 | 7.3 | 3 |
"""Adds SCP models
Revision ID: adb04bc6d4dd
Revises: 491f02babf92
Create Date: 2024-04-25 20:50:32.943845
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'adb04bc6d4dd'
down_revision: Union[str, None] = ... | colorado-cancer-center/ecco | backend/app/migrations/versions/adb04bc6d4dd_adds_scp_models.py | .py | adc1f2f461f2b4fb | 7.3 | 3 |
"""test
Revision ID: aefecd73a242
Revises: 087ad506547e
Create Date: 2023-08-21 19:19:08.945408
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'aefecd73a242'
down_revision: Union[str, None] = '087ad50654... | colorado-cancer-center/ecco | backend/app/migrations/versions/aefecd73a242_test.py | .py | 73c5587c51a3aec6 | 7.8 | 3 |
"""Added Youth Vaping tables, health regions
Revision ID: b1ed4c973c11
Revises: d3447339ba7b
Create Date: 2024-12-05 16:57:38.249919
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'b1ed4c973c11'
down_rev... | colorado-cancer-center/ecco | backend/app/migrations/versions/b1ed4c973c11_added_youth_vaping_tables_health_regions.py | .py | f538a986544a2c4e | 7.3 | 3 |
"""added HPV model
Revision ID: bf61b2255ed0
Revises: 40972f34ab5b
Create Date: 2024-07-23 20:07:32.078843
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'bf61b2255ed0'
down_revision: Union[str, None] = ... | colorado-cancer-center/ecco | backend/app/migrations/versions/bf61b2255ed0_added_hpv_model.py | .py | 4f7aee63c8d743f3 | 7.3 | 3 |
"""Merging locations w/HPV data
Revision ID: c09b3a8d7483
Revises: cb9412070fed, bf61b2255ed0
Create Date: 2024-07-23 21:47:07.218701
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'c09b3a8d7483'
down_re... | colorado-cancer-center/ecco | backend/app/migrations/versions/c09b3a8d7483_merging_locations_w_hpv_data.py | .py | 109d4f350626f283 | 7.3 | 3 |
"""added name to locations, made names unique
Revision ID: cb9412070fed
Revises: 2f3ac89e6ffe
Create Date: 2024-07-19 18:00:02.407484
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'cb9412070fed'
down_re... | colorado-cancer-center/ecco | backend/app/migrations/versions/cb9412070fed_added_name_to_locations_made_names_.py | .py | 6cdf4df404e03739 | 7.3 | 3 |
"""add state stats
Revision ID: d3447339ba7b
Revises: c09b3a8d7483
Create Date: 2024-09-23 17:07:19.773420
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'd3447339ba7b'
down_revision: Union[str, None] = ... | colorado-cancer-center/ecco | backend/app/migrations/versions/d3447339ba7b_add_state_stats.py | .py | d0fade73635e7470 | 7.3 | 3 |
"""Added UCCC responders model
Revision ID: ef10763dbf40
Revises: 8a40c04c107c
Create Date: 2026-01-20 13:42:27.965241
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = 'ef10763dbf40'
down_revision: Union[s... | colorado-cancer-center/ecco | backend/app/migrations/versions/ef10763dbf40_added_uccc_responders_model.py | .py | fa2f5b1a19ed806e | 7.3 | 3 |
"""Join perennial-source reliability ratings to citation-frequency data.
Perennial sources are identified by name; the citation tables by domain. This
resolves each source's registrable domain via Wikidata's official-website
property (P856), then joins against a per-domain citation table to surface:
* the reliability... | kynoptic/wikipedia-reliable-sources | core/bridge_reliability.py | .py | d47775c940013e43 | 7 | 0 |
"""Process extracted citation references and output canonical source counts."""
from pathlib import Path
import json
from collections import Counter, defaultdict
from .utils.normalize_url import (
canonicalize_url,
NormalizationConfig,
load_aliases,
)
DEFAULT_CONFIG = NormalizationConfig()
DEFAULT_ALIAS_... | kynoptic/wikipedia-reliable-sources | core/clean_sources.py | .py | 9a7e41bb72dd5699 | 7 | 0 |
"""Extract citation URLs from article wikitext files."""
from __future__ import annotations
import json
import re
from pathlib import Path
from typing import List
import mwparserfromhell
URL_RE = re.compile(r"https?://[^\s\]\|><]+")
def parse_refs_from_text(text: str) -> List[str]:
"""Return a list of citatio... | kynoptic/wikipedia-reliable-sources | core/extract_refs.py | .py | 24a9a584ca397524 | 7 | 0 |
"""Fetch lists of good and featured articles from Wikipedia categories."""
from __future__ import annotations
import csv
import json
import time
from pathlib import Path
from typing import List
import requests
from scripts.common import HEADERS
API_URL = "https://en.wikipedia.org/w/api.php"
_CSV_FIELDS = ["number... | kynoptic/wikipedia-reliable-sources | core/fetch_articles.py | .py | a0b81d227525b5c7 | 7 | 0 |
"""Download article wikitext using the MediaWiki API."""
from __future__ import annotations
import json
from pathlib import Path
from typing import Iterable
import requests
from scripts.common import HEADERS
API_URL = "https://en.wikipedia.org/w/api.php"
def _fetch_single(title: str) -> str:
"""Return raw wik... | kynoptic/wikipedia-reliable-sources | core/fetch_wikitext.py | .py | 52658160327d20b7 | 7 | 0 |
"""Aggregate Wikipedia citation dumps into per-host and per-domain frequency tables.
This reimplements a Google Cloud Dataprep (Trifacta) flow that ranked web sources
by how often Wikipedia's Featured and Good articles cite them. It extracts each
citation's URL, tags the citing article as Featured/Good, and pivots by ... | kynoptic/wikipedia-reliable-sources | core/process_citations.py | .py | 3e65754d110aa4be | 7 | 0 |
"""Utility helpers for normalizing citation URLs."""
from dataclasses import dataclass
from pathlib import Path
from urllib.parse import urlparse, urlunparse, parse_qsl, urlencode
import json
import tldextract
# Offline mode: use tldextract's bundled Public Suffix List snapshot so
# decomposition is deterministic an... | kynoptic/wikipedia-reliable-sources | core/utils/normalize_url.py | .py | 6535d65103237e43 | 7 | 0 |
"""Restore the raw citation datasets from their published archives.
Each bulk file in ``data/raw/citations/`` originates from a durable public
archive (Zenodo, figshare, or a GitHub release). This script re-downloads,
decompresses, and renames them to the project's convention, so the dumps never
need to be mirrored in... | kynoptic/wikipedia-reliable-sources | scripts/fetch_citation_data.py | .py | f38726aaf5134670 | 7 | 0 |
"""Utilities for working with Wikipedia's Perennial sources page.
This implements phases 1–5 of ``docs/roadmap.md``:
* Fetch raw wikitext for each Perennial sources subpage via the MediaWiki API.
* Parse the wikitables into structured :class:`SourceEntry` records.
* Clean and validate the resulting data.
* Provide a ... | kynoptic/wikipedia-reliable-sources | scripts/fetch_perennial_sources.py | .py | 02b09206daa0051e | 7 | 0 |
"""Fetch reliability tables from various WikiProject pages."""
from __future__ import annotations
import csv
import json
from dataclasses import asdict
from typing import List, Optional
import requests
import mwparserfromhell
from scripts.common import HEADERS
from scripts.fetch_perennial_sources import (
Sourc... | kynoptic/wikipedia-reliable-sources | scripts/fetch_wikiproject_sources.py | .py | 8cf2a617cd4f57a8 | 7 | 0 |
"""Check Wikipedia for updates to the perennial sources tables.
This implements phase 6 of ``docs/roadmap.md``:
* Check each perennial sources subpage via the MediaWiki API.
* If the revision ID has changed since the last run, re-fetch and
regenerate ``perennial_sources.json`` and ``perennial_sources.csv``.
"""
fro... | kynoptic/wikipedia-reliable-sources | scripts/update_checker.py | .py | d69a2e239b6afcb2 | 7 | 0 |
# SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/__main__.py | .py | 8c0325119254f4e0 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/build.py | .py | 2fed786a2a481f38 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/clear_cache.py | .py | d27271abc05fc08b | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/install.py | .py | 86d233d1772764ae | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/package.py | .py | 4a483fc537bb5f4f | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/setup_cmd.py | .py | 989fb62d3598c373 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/commands/test_cmd.py | .py | 188fb7c560f982d9 | 7.65 | 1 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/container/parsers.py | .py | 07dcc119fd626a96 | 7.15 | 1 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/container/signals.py | .py | c30f4e95cc7fb736 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/metadata/gather_metadata.py | .py | 5c29fd43d654896c | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/metadata/utils.py | .py | 7bfc2afd36ca4809 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/project_context.py | .py | c4392aa323f861c5 | 7.15 | 1 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/status.py | .py | c89c95d02ab54d6e | 7.15 | 1 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/system_check.py | .py | a957655a3e34ade8 | 7.15 | 1 |
"""
SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:/... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/.github/workflows/scripts/check_copyright.py | .py | fb616f31090edd0d | 7.15 | 1 |
"""
SPDX-FileCopyrightText: Copyright (c) 2022-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http:/... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/.github/workflows/scripts/gitutils.py | .py | cd44a670c4ab1fcc | 7.15 | 1 |
#!/usr/bin/env python3
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy o... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/templates/module/{{cookiecutter.module_repo_name}}/.github/workflows/scripts/validate_metadata.py | .py | d2f33939aecd26eb | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/utils/cmake_manifest.py | .py | bcdbc73bbe8ba069 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/utils/docker.py | .py | 5efad709d6e2ae93 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/utils/filesystem.py | .py | 4bd439cf575edd81 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/utils/holohub.py | .py | 40029c1886a75e95 | 7.15 | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ht... | nvidia-holoscan/holoscan-cli | src/holoscan_cli/utils/sdk.py | .py | b2ae47c6fdfde615 | 7.15 | 1 |
from typing import Generator
from .models import (
AccountingGraph, FlowComponentsTypes, InterzoneFlow, Zone, ZoneTypes
)
class GraphManager:
"""Manages the static structure and traversal of the accounting graph."""
def __init__(self, graph: AccountingGraph):
self._validate(graph)
self.g... | utahdwri/Apportionment-Solver | src/ut_water_apportionment/graph_manager.py | .py | 62a7554cba62a8b3 | 7 | 0 |
from collections import defaultdict
from collections.abc import Mapping
from dataclasses import replace
from datetime import date, timedelta
from math import floor, isclose, isfinite
from .models import SolverOutputApportionment
SeriesKey = tuple[str, str]
def unlag_series(
dates: list[str],
values: list[f... | utahdwri/Apportionment-Solver | src/ut_water_apportionment/lag_utils.py | .py | 812be0e507a5f746 | 7 | 0 |
from __future__ import annotations
from dataclasses import dataclass
from datetime import date as Date
from math import isclose, isfinite
TOLERANCE = 1e-10
@dataclass(frozen=True)
class LossCurvePoint:
"""One point on an absolute-loss curve."""
inflow: float
loss: float
def __post_init__(self) ->... | utahdwri/Apportionment-Solver | src/ut_water_apportionment/loss_models.py | .py | e7d712148b747d07 | 7 | 0 |
from dataclasses import dataclass
from .models import (
InterzoneFlow, NaturalFlowMode, ZoneTypes
)
from .graph_manager import GraphManager
from .loss_models import LossDefinition
SOLVER_TOL = 1e-6
@dataclass
class CurFlowInfo:
"""Stores the total flow, natural flow, and total apportioned flow for an interzon... | utahdwri/Apportionment-Solver | src/ut_water_apportionment/natural_flow_calculator.py | .py | 147e26ca972f7b22 | 7 | 0 |
from typing import Generator
from dataclasses import dataclass, field
from math import isclose, isfinite
from collections.abc import Iterator
from .models import (
FlowComponentsTypes, InterzoneFlow, MeasurementCollection, NaturalFlowMode, Zone, ZoneTypes
)
from .graph_manager import GraphManager
from .natural_flo... | utahdwri/Apportionment-Solver | src/ut_water_apportionment/timeseries_manager.py | .py | 6e8c552e5d3c3100 | 7 | 0 |
"""Cart models."""
from __future__ import annotations
from csobpg.v19 import signature as _s
class CartItem(_s.SignedModel):
"""Cart item."""
def __init__(
self,
name: str,
quantity: int,
amount: int,
description: str | None = None,
) -> None:
"""Init a c... | litteratum/csobpg | csobpg/v19/models/cart.py | .py | 30df4c6699b08ba4 | 7.35 | 4 |
"""Customer account."""
from __future__ import annotations
from csobpg.v19 import signature as _s
class AccountData(_s.SignedModel):
"""Customer account data."""
def __init__(
self,
created_at: str | None = None,
changed_at: str | None = None,
changed_pwd_at: str | None = No... | litteratum/csobpg | csobpg/v19/models/customer/account.py | .py | 28a87faf922186ef | 7.35 | 4 |
"""Customer data."""
from __future__ import annotations
from typing import TYPE_CHECKING
from csobpg.v19 import signature as _s
if TYPE_CHECKING:
from .account import AccountData
from .login import LoginData
class PhoneNumber:
"""Phone number."""
def __init__(self, prefix: str, subscriber: str) -... | litteratum/csobpg | csobpg/v19/models/customer/data.py | .py | 608f2096e058b9d0 | 7.35 | 4 |
"""Customer login."""
from __future__ import annotations
from enum import Enum
from csobpg.v19 import signature as _s
class AuthMethod(Enum):
"""Auth method."""
GUEST = "guest"
ACCOUNT = "account"
FEDERATED = "federated"
ISSUER = "issuer"
THIRD_PARTY = "thirdparty"
FIDO = "fido"
FI... | litteratum/csobpg | csobpg/v19/models/customer/login.py | .py | e92911d89d502520 | 7.35 | 4 |
"""Fingerprint model."""
from __future__ import annotations
from csobpg.v19 import signature as _s
class SDK(_s.SignedModel):
"""SDK."""
def __init__(
self,
max_timeout: int,
reference_number: str,
transaction_id: str,
app_id: str | None = None,
enc_data: str... | litteratum/csobpg | csobpg/v19/models/fingerprint.py | .py | 69fbce08b78efbda | 7.35 | 4 |
"""Address data."""
from __future__ import annotations
from csobpg.v19 import signature as _s
class AddressData(_s.SignedModel):
"""Address data."""
def __init__(
self,
address: str,
country: str,
city: str,
zip_code: str,
state: str | None = None,
ad... | litteratum/csobpg | csobpg/v19/models/order/address.py | .py | ad6ae458e39fd90c | 7.35 | 4 |
"""Order data."""
from __future__ import annotations
from enum import Enum
from typing import TYPE_CHECKING
from csobpg.v19 import signature as _s
if TYPE_CHECKING:
from csobpg.v19.models.currency import Currency
from .address import AddressData
from .delivery import DeliveryData
class OrderType(Enum... | litteratum/csobpg | csobpg/v19/models/order/data.py | .py | 9cbcc62eacc8751c | 7.35 | 4 |
"""Delivery data."""
from __future__ import annotations
from enum import Enum
class DeliveryIndicator(Enum):
"""Delivery indicator."""
SHIPPING = "shipping"
SHIPPING_VERIFIED = "shipping_verified"
INSTORE = "instore"
DIGITAL = "digital"
TICKET = "ticket"
OTHER = "other"
PICKUP = "pi... | litteratum/csobpg | csobpg/v19/models/order/delivery.py | .py | 0cf203d1ea6aede4 | 7.35 | 4 |
"""Webpage models."""
from __future__ import annotations
from enum import Enum
class WebPageLanguage(Enum):
"""PG web page language."""
CS = "cs"
EN = "en"
DE = "de"
FR = "fr"
HU = "hu"
IT = "it"
JA = "ja"
PL = "pl"
PT = "pt"
RO = "ro"
RU = "ru"
SK = "sk"
ES ... | litteratum/csobpg | csobpg/v19/models/webpage.py | .py | 9f3d1d03d037cf09 | 7.35 | 4 |
"""Apple Pay payment process request."""
from csobpg.v19.models import fingerprint as _fingerprint
from .oneclick_process import OneClickPaymentProcessRequest
class ApplePayPaymentProcessRequest(OneClickPaymentProcessRequest):
"""Apple Pay payment process request."""
def __init__(
self,
mer... | litteratum/csobpg | csobpg/v19/request/applepay_process.py | .py | e9ec0de1e7e6af49 | 7.35 | 4 |
"""Base request."""
from __future__ import annotations
from abc import ABC, abstractmethod
from csobpg.v19 import signature as _s
from .dttm import get_dttm
def _with_none_removed(body: dict) -> dict:
"""Return a copy of the dict without None values and empty objects."""
result = {}
for key, val in bo... | litteratum/csobpg | csobpg/v19/request/base.py | .py | 501621e5d37bc373 | 7.35 | 4 |
"""Module for dealing with dttm."""
from __future__ import annotations
import datetime
_DT_FORMAT = "%Y%m%d%H%M%S"
def get_dttm() -> str:
"""Build current dttm."""
return datetime.datetime.now().astimezone().strftime(_DT_FORMAT)
def decode_dttm(value: str) -> datetime.datetime:
"""Decode value to the... | litteratum/csobpg | csobpg/v19/request/dttm.py | .py | 92c08545e9098e1e | 7.35 | 4 |
"""Google Pay payment process request."""
from csobpg.v19.models import fingerprint as _fingerprint
from .oneclick_process import OneClickPaymentProcessRequest
class GooglePayPaymentProcessRequest(OneClickPaymentProcessRequest):
"""Google Pay payment process request."""
def __init__(
self,
... | litteratum/csobpg | csobpg/v19/request/googlepay_process.py | .py | 05717885de74a75a | 7.35 | 4 |
"""OneClick echo request."""
from .base import BaseRequest
class OneClickEchoRequest(BaseRequest):
"""OneClick echo request."""
def __init__(
self,
merchant_id: str,
private_key: str,
template_id: str,
) -> None:
super().__init__("oneclick/echo", merchant_id, priv... | litteratum/csobpg | csobpg/v19/request/oneclick_echo.py | .py | 089ff401378c6643 | 7.35 | 4 |
"""Payment close request."""
from __future__ import annotations
from .base import BaseRequest
class PaymentCloseRequest(BaseRequest):
"""Payment close request."""
def __init__(
self,
merchant_id: str,
private_key: str,
pay_id: str,
total_amount: int | None = None,
... | litteratum/csobpg | csobpg/v19/request/payment_close.py | .py | 0184f7e109cb33a5 | 7.35 | 4 |
"""Payment process request."""
from .base import BaseRequest
from .url import join_url as _join_url
class PaymentProcessRequest(BaseRequest):
"""Payment process request."""
def __init__(
self,
merchant_id: str,
private_key: str,
pay_id: str,
) -> None:
super().__i... | litteratum/csobpg | csobpg/v19/request/payment_process.py | .py | f3ded03eddd133c5 | 7.35 | 4 |
"""Payment refund request."""
from __future__ import annotations
from .base import BaseRequest
class PaymentRefundRequest(BaseRequest):
"""Payment close request."""
def __init__(
self,
merchant_id: str,
private_key: str,
pay_id: str,
amount: int | None = None,
) ... | litteratum/csobpg | csobpg/v19/request/payment_refund.py | .py | ef984899a41a6a99 | 7.35 | 4 |
"""Payment reverse request."""
from .base import BaseRequest
class PaymentReverseRequest(BaseRequest):
"""Payment reverse request."""
def __init__(
self,
merchant_id: str,
private_key: str,
pay_id: str,
) -> None:
super().__init__("payment/reverse", merchant_id, p... | litteratum/csobpg | csobpg/v19/request/payment_reverse.py | .py | 6e23fc203b83ebbd | 7.35 | 4 |
"""Payment status request."""
from .base import BaseRequest
from .url import join_url as _join_url
class PaymentStatusRequest(BaseRequest):
"""Payment status request."""
def __init__(
self,
merchant_id: str,
private_key: str,
pay_id: str,
) -> None:
super().__init... | litteratum/csobpg | csobpg/v19/request/payment_status.py | .py | a541c6226c0a9503 | 7.35 | 4 |
"""Apple Pay echo response."""
from __future__ import annotations
from csobpg.v19.signature import SignedModel
from .base import Response
class ApplePayInitParams(SignedModel):
"""Apple Pay initialization parameters."""
def __init__(
self,
country_code: str,
supported_networks: lis... | litteratum/csobpg | csobpg/v19/response/applepay_echo.py | .py | 2d0386d9be988749 | 7.35 | 4 |
"""Base API response wrappers."""
from abc import ABC, abstractmethod
from enum import Enum
from csobpg.v19 import errors as _e
from csobpg.v19 import signature as _s
class PaymentStatus(Enum):
"""Payment status."""
# Note: it is not documented by the API. But the API returns it sometimes
ZERO = 0
... | litteratum/csobpg | csobpg/v19/response/base.py | .py | 347966b6496d8c16 | 7.35 | 4 |
"""Echo response."""
from __future__ import annotations
from .base import Response
class EchoResponse(Response):
"""Echo response."""
@classmethod
def _from_json(
cls,
response: dict, # noqa: ARG003 (echo has no extra params)
dttm: str,
result_code: int,
result_... | litteratum/csobpg | csobpg/v19/response/echo.py | .py | 4ffbca24e0f00752 | 7.35 | 4 |
import re
from pathlib import Path
import numpy as np
import pandas as pd
from loguru import logger
from ai4bmr_datasets.datasets.BaseIMCDataset import BaseIMCDataset
from ai4bmr_datasets.utils import io
from ai4bmr_datasets.utils.tidy import tidy_name
class Danenberg2022(BaseIMCDataset):
name = "Danenberg2022"... | AI4SCR/ai4bmr-datasets | src/ai4bmr_datasets/datasets/Danenberg.py | .py | 6f96450d590d96d5 | 7.3 | 3 |
import re
import shutil
from pathlib import Path
import numpy as np
import pandas as pd
from ai4bmr_datasets.utils import io
from ai4bmr_datasets.utils.tidy import tidy_name
from loguru import logger
from ai4bmr_datasets.datasets.BaseIMCDataset import BaseIMCDataset
from ai4bmr_datasets.utils.download import Downloa... | AI4SCR/ai4bmr-datasets | src/ai4bmr_datasets/datasets/Keren2018.py | .py | 66351bb14cf943b9 | 7.3 | 3 |
from pathlib import Path
import numpy as np
from PIL import Image
# Default lossless compression configurations
DEFAULT_ZARR_CODECS = [
{'name': 'bytes', 'configuration': {'endian': 'little'}}, # ArrayBytesCodec
{'name': 'blosc', 'configuration': {'cname': 'zstd', 'clevel': 1, 'shuffle': 'shuffle'}} # Bytes... | AI4SCR/ai4bmr-datasets | src/ai4bmr_datasets/utils/io.py | .py | d8b88825dcd81842 | 7.3 | 3 |
import re
from pathlib import Path
def filter_paths(
dir_path: Path,
include_files: bool = True,
include_dirs: bool = True,
exclude_hidden: bool = True,
as_posix: bool = True
) -> list[Path]:
"""
List files and/or directories from dir_path, excluding items that match
any of the given pr... | AI4SCR/ai4bmr-datasets | src/ai4bmr_datasets/utils/tidy.py | .py | c82a6ac5e74722d3 | 7.3 | 3 |
# Description: Combine gene expression counts from multiple samples into a single file.
# Usage:
# python combine_counts.py --input_dir <input_dir> --output_file <output_file> --sample_names <sample_names>
# Example:
# python combine_counts.py --input_dir ./counts_dir --output_file ./combined_counts.txt --sample_name... | morphic-bio/gRNA-Enrichment | reference_files/combine_counts.py | .py | e2dcf732b04cdf9c | 7 | 0 |
### This script extracts the minimum p-value and FDR values from MAGeCK test output for a screen.
### It also generates volcano plots for the minimum p-value and FDR dataframes.
#
# Usage:
# python mageck_test_min_pval_fdr.py --input_dir <input_dir> --output_dir <output_dir> --screen <screen_name> --volcano
# --y_axis_... | morphic-bio/gRNA-Enrichment | reference_files/mageck_test_min_pval_fdr.py | .py | fbf935a7eea81cd5 | 7.5 | 0 |
# Description: Combine count summary statistics from each fastq file by sample.
#
# Usage:
# python sample_count_stats.py --input_dir <input_dir> --stats_file <output_file> --sample_names <sample_names>
#
# Example:
# python sample_count_stats.py --input_dir ./counts_dir --stats_file ./combined_counts.txt --sample_nam... | morphic-bio/gRNA-Enrichment | reference_files/sample_count_stats.py | .py | dc16b47da5e778fe | 7 | 0 |
import csv
import numpy as np
class Gene(object):
def __init__(self,genename,chrno,start,end):
self.genename = genename
self.chrno = chrno
self.start = int(start)
self.end = int(end)
class sgRNA(object):
def __init__(self,sgrna,genename,chrno,start,end):
self.sgrna = sgrna
self.genename = genename
sel... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/cnv_estimation.py | .py | 765c40754e9ea4ff | 7 | 0 |
import os
import copy
import numpy as np
import operator
from scipy.stats import nbinom
from scipy.special import factorial,gamma
import scipy
import scipy.stats
from collections import defaultdict
from mageck.mleclassdef import *
from mageck.mledesignmat import *
import logging
import decimal
#from sympy.... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/dispersion_characterization.py | .py | 07095d0aa58e1ae0 | 7 | 0 |
"""FDR correction for U-shaped p-value distributions as proposed by
Pounds et al., Bioinformatics 2006.
Copyright (c) 2015 Johannes Koester, Xiaole Liu lab
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@sta... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/fdr_calculation.py | .py | 7915c130ef5ae463 | 7 | 0 |
#!/usr/bin/env python
"""MAGeCK file operation module
Copyright (c) 2014 Wei Li, Han Xu, Xiaole Liu lab
This code is free software; you can redistribute it and/or modify it
under the terms of the BSD License (see the file COPYING included with
the distribution).
@status: experimental
@version: $Revision$
@author: We... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/fileOps.py | .py | 22555fb79ebee86c | 7 | 0 |
""" MAGeCK count normalization related functions
"""
from __future__ import print_function
import sys
import math
import logging
import string
class NormMsgs:
def __init__(self):
self.haswarning=False
def mageckcount_gettotalnormfactor(ctable):
"""
Get the factor by total normalization
"""
n=len(ctab... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/mageckCountNorm.py | .py | 73072e877a2051a8 | 7 | 0 |
"""MAGeCK Count QC
Perform Quality Control test for MAGeCK count module
"""
from __future__ import print_function
import sys
import argparse
import math
import logging
import string
from mageck.testVisualCount import *
from mageck.fileOps import *
def mageckcount_printstat(args,datastat):
'''
Write data sta... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/mageckCountQC.py | .py | 086dae33b1259f1d | 7 | 0 |
"""
MAGeCK related mathematical functions
@author: Wei Li
@contact: li.david.wei AT gmail.com
"""
from __future__ import print_function
import sys
import math
import os
import logging
def mmedian(lst):
"""
get the median value
"""
sortedLst = sorted(lst)
lstLen = len(lst)
if lstLen==0:
return 0.0
i... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/mageckMathFunc.py | .py | 32f09bdabbca4a05 | 7 | 0 |
'''
Argument parsing of the MLE approach
Warning: the mageckmle_parseargs() function is only used in a standalone MLE program. For mageck mle sub-command, the argument parsing is done through argsParser.py.
'''
from __future__ import print_function
import sys
import argparse
import logging
def mageckmle_postargs(arg... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/mleargparse.py | .py | acefedb497665736 | 7 | 0 |
'''
Class definition
'''
from __future__ import print_function
# from IPython.core.debugger import Tracer
class SimCaseSimple:
prefix='sample1'
# the beta parameters; beta0 is the base value (a list of double, size nsgRNA)
beta0=[]
# beta1 (a nsample*r) is the beta values of different conditions
beta1=[0]
... | morphic-bio/gRNA-Enrichment | workflows/mageck_count/widgets/mageck_count/MAGeCK_count/Dockerfiles/mageck-0.5.9.5/mageck/mleclassdef.py | .py | 9b9bc8cdc681d488 | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.