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 python3 """Turn-level view of a run's trace. The substrate every metric reads. Nothing here scores anything. It loads `reasoning_trace.jsonl` for one (world, agent), normalises the parts every metric needs, and hands back a list of turns. TWO TRAPS THIS FILE EXISTS TO ABSORB, both found on live data 20...
bdambrosio/Cognitive_workbench
measure/trace.py
.py
97ec5ec51f9f8c3e
7.52
10
"""ProcState: state vector published by AffectPublisher. Wire format is the JSON-serialized dataclass. Keep field names stable — the P5 sketch reads them by name. All time fields are wall-clock seconds (time.time()) so a separate display process can compute ages without a shared monotonic clock. """ from __future__ im...
bdambrosio/Cognitive_workbench
src/affect/state.py
.py
47d02a18f177060c
7.52
10
"""CanvasState: payload published by CanvasPublisher. Wire format is the JSON-serialized dataclass — `content` carries the markdown/HTML body, `format` selects how the shim renders it. seq is monotonic per publisher; ts is wall-clock seconds. turn is the ReAct episode counter (see CanvasPublisher.new_turn) — the displ...
bdambrosio/Cognitive_workbench
src/canvas/state.py
.py
74f527806c11c3f7
7.52
10
# ruff: noqa import contextlib import dataclasses import datetime import faulthandler import os import signal import time from moviepy.editor import ImageSequenceClip import numpy as np from openpi_client import image_tools from openpi_client import websocket_client_policy import pandas as pd from PIL import Image fro...
hku-sail/StreamPI
examples/droid/main.py
.py
4bdbdbdde068ebb3
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/benchmarks/video/run_video_benchmark.py
.py
984bda3a043a6133
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/compute_stats.py
.py
9afd2da5f91d646e
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/factory.py
.py
9ad5c3023d0a7b58
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/image_writer.py
.py
44f057d19b1036a5
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/online_buffer.py
.py
d249b0d221418e75
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/push_dataset_to_hub/utils.py
.py
4aa7b52060ffde82
7.59
14
#!/usr/bin/env python # Copyright 2024 The HuggingFace Inc. team. All rights reserved. # # 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 # # ...
hku-sail/StreamPI
lerobot/lerobot/common/datasets/transforms.py
.py
347e95d505e53973
7.59
14
from dataclasses import dataclass from lerobot.teleoperators.config import TeleoperatorConfig from .config_bi_pico4 import BiPico4Config @TeleoperatorConfig.register_subclass("bi_pico4_head") @dataclass class BiPico4HeadConfig(BiPico4Config): """Both Pico controllers for the arms plus the headset for an active ...
xensedyl/lerobot-teleoperator-pico4
lerobot_teleoperator_pico4/config_bi_pico4head.py
.py
833f637dc815fc40
7.56
12
"""Live verification of the harness four-gate discipline against a real model. Run: # GLM (default) ANTHROPIC_API_KEY=<key> .venv/Scripts/python.exe scripts/verify_harness_live.py # StepFun STEP_KEY=<key> CODERIO_PROVIDER=stepfun .venv/Scripts/python.exe scripts/verify_harness_live.py Proves against a...
Lion-1209/coderio
scripts/verify_harness_live.py
.py
f972c3094ecb1bdc
7.5
9
"""Compatibility layer for deepagents internal APIs. Centralizes all usage of deepagents internals (non-public APIs) so that: 1. There's a single file to update when deepagents changes its internals. 2. Version-specific breakage produces a clear error message instead of a cryptic AttributeError/ImportError deep in ...
Lion-1209/coderio
src/coderio/agent/_deepagents_compat.py
.py
fbaf9171324c3e08
7.5
9
"""Command-content review as a deepagents AgentMiddleware. Sits in the same middleware chain as PermissionMiddleware, AFTER it. While PermissionMiddleware decides based on TOOL TYPE + MODE (which tier), this middleware inspects the CONTENT of shell commands and network calls — blocking destructive patterns (``rm -rf /...
Lion-1209/coderio
src/coderio/agent/command_review.py
.py
1d2794b4a6bd87d9
7.5
9
"""Custom subagents: ``.coderio/agents/*.md`` (project) + ``~/.coderio/agents/*.md`` (user). A file's filename (minus .md) is the subagent NAME used via ``task(subagent_type="<name>")``; optional frontmatter ``description`` tells the MAIN model when to delegate; the body is the subagent's SYSTEM PROMPT. SECURITY MODE...
Lion-1209/coderio
src/coderio/agent/custom_agents.py
.py
7bfbc812dd229e00
7.5
9
"""Permission gate as a deepagents AgentMiddleware. Wraps coderio's PermissionGate (the 4-tier access system: plan/confirm/ auto_edit/full) so it runs BEFORE every tool execution inside a deepagents agent loop. No path translation or WorkspacePolicy — file path isolation is handled by deepagents' backend virtual_mode...
Lion-1209/coderio
src/coderio/agent/permission_middleware.py
.py
31278b27658ae2b8
7.5
9
from __future__ import annotations from dataclasses import dataclass, field from coderio.skills.store import SkillStore @dataclass class ActiveSkills: """Tracks currently-active skills for the session (spec §2.4).""" _active: dict = field(default_factory=dict) # name -> Skill def activate(self, skill...
Lion-1209/coderio
src/coderio/agent/prompts.py
.py
998cee95d36e3557
7.5
9
from __future__ import annotations from pydantic import BaseModel, Field from coderio.agent.prompts import ActiveSkills from coderio.skills.store import SkillStore class ActivateSkillArgs(BaseModel): name: str = Field(description="Name of the skill to activate.") class ActivateSkillTool: """Tool that acti...
Lion-1209/coderio
src/coderio/agent/skill_tool.py
.py
b1d3be9d8ada7367
7.5
9
"""Explicit agent state machine — observability for execution phases. Inspired by Step-Realtime-CLI's AgentStateMachine, but unlike theirs (which only RECORDS transitions for telemetry), this tracker derives phase from the harness's ground-truth signals (writes/verifications/todos) so the displayed phase reflects what...
Lion-1209/coderio
src/coderio/agent/state.py
.py
b7dce4193024f7c3
7.5
9
from __future__ import annotations from typing import Any, Protocol class StreamHandler(Protocol): """Abstract streaming UI. CLI/GUI implement these (spec §4.3).""" def on_step_start(self, step: int = 1) -> None: ... def on_token(self, text: str) -> None: ... def on_tool_start( self, ...
Lion-1209/coderio
src/coderio/agent/stream.py
.py
a13b40d7a8e6a83d
7.5
9
from __future__ import annotations from dataclasses import dataclass, field from coderio.cli.render import mask_key @dataclass(frozen=True) class SlashCommand: """A single slash command's metadata, for both help and autocomplete. ``completions`` lists the full strings the autocomplete should offer when the...
Lion-1209/coderio
src/coderio/cli/commands.py
.py
be7a123320946ed2
7.5
9
from __future__ import annotations import os import subprocess import sys import tomllib from pathlib import Path import tomli_w _DEFAULT = Path.home() / ".coderio" / "credentials" def _restrict_permissions(p: Path) -> None: """Restrict the credentials file to the current user only. POSIX: chmod 0600. Win...
Lion-1209/coderio
src/coderio/cli/credentials.py
.py
72ff06ac10ee1c3c
7.5
9
"""Custom slash commands: ``.coderio/commands/*.md`` (project) + ``~/.coderio/commands/*.md`` (user). A command file's filename (minus .md) is the command name — ``review.md`` defines ``/review``. Optional frontmatter carries a description for /help and autocomplete; the body is the PROMPT TEMPLATE sent to the model w...
Lion-1209/coderio
src/coderio/cli/custom_commands.py
.py
734f09aa540604c1
7.5
9
"""``coderio mcp`` subcommand implementations (add / list / remove). Manages MCP server entries in the Claude-Code-compatible ``.mcp.json`` files: - Project scope: ``{project}/.mcp.json`` (created if absent on add) - User scope: ``~/.coderio/mcp.json`` The config format is identical across both scopes (top-lev...
Lion-1209/coderio
src/coderio/cli/mcp_cmd.py
.py
cfb6baaa9e9cf3dc
7.5
9
"""Multimodal input helper: detect image paths in user text and encode them. When the user's REPL input references an image file (e.g. "分析一下 @screen.png" or a bare path "./photo.jpg"), this extracts the path, reads it as base64, and builds a multimodal content-block list suitable for Anthropic-protocol models (智谱 GLM ...
Lion-1209/coderio
src/coderio/cli/multimodal.py
.py
e0a5dab7e7758c96
7.5
9
from __future__ import annotations import tomllib from dataclasses import dataclass from pathlib import Path import tomli_w from coderio.cli.credentials import write_credentials from coderio.cli.providers import PROVIDERS, ProviderInfo _SKIP = "skip" @dataclass class OnboardingResult: provider_id: str mod...
Lion-1209/coderio
src/coderio/cli/onboarding.py
.py
b0dc7281f7084f5e
7.5
9
from __future__ import annotations import sys from pathlib import Path from typing import TYPE_CHECKING, Any from rich.console import Console from coderio.agent.prompts import ActiveSkills from coderio.cli.stream import RichStream from coderio.config import load_config from coderio.config.loader import _find_project...
Lion-1209/coderio
src/coderio/cli/repl.py
.py
1b72a85a039e4eb7
7.5
9
"""``coderio run`` — headless one-shot agent execution. Non-interactive counterpart to the TUI: same runtime (config, model, tools, skills, session), no Textual app. Purpose-built for CI, scripting, and benchmark harnesses (Terminal-Bench / Harbor agents call exactly this shape: give a task string, get the final resul...
Lion-1209/coderio
src/coderio/cli/run_cmd.py
.py
d8e5c59682dd84d3
7.5
9
"""TUI-based onboarding wizard — extracted from tui.py for modularity. Contains OnboardingScreen (multi-step ModalScreen for provider/model/key setup), _OnboardingApp (minimal App wrapper), and _run_onboarding_tui (entry point). All coderio dependencies are lazy imports inside methods, so this module has zero top-lev...
Lion-1209/coderio
src/coderio/cli/tui_onboarding.py
.py
65ba70e313fc09b7
7.5
9
"""TUI picker screens — extracted from tui.py for modularity. Contains the three modal picker screens used by the TUI: - ProfilePickerScreen: /profile (switch saved [[profiles]]) - ModePickerScreen: /mode with no argument (switch permission mode) - SessionPickerScreen: /resume (resume or delete recent session...
Lion-1209/coderio
src/coderio/cli/tui_screens.py
.py
1698548635a19b5d
7.5
9
"""TUI widgets — extracted from tui.py for modularity. Contains the popup slash-command menu (CommandMenu), the permission-confirmation menu (ConfirmMenu), and the live status bar (StatusBar) with its animated spinner + phase/timer display. These are self-contained widgets with no top-level coupling to the rest of cod...
Lion-1209/coderio
src/coderio/cli/tui_widgets.py
.py
a57eaa6b715c49eb
7.5
9
from __future__ import annotations import os import tomllib from dataclasses import replace from pathlib import Path from coderio.config.models import ( CliConfig, Config, ContextConfig, ModelConfig, Profile, SandboxFsConfig, SessionConfig, SkillsConfig, ToolsConfig, ) def _read_...
Lion-1209/coderio
src/coderio/config/loader.py
.py
25ddd9e6aa7d1edc
7.5
9
from __future__ import annotations from dataclasses import dataclass, field @dataclass class ModelConfig: default: str = "glm-4.5" provider: str = "openai_compatible" base_url: str = "https://open.bigmodel.cn/api/paas/v4" provider_id: str = "" max_output_tokens: int = 16384 # Context window s...
Lion-1209/coderio
src/coderio/config/models.py
.py
d0021b97b00db938
7.5
9
"""First-use trust confirmation for repository-level config files. SECURITY (2026-08-14 v2 audit, biggest remaining hole): the loader placed the REPOSITORY's ``.coderio/config.toml`` ABOVE the user config — a cloned malicious repo could set ``permission_mode = "full"``, point ``model.base_url`` at an attacker's endpoi...
Lion-1209/coderio
src/coderio/config/trust.py
.py
032ce76492c42f08
7.5
9
from __future__ import annotations import os from pathlib import Path from langchain_anthropic import ChatAnthropic from langchain_openai import ChatOpenAI from coderio.config import Config # Max SDK-level retries on transient failures (429 / 5xx / network). The OpenAI # client defaults to 2 and Anthropic to 2; bum...
Lion-1209/coderio
src/coderio/llm/factory.py
.py
8b36857ca496136e
7.5
9
"""Provider context-window discovery. On setup, we want to record the actual model's context window so the context- compaction threshold is accurate. coderio defaults to 200K (covers most modern models), but a model like step-3.7-flash (256K) would be mistreated as 200K, triggering compaction at 120K instead of 153K. ...
Lion-1209/coderio
src/coderio/llm/probe.py
.py
a2858094bd1c53aa
7.5
9
"""MCP (Model Context Protocol) tool loader. Reads Claude-Code-compatible ``.mcp.json`` config files, connects to the configured MCP servers via ``langchain-mcp-adapters``, and returns the tools as LangChain ``StructuredTool`` instances ready to pass to ``create_deep_agent``. Config format (identical to Claude Code's...
Lion-1209/coderio
src/coderio/mcp_loader.py
.py
c9acd35d2bd541aa
7.5
9
from __future__ import annotations import time from dataclasses import dataclass, field from typing import Any, Literal @dataclass class ToolCall: id: str name: str args: dict[str, Any] def to_dict(self) -> dict: return {"id": self.id, "name": self.name, "args": self.args} @classmethod ...
Lion-1209/coderio
src/coderio/session/message.py
.py
d7ae7c1e98c3d922
7.5
9
from __future__ import annotations import importlib.util import logging from dataclasses import dataclass, field from pathlib import Path _log = logging.getLogger(__name__) @dataclass class Skill: name: str description: str dir_path: Path source_layer: str = "" _body: str = "" _loaded: bool ...
Lion-1209/coderio
src/coderio/skills/models.py
.py
15e8b22ae06054a5
7.5
9
"""Read a dataset release on disk into a statement. A capture reads what is already there rather than producing it, so what ends up in the statement is what the release actually contains. Nothing here reaches a network, and nothing here guesses. Three things the caller has to supply, because the files cannot answer t...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/capture/dataset.py
.py
68cc921587936e03
7.5
9
"""Read a Foundry build into a Solidity release statement. Everything the predicate needs about the build is already on disk. `forge` writes solc's full standard-JSON input and output to `out/build-info/*.json`, which carries the compiler version, the optimiser settings, the EVM target and the source list, and one art...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/capture/foundry.py
.py
7f539a864c914c1e
7.5
9
"""Reading a directory of files without losing any of them quietly. Every capture that digests a directory needs the same three refusals, and the reason is the same one the gates exist for. `os.walk` does not descend a symlinked directory and swallows a directory it cannot read, so either would drop files from the sta...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/capture/tree.py
.py
3572dc571f3e2597
7.5
9
"""The block every predicate carries, whatever its artefact. Two lists. `claims` are the things that were checked, each naming the subject digest it covers and what happened to it. `commands` are the things that were run, each declaring whether its output has to match byte for byte on a replay. A dataset predicate an...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/core_predicate.py
.py
f53891fdd6f9dc62
7.5
9
"""Comparisons between two releases, each side named. Three kinds, because three things break differently. An ABI entry disappearing breaks a caller at compile time. A method identifier changing breaks one at run time, silently, which is worse. A storage slot moving breaks an upgrade, and breaks it after the transacti...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/deltas.py
.py
a5f7bcbd18fb0da4
7.5
9
"""Digest sets, and the rules for when two of them mean the same artefact. A statement's subject is a digest and nothing else, so every way of writing a digest loosely is a way of making a subject match something it should not. Uppercase hex, a truncated value, an empty set and a set carrying only a weak algorithm are...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/digests.py
.py
94d6720e58b7a20c
7.5
9
"""The DSSE envelope, read and written. A DSSE signature covers bytes, not an object. The consequence runs through this module: the payload decoded from an envelope is kept exactly as it arrived and never re-serialised before it is checked or shown. A verifier that re-encodes first is checking a document its signer ne...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/envelope.py
.py
1d56c77b00b483ad
7.5
9
"""The five core gates, run over any statement whatever its predicate. These are the part a bare in-toto statement does not carry. A statement can be well formed, correctly signed, and still say nothing a reader can rely on: a result attached to a branch rather than to bytes, a check that quietly vanished when it fail...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/gates.py
.py
5853b9027b773fd6
7.5
9
"""The Solidity release predicate: the first shape on the artefact-neutral core. Its subject is compiled bytecode. What it adds to the core block is the part that makes a contract release checkable rather than merely signed: which source produced the bytecode, under which compiler and settings, what the interface and ...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/predicates/solidity_release.py
.py
a1d006297c644715
7.5
9
"""The predicate registry: a type URI to the module that understands it. The registry is the reason the core can stay artefact-neutral. A predicate module owns its own field table and its own checks, and the core knows only how to find it and what to ask of it. Adding a predicate costs a module and a registration, whi...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/registry.py
.py
c342ccac60324436
7.5
9
"""Re-run the deterministic half of a statement, and say what it did not run. Gate 6 makes every command declare whether its output has to match byte for byte. The declaration earns its place only if something acts on it, which is what this does: the commands marked `exact` can be re-run and compared, and the ones mar...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/replay.py
.py
6d3b9d17a9a87dd3
7.5
9
"""JSON parsing for documents that arrived from somebody else. Three things the standard parser will do that a verifier should not. It will read a file of any size into memory. It will recurse until the stack gives out, which surfaces as a crash rather than a refusal. And it keeps the last value for a repeated key, so...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/safejson.py
.py
f85e323c6680b571
7.5
9
"""in-toto Statement v1, built and parsed. The structure is borrowed rather than invented: `_type`, `subject`, `predicateType`, `predicate`, exactly as in-toto defines them. What this module adds is refusal. A subject without a digest, a predicate type that is not a URI, or a predicate that is not an object are all th...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/statement.py
.py
4e1c33e50f809774
7.5
9
"""Verification: the core gates, the signature state, and what went unchecked. A report says three things. Whether each core gate held. What is known about the signatures, which is never that they were checked, because this tool does not check them. And which gates belong to a predicate this build does not know, so a ...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/ariadne/scripts/ariadne_lib/verify.py
.py
a434eb1dbbf328a6
7.5
9
"""Canonical JSON for digested documents. One spelling per document: sorted keys, compact separators, UTF-8 without escaping, no trailing newline. Floats are refused rather than serialised, because two runtimes disagree about their text long before they disagree about anything else, and a digest over disagreeing bytes...
wildcat-finance/skills
.agents/skills/promise-machine/runtime/plugins/berean/scripts/berean_lib/canonical.py
.py
dbc39034b0e5ec58
7.5
9
#!/usr/bin/env python3 """One-off cleanup of the event-storm instance backlog (JVNAUTOSCI-2507). Self-sustaining event cascades (paper_recommendation_evaluation_workflow and episode_evaluation_workflow re-trigger themselves via their own text_relation.* / relationship.* / workflow.instance_terminal bindings) left a la...
Strong-AI-Lab/Von
scripts/cleanup_event_storm_backlog.py
.py
7492d19470946172
7.54
11
"""Shared defaults for live Von test scripts. The JVNAUTOSCI-2070 launcher path keeps automated coding-agent tests on an isolated backend so they do not restart or reuse the user's interactive server. """ from __future__ import annotations import os from collections.abc import Mapping from typing import Any DEFAUL...
Strong-AI-Lab/Von
scripts/live_test_server_defaults.py
.py
4790c08e09deea5f
8.04
11
"""Manual end-to-end test for the todo_refresh workflow. Instantiates a real orchestrator with a real gateway and LLM client, then runs the todo_refresh workflow through execute_workflow(). Prerequisites: - MongoDB running (VON_DB_NAME defaults to test_von_db here for safety) - .env loaded (LLM API key, etc.) -...
Strong-AI-Lab/Von
scripts/manual_test_todo_refresh.py
.py
a122a5bac411f9d9
7.04
11
#!/usr/bin/env python3 """Email the nightly backend test drift result. JVNAUTOSCI-2656. A report nobody reads is decorative, and GitHub's default for a scheduled workflow is to mail whoever last edited the cron expression, which is an accident of authorship rather than a decision. This sends the result to a named reci...
Strong-AI-Lab/Von
scripts/notify_backend_test_drift.py
.py
10dfab6ffcb7daed
8.04
11
import pytest import numpy as np import torch from env_ssl_wrapper.action_transform_wrapper import ActionTransformWrapper from env_ssl_wrapper.mocks import GymnasiumMockEnv, GymnasiumDiscreteMockEnv, DMControlMockEnv, Space class MockEnv: def step(self, action): self.last_action = action return np...
lucidrains/env-ssl-wrapper
tests/test_action_transform.py
.py
9bac19d51db71a66
7.02
10
from __future__ import annotations import pytest import torch from torch import is_tensor import gymnasium as gym from env_ssl_wrapper import ImageObservationWrapper from env_ssl_wrapper.mocks import ( GymnasiumMockEnv, DMControlMockEnv, DMControlRoboticsMockEnv, PyBulletMockEnv, RobosuiteMockEnv,...
lucidrains/env-ssl-wrapper
tests/test_image_wrapper.py
.py
efc4ff72d37dd47d
7.02
10
from __future__ import annotations import numpy as np import torch from torch import is_tensor import gymnasium as gym from env_ssl_wrapper.tensor_wrapper import TensorWrapper # tests def test_tensor_wrapper(): env = gym.make('CartPole-v1') device = 'cpu' env = TensorWrapper(env, device = device) ob...
lucidrains/env-ssl-wrapper
tests/test_tensor_wrapper.py
.py
82989ec171eb7c11
7.02
10
""" BT1295 — The q=3 Master Identity Collects ALL faces of q=3 discovered across the W33-Theory commit history into a single substrate-fixed master identity. The central claim: q=3 is NOT chosen. It is the UNIQUE integer satisfying all of the following simultaneously: (A) Spectral-action condition: (q-3)(3q-1) = 0...
wilcompute/W33-Theory
BT1295_q3_master_identity.py
.py
648641676aae6d57
7.5
9
#!/usr/bin/env python3 """ BT1643: CSS Code Complex Boundary = Genus-21 Surface Theorem: The 2-skeleton of the W(3,3) line complex is a topological surface of genus 21, and the CSS code [[240, 160, 4, 3]]_3 built on this complex is a topological quantum code — a qutrit analogue of Kitaev's toric code (toric code lives...
wilcompute/W33-Theory
BT1643_css_boundary_genus21.py
.py
8c2e8c3a7991ab3d
7.5
9
#!/usr/bin/env python3 """ EDGE LENGTH DEEP PATTERNS: 7 Realizations (5 Csász + 2 Szilassi) Full verification suite for all theorems A-G """ import math, itertools from collections import Counter from math import gcd from functools import reduce import numpy as np # W(3,3) parameters q,r,k,v = 3,2,12,40 E1,g1,g2,Phi6 ...
wilcompute/W33-Theory
EDGE_LENGTH_ANALYSIS.py
.py
42c376c3101e98dc
7.5
9
""" GitHub 用户偏好获取 获取用户的 Star、仓库、关注等数据用于个性化推荐 """ import requests from typing import Optional import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import UserProfile class GitHubProfileFetcher: """GitHub 用户偏好获取器""" BASE_URL = "https://api.github.c...
kkkano/tech-digest-daily
src/ai/github_profile.py
.py
6dbb72e0d738db01
7.5
9
""" LLM API 客户端 支持多模型自动重试和故障转移 """ import json import time import requests from typing import Optional import os class LLMClient: """LLM API 客户端 - 支持多模型重试""" DEFAULT_API_URL = "https://x666.me/v1/chat/completions" # 模型优先级列表(按顺序尝试) MODEL_PRIORITY = [ "claude-opus-4-5-thinking", "gpt-...
kkkano/tech-digest-daily
src/ai/llm_client.py
.py
5b51618a16393e22
7.5
9
""" AI 智能总结生成器 根据用户偏好 + 热度综合分析,生成个性化的技术日报总结 """ import json from typing import Optional import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem, SourceResult, AISummary, UserProfile, SourceType from ai.llm_client import LLMClient from ai.github...
kkkano/tech-digest-daily
src/ai/summarizer.py
.py
b26d52846a230a4d
7.5
9
""" 日志系统 - 结构化日志支持 支持控制台彩色输出 + 文件日志 """ import logging import sys from datetime import datetime from typing import Optional class ColoredFormatter(logging.Formatter): """带颜色的控制台日志格式化器""" # ANSI 颜色码 COLORS = { 'DEBUG': '\033[36m', # 青色 'INFO': '\033[32m', # 绿色 'WARNING'...
kkkano/tech-digest-daily
src/core/logger.py
.py
987286ddaa86ac5b
7.5
9
""" 历史去重器 持久化存储已发送的内容,避免重复推送 """ import json import os from datetime import datetime, timedelta from pathlib import Path from typing import Optional import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem class HistoryDedup: """历史去重器(持久化)""" D...
kkkano/tech-digest-daily
src/dedup/history.py
.py
83a6a29e494dc3de
7.5
9
""" 内存去重器 用于同一封邮件内的去重 """ import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem class MemoryDedup: """内存去重器""" def __init__(self): self._seen_ids: set[str] = set() self._seen_urls: set[str] = set() self._see...
kkkano/tech-digest-daily
src/dedup/memory.py
.py
b43ea01d1e9f985f
7.5
9
""" 邮件发送模块 支持多种免费邮件服务:Resend、Gmail SMTP 支持新的多源邮件模板和旧的单源模板(向后兼容) """ import os import smtplib from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from datetime import datetime from typing import Optional, Union import requests # 向后兼容:支持旧的 TrendingRepo try: from trending import Trend...
kkkano/tech-digest-daily
src/email_sender.py
.py
32234103953c90d2
7.5
9
""" Tech Digest Daily - 主程序 多源技术资讯聚合 + AI 智能总结 """ import os import sys from datetime import datetime from concurrent.futures import ThreadPoolExecutor, as_completed # 数据模型 from models import SourceResult, AISummary # 数据源 from sources.github_trending import GitHubTrendingSource from sources.hackernews import HackerN...
kkkano/tech-digest-daily
src/main.py
.py
34abe725f3783be7
7.5
9
""" 统一数据模型 定义所有数据源共用的数据结构 """ from dataclasses import dataclass, field from typing import Optional from datetime import datetime from enum import Enum import hashlib class SourceType(Enum): """数据源类型""" GITHUB = "github" HACKERNEWS = "hackernews" PRODUCTHUNT = "producthunt" DEVTO = "devto" class...
kkkano/tech-digest-daily
src/models.py
.py
a953d72196fd12fc
7.5
9
""" 数据源基类 定义所有数据源必须实现的接口 """ from abc import ABC, abstractmethod from typing import Optional import sys import os # 添加父目录到路径 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem, SourceType, SourceResult class BaseSource(ABC): """数据源抽象基类""" @property ...
kkkano/tech-digest-daily
src/sources/base.py
.py
99e59c0f8a7dd779
7.5
9
""" 深度信息获取器 进入仓库/文章详情页获取更丰富的信息 """ import requests from typing import Optional from concurrent.futures import ThreadPoolExecutor, as_completed import base64 import re import os class DepthFetcher: """深度信息获取器""" GITHUB_API = "https://api.github.com" def __init__(self, github_token: Optional[str] = None)...
kkkano/tech-digest-daily
src/sources/depth_fetcher.py
.py
48c4119bd97acd56
7.5
9
""" Dev.to 数据源 使用 Dev.to 公开 API 获取热门文章 """ import requests from typing import Optional from datetime import datetime import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem, SourceType, SourceResult from sources.base import BaseSource from tran...
kkkano/tech-digest-daily
src/sources/devto.py
.py
3dad897097d4eb93
7.5
9
""" GitHub Trending 数据源 爬取 GitHub Trending 页面获取热门项目 """ import requests from bs4 import BeautifulSoup from typing import Optional import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem, SourceType, SourceResult from sources.base import BaseSou...
kkkano/tech-digest-daily
src/sources/github_trending.py
.py
52c1ecfdda1520d5
7.5
9
""" Hacker News 数据源 使用官方 Firebase API 获取热门文章 """ import requests from concurrent.futures import ThreadPoolExecutor, as_completed from typing import Optional import sys import os sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from models import NewsItem, SourceType, SourceResult from ...
kkkano/tech-digest-daily
src/sources/hackernews.py
.py
758fb07e744b38ca
7.5
9
""" Product Hunt 数据源 使用 RSS Feed 获取每日新品(更稳定) """ import requests import xml.etree.ElementTree as ET from bs4 import BeautifulSoup from typing import Optional import sys import os import re from datetime import datetime, timedelta sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from mo...
kkkano/tech-digest-daily
src/sources/producthunt.py
.py
5b128c66c21e42b2
7.5
9
""" 翻译模块 使用 Google Translate 免费 API 将文本翻译为中文 """ import requests from typing import Optional import time def translate_to_chinese(text: str, max_retries: int = 3) -> str: """ 将文本翻译为中文 Args: text: 要翻译的文本 max_retries: 最大重试次数 Returns: 翻译后的中文文本,失败则返回原文 """ if not text or...
kkkano/tech-digest-daily
src/translator.py
.py
c8d03dc921679a31
7.5
9
""" GitHub Trending 爬取模块 获取每日热门项目,包含链接、封面图、简介 """ import requests from bs4 import BeautifulSoup from dataclasses import dataclass from typing import Optional import re @dataclass class TrendingRepo: """趋势项目数据结构""" rank: int name: str # owner/repo url: str description: str description_cn: str...
kkkano/tech-digest-daily
src/trending.py
.py
4e0bd9d013983b2a
7.5
9
#!/usr/bin/env python3 """ Intelligent build script that automatically resolves workspace dependencies and builds packages in the correct order using topological sort. """ import subprocess import sys from pathlib import Path from typing import Dict, List, Set if sys.version_info < (3, 11): print("Error: This scr...
Datus-ai/datus-db-adapters
build_all.py
.py
02094e83fab94861
7.52
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. # See http://www.apache.org/licenses/LICENSE-2.0 for details. from typing import Any, Optional from pydantic import BaseModel, ConfigDict, Field, Secret, SecretStr, field_validator, model_validator class BigQueryConfig(BaseMode...
Datus-ai/datus-db-adapters
datus-bigquery/datus_bigquery/config.py
.py
1aa9282107984a70
7.52
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. """Credential-free Agent integration hooks for BigQuery.""" from typing import Any, Dict, Tuple from urllib.parse import quote, unquote, urlencode, urlparse def _clean(value: Any) -> str: if value is None: return ""...
Datus-ai/datus-db-adapters
datus-bigquery/datus_bigquery/handlers.py
.py
1393c619f8556aed
7.52
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. """BigQuery SQL skill discovery and legacy Agent notes hook.""" from pathlib import Path _SKILLS_DIR = Path(__file__).resolve().parent / "skills" _BIGQUERY_SQL_SKILL = _SKILLS_DIR / "db-bigquery-sql" / "SKILL.md" def get_skill...
Datus-ai/datus-db-adapters
datus-bigquery/datus_bigquery/skills.py
.py
b53aa2e0b6146322
7.52
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. # See http://www.apache.org/licenses/LICENSE-2.0 for details. import json import os from typing import Generator import pytest from datus_bigquery import BigQueryConfig, BigQueryConnector @pytest.fixture def config() -> BigQue...
Datus-ai/datus-db-adapters
datus-bigquery/tests/integration/conftest.py
.py
6d85971cf92f6dc0
8.02
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. # See http://www.apache.org/licenses/LICENSE-2.0 for details. import uuid import pytest from datus_bigquery import BigQueryConfig, BigQueryConnector from datus_db_core.testing.contract import assert_success # ==================...
Datus-ai/datus-db-adapters
datus-bigquery/tests/integration/test_integration.py
.py
76b2ecc4cf2a74d8
7.02
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. # See http://www.apache.org/licenses/LICENSE-2.0 for details. """URI builder and context resolver for ClickHouse.""" from typing import Optional, Tuple, Union from sqlalchemy.engine.url import URL, make_url def _clean_str(valu...
Datus-ai/datus-db-adapters
datus-clickhouse/datus_clickhouse/handlers.py
.py
24b85a15f311787b
7.52
10
# Copyright 2025-present DatusAI, Inc. # Licensed under the Apache License, Version 2.0. # See http://www.apache.org/licenses/LICENSE-2.0 for details. def pytest_configure(config): """Configure custom markers.""" config.addinivalue_line( "markers", "integration: marks tests as integration test...
Datus-ai/datus-db-adapters
datus-clickhouse/tests/conftest.py
.py
0ad5da1cbb06fb73
7.02
10
"""Old spellings of moved documents, derived from `formerly:` (ADR-040). A migrated document carries its past in its own frontmatter: formerly: - DP-4 That field is the *only* persistent bookkeeping a migration leaves in the record — config describes the present, documents carry their pasts — and this module...
dmarx/luria
luria/aliases.py
.py
d9bf78fc29a2f3bd
7.64
18
#!/usr/bin/env python3 """Two numbers about the record, rendered as badges in the README. This is a library: `luria index` rewrites the region with everything else and `luria lint` checks it. The `luria badges` command was retired (ADR-030) — its normal use had become printing a warning that `luria index` is what you ...
dmarx/luria
luria/badges.py
.py
f589a07a8f729e96
7.64
18
#!/usr/bin/env python3 """Whether this is a build, and what that changes about what luria says. A generated view is a **committed artifact**. Who commits it is open: the author can regenerate and commit, or a generation job can run the generator and push what it wrote — the second is usually better, since a view a hum...
dmarx/luria
luria/ci.py
.py
b901269277c1f6c8
7.64
18
#!/usr/bin/env python3 """The BibTeX entry in the README, derived from `CITATION.cff`. Two places want the same facts. GitHub reads `CITATION.cff` and renders a "Cite this repository" button from it; a reader of the README wants a block they can paste. Writing both by hand is the drift DP-3 names — and a citation is a...
dmarx/luria
luria/citation.py
.py
f6c7d2284f69569d
7.64
18
"""`luria` — one entry point for the whole record, driven by Fire (ADR-039). luria lint check the record; the only command that can fail luria link [--fix] rewrite bare references as hyperlinks luria index regenerate every generated view, badges included luria new [kind] scaffold a...
dmarx/luria
luria/cli.py
.py
d6db6a79d32fc536
7.64
18
#!/usr/bin/env python3 """Fragment collection — assembling a narrative view from per-contribution files. A single long file that every substantial contribution appends to is a reliable merge-conflict generator: two branches that touch nothing else in common still collide at the bottom of it, and so does every rebase o...
dmarx/luria
luria/collect.py
.py
1ebed78e44bbed06
7.64
18
#!/usr/bin/env python3 """`luria concretize` — assign real numbers to temporary codes (ADR-049). luria concretize # rename, rewrite, alias, regenerate luria concretize --check # exit 1 naming any temporary code; no writes A merge-allocated scheme's documents arrive from their branches under temp...
dmarx/luria
luria/concretize.py
.py
da7fad56e6bbe6c5
7.64
18
#!/usr/bin/env python3 """The configuration reference, rendered from the config schema itself. luria index # → <docs>/configuration.md, in Luria's own tree It renders only where `luria/config.py` is a file the reader can open — see `Config.owns_schema` (ADR-059). An adopting project gets `record.m...
dmarx/luria
luria/config_doc.py
.py
61eb632afa9d0ddf
7.64
18
"""Relative link targets, checked from where the prose renders. A markdown link written in record prose is followed from the page it *lands on*, not the file it was typed in. A journal entry lives in `record/reading.d/2026/08/16/` and renders into `docs/reading/2026-08-16.md`; those are five directories apart, so the ...
dmarx/luria
luria/link_targets.py
.py
702ebffb5bad6731
7.64
18
#!/usr/bin/env python3 """Titles that claim to transfer, checked against the project's own nouns. A decision is *about* something specific, and naming that thing in its title is correct. A **principle** is the opposite: one stated about the artifact it was first noticed on is one nobody applies to the next artifact. T...
dmarx/luria
luria/narrow_titles.py
.py
3a0f1cb111d29315
7.64
18