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 """Demo session gateway — single process on $PORT (8765). Status: verified 2026-07-13 — this exact file runs the nav-trial live demo on robium.ai (Cloud Run service demo-nav-trial). Adapt FLEET_BUDGET and the CORS origin for your deployment. Routes: * WebSocket upgrade (any path) -> raw byte...
robium-ai/robium
archive/live-demo/1.1.1/examples/demo_gateway.py
.py
2ee4d74f6171cd31
7.48
8
# status: unverified # source: https://github.com/ros2/ros2_documentation/blob/rolling/source/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Py-Publisher-And-Subscriber.rst # (rclpy Node/Publisher/Timer pattern, including the current # `with rclpy.init(): ...` + ExternalShutdownException idiom — t...
robium-ai/robium
archive/ros2/1.0.0/examples/package-ament-python/ros2_example_pkg/talker_node.py
.py
19e7f6a63f2c2f39
7.48
8
"""Shared helpers for github-explore skill scripts. All scripts in this directory import from _lib. Keep the surface small. """ from __future__ import annotations import json import os import re import subprocess import sys from dataclasses import dataclass from datetime import datetime, timedelta from typing import ...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/_lib.py
.py
c14f49a0212ad226
7.42
6
#!/usr/bin/env python3 """gh-discover: given a keyword, expand into related topics and find top repos in each. Strategy: 1. Search repos matching the seed keyword. 2. Aggregate topics from the top results. 3. For each top topic, run a topic-scoped repo search. 4. Dedupe, score, group output by topic. Examples...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/discover.py
.py
66393bd95c056930
7.42
6
#!/usr/bin/env python3 """gh-find-repos: comprehensive repository search with smart filters. By default, multi-word free-text queries are wrapped with `in:readme` for much better conceptual recall (e.g. "self-hosted sso" → finds zitadel, goauthentik/authentik instead of unrelated trip-planner repos). This auto-wrappin...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/find_repos.py
.py
05ef2bf8cf8d7c22
7.42
6
#!/usr/bin/env python3 """gh-find-similar: find repositories similar to a given one. Strategy: 1. Get source repo's topics and primary language. 2. Search for repos matching the same topics. 3. Filter to same language, similar star tier, exclude forks/archived/self. 4. Rank by topic overlap + star proximity. ...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/find_similar.py
.py
d6f51a7b2900a518
7.42
6
#!/usr/bin/env python3 """gh-org-landscape: scan an entire GitHub org and group repos by status/topic. Examples: python org_landscape.py vercel --group-by language python org_landscape.py langchain-ai --group-by activity --include-archived python org_landscape.py microsoft --group-by topic --min-stars 100 --form...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/org_landscape.py
.py
e9eac95f9592df85
7.42
6
#!/usr/bin/env python3 """Stdin-to-stdout credential redactor. Use when piping raw `gh` command output (stderr merged via `2>&1`) into the agent transcript: gh <cmd> 2>&1 | python scripts/redact_stderr.py The agent runs `gh` directly via the Bash tool, so the Python wrapper in _lib is not on the path for those c...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/redact_stderr.py
.py
0acdaad6e7907ddf
7.42
6
"""Shared test fixtures for the github-explore test suite. Importing from this module keeps fake subprocess results in one place, so the shape of `subprocess.CompletedProcess` is defined exactly once. """ from __future__ import annotations class FakeProc: """Minimal stand-in for `subprocess.CompletedProcess` in ...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/tests/_fixtures.py
.py
d6724371b0f5bb6a
7.92
6
"""Review point 2 (post-fix): raw `gh` command stderr piped through scripts/redact_stderr.py is redacted before reaching the agent transcript. """ import io import os import subprocess import sys import unittest HERE = os.path.dirname(os.path.abspath(__file__)) SCRIPTS = os.path.dirname(HERE) sys.path.insert(0, SCRIPT...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/github-explore/skills/github-explore/scripts/tests/test_redact_stderr.py
.py
0bd4e06d44683104
7.92
6
"""Shared test fixtures for the searxng-search test suite.""" from __future__ import annotations import urllib.error class FakeResponse: """Minimal stand-in for the context manager returned by `urlopen`.""" def __init__(self, body: bytes = b"", status: int = 200) -> None: self._body = body s...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/searxng-search/skills/searxng-search/scripts/tests/_fixtures.py
.py
49e3e68ac6c173ae
7.92
6
"""Review point 4: on error, sensitive info that leaked into stderr is masked. `redact_secrets` covers 5 credential shapes. `die` and `warn` route through it before printing. We also assert the `Authorization: Basic` header value is masked in error output. P1 review round 2 (point 3): the exact-secret registry (`regi...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/searxng-search/skills/searxng-search/scripts/tests/test_redaction.py
.py
e624604ba072cd26
7.92
6
"""Review point 4: the configured `timeout` is passed through to the HTTP opener. We mock `_build_opener` (returns an opener whose `.open` is the call we inspect) so the timeout kwarg is observable. """ import os import sys import unittest from unittest import mock sys.path.insert(0, os.path.dirname(os.path.dirname(os...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Fectivnfy112357/searxng-search/skills/searxng-search/scripts/tests/test_timeout.py
.py
fb8f23820afc9f67
7.92
6
#!/usr/bin/env python3 """Parse Refworks/EndNote-style tagged exports (CNKI, Wanfang) to PaperDocument JSON. Reads a .txt file of tagged records (one tag per line, e.g. "RT Journal Article", "T1 Some title") and prints a JSON array of PaperDocuments: {id, title, authors, year, venue, doi, url, abstract, source, retrie...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/cn-literature/scripts/parse_refworks.py
.py
877ff2aba391e91e
7.42
6
#!/usr/bin/env python3 """Search the Wanfang Open Platform API and print PaperDocument JSON. Credential comes from WANFANG_TOKEN; when missing, a structured auth_missing error is printed instead of a traceback. Endpoint layout and response fields follow the official docs (api.wanfangdata.com.cn); if the upstream API c...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/cn-literature/scripts/wanfang_search.py
.py
4fecde6293d956ff
7.42
6
#!/usr/bin/env python3 """Build an ASCII epidemic curve and summary stats from a case linelist CSV. Pure stdlib. The linelist must contain an onset-date column (default `onset_date`); an optional case-type column (default `case_type`) is used for stratified counts. With --group-by and --population it also prints an at...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/outbreak-analysis/scripts/epi_curve.py
.py
f1eecf15e08d634d
7.42
6
#!/usr/bin/env python3 """Search academic paper APIs and print unified PaperDocument JSON. Providers: OpenAlex, Crossref, arXiv. On success prints a JSON array of PaperDocuments; on failure prints one structured error object instead of a traceback, so the calling agent can record it in a search manifest. """ import a...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/paper-search/scripts/search_papers.py
.py
739b27e2a2cdebbf
7.42
6
#!/usr/bin/env python3 """Append one provenance entry to .openscience/provenance.jsonl. Records what was produced, by which tool, in which environment. Pure standard library; safe to run from any project root. """ import argparse import hashlib import json import platform import sys from datetime import datetime, tim...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/provenance-record/scripts/record_run.py
.py
860c86d7300df031
7.42
6
#!/usr/bin/env python3 """Integrate SIR/SEIR compartment models with a hand-written RK4 solver. Pure stdlib. Prints the daily time series of S/E/I/R plus the peak infectious day and count, as JSON or CSV. These are deterministic scenario projections, not forecasts; always report parameters with them. """ import argpa...
MiniMax-AI/MiniMax-Code-Plugins
plugins/Hylouis233/openscience/skills/seir-modeling/scripts/seir.py
.py
5b61144f77f5209d
7.42
6
"""Verify built distributions before they are smoke-tested or published. Enforces the distribution contract against the artifacts that will actually be uploaded, rather than against the sources they came from: - the distribution directory holds exactly one wheel and one sdist per allowlisted package and nothing els...
delbem-research/damicore
.github/scripts/verify_dist.py
.py
69ab4d6d6bdc81b6
7.42
6
"""Smoke an environment built only from wheels. Runs under the target interpreter of a clean virtual environment, so it may import nothing beyond the standard library and the installed ``damicore`` distributions. It never imports from the checkout: the only thing this file contributes is the check itself. ``--package...
delbem-research/damicore
.github/scripts/wheel_smoke.py
.py
26b441eb30d1683d
7.42
6
from __future__ import annotations import os from typing import Literal from pydantic import BaseModel, ConfigDict, Field, field_validator class ResourceLimits(BaseModel): """The gates preflight applies before a run starts, sized for the exact 0.2 algorithm. Raise one only after reading an ``estimate()``: ...
delbem-research/damicore
packages/damicore/src/damicore/config.py
.py
3ccc52c673cd1251
7.42
6
from __future__ import annotations import re def _default_code(name: str) -> str: words = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", name) return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", words).lower() class DamicoreError(Exception): """Base class of every public DAMICORE failure, and the only one worth catch...
delbem-research/damicore
packages/damicore/src/damicore/errors.py
.py
a116e68f99263a2e
7.42
6
from __future__ import annotations import logging import platform import time import zlib from datetime import UTC, datetime from importlib.metadata import PackageNotFoundError, version from pathlib import Path from typing import Any from damicore.errors import ArtifactValidationError, CheckpointMismatchError from da...
delbem-research/damicore
packages/damicore/src/damicore/pipeline.py
.py
8e1382408993e8ab
7.42
6
from __future__ import annotations import hashlib import os import tempfile from dataclasses import dataclass from pathlib import Path, PurePosixPath from typing import Literal import pandas as pd from damicore_distance import DistanceMatrixView from pydantic import BaseModel, ConfigDict, Field, ValidationError from...
delbem-research/damicore
packages/damicore/src/damicore/result.py
.py
393384515b2f0449
7.42
6
import json import os import subprocess import sys from importlib import metadata from pathlib import Path from typing import Any, cast import pytest from damicore import DamicoreResult from damicore.cli import _parser, main pytestmark = pytest.mark.unit def _csv(tmp_path: Path) -> Path: path = tmp_path / "inp...
delbem-research/damicore
packages/damicore/tests/test_cli.py
.py
bd8f02161aea86d4
7.92
6
"""Guards that back the public contracts: the CLI exit-status table, the configuration bounds, the preflight input checks, and the manifest's own narrowing helpers.""" import json import os from importlib import import_module from pathlib import Path import pytest from damicore_normalizer import NormalizerError from...
delbem-research/damicore
packages/damicore/tests/test_contract_guards.py
.py
f4d34af00de0f959
7.92
6
"""The public failure contract, which this module is the source of truth for. One rule holds for every public exception: ``code`` is the class name in snake_case, and ``input_drift`` is the version 0.2 exception to it. That rule is what callers and the CLI's JSON error envelope depend on, so it is asserted here as a r...
delbem-research/damicore
packages/damicore/tests/test_error_contract.py
.py
9959d46f0b1ee9e8
7.92
6
"""The source axis as the orchestrator exposes it: run, estimate, run identity, and the CLI. The stage suites prove what each source produces. What is proved here is that the choice of source reaches every surface that depends on it -- the resource projection, the run manifest, the configuration hash that names a run ...
delbem-research/damicore
packages/damicore/tests/test_object_sources.py
.py
796b4683bcb34523
7.92
6
import csv import json import os from collections.abc import Callable from pathlib import Path from typing import IO, Any, cast import pytest from pydantic import ValidationError import damicore_clusterizer.api as api import damicore_clusterizer.artifacts as artifacts import damicore_clusterizer.tree_graph as tree_gr...
delbem-research/damicore
packages/damicore_clusterizer/tests/test_clusterizer.py
.py
a71ee9c14fbd4d88
7.92
6
from __future__ import annotations class DistanceError(Exception): """Base error raised by the standalone distance package. ``code`` is the stable machine-readable identifier a caller branches on, and it is part of this package's contract rather than a message detail: the orchestrator keys its own public...
delbem-research/damicore
packages/damicore_distance/src/damicore_distance/errors.py
.py
9129fb6a0c946918
7.42
6
from __future__ import annotations from collections.abc import Callable from pathlib import Path from typing import TYPE_CHECKING, Any import numpy as np from pydantic import BaseModel, ConfigDict, Field from damicore_distance.errors import DistanceError if TYPE_CHECKING: import pandas as pd # pandas backs onl...
delbem-research/damicore
packages/damicore_distance/src/damicore_distance/matrix.py
.py
2df50062d1aecacd
7.42
6
"""Hypothesis properties for the compressor and the NCD matrix. The example-based suite in ``test_distance.py`` pins named scenarios. These properties cover the two things a fixed example cannot: that the streaming, chunked, file-backed compressor agrees with a direct in-memory one for arbitrary payloads and chunk bou...
delbem-research/damicore
packages/damicore_distance/tests/test_ncd_properties.py
.py
0d82119cef1216db
7.92
6
from __future__ import annotations import hashlib import json import os import tempfile from collections.abc import Sequence from pathlib import Path from typing import cast from damicore_normalizer.config import ( DelimitedSource, FileCorpusSource, NormalizationConfig, SpreadsheetSource, ) from damic...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/api.py
.py
24548be3811d3d8a
7.42
6
from __future__ import annotations import codecs from typing import Annotated, Literal from pydantic import BaseModel, ConfigDict, Field, field_validator class DelimitedSource(BaseModel): """Split one delimited-text file. Any single character is a delimiter, so `.csv`, `.tsv`, and `.txt` are the same source...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/config.py
.py
62d7f2d455beff07
7.42
6
from __future__ import annotations import codecs import csv from collections.abc import Generator, Iterator from contextlib import contextmanager from pathlib import Path import pandas as pd from damicore_normalizer.config import DelimitedSource from damicore_normalizer.errors import NormalizerError from damicore_no...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/delimited_reader.py
.py
089d8c04c1e99cdb
7.42
6
from __future__ import annotations class NormalizerError(Exception): """Base error raised by the standalone normalizer package. ``code`` is the stable machine-readable identifier a caller branches on; the orchestrator maps it onto its own public class, so it is part of this package's contract rather than...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/errors.py
.py
d4ca613a717802c1
7.42
6
from __future__ import annotations import hashlib import json import os import shutil from collections.abc import Iterable, Sequence from dataclasses import dataclass from pathlib import Path from damicore_normalizer.config import FileCorpusSource from damicore_normalizer.errors import NormalizerError from damicore_n...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/file_corpus.py
.py
d824e8513b6ff074
7.42
6
from __future__ import annotations from pathlib import Path from typing import Annotated, Literal, Self from pydantic import BaseModel, ConfigDict, Field, field_validator, model_validator class ObjectDescriptor(BaseModel): model_config = ConfigDict(frozen=True, extra="forbid", strict=True) object_id: str ...
delbem-research/damicore
packages/damicore_normalizer/src/damicore_normalizer/manifest.py
.py
b22d402d77fb54c2
7.42
6
#!/usr/bin/env python """Workspace > Scripts > Resolve AI Bridge > Bridge Status. Prints what the bridge sees right now, without changing anything. Use this first whenever an AI client says Resolve is offline. """ import json import os import time HOME = os.path.expanduser( os.environ.get("RESOLVE_AI_BRIDGE_HOME...
flamexnreal/davinci-resolve-ai-bridge-mcp
agent/menu/Bridge Status.py
.py
5e99da18049c7ea0
7.62
16
#!/usr/bin/env python """Workspace > Scripts > Resolve AI Bridge > Start AI Bridge. Copies the activation command to clipboard and explains the Py3 step. """ import os import subprocess import sys HOME = os.path.expanduser( os.environ.get("RESOLVE_AI_BRIDGE_HOME", "~/.resolve-ai-bridge") ) PORTABLE_CMD = ( '...
flamexnreal/davinci-resolve-ai-bridge-mcp
agent/menu/Start AI Bridge.py
.py
8e90916edc4260f2
7.62
16
"""Audio analysis and digital signal processing utilities for DaVinci Resolve AI Bridge.""" import math import os import shutil import struct import subprocess import tempfile import wave from pathlib import Path from typing import Any, Dict, List, Optional, Tuple def get_audio_temp_dir() -> Path: """Return a te...
flamexnreal/davinci-resolve-ai-bridge-mcp
bridge/audio_analysis.py
.py
324bca45a6a7bcf8
7.62
16
"""Direct attach transport: talk to DaVinci Resolve without a Console worker. Resolve ships a native module (``fusionscript``) that lets a normal Python process obtain the same API object the internal Console gets. When that works, Resolve AI Bridge needs nothing pasted or clicked: open Resolve and the MCP tools are l...
flamexnreal/davinci-resolve-ai-bridge-mcp
bridge/direct.py
.py
733dde77eaa6a401
7.62
16
"""Frame capture and image utilities for DaVinci Resolve AI Bridge.""" import base64 import os import shutil import subprocess import tempfile import time from pathlib import Path from typing import Any, Dict, Optional, Tuple def get_capture_dir() -> Path: """Return a temporary directory for frame dumps.""" ...
flamexnreal/davinci-resolve-ai-bridge-mcp
bridge/frame_capture.py
.py
3abe8097ad1ea03e
7.62
16
"""Pick the best available route into DaVinci Resolve. Two transports exist and they behave identically from the MCP server's point of view: ``direct`` The MCP process attaches to a running Resolve through Blackmagic's native scripting library. Nothing has to be pasted or clicked. This is the default when...
flamexnreal/davinci-resolve-ai-bridge-mcp
bridge/transport.py
.py
ddb1de37a1c3186a
7.62
16
#!/usr/bin/env python3 """ backfill_links.py - Backfill paper note links to recommendation file. This script is part of daily-papers-notes (Step 3). Usage: python3 backfill_links.py --recommendation YYYY-MM-DD-论文推荐.md python3 backfill_links.py --recommendation YYYY-MM-DD-论文推荐.md --notes-dir 论文笔记 The script: ...
jing1tian/DailyPapers
.claude/skills/daily-papers-notes/backfill_links.py
.py
ec6c62014dca9faa
7.52
10
#!/usr/bin/env python3 """ update_history.py - Update the recommendation history file. This script is part of daily-papers-review (Phase 6). Usage: python3 update_history.py --arxiv-ids ID1 ID2 ... --date YYYY-MM-DD python3 update_history.py --from-enriched /tmp/daily_papers_enriched.json --date YYYY-MM-DD ...
jing1tian/DailyPapers
.claude/skills/daily-papers-review/update_history.py
.py
19166712846575fa
7.52
10
#!/usr/bin/env python3 """Selectively download unreachable images in Obsidian markdown notes. Usage: python3 download_note_images.py <note.md> For each external image link ![...](https://...): - Reachable (HTTP 200 within 10s) → keep as-is - Unreachable → download to assets/ and replace with Obsidian wikilink...
jing1tian/DailyPapers
.claude/skills/daily-papers/download_note_images.py
.py
738ed6bed7934da1
7.52
10
#!/usr/bin/env python3 """Extract affiliations from PDF text (pdftotext -l 2 output via stdin). Usage: curl -sL "https://arxiv.org/pdf/{arxiv_id}" | pdftotext -l 2 - - | python3 extract_affiliations.py Output: {"affiliations": ["Tsinghua University", "UC Berkeley"]} """ import json import re import sys # ──...
jing1tian/DailyPapers
.claude/skills/daily-papers/extract_affiliations.py
.py
8cddc87deed964a1
7.52
10
#!/usr/bin/env python3 """ 论文笔记自动分类工具 根据论文 tags 和内容自动分类到对应目录,并同步更新 Zotero 分类 """ import os import csv import re import sys import shutil import sqlite3 from pathlib import Path from typing import Any, Optional, Dict, List _SHARED_DIR = Path(__file__).resolve().parents[2] / "_shared" if str(_SHARED_DIR) not in sys.pat...
jing1tian/DailyPapers
.claude/skills/paper-reader/assets/reorganize_notes.py
.py
00bd26098cd5b11f
7.52
10
#!/usr/bin/env python3 """ Zotero 数据库查询辅助脚本 用于 paper-reader skill 的 Zotero 集成 """ import sqlite3 import os import shutil import argparse import sys from pathlib import Path _SHARED_DIR = Path(__file__).resolve().parents[2] / "_shared" if str(_SHARED_DIR) not in sys.path: sys.path.insert(0, str(_SHARED_DIR)) from...
jing1tian/DailyPapers
.claude/skills/paper-reader/assets/zotero_helper.py
.py
4520570e1d21c8bc
7.52
10
"""Guard the examiner-facing artifact metadata against unsupported claims. Every artifact module declares an ``__artifacts_v2__`` dict. Its ``name`` and ``description`` fields are not developer notes: they are rendered into the HTML report, written into the LAVA manifest, and from there they get pasted into examinatio...
abrignoni/DLEAPP
admin/scripts/check_claim_language.py
.py
9fe720b02c558eb0
7.59
14
#!/usr/bin/env python3 """Comments on pull requests that change artifact modules without test data. Runs from .github/workflows/request_test_data.yml on pull_request_target, so the copy of this script that executes is always the one on the base branch, never the contributor's. The pull request's own code is fetched as...
abrignoni/DLEAPP
admin/scripts/check_pr_test_data.py
.py
86ccf92bbeb996dc
8.09
14
"""Fail CI only on pylint warnings a change actually introduces. The lint job runs pylint over the files a pull request touches. Several long-lived modules carry pre-existing warnings that are deliberate rather than fixable -- `ileapp.py` uses wildcard imports as its module architecture, `scripts/ilapfuncs.py` re-expo...
abrignoni/DLEAPP
admin/scripts/lint_changed.py
.py
0da2ac1078fcb6cd
7.59
14
# pylint: disable=broad-exception-caught """Smoke test: every artifact module must import on the running Python. Run across the supported Python versions in CI, this is the only check that a change still parses and imports on the oldest one. Syntax accepted by a newer interpreter is not always accepted by an older one...
abrignoni/DLEAPP
admin/test/scripts/test_artifact_imports.py
.py
5836dc938a3efe44
8.09
14
"""Structural check: committed case files carry no machine-local paths. The image manifest split (iLEAPP #2028) keeps machine-independent identity in committed files and machine-specific locations in the git-ignored admin/image_manifest.local.json. A case entry's make_data.input_data_path is display text for the case ...
abrignoni/DLEAPP
admin/test/scripts/test_case_file_paths.py
.py
79752c7533230a83
8.09
14
"""Prove the local-path checker still detects the defects it exists to detect. check_report_local_paths.py reads artifact source and reports staged paths that reach report output. It is itself a script and can rot. Two of its own rules were wrong before they were right in the session that introduced it, and only a run...
abrignoni/DLEAPP
admin/test/scripts/test_check_report_local_paths.py
.py
abcde343f9cbde84
7.09
14
"""Prove the source_path checker still detects the defects it exists to detect. check_source_path.py fails when an artifact returns a string constant where the report expects real paths. The class had already been swept out of iLEAPP once (PRs #2022 and #2024) and had come back in two sibling cores by the time it was ...
abrignoni/DLEAPP
admin/test/scripts/test_check_source_path.py
.py
72ccf9f3060b79d6
8.09
14
"""The command line and GUI entry points must load on every supported Python. The artifact import test covers scripts/, but the entry points themselves sat outside any version-matrixed check, so a change to either could break on the oldest supported Python and only surface when a user ran it. The two are checked diff...
abrignoni/DLEAPP
admin/test/scripts/test_entry_points.py
.py
a6302f7b1f8739dc
8.09
14
"""Guard the LAVA writer against artifact names that are hostile to SQL or to the filesystem. The LAVA writer turns each artifact's data_headers into SQLite column names. Those identifiers used to be interpolated into CREATE TABLE and INSERT statements unquoted, so any header that sanitizes down to a reserved word ('F...
abrignoni/DLEAPP
admin/test/scripts/test_lava_sql_identifiers.py
.py
7cf2266db9d20949
8.09
14
r"""Windows: open a SQLite database whose full path exceeds 260 characters. Regression test for the case Mattia Epifani reported. On a Windows output path over MAX_PATH (260), each core's main prepends the extended-length prefix \\?\ to the output, so the seeker hands artifacts a path like \\?\D:\...\telephony.db. Man...
abrignoni/DLEAPP
admin/test/scripts/test_sqlite_longpath_uri.py
.py
c95c84ff382be6c8
8.09
14
"""Tests for the Windows system artifacts migrated from WLEAPP.""" # pylint: disable=protected-access import sqlite3 from datetime import datetime, timezone from scripts.artifacts import windowsSystem class _Context: def __init__(self, files): self._files = files def get_files_found(self): ...
abrignoni/DLEAPP
admin/test/scripts/test_windows_system.py
.py
64a95afafa5af738
8.09
14
"""Output folder path resolution and availability checks.""" import os from datetime import datetime from leapp_functions.app.platform import validate_filename from scripts.version_info import leapp_name def default_output_folder_name(): '''Return the default report subfolder name for a new run.''' currentt...
abrignoni/DLEAPP
leapp_functions/app/output.py
.py
d8193d3ad10657d4
7.59
14
"""Cross-platform filename and path string safety utilities.""" import re ILLEGAL_FILENAME_CHARS = { '\\': '\\ backslash', '/': '/ forward slash', '*': '* asterisk', '?': '? question mark', ':': ': colon', '"': '" double quote', '<': '< less than', '>': '> greater than', '|': '| pi...
abrignoni/DLEAPP
leapp_functions/app/platform.py
.py
eb48a39201568d27
7.59
14
"""LiveKit Agents + SupafoneLabs: chat-context append on session events. pip install supafone-labs[all] livekit-agents """ import asyncio from livekit.agents import AgentSession import supafone_labs brain = supafone_labs.SupafoneLabs(provider="livekit", scenario="support", mode="return") def attach_second_min...
samthedataman/supafone-labs
examples/livekit_agent.py
.py
0aff881e6eb0d33c
7.45
7
"""Pipecat + SupafoneLabs: an observer that appends context frames. You own the pipeline, so the whisper is an LLMMessagesAppendFrame pushed before the next model turn (run_llm=False — the whisper never forces a turn). pip install supafone-labs[all] pipecat-ai """ from pipecat.frames.frames import LLMMessagesAppe...
samthedataman/supafone-labs
examples/pipecat_pipeline.py
.py
f16d57f5e48b9239
7.45
7
"""Ultravox end-to-end: one line to supercharge an agent, run with no API key. python examples/ultravox_end_to_end.py """ import asyncio import supafone_labs class FakeUltravoxAgent: """Stand-in for a real Ultravox agent. provider_name drives auto-detection; inject() is what SupafoneLabs calls to silent...
samthedataman/supafone-labs
examples/ultravox_end_to_end.py
.py
0688f58e566cf4fe
7.45
7
"""Runtime settings (env-driven). Latest Claude defaults; never holds secrets.""" from __future__ import annotations import os from pydantic import BaseModel DEFAULT_ORACLE_MODEL = "claude-haiku-4-5-20251001" DEFAULT_CRITIC_MODEL = "claude-sonnet-4-6" # Bootstrap/offline FALLBACK only — the live source of truth is ...
samthedataman/supafone-labs
src/supafone_labs/config.py
.py
b4c9c0f09ea5fe7f
7.45
7
"""LLM provider contract + a deterministic fake + a lazy Anthropic provider.""" from __future__ import annotations import os from typing import Any, Protocol, runtime_checkable _DEFAULT_BELIEF = ( '{"caller_identity":"new_lead","case_type":"auto_accident","emotional_state":"distressed",' '"intent":"fresh_inju...
samthedataman/supafone-labs
src/supafone_labs/llm/base.py
.py
64f78ddea127c009
7.45
7
"""LLMProvider backed by the OpenAI SDK (imported lazily).""" from __future__ import annotations import os from typing import Any class OpenAIProvider: """Chat-completions provider using the OpenAI SDK; imported only when used. `base_url` makes this serve any OpenAI-compatible vendor — xAI's Grok API is...
samthedataman/supafone-labs
src/supafone_labs/llm/openai_provider.py
.py
90de712b2c187cb9
7.45
7
"""Provider resolution: explicit by name, or auto by tier and available keys. Auto order: 1. ``SUPAFONE_LABS_API_KEY`` set -> HostedLLMProvider (pro tier, Supafone Labs' keys) 2. ``ANTHROPIC_API_KEY`` set -> AnthropicProvider (free tier, your key) 3. ``OPENAI_API_KEY`` set -> OpenAIProvider (free tier, your ke...
samthedataman/supafone-labs
src/supafone_labs/llm/registry.py
.py
f73bbc76b1615d2c
7.45
7
"""BeliefStateEngine — the oracle's perception core (LLM over the canonical transcript).""" from __future__ import annotations from typing import Optional from supafone_labs._json import loads_tolerant from supafone_labs.config import Settings, get_settings from supafone_labs.llm.base import LLMProvider from supafone...
samthedataman/supafone-labs
src/supafone_labs/oracle/belief_state.py
.py
83225eef1001686c
7.45
7
"""OracleWorkflow — a runtime WorkflowDefinition that drains oracle directives (no LLM call).""" from __future__ import annotations from typing import Optional from supafone_labs.oracle.session import OracleSession from supafone_labs.runtime.core.decision import RuntimeDecision from supafone_labs.runtime.core.events ...
samthedataman/supafone-labs
src/supafone_labs/oracle/policy.py
.py
3a900db905b3b953
7.45
7
"""OracleSession — the off-hot-path supervisor. Time-bounded, degrade-safe.""" from __future__ import annotations import asyncio import inspect from collections.abc import Awaitable, Callable, Mapping from typing import Any, Optional from supafone_labs.config import Settings, get_settings from supafone_labs.llm.base ...
samthedataman/supafone-labs
src/supafone_labs/oracle/session.py
.py
32b979e209e209d2
7.45
7
"""Adapter and decoder construction from a Time-MMD model config.""" import torch from examples.time_mmd.configs.model import ModelConfig from tsfmx.decoder import MultimodalDecoder, MultimodalDecoderConfig from tsfmx.tsfm.base import TsfmAdapter from tsfmx.tsfm.chronos import Chronos2Adapter from tsfmx.tsfm.timesfm ...
himura467/tsfmx
examples/time_mmd/builders.py
.py
33c9f856e3671bda
7.42
6
"""Domain-specific column configuration for Time-MMD dataset.""" from __future__ import annotations from dataclasses import dataclass, field from typing import Any @dataclass class DomainColumnConfig: """Configuration for columns in a specific domain's dataset. Attributes: start_date_col: Column na...
himura467/tsfmx
examples/time_mmd/configs/domain_columns.py
.py
bc7ab89524a3ad55
7.42
6
"""Model configuration for Time-MMD dataset.""" from __future__ import annotations from dataclasses import dataclass, field from pathlib import Path from typing import Literal from tsfmx.utils.yaml import load_yaml @dataclass class AdapterConfig: """Configuration for the time series foundation model adapter.""...
himura467/tsfmx
examples/time_mmd/configs/model.py
.py
6c4275a10031af23
7.42
6
"""Cross-validation utilities for Time-MMD dataset.""" from dataclasses import dataclass, field from pathlib import Path from typing import Literal from torch.utils.data import ConcatDataset, Dataset from tsfmx.data.dataset import PreprocessedDataset from tsfmx.data.preprocess import PreprocessPipeline from tsfmx.ty...
himura467/tsfmx
examples/time_mmd/cross_validation.py
.py
5415e1bb0c6a2ced
7.42
6
#!/usr/bin/env python3 """Pre-compute and cache text embeddings for all Time-MMD domains. Text embeddings must be cached before training or evaluation. This script iterates over every domain in the dataset, runs the text encoder once, and persists the results as pickle files so that training scripts can load them with...
himura467/tsfmx
scripts/cache_time_mmd_datasets.py
.py
98188fbfbfbc9b62
7.42
6
#!/usr/bin/env python3 """Measure how much sample-specific signal survives the text encoder and the fusion projection.""" import argparse import json from pathlib import Path import numpy as np import torch from torch.utils.data import DataLoader from examples.time_mmd.builders import build_decoder from examples.tim...
himura467/tsfmx
scripts/diagnose_time_mmd_text_fusion.py
.py
3b2b445bc96ad7db
7.42
6
#!/usr/bin/env python3 """Evaluate a tsfmx checkpoint on Time-MMD test splits under text ablations and write results to JSON.""" import argparse import json from pathlib import Path import torch from torch.utils.data import ConcatDataset from examples.time_mmd.builders import build_decoder from examples.time_mmd.con...
himura467/tsfmx
scripts/eval_time_mmd_text_ablation.py
.py
a716fe66c6ff4da2
7.42
6
#!/usr/bin/env python3 """Split Time-MMD numerical data chronologically and duplicate textual data per split.""" import argparse import shutil from pathlib import Path from typing import Literal, get_args import pandas as pd from examples.time_mmd.configs.domain_columns import DEFAULT_TIME_MMD_CONFIGS from examples....
himura467/tsfmx
scripts/split_time_mmd_datasets.py
.py
b39d04ef354062a6
7.42
6
"""Text ablations for measuring how much a trained model relies on text.""" from __future__ import annotations from collections.abc import Sized from typing import TYPE_CHECKING, Literal, cast import numpy as np from torch.utils.data import Dataset from typing_extensions import override from tsfmx.types import Prep...
himura467/tsfmx
src/tsfmx/ablation.py
.py
fa7f0f7d88baef94
7.42
6
"""Collate functions for DataLoader batching.""" from typing import Callable import numpy as np import torch from tsfmx.types import Batch, PreprocessedSample, TrainingMode def _build_batch(batch: list[PreprocessedSample]) -> Batch: context = torch.from_numpy(np.stack([s["context"] for s in batch])) horizo...
himura467/tsfmx
src/tsfmx/data/collate.py
.py
700e934c1f6c9e83
7.42
6
"""Dataset classes for multimodal time series.""" from abc import ABC, abstractmethod from torch.utils.data import Dataset from typing_extensions import override from tsfmx.types import PreprocessedSample, RawSample, TrainingMode class MultimodalDatasetBase(Dataset[RawSample], ABC): """Abstract base class for ...
himura467/tsfmx
src/tsfmx/data/dataset.py
.py
beddf773ab283978
7.42
6
"""Preprocessing pipeline for multimodal and baseline datasets.""" import pickle from pathlib import Path from typing import Callable import torch from tsfmx.data.dataset import MultimodalDatasetBase from tsfmx.text_encoder.base import TextEncoderBase from tsfmx.types import PreprocessedSample from tsfmx.utils.loggi...
himura467/tsfmx
src/tsfmx/data/preprocess.py
.py
8ca69978a19b10bf
7.42
6
"""Multimodal decoder for time series forecasting with text fusion.""" from dataclasses import dataclass, field from pathlib import Path from typing import Any from typing_extensions import override import torch from torch import nn from tsfmx.fusion import MultimodalFusion from tsfmx.tsfm.base import TsfmAdapter f...
himura467/tsfmx
src/tsfmx/decoder.py
.py
4ef0a5235190c703
7.42
6
"""Evaluator for multimodal decoder models.""" import torch from torch.utils.data import DataLoader from tsfmx.decoder import MultimodalDecoder from tsfmx.types import Batch, EvaluationMetrics class MultimodalEvaluator: """Computes evaluation metrics for a multimodal decoder. Passes `text_embeddings` to th...
himura467/tsfmx
src/tsfmx/evaluator.py
.py
10dc4358303f9ebe
7.42
6
"""Multimodal fusion mechanism for combining time series and text embeddings.""" import torch from torch import nn from typing_extensions import override class MultimodalFusion(nn.Module): """Addition-based fusion of time series and text embeddings. Projects text_embeddings to ts_embedding_dims, then adds e...
himura467/tsfmx
src/tsfmx/fusion.py
.py
1ce602f477dbca0f
7.42
6
# Adapted from https://github.com/huggingface/transformers/blob/main/src/transformers/optimization.py """PyTorch optimization utilities for multimodal time series forecasting.""" import math from functools import partial from torch.optim import Optimizer from torch.optim.lr_scheduler import LambdaLR, LRScheduler de...
himura467/tsfmx
src/tsfmx/optimization.py
.py
59e0a4bb52d35e53
7.42
6
"""Abstract text encoder interface.""" from abc import ABC, abstractmethod import numpy as np import torch from torch import nn from typing_extensions import override from tsfmx.utils.device import resolve_device class TextEncoderBase(nn.Module, ABC): """Abstract base class for text encoders.""" def __ini...
himura467/tsfmx
src/tsfmx/text_encoder/base.py
.py
a40ad3df9e771fcd
7.42
6
"""English text encoder using SentenceTransformer models.""" import numpy as np import torch from sentence_transformers import SentenceTransformer from typing_extensions import override from tsfmx.text_encoder.base import TextEncoderBase class EnglishTextEncoder(TextEncoderBase): """Text encoder for English tex...
himura467/tsfmx
src/tsfmx/text_encoder/english.py
.py
2f0f6d92df6d16bb
7.42
6
"""Japanese text encoder using SentenceTransformer models.""" import numpy as np import torch from sentence_transformers import SentenceTransformer from typing_extensions import override from tsfmx.text_encoder.base import TextEncoderBase class JapaneseTextEncoder(TextEncoderBase): """Text encoder for Japanese ...
himura467/tsfmx
src/tsfmx/text_encoder/japanese.py
.py
926117bc241a1bbf
7.42
6
# Adapted from https://github.com/huggingface/transformers/blob/main/src/transformers/training_args.py """Training arguments for multimodal time series forecasting.""" from __future__ import annotations import math from dataclasses import dataclass, field from pathlib import Path from typing import Literal from tsfm...
himura467/tsfmx
src/tsfmx/training_args.py
.py
eae38d13b6659b44
7.42
6
"""Chronos adapters.""" from __future__ import annotations from typing import cast from typing_extensions import override import torch from chronos import Chronos2Model from huggingface_hub import hf_hub_download from safetensors.torch import load_file from tsfmx.tsfm.base import PreprocessResult, TsfmAdapter from...
himura467/tsfmx
src/tsfmx/tsfm/chronos.py
.py
3709d373504ec824
7.42
6
"""TimesFM adapters.""" from __future__ import annotations import torch from huggingface_hub import hf_hub_download from typing_extensions import override from safetensors.torch import load_file from timesfm.timesfm_2p5.timesfm_2p5_torch import TimesFM_2p5_200M_torch_module from timesfm.torch.util import revin, updat...
himura467/tsfmx
src/tsfmx/tsfm/timesfm.py
.py
d987d86535381dad
7.42
6
"""Device management utilities.""" import torch def _default_device() -> torch.device: """Select the best available device in priority order: cuda -> mps -> cpu.""" if torch.cuda.is_available(): return torch.device("cuda") if torch.backends.mps.is_available(): return torch.device("mps") ...
himura467/tsfmx
src/tsfmx/utils/device.py
.py
3a1d5600e2a7af91
7.42
6
"""Visualization utilities for multimodal time series forecasting.""" from __future__ import annotations from pathlib import Path from typing import TYPE_CHECKING import numpy as np import numpy.typing as npt import torch from torch.utils.data import DataLoader from tsfmx.decoder import MultimodalDecoder from tsfmx...
himura467/tsfmx
src/tsfmx/visualizer.py
.py
b6555e8b2f5e7768
7.42
6
import json import time import chainlit as cl from mcp import ClientSession from src.llm.call_model import ( model_name, call_ollama, thread_renamed, synthesize_results, ) from src.utils.config import COMMANDS from chainlit.types import ThreadDict from typing import Dict, Optional, Any from src.log.logg...
EliAbdiel/ollama-chat-application
main.py
.py
160453b1b26c2070
7.54
11
import fitz import base64 import asyncio import chainlit as cl from io import BytesIO from pathlib import Path from docx import Document from ollama import AsyncClient, ChatResponse from src.log.logger import setup_logger from typing import Optional, Dict, Any, Set, AsyncIterator from src.document.processor_config impo...
EliAbdiel/ollama-chat-application
src/document/document_processor.py
.py
68193f2e56e23d21
7.54
11