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 |
|---|---|---|---|---|---|---|
"""Profile the connection open+close cycle for pycubrid.
Usage
-----
python scripts/profile_connect.py [options]
Examples
--------
# Basic run with defaults (100 iterations, localhost:33000/demodb):
python scripts/profile_connect.py
# Custom target, 50 iterations, save .prof for snakeviz:
python ... | cubrid-lab/pycubrid | scripts/profile_connect.py | .py | a8292132a34d1cf2 | 7.63 | 17 |
"""Profile prepare+execute cycles for INSERT/SELECT/UPDATE/DELETE in pycubrid.
Creates a temporary table ``_profile_tmp`` for the duration of the run, then drops it.
Usage
-----
python scripts/profile_execute.py [options]
Examples
--------
# All operations, 100 iterations each (default):
python scripts/p... | cubrid-lab/pycubrid | scripts/profile_execute.py | .py | cbdeaa8e12300abd | 7.63 | 17 |
"""Profile result-fetching operations (fetchone, fetchall, fetchmany) for pycubrid.
Pre-inserts a configurable number of rows into a temporary table ``_profile_tmp``,
then benchmarks each fetch variant over multiple iterations.
Usage
-----
python scripts/profile_fetch.py [options]
Examples
--------
# Default... | cubrid-lab/pycubrid | scripts/profile_fetch.py | .py | 4800f5035ff37887 | 7.63 | 17 |
"""Shared test fixtures for pycubrid."""
from __future__ import annotations
import pytest
from pycubrid.aio.connection import AsyncConnection
from pycubrid.connection import Connection
@pytest.fixture(autouse=True)
def _skip_backslash_probe(request: pytest.FixtureRequest, monkeypatch: pytest.MonkeyPatch) -> None:
... | cubrid-lab/pycubrid | tests/conftest.py | .py | 1e0e57ec674878b1 | 8.13 | 17 |
"""Microbenchmarks for pycubrid driver performance profiling.
Tier 0 — Connection: open/close latency, handshake time
Tier 1 — Single-row CRUD: INSERT, SELECT, UPDATE, DELETE latency
Tier 1+ — Multi-row and prepared statement reuse benchmarks
These benchmarks require a live CUBRID database.
Run with: pytest tests/tes... | cubrid-lab/pycubrid | tests/test_benchmarks.py | .py | d6de6101141dbdca | 8.13 | 17 |
"""Tests for _extract_first_keyword() comment-stripping SQL parser."""
from __future__ import annotations
from pycubrid.cursor import _DML_BATCH_VERBS, _extract_first_keyword
class TestExtractFirstKeyword:
"""Verify SQL keyword extraction handles comments and edge cases."""
def test_simple_insert(self):
... | cubrid-lab/pycubrid | tests/test_extract_keyword.py | .py | 929c2516a897dcbe | 8.13 | 17 |
#!/usr/bin/env python
"""Freeze sw2robot into a standalone executable with PyInstaller.
Builds a single-file binary for the host OS:
* Windows -> ``sw2robot-web.exe`` (the only OS where the SolidWorks ``extract``
step works -- it drives SolidWorks over COM via pywin32).
* macOS / Linux -> ``sw2robot-web`` (no ... | jsk-ros-pkg/solidworks_urdf_exporter2 | build_exe.py | .py | 4684a31548ba8aed | 7.62 | 16 |
"""Self-collision joint-limit sweep as a standalone subprocess (JSON on stdout).
The webserver shells out to this instead of sweeping in-process: the sweep is
CPU-bound and releases the GIL (numpy / python-fcl), so running it inside the
threaded HTTP server makes it thrash the GIL against the browser's idle
keep-alive... | jsk-ros-pkg/solidworks_urdf_exporter2 | sw2robot/editor/_autolimits_cli.py | .py | 3b96a1cc07a08f3d | 7.62 | 16 |
"""Resolve and serve ROS ``package://`` mesh references for the web editor.
Package *resolution* is delegated to scikit-robot (>= 0.3.16), whose
``get_path_with_cache`` resolves from ``ament_index`` / ``rospkg`` AND the
sourced ROS search-path environment variables -- so it also works in the
standalone binary, which b... | jsk-ros-pkg/solidworks_urdf_exporter2 | sw2robot/editor/package_uri.py | .py | 6e19ca5358d307f9 | 7.62 | 16 |
"""UI-independent state for a CAD-derived module under configuration.
The View (the web editor today, React/Three.js later) only *reads* this; the core API
mutates it; export consumes it. Pydantic so it serializes to JSON for a
REST/WebSocket payload without change.
"""
from __future__ import annotations
from pydan... | jsk-ros-pkg/solidworks_urdf_exporter2 | sw2robot/editor/state.py | .py | 2ff038574a019dc4 | 7.62 | 16 |
"""Add communication idempotency keys.
Revision ID: 0002_communication_idempotency
Revises: 0001_initial_schema
Create Date: 2026-05-26
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0002_communication_idempotency"
down_revision: str | None = "0001_initial_schema"
branch_labels: st... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0002_communication_idempotency.py | .py | fd9f3055a2414a49 | 7.5 | 9 |
"""Add persistent role gap events.
Revision ID: 0004_role_gaps
Revises: 0003_retention_indexes
Create Date: 2026-06-01
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0004_role_gaps"
down_revision: str | None = "0003_retention_indexes"
branch_labels: str | Sequence[str] | None = Non... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0004_role_gaps.py | .py | 4254220ad5d82ab1 | 7.5 | 9 |
"""Add invocation memory traces.
Revision ID: 0005_memory_traces
Revises: 0004_role_gaps
Create Date: 2026-06-02
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0005_memory_traces"
down_revision: str | None = "0004_role_gaps"
branch_labels: str | Sequence[str] | None = None
depends_... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0005_memory_traces.py | .py | 95ac686abd418493 | 7.5 | 9 |
"""Add memory steward findings.
Revision ID: 0006_memory_steward_findings
Revises: 0005_memory_traces
Create Date: 2026-06-02
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0006_memory_steward_findings"
down_revision: str | None = "0005_memory_traces"
branch_labels: str | Sequence[... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0006_memory_steward_findings.py | .py | 4daf926381850384 | 7.5 | 9 |
"""Enforce one durable outcome assessment per work item.
Revision ID: 0018_outcome_learning_integrity
Revises: 0017_company_claim_extraction
Create Date: 2026-08-15
"""
from collections.abc import Sequence
from alembic import op
revision: str = "0018_outcome_learning_integrity"
down_revision: str | None = "0017_com... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0018_outcome_learning_integrity.py | .py | f14b3425738f7c93 | 7.5 | 9 |
"""Add task-level model capability evaluation evidence.
Revision ID: 0020_model_capability_evaluations
Revises: 0019_claim_extraction_leases
Create Date: 2026-08-15
"""
from collections.abc import Sequence
import sqlalchemy as sa
from alembic import op
revision: str = "0020_model_capability_evaluations"
down_revis... | Hyper-AI-Lab/cyber-ai-team | backend/alembic/versions/0020_model_capability_evaluations.py | .py | 97f3328dff14a0ad | 7.5 | 9 |
"""Cyber-Team CLI entry point."""
import asyncio
import json
import os
import subprocess
import sys
import click
@click.group()
def main():
"""Cyber-Team — AI-powered digital company operating system."""
pass
@main.command()
@click.option("--build", is_flag=True, help="Build containers before starting")
@... | Hyper-AI-Lab/cyber-ai-team | backend/src/cyber_team/cli.py | .py | 85b8e201fdd35344 | 7.5 | 9 |
"""Regressions for the 2026-08-23 audit handoff (RUN acb-mt51rjib).
CORE-002..006, W2-002/003, PERF-001/004 against the ed1f86e8 baseline.
Focus on the shared attempt contract helpers and the public CLI reproductions
the audit described, so a fix cannot be undone by prose or a fixture tweak.
"""
from __future__ impor... | vacterro/saipen | tests/test_audit_2026_08_23.py | .py | 293cf4af3e7a9701 | 7.95 | 7 |
#!/usr/bin/env python3
"""No module-level name is read before the line that assigns it.
`tools/validate.py` is a 2300-line straight-line script: its checks execute in
file order, so a constant defined below its first use is a `NameError` waiting
for the one input that reaches that branch. Three of them landed in a sin... | vacterro/saipen | tools/audit_order.py | .py | 1a8ed22e200b87e7 | 7.45 | 7 |
#!/usr/bin/env python3
"""Measures how much weaker the portable floor is than the canonical validator.
The floor (`tests/validate.sh` / `.ps1`) exists for hosts without Python. It is
frozen against new checks on purpose, so the gap between it and
`tools/validate.py` is permanent by design -- but until this tool the SI... | vacterro/saipen | tools/audit_parity.py | .py | 8bee7a20400a4e6a | 7.45 | 7 |
#!/usr/bin/env python3
"""Every release tag points at a commit whose VERSION file agrees with it.
`release.yml` refuses to publish a tag whose `VERSION` disagrees. That guard
is FORWARD-ONLY: it was added in v7.99.0 *because* a tag had already reached
origin pointing two releases behind, and it can say nothing about t... | vacterro/saipen | tools/audit_tags.py | .py | de5bc06cf344e964 | 7.45 | 7 |
"""Attempt lifecycle -- Work vs Attempt separation (T-1148).
A SAIPEN ticket (Work) is durable; an Attempt is one bounded execution
episode of one agent working that ticket. An agent dying, a context window
ending, or a provider switching must never rename, fail, or destroy the
Work -- only the Attempt closes. The Att... | vacterro/saipen | tools/saipen_engine/attempt.py | .py | 4fef20a90416daf1 | 7.45 | 7 |
"""Bounded progress detection for the legacy crew-only intent loop.
The compatibility ``autonomous_crew_loop`` lives in
:mod:`saipen_engine.intent`; canonical continue/converge and targeted producer
execution have separate CLI routes and do not enter it. This module owns only
the reusable, pure stall detector, so ther... | vacterro/saipen | tools/saipen_engine/autonomy.py | .py | 541ffe0aa4a5df33 | 7.45 | 7 |
"""The CURRENT-SESSION capability -- negotiated, never remembered (CORE § 1.3).
`STATE.mode` records the LAST handshake outcome. It is history: the session that
wrote it is over, and a value on disk can neither grant nor revoke the authority
of the session reading it. Authorization, routing, release and crew therefore... | vacterro/saipen | tools/saipen_engine/capability.py | .py | dc746ab156d6e8f8 | 7.45 | 7 |
"""Document I/O with genuine encoding/BOM/newline byte preservation.
Reads never die on a `.saipen/` file's encoding (a decode error must not kill
the whole run). A Document retains every representation fact -- encoding,
BOM, newline convention, final-newline state -- and `encode()` reproduces the
exact byte represent... | vacterro/saipen | tools/saipen_engine/codec.py | .py | cf970f9841b9d488 | 7.45 | 7 |
# ruff: noqa: RUF001, RUF002, RUF003
"""Deterministic command parsing for SAIPEN compound inputs.
Defect class this module exists to close: a protocol command or shortcut can
reach free-form natural-language reasoning before deterministic SAIPEN
resolution ("sc" answered as a style-mode greeting; "saipen push + build ... | vacterro/saipen | tools/saipen_engine/commands.py | .py | 8a2d84efdb2f6d50 | 7.45 | 7 |
"""Engine exceptions and the closed set of stable result codes.
A weak model should reason about a CODE, not parse an essay. Every refusal the
engine can emit is named here once; `saipen/OPS.md` section 7 is the contract
these must satisfy, and `CODES` is checked against that document so a code
cannot be invented in c... | vacterro/saipen | tools/saipen_engine/errors.py | .py | ccc590cd2a73b82c | 7.45 | 7 |
"""INDEPENDENT raw-level foundational falsifiers (T-1003 carrier-loss wave).
The engine's parsers are SHARED by the validator, the planners and the gates.
Sharing is normally good, but when the parser itself is the defect, every
consumer can agree on the same wrong world -- the one physical BOARD line that
swallowed a... | vacterro/saipen | tools/saipen_engine/floor.py | .py | bf8a95810cdb60b1 | 7.45 | 7 |
"""Continuation liveness projection (T-1159).
Durable memory for exactly one fact across CLI invocations: the fingerprint
of the last actionable crew/continuation carrier handed to the agent, so an
identical actionable answer twice in a row is surfaced as CREW_STALLED
instead of silently re-polled (CORE § 1.10 "EXECUT... | vacterro/saipen | tools/saipen_engine/liveness.py | .py | 8116d93c98b681ce | 7.45 | 7 |
"""ONE shared expansion of saipen/MANIFEST.json (runtime surface).
The validator (tools/validate.py) and the injector (tools/autoinject.py) must
agree on what the runtime manifest ships: the injector copies the surface,
the validator proves every clone has it. Two divergent expansions are how a
declared tree gets skip... | vacterro/saipen | tools/saipen_engine/manifest.py | .py | ee252d3aa5db52a3 | 7.45 | 7 |
"""The phase DFA and the `next_action` grammar, in one place.
These were hand-kept constants inside `tools/validate.py`. They are mechanical
facts — which phase may follow which, which phases carry a ticket, what shape a
`next_action` takes — so under NITRO they belong to the engine and the validator
imports them.
Th... | vacterro/saipen | tools/saipen_engine/phases.py | .py | dad6bf58b659470c | 7.45 | 7 |
"""TTLock BLE integration for Home Assistant."""
from __future__ import annotations
from functools import partial
from typing import TYPE_CHECKING, cast
from homeassistant.const import Platform
from homeassistant.core import callback
from homeassistant.helpers.device_registry import (
async_entries_for_config_en... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/__init__.py | .py | b3eb70094513bbbb | 7.62 | 16 |
"""Passive advertisement tracking for ttlock_ble."""
from __future__ import annotations
from functools import partial
from typing import TYPE_CHECKING
from homeassistant.components.bluetooth import (
BluetoothCallbackMatcher,
BluetoothScanningMode,
async_register_callback,
)
from homeassistant.core impor... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/advertisement.py | .py | c360956e03ae1fd2 | 7.62 | 16 |
"""
TTLock BLE cloud-bootstrap client.
Wraps `ttlock_ble.TTLockCloud` so the config flow and entry setup only
see the integration's own exception hierarchy. Calls run through a
shared `httpx.AsyncClient` supplied by Home Assistant; cleanup of that
client stays with the caller.
"""
from __future__ import annotations
... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/api.py | .py | e63285acf43d7f65 | 7.62 | 16 |
"""Binary sensor platform for ttlock_ble — live BLE connection state."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.const import EntityCategory
from homeassistant.co... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/binary_sensor.py | .py | 5efcf5867858bae4 | 7.62 | 16 |
"""
Persistent BLE connection wrapper for ttlock_ble.
Each `TtlockBleConnection` owns a long-lived `TTLockClient` for a single
`VirtualKey`, runs a background reconnect loop, and serializes state
queries and lock commands through a single `asyncio.Lock`. Push events
arriving on that connection are dispatched live via ... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/connection.py | .py | a5559edbf96e052e | 7.62 | 16 |
"""
DataUpdateCoordinator for ttlock_ble.
State arrives without opening anything: `async_apply_advertisement`
publishes what `TtlockBleAdvertisementTracker` decodes from the lock's
advertisements, which is also the only channel that reports an
auto-lock. The same advertisements announce that the lock holds
unsynced op... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/coordinator.py | .py | 2b2604e76cba07e7 | 7.62 | 16 |
"""Persisted per-lock hardware description for ttlock_ble."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.helpers.singleton import singleton
from homeassistant.helpers.storage import Store
from homeassistant.util.hass_dict import HassKey
from .const import DOMAIN
if TYPE_... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/device_description_store.py | .py | 9e8a047fe0a2dbcf | 7.62 | 16 |
"""TtlockBleEntity base class — one device per `VirtualKey`."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.helpers.device_registry import (
CONNECTION_BLUETOOTH,
DeviceInfo,
format_mac,
)
from homeassistant.helpers.update_coordinator import CoordinatorEntity
f... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/entity.py | .py | 543be08c4cc838fa | 7.62 | 16 |
"""
Event platform for ttlock_ble.
Surfaces historical operation records read from the lock's on-device
storage (fingerprint, keypad, IC card, etc.) every time the integration
connects or polls.
"""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.components.event import EventE... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/event.py | .py | 082ecbe74e2dcccb | 7.62 | 16 |
"""Lock platform for ttlock_ble."""
from __future__ import annotations
import asyncio
import time
from typing import TYPE_CHECKING, Any
from homeassistant.components.lock import LockEntity
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.dispa... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/lock.py | .py | f21aba421e0dc8ac | 7.62 | 16 |
"""Build a `VirtualKey` from the manual key form, for locks with no cloud account."""
from __future__ import annotations
import re
from typing import TYPE_CHECKING
from homeassistant.components.bluetooth import async_last_service_info
from homeassistant.helpers.device_registry import format_mac
from ttlock_ble impo... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/manual_key.py | .py | 92c6b62bd2ec45ab | 7.62 | 16 |
"""Options flow for ttlock_ble."""
from __future__ import annotations
from typing import TYPE_CHECKING
import voluptuous as vol
from homeassistant.config_entries import ConfigFlowResult, OptionsFlow
from homeassistant.helpers import selector
from .const import CONF_PERMANENT_CONNECTION
if TYPE_CHECKING:
from .... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/options_flow.py | .py | f09a486f153ea0e9 | 7.62 | 16 |
"""Persisted operation-log cursor for ttlock_ble."""
from __future__ import annotations
from typing import TYPE_CHECKING, TypedDict
from homeassistant.helpers.singleton import singleton
from homeassistant.helpers.storage import Store
from homeassistant.util.hass_dict import HassKey
from .const import DOMAIN
if TYP... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/record_store.py | .py | c4228db17e04a166 | 7.62 | 16 |
"""Sensor platform for ttlock_ble — battery level and last contact."""
from __future__ import annotations
from datetime import timedelta
from typing import TYPE_CHECKING
from homeassistant.components.bluetooth import (
MONOTONIC_TIME,
async_last_service_info,
)
from homeassistant.components.sensor import (
... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/sensor.py | .py | 17abfacf2216150b | 7.62 | 16 |
"""Switch platform for ttlock_ble — the lock's beep."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from homeassistant.components.switch import SwitchEntity
from homeassistant.const import EntityCategory
from homeassistant.exceptions import HomeAssistantError
from ttlock_ble import TTLo... | roquerodrigo/ha-ttlock-ble | custom_components/ttlock_ble/switch.py | .py | ba4ac4ef99c9db66 | 7.62 | 16 |
from __future__ import annotations
from typing import TYPE_CHECKING
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
from ttlock_ble import DeviceInfo, VirtualKey
from ttlock_ble.models.lock_version import LockVersion
# Eagerly import the integration submodules so `unittest.mock.patch` can
# resol... | roquerodrigo/ha-ttlock-ble | tests/conftest.py | .py | e8c5df0d7bc9cd07 | 8.12 | 16 |
"""Coverage for the passive advertisement tracker."""
from __future__ import annotations
from unittest.mock import AsyncMock, MagicMock, patch
import pytest
MAC = "AA:BB:CC:DD:EE:FF"
MAC_TAIL = bytes.fromhex("ffeeddccbbaa")
V3_COMPANY_ID = 0x0305
def manufacturer_data(flags: int, battery: int = 77, tail: bytes = ... | roquerodrigo/ha-ttlock-ble | tests/test_advertisement.py | .py | fdec4f57d13f411b | 7.12 | 16 |
"""AC Compatibility API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticati... | fulviofreitas/eero-api | src/eero/api/ac_compat.py | .py | 1f8e68c3d25cc514 | 7.48 | 8 |
"""Authentication API for Eero."""
from datetime import datetime, timedelta
from typing import Optional
import aiohttp
from aiohttp import ClientSession
from ..const import (
API_ENDPOINT,
LOGIN_ENDPOINT,
LOGIN_VERIFY_ENDPOINT,
LOGOUT_ENDPOINT,
REFRESH_ENDPOINTS,
SESSION_TOKEN_KEY,
)
from ..e... | fulviofreitas/eero-api | src/eero/api/auth.py | .py | cb7dbabdd761a632 | 7.48 | 8 |
"""Credential storage backends for Eero authentication.
This module provides storage backends for persisting authentication tokens:
- KeyringStorage: Uses OS keyring for secure credential storage
- FileStorage: Uses JSON file with restricted permissions
- MemoryStorage: In-memory only, no persistence (for testing/ephe... | fulviofreitas/eero-api | src/eero/api/auth_storage.py | .py | 0cfaffc481be8151 | 7.48 | 8 |
"""Burst Reporters API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticatio... | fulviofreitas/eero-api | src/eero/api/burst_reporters.py | .py | ad179d8cefdd1166 | 7.48 | 8 |
"""Data Usage API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict, Optional
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenti... | fulviofreitas/eero-api | src/eero/api/data_usage.py | .py | cb63731836604820 | 7.48 | 8 |
"""Insights API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationExcept... | fulviofreitas/eero-api | src/eero/api/insights.py | .py | ccd345514acb20f3 | 7.48 | 8 |
"""Password API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationException
from ..logg... | fulviofreitas/eero-api | src/eero/api/password.py | .py | c2d886972155614a | 7.48 | 8 |
"""Routing API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationExcepti... | fulviofreitas/eero-api | src/eero/api/routing.py | .py | 59aae6aed23c0da0 | 7.48 | 8 |
"""Settings API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationExcept... | fulviofreitas/eero-api | src/eero/api/settings.py | .py | 5e6287a9e0592693 | 7.48 | 8 |
"""Thread API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationExceptio... | fulviofreitas/eero-api | src/eero/api/thread.py | .py | 493cb54e14707bf4 | 7.48 | 8 |
"""Transfer Stats API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict, Optional
from ..const import API_ENDPOINT
from ..exceptions import EeroAuth... | fulviofreitas/eero-api | src/eero/api/transfer.py | .py | 883b14587df243c7 | 7.48 | 8 |
"""Updates API for Eero.
IMPORTANT: This module returns RAW responses from the Eero Cloud API.
All data extraction, field mapping, and transformation must be done by downstream clients.
"""
import logging
from typing import Any, Dict
from ..const import API_ENDPOINT
from ..exceptions import EeroAuthenticationExcepti... | fulviofreitas/eero-api | src/eero/api/updates.py | .py | 52770d3a9ef13d88 | 7.48 | 8 |
"""Constants for the Eero API package."""
from enum import Enum
from typing import Dict, Final
# API Endpoints
API_ENDPOINT: Final[str] = "https://api-user.e2ro.com/2.2"
# Device-mutation writes (pause/block/nickname/priority) are silently dropped on
# API version 2.2: the backend accepts the PUT and returns 200 OK ... | fulviofreitas/eero-api | src/eero/const.py | .py | b100ba53b86bde12 | 7.48 | 8 |
"""Secure logging utilities for Eero API.
This module provides a SecureLogger that automatically redacts sensitive
data from log messages based on field names and patterns.
"""
from __future__ import annotations
import logging
import re
from functools import lru_cache
from typing import Any, Dict, FrozenSet, List, M... | fulviofreitas/eero-api | src/eero/logging.py | .py | a35dcafb9c696b7b | 7.48 | 8 |
"""Shared fixtures for API tests.
This module provides reusable fixtures for testing the Eero API layer,
mocking HTTP responses and session management at the aiohttp boundary.
"""
import json
from datetime import datetime, timedelta
from typing import Any, Dict, List, Optional
from unittest.mock import AsyncMock, Mag... | fulviofreitas/eero-api | tests/api/conftest.py | .py | a0e354201d85c2fd | 7.98 | 8 |
"""Tests for ACCompatAPI module."""
from unittest.mock import AsyncMock, MagicMock
import pytest
from eero.api.ac_compat import ACCompatAPI
from eero.exceptions import EeroAuthenticationException
from .conftest import api_success_response, create_mock_response
class TestACCompatAPIInit:
"""Tests for ACCompatA... | fulviofreitas/eero-api | tests/api/test_ac_compat.py | .py | e3479e3b907c11bc | 7.98 | 8 |
"""OpenAI-shape bridge shared by Hermes' ACP clients.
An ACP agent (``copilot --acp``, and the ACP CLIs that reach Hermes as
providers) speaks the Agent Client Protocol, which has no OpenAI-style
``tools``/``tool_calls`` channel: a prompt is text, and a response is text plus
the agent's *own* tool notifications. Herme... | Lexus2016/hermes-agent-evolution | agent/acp_openai_bridge.py | .py | d4fadeb89c4863cd | 7.57 | 13 |
# -*- coding: utf-8 -*-
"""AgentOpt Slice 1 — opt-in LLM-call telemetry (#2741).
Child of #2695. Opt-in via ``config.yaml -> agentopt.telemetry.enabled`` ONLY
(no env vars), disabled by default. When on, each auxiliary LLM call appends
one content-free JSONL record (model, tool, step, cost, latency_ms, outcome);
off =... | Lexus2016/hermes-agent-evolution | agent/agentopt_telemetry.py | .py | 23bf518e31c5ca08 | 7.57 | 13 |
# -*- coding: utf-8 -*-
"""Architecture router: single-agent vs centralized multi-agent selector (#1139).
Classifies each task on two axes — decomposability and tool density (plus
sequentiality) — and recommends the execution architecture, following the
scaling principles from Google Research's "science of scaling age... | Lexus2016/hermes-agent-evolution | agent/architecture_router.py | .py | ad9a15d907758ac0 | 7.57 | 13 |
"""Structured audit event log (EU AI Act Art. 12) — #1718.
JSONL at ``$HERMES_HOME/logs/audit-events.jsonl`` recording tool calls as
immutable records exportable for regulatory review. Gated via
``security.audit_log`` (default off), fail-open, profile-aware.
"""
import json
import logging
import os
import threading
... | Lexus2016/hermes-agent-evolution | agent/audit_log.py | .py | 0657bc4972793c4b | 7.57 | 13 |
"""Tamper-evident append-only audit trail (issue #1719, issue #3065).
Hash-chained JSONL: each entry stores the SHA-256 of the previous entry's hash
plus its payload, so tampering is detectable via ``verify()``. Retention via
``security.audit.retention_days`` (default 90); ``prune()`` re-anchors the chain.
Issue #306... | Lexus2016/hermes-agent-evolution | agent/audit_trail.py | .py | 32082e9a0982e25d | 7.57 | 13 |
# -*- coding: utf-8 -*-
"""Co-evolution loop — agents and tools improve together (#2262, parent #2251).
Slice B of the dual asset banks: the agent bank (``agent/experience_bank.py``,
#2261) stores ``DelegationPattern`` assets; this module tags every delegation
outcome with the tools the child agent actually used, succ... | Lexus2016/hermes-agent-evolution | agent/coevolution.py | .py | 98a6297547247491 | 7.57 | 13 |
"""CompactionRL evaluation signal — record compaction events and summarize outcomes.
Phase 1 (no training): records token/message counts before and after each
compaction step, and whether the post-compaction trajectory succeeded. Over
many cycles, this surfaces which summary patterns correlate with success.
Inspired ... | Lexus2016/hermes-agent-evolution | agent/compaction_eval.py | .py | 37d27f3dd56b4bad | 7.57 | 13 |
# -*- coding: utf-8 -*-
"""Multi-scale context folding for long autonomous sessions (issue #2361).
Adopts AgentFold (arXiv:2510.24699, 'AgentFold: Multi-Scale Context Folding for
Long-Horizon Autonomous Agents'):
1. Partitions conversation history into Invariant Goal + Multi-Scale State Summaries + Working Memory.
2. ... | Lexus2016/hermes-agent-evolution | agent/context_folding.py | .py | 2ddc44edda3b6cdd | 7.57 | 13 |
"""Context-file load instrumentation (issue #2442, Slice A).
The AGENTS.md evaluation harness (parent #2252) needs to answer, for any
given session, *"which context files actually loaded, and what did the loader
do with them?"* before it can assert that the right rules were applied.
This slice delivers the edges-only... | Lexus2016/hermes-agent-evolution | agent/context_load_instrument.py | .py | 6da69163d356d912 | 7.57 | 13 |
"""Application context bundling configuration and the database handle.
The MCP tools historically reached for two separate module-level singletons
(``_config`` and ``_database``). ``AppContext`` replaces those with a single,
explicitly constructed object so that configuration and its derived database
connection are al... | cubrid-lab/cubrid-mcp-server | cubrid_mcp_server/context.py | .py | 56a485a0aac8df69 | 7.59 | 14 |
"""Thin wrapper around pycubrid for the MCP server."""
from __future__ import annotations
import logging
import socket
import threading
from contextlib import contextmanager
from typing import Any, Iterator
import pycubrid
from cubrid_mcp_server.config import Config
logger = logging.getLogger(__name__)
class Da... | cubrid-lab/cubrid-mcp-server | cubrid_mcp_server/database.py | .py | 3dd07c9fb6194fd9 | 7.59 | 14 |
"""Read-only SQL safety checker.
When the server runs in read-only mode (the default), every statement passed
to ``execute_query`` is inspected by :func:`ensure_read_only` before reaching
the database. Only the minimal set of statements needed to inspect data and
schemas is allowed, and multi-statement input is reject... | cubrid-lab/cubrid-mcp-server | cubrid_mcp_server/safety.py | .py | 507baf476bf381d0 | 7.59 | 14 |
"""FastMCP server exposing read-only CUBRID tools."""
from __future__ import annotations
import base64
import logging
import sys
import threading
from typing import Any
from fastmcp import FastMCP
from cubrid_mcp_server.config import Config, ConfigError
from cubrid_mcp_server.context import AppContext
from cubrid_m... | cubrid-lab/cubrid-mcp-server | cubrid_mcp_server/server.py | .py | 4cce59caab1aabcb | 7.59 | 14 |
"""Unit tests for cubrid_mcp_server.database using a fake pycubrid driver.
These exercise the connection lifecycle, cursor error handling, and streaming
fetch logic without a live CUBRID server by monkeypatching ``pycubrid.connect``.
"""
from __future__ import annotations
import socket
from typing import Any
import... | cubrid-lab/cubrid-mcp-server | tests/test_database.py | .py | e45447a1d3096fee | 7.09 | 14 |
import pytest
from cubrid_mcp_server.safety import UnsafeSQLError, ensure_read_only
@pytest.mark.parametrize(
"sql",
[
"SELECT 1",
"select * from users where id = 1",
"SHOW TABLES",
"DESC users",
"DESCRIBE users",
"EXPLAIN SELECT * FROM users",
"WITH re... | cubrid-lab/cubrid-mcp-server | tests/test_safety.py | .py | 4206c48a4daf9efb | 7.09 | 14 |
"""Deterministic Python CI test planner for CodexHub.
This seam decides which Python tests run for a given GitHub Actions event and
changed-path set. It is intentionally free of third-party path-filter actions
and relies only on git and pytest semantics.
"""
from __future__ import annotations
import argparse
import ... | NOirBRight/CodexHub | scripts/ci/python_test_plan.py | .py | eb0120853960c3e3 | 8.12 | 16 |
#!/usr/bin/env python3
"""Measure decode rate, either single stream or saturated with concurrent requests.
Two different questions, two different numbers:
Single stream (--concurrency 1, the default)
How fast does one interactive session feel. This is the number that matters for agentic
coding, where on... | KempnerInstitute/hpc-agentic-recipes | common/tools/bench.py | .py | 05ba2bcca5da5366 | 7.52 | 10 |
#!/usr/bin/env python3
"""Start SGLang's server with the API key taken from the environment.
SGLang accepts the key only as --api-key. A command line lands in /proc/<pid>/cmdline, which any user on
the node can read, while /proc/<pid>/environ is mode 400 and readable only by its owner and root. vLLM
reads VLLM_API_KEY... | KempnerInstitute/hpc-agentic-recipes | common/tools/sglang_launch.py | .py | c4a920de6feb8386 | 7.52 | 10 |
#!/usr/bin/env python3
"""Check that a downloaded checkpoint is complete before serving it.
python3 common/tools/verify_checkpoint.py <checkpoint-dir>
An incomplete download fails deep inside weight loading with an error that points at the model rather than
at the file, so it is worth ruling out first. Two things... | KempnerInstitute/hpc-agentic-recipes | common/tools/verify_checkpoint.py | .py | e1d120b2402c1b9c | 7.52 | 10 |
"""
Multi-scene dataset builder & export (Phase 3).
Combines whole scenes into one UMI-format ReplayBuffer, per the "ingest owns
preprocessing/export, catalog only imports it" decision — the
same pattern already used for Phase 2.5's MCAP export. Exports the buffer first and only then
writes the dataset manifest (§3.2)... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/dataset_builder.py | .py | 0eef0da16b34db93 | 7.45 | 7 |
"""
Engine / session helpers for the catalog SQLite cache.
There are deliberately **no migrations** here. Every row is derived from the recordings
tree, so when the models and an existing DB file disagree the answer is always to throw
the file away and re-sync — :func:`schema_mismatches` detects the drift at startup a... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/db.py | .py | 7894afbdb6bd0d84 | 7.45 | 7 |
"""
Per-episode SLAM tracking-quality stats surfaced in the catalog UI (Phase 4).
The numbers come from the ``annotations/slam`` group attrs the SLAM preprocessing step
(``OrbSlam3Step``, ingest step 2) already writes into each episode's pzarr group — no new
computation, just plumbing an existing per-episode summary t... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/episode_quality.py | .py | 14f6e8f76dcdff2f | 7.45 | 7 |
"""
Read/write helpers for the catalog's authoritative on-disk manifests.
``SceneManifest`` (``scene.json`` at a scene root) is the canonical home of a scene's
task assignment, notes, and unusable-episode markers; it lives in ``polyumi_ingest.manifests``
(re-exported here, along with the ``update_scene_manifest`` / ``... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/manifests.py | .py | 1d3a8a05be91ec55 | 7.45 | 7 |
"""
Per-episode MCAP export + local Foxglove launch (Phase 2.5).
MCAP export reuses ingest's existing exporter (``polyumi_ingest.export.mcap``)
rather than reimplementing anything, per the "ingest owns preprocessing/export"
decision. The one bit of glue this module adds is
resolving a catalog ``Session`` to its pzarr ... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/mcap_tools.py | .py | 55be061a80fcea31 | 7.45 | 7 |
"""
SQLModel tables for the catalog cache.
This database is a *rebuildable index* — the authoritative homes of each fact are the
on-disk ``metadata.json`` (sessions), ``scene.json`` (scene→task, notes), and the
per-dataset manifest. Any row here can be
reconstructed by re-running ``sync`` against the recordings tree.
... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/models.py | .py | 936902da9630698c | 7.45 | 7 |
"""
Mutating operations for the catalog UI: tasks, scene/session assignment, notes, and flags.
Every mutation writes the authoritative on-disk file first (``scene.json`` for
scene-level fields, a session's own ``metadata.json`` for session-level ones), then
updates the corresponding DB row in the same operation
("task... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/mutations.py | .py | 211fe82ed5920a6b | 7.45 | 7 |
"""
Full preprocessing pipeline status + trigger for the scene detail pane (Phase 4).
``scene_pp_status`` mirrors what ``pingest pp --list`` plus a scene's
``preprocessing_steps`` attr would tell you: which registered steps exist and
which of them are already marked complete on this scene's pzarr. ``run_full_pipeline`... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/pp_status.py | .py | b91499539e85da8b | 7.45 | 7 |
"""
Which commits produced a scene's data, for the scene detail pane.
Two independent lineages meet in one scene directory and they are not the same code:
* **Recording** — the ``polyumi_version`` each session's ``metadata.json`` records, which
``deploy.sh`` bakes into ``pi/polyumi_pi/_version.py`` at deploy time. ... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/provenance.py | .py | 674f11aa43969691 | 7.45 | 7 |
"""
Per-session pzarr stream inspection for the detail pane (Phase 4).
Wraps ingest's own ``inspect_pzarr`` (the same summary ``pingest inspect-zarr``
prints), scoped down to just the one episode a selected session maps to, and
formatted the same way as that CLI's per-episode table — no new computation,
just reusing i... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/pzarr_inspect.py | .py | 85a541e9fcec4726 | 7.95 | 7 |
"""
Read-only query helpers over the catalog cache, for the Phase 1 browser.
These are pure functions of a DB session so they can be unit-tested without HTTP.
They return plain dicts (view models) rather than ORM rows so the templates stay
decoupled from the SQLModel schema.
"""
from __future__ import annotations
im... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/queries.py | .py | 21805eb2348129a8 | 7.45 | 7 |
"""
Scan the recordings tree and upsert its scenes/sessions/tasks/datasets into the catalog DB.
The scene/session scan is idempotent and mtime-gated: a scene is re-parsed only when its
directory, one of its session directories, or a ``metadata.json`` has changed since the last
sync (or when ``force`` is set). SQLite i... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/sync.py | .py | 3f42e69506a06085 | 7.45 | 7 |
"""
On-demand GoPro video info (thumbnails, fps) for the Episodes list + session detail pane.
Reads directly from a session's ``gopro.mp4`` sidecar via OpenCV — independent of pzarr
(the frames array itself isn't stored there; see ``polyumi_ingest.pzarr.store``), so this
works for any synced session regardless of prep... | cwoodhayes/PolyUMI | catalog/polyumi_catalog/thumbnails.py | .py | bfd9ff08eb09d1b6 | 7.45 | 7 |
"""
Round-trip tests for the on-disk manifests, from the catalog side.
Named ``test_catalog_manifests`` rather than ``test_manifests`` so it doesn't collide with
``ingest/test/test_manifests.py``: neither test dir is a package, so pytest imports both by
bare module name and a shared basename makes collecting the two s... | cwoodhayes/PolyUMI | catalog/test/test_catalog_manifests.py | .py | 7c40495b8d8fb742 | 7.95 | 7 |
"""
Tests for the Phase 3 dataset builder.
``build_dataset`` is a thin wrapper around ``polyumi_ingest.export.dp.export_scenes_to_dp``
(exercised for real in ingest's own test suite) plus the catalog-specific glue: validation,
writing the dataset manifest (§3.2), and upserting Dataset/DatasetMember rows. So here we
mo... | cwoodhayes/PolyUMI | catalog/test/test_dataset_builder.py | .py | 9643ef87f5c44be1 | 7.95 | 7 |
"""Tests for engine setup and the startup schema check over an older catalog DB."""
from __future__ import annotations
import pathlib
import pytest
import typer
from polyumi_catalog.db import get_engine, rebuild_schema, schema_mismatches
from polyumi_catalog.main import _open_db
from polyumi_catalog.models import Sc... | cwoodhayes/PolyUMI | catalog/test/test_db.py | .py | 904c75db3e18f1b5 | 7.95 | 7 |
"""Tests for reading per-episode SLAM tracking-quality stats out of pzarr (Phase 4)."""
from __future__ import annotations
import pathlib
import zarr
from polyumi_catalog import episode_quality
def _make_pzarr_with_slam(scene_dir: pathlib.Path, episodes: list[tuple[str, dict | None]]) -> None:
"""
Build a ... | cwoodhayes/PolyUMI | catalog/test/test_episode_quality.py | .py | c9a1637822e33f9c | 7.95 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.