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 |
|---|---|---|---|---|---|---|
from typing import Dict, Any, List, Callable, TYPE_CHECKING, Optional
from dataclasses import dataclass
import ctk
from enum import Enum
import qt
import slicer
from slicer import vtkMRMLScalarVolumeNode
from OpenLIFULib.parameter_node_utils import SlicerOpenLIFUProtocol
from OpenLIFULib.util import get_openlifu_data... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/algorithm_input_widget.py | .py | 651f5c50f41e0f6e | 7.54 | 11 |
"""Tools for checking and installing the extension's Python requirements."""
from pathlib import Path
from OpenLIFULib.install_asset_dialog import InstallAssetDialog
import slicer
import importlib
import qt
import re
from OpenLIFULib.util import BusyCursor
_openlifu_version_mismatch_warning_shown = False
def install... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/dependency_utils.py | .py | 822b071c82a57d6c | 7.54 | 11 |
from typing import Optional, TYPE_CHECKING, Dict
import qt
import slicer
from OpenLIFULib.util import display_errors, replace_widget
from OpenLIFULib.algorithm_input_widget import OpenLIFUAlgorithmInputWidget
if TYPE_CHECKING:
import openlifu
from OpenLIFUData.OpenLIFUData import OpenLIFUDataLogic
from Ope... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/guided_mode_util.py | .py | 3615873cab6c3501 | 7.54 | 11 |
import qt
from pathlib import Path
from typing import Optional, Tuple
DOWNLOAD_ACTION = "download"
BROWSE_ACTION = "browse"
class InstallAssetDialog(qt.QDialog):
"""
A dialog that asks the user to either download a missing file automatically
or browse for it on their local disk.
"""
def __init__(s... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/install_asset_dialog.py | .py | cbf1959a758ddd50 | 7.54 | 11 |
from typing import Optional
import logging
import slicer
import qt
LAST_NOTIFICATION = None # globally tracks the last notification that was shown
class Notification(qt.QWidget):
"""
Notification widget that can be shown temporarily on top of its parent.
"""
def __init__(self, message:str, parent=None... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/notifications.py | .py | 19146ca56424e464 | 7.54 | 11 |
from typing import List, TYPE_CHECKING, Optional, Tuple, Dict
import numpy as np
import slicer
from slicer import (
vtkMRMLTransformNode,
vtkMRMLScalarVolumeNode,
vtkMRMLMarkupsFiducialNode,
)
from slicer.parameterNodeWrapper import parameterPack
from OpenLIFULib.util import get_openlifu_data_parameter_node... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/session.py | .py | 6cad1ee8ccce5d55 | 7.54 | 11 |
from typing import TYPE_CHECKING
from scipy.ndimage import affine_transform
import numpy as np
import vtk
from vtk.util import numpy_support
import slicer
from slicer import vtkMRMLScalarVolumeNode
from OpenLIFULib.coordinate_system_utils import get_IJK2RAS
if TYPE_CHECKING:
import openlifu
import openlifu.db
... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/simulation.py | .py | c9026b85e88cdbd7 | 7.54 | 11 |
"""Skin segmentation tools"""
from slicer import vtkMRMLScalarVolumeNode, vtkMRMLModelNode
from OpenLIFULib.coordinate_system_utils import get_IJK2RAS
from OpenLIFULib.transducer import TRANSDUCER_MODEL_COLORS
import slicer
from typing import Union, Optional
import numpy as np
def generate_skin_segmentation(volume_no... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/skinseg.py | .py | 7c8ec52421ac9b34 | 7.54 | 11 |
from typing import List, NamedTuple, TYPE_CHECKING
import numpy as np
import slicer
from slicer import vtkMRMLScalarVolumeNode
from slicer.parameterNodeWrapper import parameterPack
from OpenLIFULib.parameter_node_utils import (
SlicerOpenLIFUSolutionWrapper,
)
from OpenLIFULib.simulation import (
make_volume_fr... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/solution.py | .py | 1e2030359c89c61a | 7.54 | 11 |
from typing import List, TYPE_CHECKING, Optional
import numpy as np
import slicer
from slicer import vtkMRMLMarkupsFiducialNode
from OpenLIFULib.coordinate_system_utils import get_xx2mm_scale_factor, get_xxx2ras_matrix
if TYPE_CHECKING:
import openlifu
import openlifu.geo
from OpenLIFULib.transducer import... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/targets.py | .py | bc3056c9f34357d0 | 7.54 | 11 |
from typing import Optional, TYPE_CHECKING, Callable, Any
import numpy as np
from pathlib import Path
import vtk
import slicer
from slicer import (
vtkMRMLModelNode,
vtkMRMLTransformNode,
vtkMRMLNode,
)
from slicer.parameterNodeWrapper import parameterPack
from OpenLIFULib.parameter_node_utils import Slicer... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/transducer.py | .py | 4686c6d4924fc092 | 7.54 | 11 |
import slicer
import qt
from typing import Tuple, List
from slicer import vtkMRMLViewNode, vtkMRMLModelNode
from OpenLIFULib.util import replace_widget
from OpenLIFULib import SlicerOpenLIFUPhotoscan
def initialize_wizard_ui(wizard: qt.QWizard):
layout = qt.QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/transducer_tracking_wizard_utils.py | .py | bd03c782f02be351 | 7.54 | 11 |
"""Utilities for converting transforms between SlicerOpenLIFU and openlifu formats"""
from typing import TYPE_CHECKING
import slicer
from slicer import vtkMRMLTransformNode
import numpy as np
from OpenLIFULib.coordinate_system_utils import (
linear_to_affine,
get_xxx2ras_matrix,
get_xx2mm_scale_factor,
... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/transform_conversion.py | .py | 9a076665cc3f96c5 | 7.54 | 11 |
from types import SimpleNamespace
from typing import Optional, TYPE_CHECKING
import qt
import slicer
from OpenLIFULib.util import (
get_openlifu_login_parameter_node,
get_openlifu_login_logic,
)
if TYPE_CHECKING:
import openlifu.db
_restricted_anonymous_user = SimpleNamespace(
id="an... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/user_account_mode_util.py | .py | 750f37a82af2bc84 | 7.54 | 11 |
from typing import TYPE_CHECKING, Any, List, Optional, get_type_hints, Annotated
from typing_extensions import get_type_hints as get_type_hints_ext # for <3.10 compatibility
import logging
import qt
import slicer
from slicer import vtkMRMLNode
if TYPE_CHECKING:
from openlifu.db import Database
from OpenLIFUData... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/util.py | .py | b7e68a7843dd61ca | 7.54 | 11 |
import slicer
from slicer import vtkMRMLTransformNode
from typing import Optional, Iterable, List, Tuple, Dict, TYPE_CHECKING, Union
from OpenLIFULib.transform_conversion import transducer_transform_node_to_openlifu, transducer_transform_node_from_openlifu
from OpenLIFULib.util import get_cloned_node
if TYPE_CHECKING:... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/virtual_fit_results.py | .py | a1ff05da60970180 | 7.54 | 11 |
"""Volume thresholding tools"""
import logging
import numpy as np
from typing import Tuple
import vtk
import slicer
from slicer import vtkMRMLScalarVolumeNode
from OpenLIFULib.util import BusyCursor
def cast_volume_to_float(volume_node:vtkMRMLScalarVolumeNode) -> None:
"""Converts a volume node to float, replacin... | OpenwaterHealth/SlicerOpenLIFU | OpenLIFULib/OpenLIFULib/volume_thresholding.py | .py | 588cdf6df54d3dd2 | 7.54 | 11 |
/*
Copyright 2025 Rackspace Technology.
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | rackerlabs/understack | go/dexop/internal/controller/suite_test.go | .go | e1ba7e6f5aa64006 | 7.07 | 13 |
/*
Copyright 2025 Rackspace Technology.
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | rackerlabs/understack | go/dexop/test/e2e/e2e_suite_test.go | .go | 968cbfd444006e5c | 7.07 | 13 |
/*
Copyright 2025 Rackspace Technology.
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... | rackerlabs/understack | go/dexop/test/utils/utils.go | .go | 3b9a331683df857e | 7.07 | 13 |
/*
Copyright 2025.
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed un... | rackerlabs/understack | go/nautobotop/internal/controller/nautobot_controller_test.go | .go | 7c4a92d26814fa10 | 7.07 | 13 |
/*
Copyright 2025.
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://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed un... | rackerlabs/understack | go/nautobotop/internal/controller/suite_test.go | .go | a1e61040412f576e | 7.07 | 13 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/env.py | .py | 1fad526a53e2cf66 | 7.56 | 12 |
"""Adding count on metadata to support Performance Test
Revision ID: 0a251edfd975
Revises: 96ee37627a48
Create Date: 2024-05-16 06:36:51.663230
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "0a251edfd975"
down_revision = "e2c185af1226"
branch_labels = None
d... | project-chip/certification-tool-backend | alembic/versions/0a251edfd975_adding_count_on_metadata_to_support_.py | .py | 53f658de84057e58 | 7.56 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/4183bcf568f2_remove_user_and_item.py | .py | fa5dfcb02f967180 | 7.56 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/621cc7fec168_added_thread_project_config.py | .py | 29a71af9ad828f21 | 7.56 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/72989eaa90f6_added_test_run_config.py | .py | 6650dba24fbe38bb | 8.06 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/8ad40d9f3ac1_added_test_execution_models.py | .py | 77a73f6d225d0ae7 | 7.06 | 12 |
"""Adding the new column collection_id
Revision ID: 96ee37627a48
Revises: 9996326cbd1d
Create Date: 2023-08-15 14:42:39.893126
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "96ee37627a48"
down_revision = "9996326cbd1d"
branch_labels = None
depends_on = None
... | project-chip/certification-tool-backend | alembic/versions/96ee37627a48_adding_the_new_column_collection_id.py | .py | 6d9eba5e19a22890 | 7.56 | 12 |
"""Migrate python test legacy suite executions
Revision ID: 9df8004ad9bb
Revises: 96ee37627a48
Create Date: 2024-04-24 17:26:26.770729
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "9df8004ad9bb"
down_revision = "96ee37627a48"
branch_labels = None
depends_on = None
def upgrade():... | project-chip/certification-tool-backend | alembic/versions/9df8004ad9bb_migrate_python_test_legacy_suite_.py | .py | 3510636070882823 | 8.06 | 12 |
"""add execution_pics to test_run_execution
Revision ID: a16c8c20cd36
Revises: e6153267b741
Create Date: 2026-04-08 17:41:21.198510
"""
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from alembic import op
# revision identifiers, used by Alembic.
revision = "a16c8c20cd36"
down_revision = "e61532... | project-chip/certification-tool-backend | alembic/versions/a16c8c20cd36_add_execution_pics_to_test_run_execution.py | .py | 9438fd97663de8db | 8.06 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/b173743bd652_added_test_metadata.py | .py | 14620b257b92a948 | 8.06 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/d125c14ea922_add_project.py | .py | 9f9a0905462ac8fb | 7.56 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/d4867f3a4c0a_first_revision.py | .py | 1d998e5172abda65 | 7.56 | 12 |
"""add execution_config to test_run_execution
Revision ID: e6153267b741
Revises: 0a251edfd975
Create Date: 2026-01-15 17:36:00.000000
"""
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from alembic import op
# revision identifiers, used by Alembic.
revision = "e6153267b741"
down_revision = "0a25... | project-chip/certification-tool-backend | alembic/versions/e6153267b741_add_execution_config_to_test_run_execution.py | .py | a2cfc79208519cc1 | 8.06 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | alembic/versions/f5af3855be39_add_operator.py | .py | 4722e09ea2a81c7e | 7.56 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | app/api/api_v1/endpoints/test_run_configs.py | .py | f0d9ac249c38e241 | 7.06 | 12 |
#
# Copyright (c) 2023 Project CHIP Authors
#
# 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | project-chip/certification-tool-backend | app/container_manager/backend_container.py | .py | ca11cb1ff4d0c5b9 | 7.56 | 12 |
#!/usr/bin/env python3
"""
Cross-framework parity test for Tina4 Live Docs.
Spawns each framework's `Docs` module in its own language process,
runs the same query, asserts the results are equivalent modulo
language-specific FQN naming.
Usage:
python3 plan/v3/tools/docs-parity.py
Exit 0 = parity passes. Non-zero ... | tina4stack/tina4-documentation | plan/v3/tools/docs-parity.py | .py | b862c3cdd8b026a4 | 7.42 | 6 |
#!/usr/bin/env python3
"""Verify every contract fixture describes reality, and report what is owed.
ADR-0024 rule 6: a pluggable subsystem's contract is machine-checked by a SHARED
FIXTURE plus ONE CHECKER SCRIPT - not a runner per framework. This is that one
script, for every ``plan/v3/fixtures/*_contract.json``.
WH... | tina4stack/tina4-documentation | scripts/audit-contract-fixtures.py | .py | 6da621c622433ed3 | 7.42 | 6 |
#!/usr/bin/env python3
"""Verify the dispatch contract fixture describes reality.
plan/v3/fixtures/dispatch_contract.json is the ONE answer key for feature 6:
seven ordering/outcome invariants, each naming the suite and the case names
that prove it in all four frameworks.
A fixture nobody checks is a wish. This asser... | tina4stack/tina4-documentation | scripts/audit-dispatch-contract.py | .py | 29e14c56afb8191f | 7.42 | 6 |
#!/usr/bin/env python3
"""Verify the health contract fixture describes reality.
plan/v3/fixtures/health_contract.json is the ONE answer key for feature 8: the
liveness/readiness split, the four-key body, the path alias rule, and the
registration rule, each naming the suite and the case names that prove it.
A fixture ... | tina4stack/tina4-documentation | scripts/audit-health-contract.py | .py | a90af41e0032a128 | 7.42 | 6 |
#!/usr/bin/env python3
"""
audit-links.py — Find broken links in the VitePress docs.
Usage:
python3 scripts/audit-links.py # report only (exit 0)
python3 scripts/audit-links.py --strict # exit 1 if any missing files
python3 scripts/audit-links.py --strict-anchors # also fail on stale anchors
... | tina4stack/tina4-documentation | scripts/audit-links.py | .py | 79e97fc3772c841e | 7.42 | 6 |
# Map extracted data to other formats/standards
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
import logging
from rdflib import Graph
# Import script modules
fro... | digicademy/hydra-scraper | base/map.py | .py | 69f54b01de96cdab | 7.45 | 7 |
# Provide a structured input command
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
import logging
from argparse import ArgumentParser
from datetime import datetim... | digicademy/hydra-scraper | base/organise.py | .py | 7bd9d2587d5e73fb | 7.45 | 7 |
# Retrieve and extract data from Beacon files or plain-text URI lists
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
from re import search
# Import script modules... | digicademy/hydra-scraper | extract/beacon.py | .py | 04662ba832368e66 | 7.45 | 7 |
# Retrieve and extract data from LIDO files
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
from datetime import date
from rdflib import Namespace
from rdflib.term ... | digicademy/hydra-scraper | extract/lido.py | .py | 1010b269e34c65ce | 7.45 | 7 |
# Generate a Beacon list
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
import logging
from datetime import date
# Import script modules
from base.map import MapF... | digicademy/hydra-scraper | map/beacon.py | .py | cfc8e46ad035e6f3 | 7.45 | 7 |
# Generate nfdicore/cto-style triples
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
import logging
# Import script modules
from base.map import MapFeedInterface,... | digicademy/hydra-scraper | map/csv.py | .py | 5d9e224322bb24ce | 7.45 | 7 |
# Generate nfdicore/cto-style triples
#
# This file is part of the Hydra Scraper package.
#
# For the full copyright and license information, please read the
# LICENSE.txt file that was distributed with this source code.
# Import libraries
import logging
from datetime import date
from hashlib import sha256
from rdfli... | digicademy/hydra-scraper | map/cto.py | .py | 01d4465d08df6e47 | 7.45 | 7 |
"""
Learning processing service.
This module handles the extraction, processing and storage of learning entries
from notes, including generating titles and tags using AI services.
"""
import os
import re
from typing import List, Tuple
from services.llm_service import LLMService
from utils.file_handler import load_no... | ivo-toby/obsidian-autopilot-backend | services/learning_service.py | .py | 277ff2f495d4ef5f | 7.42 | 6 |
"""
Notes processing service.
This module handles loading, extracting, and saving various types of notes
including daily notes, weekly notes, and meeting notes.
"""
import os
import re
from datetime import datetime, timedelta
from typing import Optional, Tuple
from utils.date_utils import get_date_str
class NotesS... | ivo-toby/obsidian-autopilot-backend | services/notes_service.py | .py | e93ba38d4ff920c5 | 7.42 | 6 |
"""
OpenAI provider implementation.
This module provides the OpenAI implementation of the LLM provider interface.
"""
import logging
import os
from typing import Any, Dict, List, Optional
from openai import OpenAI
from services.providers.base_provider import BaseProvider
logger = logging.getLogger(__name__)
clas... | ivo-toby/obsidian-autopilot-backend | services/providers/openai_provider.py | .py | 665b306c2b066940 | 7.42 | 6 |
"""
Reminder service for macOS.
This module provides functionality to interact with the macOS Reminders app,
allowing the addition of tasks to the default Work list.
"""
import applescript
class ReminderService:
"""
Service for managing reminders in macOS Reminders app.
This service provides methods to... | ivo-toby/obsidian-autopilot-backend | services/reminder_service.py | .py | d5f4fb6032fe694d | 7.42 | 6 |
"""
Summary service for processing daily and weekly notes.
This module handles the generation and storage of note summaries.
"""
import fnmatch
import os
from datetime import datetime, timedelta
from typing import Dict, List, Optional
from services.notes_service import NotesService
from services.llm_service import L... | ivo-toby/obsidian-autopilot-backend | services/summary_service.py | .py | 646461c83ce391b8 | 7.42 | 6 |
"""Service for generating embeddings using various embedding models through LangChain."""
import logging
from typing import Any, Dict, List, Optional
from langchain_community.embeddings import (
OpenAIEmbeddings,
HuggingFaceEmbeddings,
CohereEmbeddings,
HuggingFaceInstructEmbeddings,
OllamaEmbeddi... | ivo-toby/obsidian-autopilot-backend | services/vector_store/embedding_service.py | .py | 09567eba4fe15711 | 7.42 | 6 |
#!/usr/bin/env python3
"""
Test script for programmatic reasoning detection.
This script tests the new programmatic reasoning detection mechanism
with real Ollama models.
"""
import sys
from services.providers.ollama_provider import OllamaProvider
def test_model_reasoning_support(model_name):
"""Test reasoning ... | ivo-toby/obsidian-autopilot-backend | test_reasoning_detection.py | .py | 3e52790ea653555b | 7.92 | 6 |
#!/usr/bin/env python3
"""
Test script for programmatic tool calling detection.
This script tests the new programmatic tool detection mechanism
with real Ollama models.
"""
import sys
from services.providers.ollama_provider import OllamaProvider
def test_model_tool_support(model_name):
"""Test tool support dete... | ivo-toby/obsidian-autopilot-backend | test_tool_detection.py | .py | 9d10ee5d4fa4b47c | 7.92 | 6 |
"""
Common test configurations and fixtures.
This module contains pytest configurations and fixtures that can be
shared across multiple test files.
"""
import pytest
import os
import tempfile
from pathlib import Path
@pytest.fixture(scope="session")
def test_data_dir():
"""Create a temporary directory for test d... | ivo-toby/obsidian-autopilot-backend | tests/conftest.py | .py | 36465415009d51bf | 7.92 | 6 |
"""
Tests for the ChunkingService class.
This module contains comprehensive tests for the ChunkingService functionality,
including document chunking, metadata extraction, and configuration handling.
"""
import pytest
from services.vector_store.chunking_service import ChunkingService
# Test data
SAMPLE_MARKDOWN = """... | ivo-toby/obsidian-autopilot-backend | tests/services/test_chunking_service.py | .py | 8f04e597297dc0a3 | 7.92 | 6 |
"""
Tests for the EmbeddingService class.
This module contains comprehensive tests for the EmbeddingService functionality,
including model initialization, embedding generation, and error handling.
"""
import pytest
from unittest.mock import Mock, patch
from services.vector_store.embedding_service import EmbeddingServ... | ivo-toby/obsidian-autopilot-backend | tests/services/test_embedding_service.py | .py | 23c9756a6cdf6d13 | 7.92 | 6 |
"""
Tests for the NotesService class.
This module contains comprehensive tests for all NotesService functionality
including note extraction, date handling, and file operations.
"""
import os
import pytest
from datetime import datetime, timedelta
from services.notes_service import NotesService
# Test data
SAMPLE_NOTE... | ivo-toby/obsidian-autopilot-backend | tests/services/test_notes_service.py | .py | 53d41bbd4139a80c | 7.92 | 6 |
import base64
import os
import requests
def is_base64_encoded(content):
"""
Checks if the provided content is Base64 encoded.
:param content: Content to check.
:return: True if the content is Base64 encoded, False otherwise.
"""
try:
# Try to decode and check if re-encoding gives the s... | Surfboardv2ray/xhttp-parser | python/xhttp.py | .py | 34dc89e935ef7993 | 7.52 | 10 |
"""Run the public forwarder test modules against the selected vbase package."""
from __future__ import annotations
import importlib
import os
import sys
import unittest
from pathlib import Path
from types import ModuleType
TEST_MODULES = (
"vbase.tests.test_vbase_client",
"vbase.tests.test_indexing_service",... | validityBase/vbase-py | .github/scripts/run_tests_forwarder_pub_dev.py | .py | ce4f50803454f51f | 7.95 | 7 |
"""Aggregate indexing service that fans out queries across multiple services."""
import concurrent.futures
import logging
from vbase.core.indexing_service import IndexingService
from vbase.utils.log import get_default_logger
_LOG = get_default_logger(__name__)
_LOG.setLevel(logging.INFO)
class AggregateIndexingSer... | validityBase/vbase-py | vbase/core/aggregate_indexing_service.py | .py | fc9f6669a5d191f2 | 7.45 | 7 |
"""Failover indexing service that tries multiple services in sequence."""
import logging
from vbase.core.indexing_service import IndexingService
from vbase.utils.log import get_default_logger
_LOG = get_default_logger(__name__)
_LOG.setLevel(logging.INFO)
class FailoverIndexingService(IndexingService):
"""This... | validityBase/vbase-py | vbase/core/failover_indexing_service.py | .py | 85c9280890a1a7b6 | 7.45 | 7 |
"""The vbase commitment service module provides access to various commitment services
such as blockchain-based smart contracts.
This implementation uses a forwarder to execute meta-transactions on a user's behalf.
"""
import json
import logging
import os
import pprint
from enum import Enum
from typing import List, Opt... | validityBase/vbase-py | vbase/core/forwarder_commitment_service.py | .py | dcb51a5b102ee90a | 7.45 | 7 |
"""The vbase commitment service module provides access to various commitment services
such as blockchain-based smart contracts.
This implementation uses a forwarder to execute meta-transactions on a user's behalf
against a test smart contract.
"""
import logging
from typing import List, Optional, Union
from vbase.cor... | validityBase/vbase-py | vbase/core/forwarder_commitment_service_test.py | .py | 4b64aeeb17c9787a | 7.95 | 7 |
"""
Base class for set matching strategies.
"""
from abc import ABC, abstractmethod
from sqlalchemy import and_, or_
from sqlmodel import Session, select
from vbase.core.models import EventAddSetObject, LastBatchProcessingTime
from vbase.core.set_matching.types import SetIdentifier, SetMatch, SetMatchingCriteria
c... | validityBase/vbase-py | vbase/core/set_matching/base_set_matching_service.py | .py | e6fe9aedcf547649 | 7.45 | 7 |
"""
Aggregate set matching strategies.
"""
from vbase.core.set_matching.base_set_matching_service import BaseSetMatchingService
from vbase.core.set_matching.types import SetMatch, SetMatchingCriteria
class ChainSetMatchingService(
BaseSetMatchingService
): # pylint: disable=too-few-public-methods
"""
Ag... | validityBase/vbase-py | vbase/core/set_matching/chain_set_matching_service.py | .py | d8b0c76fa59a2435 | 7.45 | 7 |
"""
Fuzzy set matching service implementation.
"""
import math
from collections import Counter
from sqlmodel import Session, create_engine, select
from vbase.core.models import EventAddSetObject
from vbase.core.set_matching.base_set_matching_service import BaseSetMatchingService
from vbase.core.set_matching.types im... | validityBase/vbase-py | vbase/core/set_matching/fuzzy_set_matching_service.py | .py | 5b539921e2c2b5ea | 7.45 | 7 |
"""
Head-based set matching service implementation.
"""
from sqlmodel import Session, create_engine, select
from vbase.core.models import EventAddSetObject
from vbase.core.set_matching.base_set_matching_service import BaseSetMatchingService
from vbase.core.set_matching.types import (
ObjectSetData,
SetIdentif... | validityBase/vbase-py | vbase/core/set_matching/head_based_set_matching_service.py | .py | da10e857e290a29f | 7.45 | 7 |
"""Asynchronous dataset support for the validityBase (vBase) platform.
A vBase dataset comprises one or more records (objects) belonging to a set.
Asynchronous dataset wraps synchronous dataset object to support
async operations using asyncio.
"""
import asyncio
import logging
from typing import List, Union
import pa... | validityBase/vbase-py | vbase/core/vbase_dataset_async.py | .py | 59f49a04cca14bb2 | 7.45 | 7 |
"""The vbase commitment service module captures the common operations
of the various commitment services provided by blockchain-based smart contracts
and the Web3 interface.
Particular implementations may access the blockchain directly
or via a forwarder service.
"""
import logging
import os
import pathlib
import ppri... | validityBase/vbase-py | vbase/core/web3_commitment_service.py | .py | e74ae26daeea9c75 | 7.45 | 7 |
"""The vbase commitment service module provides access to various commitment services
such as blockchain-based smart contracts.
This implementation uses Web3.HTTPProvider.
"""
import json
import logging
import os
import pprint
import time
from typing import List, Optional, Union
from dotenv import load_dotenv
from we... | validityBase/vbase-py | vbase/core/web3_http_commitment_service.py | .py | a2d5017020967b02 | 7.45 | 7 |
"""The vbase commitment service module provides access to various commitment services
such as blockchain-based smart contracts.
This implementation uses Web3.HTTPProvider to access a test commitment service.
"""
import logging
from typing import List, Optional, Union
from vbase.core.commitment_service_test import Com... | validityBase/vbase-py | vbase/core/web3_http_commitment_service_test.py | .py | 9c04437c601cc5a6 | 7.95 | 7 |
"""
Abstract base class for testing SQL-based set matching services.
"""
import os
import tempfile
import unittest
from abc import ABC
from sqlmodel import Session, SQLModel, create_engine
from vbase.core.models import EventAddSetObject, LastBatchProcessingTime
class BaseSQLMatchingTest(unittest.TestCase, ABC):
... | validityBase/vbase-py | vbase/tests/set_matching/base_sql_matching_test.py | .py | f6e8e6370ca3f602 | 7.95 | 7 |
"""Unit tests for ChainSetMatchingService."""
import unittest
from vbase.core.set_matching.base_set_matching_service import BaseSetMatchingService
from vbase.core.set_matching.chain_set_matching_service import ChainSetMatchingService
from vbase.core.set_matching.types import SetMatch, SetMatchingCriteria, Timestamped... | validityBase/vbase-py | vbase/tests/set_matching/test_chain_set_matching_service.py | .py | 5d077157b03888c9 | 7.95 | 7 |
"""Tests for AggregateIndexingService."""
import unittest
from unittest.mock import create_autospec
from vbase.core.aggregate_indexing_service import AggregateIndexingService
from vbase.core.indexing_service import IndexingService
class TestAggregateIndexingService(unittest.TestCase):
"""Unit tests for Aggregat... | validityBase/vbase-py | vbase/tests/test_aggregate_indexing_service.py | .py | 9ae1e24e686e6c51 | 7.95 | 7 |
"""Tests for FailoverIndexingService."""
import unittest
from unittest.mock import create_autospec
from vbase.core.failover_indexing_service import FailoverIndexingService
from vbase.core.indexing_service import IndexingService
class TestFailoverIndexingService(unittest.TestCase):
"""Unit tests for FailoverInde... | validityBase/vbase-py | vbase/tests/test_failover_indexing_service.py | .py | b88caaf392766438 | 7.95 | 7 |
"""Tests of the indexing service for the vbase package
using two commitment services for two local smart contracts.
Tests multichain and app compat scenarios for multiple commitment services.
"""
import json
import os
import secrets
import unittest
from vbase.core.indexing_service import Web3HTTPIndexingService
from ... | validityBase/vbase-py | vbase/tests/test_indexing_service_dual_localhost.py | .py | 0a625e6f1d0284ee | 7.95 | 7 |
"""Test Point-in-time (PIT) simulations
Such simulations allow calculations to run in a simulated PIT environment
accessing committed data precisely as it existed historically.
"""
import logging
import time
import unittest
import numpy as np
import pandas as pd
import vbase.core.vbase_client
from vbase.core.vbase_c... | validityBase/vbase-py | vbase/tests/test_sim.py | .py | f8feca4e848f6239 | 7.95 | 7 |
"""Tests of the vbase_client module"""
import unittest
from typing import List
import pandas as pd
from vbase.core.vbase_client_test import VBaseClientTest
from vbase.tests.utils import TEST_HASH1, TEST_HASH2, int_to_hash
def _assert_commitment_receipt_fields(cl: dict, expect_set_cid: bool = False):
"""Assert ... | validityBase/vbase-py | vbase/tests/test_vbase_client.py | .py | 1755b0030b2de32a | 7.95 | 7 |
"""Tests of the vbase_dataset_async module"""
import asyncio
import logging
import time
import unittest
import pandas as pd
from vbase.core.vbase_client import VBaseClient
from vbase.core.vbase_client_test import VBaseClientTest
from vbase.core.vbase_dataset_async import VBaseDatasetAsync
from vbase.core.vbase_objec... | validityBase/vbase-py | vbase/tests/test_vbase_dataset_async.py | .py | 8e370d7d4ab08db6 | 7.95 | 7 |
"""Tests of the large dataset bootstrap for the vbase module"""
import time
import unittest
from vbase.core.vbase_client_test import VBaseClientTest
from vbase.core.vbase_object import VBasePortfolioObject
from vbase.tests.utils import create_dataset_worker, dataset_from_json_checks
class TestVBaseDatasetBootstrap(... | validityBase/vbase-py | vbase/tests/test_vbase_dataset_bootstrap.py | .py | 732d92ee769c0472 | 7.95 | 7 |
"""vBase Test utils"""
import json
import logging
import pprint
import time
from typing import Type
from vbase.core.vbase_client import VBaseClient
from vbase.core.vbase_client_test import VBaseClientTest
from vbase.core.vbase_dataset import VBaseDataset
from vbase.core.vbase_object import VBaseObject
from vbase.util... | validityBase/vbase-py | vbase/tests/utils.py | .py | 6d534bac54581f88 | 7.95 | 7 |
class SimplestateError(Exception):
"""Base for all simplestate errors."""
class InvalidGraphError(SimplestateError):
"""The machine definition is invalid (raised by build())."""
class UnknownEventError(SimplestateError):
"""The current state has no transition for the event."""
class StaleStateError(Si... | panupong-develop/simplestate | simplestate/exceptions.py | .py | b3a1ffb8255227fa | 7 | 9 |
"""Side-effect memory probes for the declearn benchmark suite.
`time_run` calls `capture_start` before the workload and `capture_end`
after, writing peak host-RSS-delta and peak GPU bytes to a per-cell
`/tmp` cache (microseconds of overhead; invisible against the
~70-180s workload). The `track_peakmem_run` / `track_pe... | DecLearn/declearn | benchmarks/_memory.py | .py | 8bdb61c4238a2acd | 7.54 | 11 |
"""Single-shot benchmark entry point for use under py-spy (or similar).
ASV runs benchmarks as a sweep across `params`. py-spy needs to wrap
one concrete Python invocation. This module accepts the same kwargs
that `build_benchmark(...)` takes and invokes `build_benchmark` +
`run_benchmark` exactly once — i.e. it execu... | DecLearn/declearn | benchmarks/tools/profile_entry.py | .py | 19b028986931d5a1 | 7.54 | 11 |
"""Idempotent MNIST data preparation for benchmark runs.
A single canonical IID split is produced per `n_clients` value, then
re-shaped on demand into the layout each backend expects. All derived
layouts come from the same canonical split so that benchmark runs at
the same client count see identical sample assignment ... | DecLearn/declearn | benchmarks/workload/data.py | .py | 0ff72f9b76c4d03c | 7.54 | 11 |
"""Run a `BenchmarkSpec` end-to-end as a local federated experiment."""
import asyncio
import os
from benchmarks.workload.spec import BenchmarkSpec
from declearn.communication import NetworkClientConfig, NetworkServerConfig
from declearn.main import FederatedClient, FederatedServer
from declearn.utils import set_devi... | DecLearn/declearn | benchmarks/workload/runner.py | .py | 95268988d3d9126c | 7.54 | 11 |
"""Dataclasses describing a fully-instantiated benchmark configuration."""
from dataclasses import dataclass, field
from typing import Any, List, Optional
from declearn.dataset import Dataset
from declearn.main.config import FLOptimConfig, FLRunConfig
from declearn.model.api import Model
from declearn.secagg.api impo... | DecLearn/declearn | benchmarks/workload/spec.py | .py | f90a49ebc143801c | 8.04 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/aggregator/_api.py | .py | fb6f76c43d5f21f2 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/aggregator/_avg.py | .py | b06ed2f01bc33133 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/aggregator/_gma.py | .py | af0c8faef4965b50 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/aggregator/_sum.py | .py | 125e66629e92eead | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/client_sampler/_api.py | .py | 3bf787a5979177dd | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/client_sampler/_composition.py | .py | a8db1b63394b258b | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/client_sampler/_config.py | .py | 30d0a7df27bd7c45 | 7.54 | 11 |
# coding: utf-8
# Copyright 2026 Inria (Institut National de Recherche en Informatique
# et Automatique)
#
# 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://www.apache.org/license... | DecLearn/declearn | declearn/client_sampler/_criterion_sampler.py | .py | 5edeb6cd23ab2a84 | 7.54 | 11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.