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
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Artifact discovery — walk a repository to find charms, rocks, and snaps. Discovery looks for ``charmcraft.yaml``, ``rockcraft.yaml``, and ``snapcraft.yaml`` marker files, extracts names, and links charm OCI-image resources to discovered rock...
canonical/charm-ci
src/opcli/core/discovery.py
.py
f8f2f010410294cd
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Environment detection utilities.""" import os import platform def is_ci() -> bool: """Return True when running inside CI (truthy ``CI`` env var).""" return bool(os.environ.get("CI")) def current_arch() -> str: """Return the n...
canonical/charm-ci
src/opcli/core/env.py
.py
8c7db39bf4cbc0c2
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """opcli exception hierarchy. All user-facing errors inherit from OpcliError so that CLI commands can catch a single base type and produce friendly output. """ import shlex class OpcliError(Exception): """Base exception for all opcli err...
canonical/charm-ci
src/opcli/core/exceptions.py
.py
c560a861dcc18b4a
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Core logic for ``opcli install`` sub-commands. These functions install tool dependencies needed for local charm development and the spread test environment. They are designed to be idempotent and work correctly whether invoked as root (e.g....
canonical/charm-ci
src/opcli/core/install.py
.py
1681cdcce0943aa3
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Shared utilities for determining pack directory and yaml symlink management. Used by both ``artifacts`` (build) and ``publish`` (upload) to ensure the working directory presented to craft tools (charmcraft, rockcraft, snapcraft) is identical...
canonical/charm-ci
src/opcli/core/pack_utils.py
.py
eec0404f1a02398b
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Timestamped progress output for long-running operations. All messages go to stderr so that stdout remains clean for machine-parseable output (JSON, shell commands, YAML). """ import sys import time from collections.abc import Iterator from ...
canonical/charm-ci
src/opcli/core/progress.py
.py
61bf1edb72fb1b94
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Core logic for ``opcli pytest expand`` and ``opcli pytest run``. Assembles the tox command for running integration tests. Artifacts are injected into test functions via the pytest-opcli plugin fixtures (``charm_path``, ``rock_images``, etc....
canonical/charm-ci
src/opcli/core/pytest_args.py
.py
ccffe1fa4537c249
7.8
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Central subprocess wrapper. All external command execution goes through :func:`run_command` so that tests can mock a single boundary and we get consistent timeout / error handling everywhere. Every invocation prints the command and working ...
canonical/charm-ci
src/opcli/core/subprocess.py
.py
d161018a89abd410
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Pydantic models for artifacts.yaml. This schema declares the charms, rocks, and snaps in a repository, and the links between charms and their OCI-image resources (rocks). Schema version: 1 - Each artifact carries an explicit path to its cra...
canonical/charm-ci
src/opcli/models/artifacts.py
.py
904176daaa706353
7.3
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Integration tests for spread local backend with real LXD VMs. These tests require ``spread`` and ``lxc`` to be available on the host. They launch real VMs, so they are slow (~30-60s) and marked with ``@pytest.mark.integration``. The prepare...
canonical/charm-ci
tests/integration/test_spread_lxd.py
.py
0761484df17b4707
7.8
3
# Copyright 2026 Canonical Ltd. # See LICENSE file for licensing details. """Unit test fixtures for opcli. Unit tests exercise local (non-CI) behaviour by default. The autouse fixture below removes GITHUB_ACTIONS from the environment so that tests never accidentally trigger GitHub-Actions-specific code paths (e.g. p...
canonical/charm-ci
tests/unit/conftest.py
.py
04c02024a0417387
7.8
3
#!/usr/bin/env python3 """ 세 방식을 **각각 독립된 Claude Code 세션**으로 돌려 비교한다. 세션 분리가 이 벤치의 핵심이다 — 한 세션에서 세 방식을 다 하면 첫 방식에서 답을 알아버려 나머지가 무효가 된다. `claude -p` 는 매번 새 프로세스라 컨텍스트가 안 샌다. bench/setup.sh up python3 bench/agent.py # 기본이 최소 집합 — 9세션 약 $5 bench/setup.sh down **비싸다.** 세션당 $0.5~1.6 이라 기본값을 최소로 잡아 뒀다...
mukansei/wikilens
bench/agent.py
.py
8c72a448a564d443
7
0
""" 골든 픽스처 계약 테스트. `contract/shared-fixture/`는 Python 과 Kotlin 이 **공유하는 정본 볼트**다. 이 테스트는 Python 쪽만 확인한다 — `build()`가 픽스처의 원본(mirror/raw, .sync-state.json)에서 체크인된 산출물(pages/, structure/, anchors.jsonl, ALIASES.md, TREE.md)을 결정적으로 재생성하는지. Kotlin 쪽은 같은 픽스처의 산출물을 `VaultReaderTest.kt`가 직접 읽어 검증한다. 두 언어가 각자 이 파일들을 정본으로 삼으므...
mukansei/wikilens
cli/tests/test_contract_fixtures.py
.py
cce87cd75ff17d28
7.5
0
""" 페이지별 읽기 권한을 수집해 `mirror/acl/acl.json` 에 쓴다. **콘텐츠 싱크와 분리한 이유:** 권한 변경은 `lastModified` 를 건드리지 않는다. 증분 `sync` 는 그것을 영영 못 잡으므로, 더는 볼 수 없게 된 페이지를 계속 서빙하게 된다 — 공유 서버에서는 그것이 전 사용자에게 나간다. 그래서 별도 명령이고 더 자주 돌려야 한다. ### 상속을 직접 풀어야 한다 `/rest/api/content/{id}/restriction/byOperation` 은 **그 페이지에 직접 걸린 제한만** 준다. Confluence 의 ...
mukansei/wikilens
cli/wikilens/acl.py
.py
6d8a29a2f30e8767
7
0
""" 빌드 단계: raw/ 를 파싱해 pages/·structure/ 를 만들고, 앵커를 전치한다. sync와 build를 나눈 이유는 **제목→ID 해석의 완전성** 때문이다. Confluence 링크는 대개 제목으로 대상을 가리키는데, 파싱 시점에 전체 제목 색인이 없으면 미해결 링크가 생긴다. raw/를 전부 받은 뒤 한 번에 파싱하면 해석이 완전해진다. 부수 효과로 build가 순수 로컬·멱등이 되어 네트워크 없이 반복 실행·테스트가 가능하다. """ from __future__ import annotations import json from colle...
mukansei/wikilens
cli/wikilens/build.py
.py
6fd6c679d8c76005
7
0
"""wikilens CLI.""" from __future__ import annotations import argparse import json import sys from pathlib import Path from . import credentials from . import layout from .build import build def _cmd_doctor(args) -> int: """연결·인증·권한을 sync 실행 전에 확인한다.""" from .sync import client_from_env d = client_from...
mukansei/wikilens
cli/wikilens/cli.py
.py
f42c0fe62cc3b4e9
7
0
""" Confluence storage format(XHTML) 파서. 앵커 텍스트 추출이 이 프로젝트의 핵심 가치이므로, 마크다운으로 변환한 뒤가 아니라 **원본 XHTML에서** 링크를 뽑는다. storage format은 링크가 구조화돼 있어 (`ac:link` + `ri:page` + `ac:plain-text-link-body`) 정확히 뽑을 수 있지만, 마크다운으로 내린 뒤에는 그 구조가 평평해져 앵커와 대상의 대응이 흐려진다. 네임스페이스 주의: API가 내려주는 body.storage는 `ac:`/`ri:` 접두사를 쓰지만 네임스페이스 선언이 없다...
mukansei/wikilens
cli/wikilens/convert.py
.py
f2a077d421199ccd
7
0
""" 자격증명 해석. **환경변수 → `~/.wikilens/env.sh` 폴백** 하나로 통일한다. CLI 는 원래 환경변수만 읽었다. 그래서 `export` 가 없는 환경에서는 전부 죽었다: - **Claude Code 안** — 로컬판 `/wikilens-local:sync` 가 한 번도 동작한 적이 없었다. 검색은 파일만 읽으니 잘 되고 갱신만 조용히 죽어서, 사용자는 정상인 줄 알고 자기 터미널에서 수동 싱크를 하고 있었다(2026-08-05 실측). 래퍼 (`plugin/local/scripts/wikilens_cli.sh`)...
mukansei/wikilens
cli/wikilens/credentials.py
.py
6af3517028c88436
7
0
""" 디스크 레이아웃 규칙. 권위 있는 노드 식별자는 Confluence 페이지 ID다. 제목이 아니다. 제목으로 경로를 잡으면 이름 변경이 삭제+생성으로 보여 diff가 오염되고, 나중에 서버판에서 학습 가중치가 통째로 날아간다. """ from __future__ import annotations from pathlib import Path # 한 디렉터리에 파일이 쌓이는 것을 막는다. # # **샤딩의 이유는 성능이 아니라 나열하는 쪽이다.** 실측(APFS): # # 한 디렉터리 파일수 직접 열기 1000회 나열 glob 1건 # ...
mukansei/wikilens
cli/wikilens/layout.py
.py
7a04b6ae2bd155a2
7
0
""" 도메인 모델. 이 파일의 핵심은 `canonical_json`이다. 구조 서명이 매 싱크마다 재생성되므로, 직렬화가 결정적이지 않으면 아무것도 안 바뀌었는데 전체 파일이 변경으로 잡힌다. 로컬판은 diff를 쓰지 않지만, 포맷을 나중에 고치면 서버판 전환 시 전체 재크롤이 필요해진다. 그래서 처음부터 고정한다. """ from __future__ import annotations import json from dataclasses import dataclass, field from typing import Any @dataclass(frozen=True...
mukansei/wikilens
cli/wikilens/models.py
.py
0f8077e7c9616847
7
0
""" 문서를 어느 문자 집합으로 썼는지 보고 **볼트에 편입할지 정한다.** 다국어 코퍼스용이다. 같은 내용이 여러 언어로 있으면 **읽지 못하는 언어의 문서가 어휘 순위에서 이길 수 있다** — 실측(한·베 혼재 13,933건, 2026-08-15): 한국어 질의에 베트남어 번역본이 1위이고 한국어 원본이 10위 밖이었다. 두 문서가 같은 영문 식별자 (`ga`·URL)를 공유하는데 번역본이 두 배 길어 tf 가 높았다. 앵커 층도 번역본을 올렸다 (원본의 인링크 19개 중 18개가 `SDK 접속 가이드` 라고 불러 `ga` 가 안 들어 있었다). **어휘 층은...
mukansei/wikilens
cli/wikilens/scripts.py
.py
95b728fbe4d7a9e8
7
0
""" README 최상단 배지의 버전이 빌드 파일과 같은지 본다. **배지는 정적이다** — 저장소가 비공개라 shields.io 가 빌드·라이선스 상태를 읽을 수 없어서, 버전을 손으로 복제하는 것 말고 방법이 없다. 그러면 의존성을 올릴 때 배지만 옛 버전을 말한다 — 이 저장소가 반복해서 물린 "두 곳이 같아야 하는데 연결이 파일도 주석도 아닌 것" 그대로다. 그래서 검사를 붙인다. **앞 두 자리만 본다.** 패치 버전은 배지에 안 적는다 — 올릴 때마다 배지를 고치게 되면 아무도 안 고치고 계약만 빨개진다. """ from __future__ impor...
mukansei/wikilens
contract/badge_versions.py
.py
bc0aa62777113147
7
0
#!/usr/bin/env python3 """ 볼트 위치와 상태를 한 번에 해석한다. 스킬이 매번 `$HOME` 확장·볼트 존재·싱크 여부·build 여부를 스스로 추론하면 실패 모드가 넷으로 갈리고 각각 다르게 실패한다. 그 판정을 여기 한 곳에 모아 결정적으로 만든다. 스킬은 이 출력의 `VAULT=` 값을 이후 모든 Grep/Read 경로 앞에 붙이기만 하면 된다. `STRAY=` 는 샤딩 규칙을 벗어난 파일 수다. 검색을 막지는 않으므로 `STATUS` 와 종료코드에는 영향을 주지 않는다 — `find_strays()` 의 주석 참고. **표준 라이브러...
mukansei/wikilens
plugin/local/scripts/vault_status.py
.py
862b0534d6142a88
7
0
"""Minimal leaf module: a few local functions and calls, no imports. Represents the cheapest realistic workload (issue #30): a tiny file whose import closure is empty, so the measured cost is almost entirely the fixed per-invocation work (parse, index, walk) rather than closure traversal. """ def add(left: int, righ...
adamtheturtle/strict-kwargs
benches/fixtures/leaf/leaf.py
.py
ce3934e67395d981
7.15
1
from __future__ import annotations import asyncio from abc import ABC, abstractmethod from collections.abc import Awaitable, Callable from decimal import Decimal from typing import Any from cross_arb.domain import ( AccountSnapshot, MarketMapping, OrderRequest, OrderResult, Position, Quote, ) ...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/adapters/base.py
.py
846b58fc5d40e811
7
0
from __future__ import annotations import asyncio import random from collections.abc import Awaitable, Callable from decimal import Decimal from typing import Any from cross_arb.adapters.base import ExchangeAdapter, QuoteFeed from cross_arb.domain import ( AccountSnapshot, MarketMapping, OrderRequest, ...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/adapters/simulated.py
.py
7e98296a2867fea1
7
0
from __future__ import annotations import os from dataclasses import dataclass, fields from decimal import Decimal def _bool(name: str, default: bool) -> bool: value = os.getenv(name) return default if value is None else value.strip().lower() in {"1", "true", "yes", "on"} def _int_or_none(name: str) -> int...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/config.py
.py
96ca1f61081b8c6b
7
0
from __future__ import annotations import json import sqlite3 from decimal import Decimal from pathlib import Path from typing import Any from cross_arb.domain import Execution, MarketMapping, Task, decimal_json class Repository: """SQLite persistence for tasks, executions and PnL rounds.""" def __init__(s...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/database.py
.py
a030f986ffe0ea3c
7
0
from __future__ import annotations import asyncio import logging from decimal import Decimal from cross_arb.adapters.base import ExchangeAdapter from cross_arb.config import Settings from cross_arb.domain import ( MarketMapping, OrderRequest, Task, now_ms, utc_now, ) logger = logging.getLogger("c...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/risk.py
.py
0cb5fea9ed42dbff
7
0
from __future__ import annotations import logging from collections import deque from decimal import Decimal from cross_arb.domain import MarketMapping, Quote logger = logging.getLogger("cross_arb.strategy") # A "spread_bps" is quoted in basis points of the mid price. Positive means # the exploitable direction is pr...
pepedesigner/Entropy-Robinhood-Lighter-Arbitrage
src/cross_arb/strategy.py
.py
a5a6b5c0298ea8b2
7
0
import sys import os import re import importlib import warnings is_pypy = '__pypy__' in sys.builtin_module_names warnings.filterwarnings('ignore', '.+ distutils .+ deprecated', DeprecationWarning) def warn_distutils_present(): if 'distutils' not in sys.modules: ...
max-lopzzz/pakupaku
pakupaku-frontend/venv/lib/python3.8/site-packages/_distutils_hack/__init__.py
.py
322f93bf23a7b8cc
7
0
""" axis.py — NODE_AXIS + FIGURY REZONANSOWE (MODEL_TETRAGON_4CPU.md, RESONANCE_COMM.md, README.md). NODE_AXIS to wspólny węzeł centralny łączący sznury 3 lub 4 procesorów (TRÓJKĄT / TETRAGON). Połączenia idą WYŁĄCZNIE przez oś — nie ma bezpośrednich połączeń A<->B<->C<->D z pominięciem NODE_AXIS. """ import itertool...
jbackk-lang/KHIPU
khipu/axis.py
.py
57df4cdfeca480f8
7.15
1
""" compressor.py — COMPRESSOR256 (COMPRESSOR256.md, SPECYFIKACJA_KOMPRESORA_TOPOLOGICZNEGO.md). Logika wg dokumentacji: bajt -> stan topologiczny (NODE256) klasyfikacja po skręcie, redukcja po kierunku/drodze/brzegu/ szerokości/warstwie/relacjach walidacja: TIMDR (skręt/kierunek), GIPU (sznur/węzły/od...
jbackk-lang/KHIPU
khipu/compressor.py
.py
7ae021f331894107
7.15
1
""" gipu.py — GIPU: globalny integrator sznurów (modelPC.md / VALIDATION_LAYER, MODEL_PC_TOPLOGIC.md, MODEL_TETRAGON_4CPU.md). Rola wg dokumentacji: - zarządzanie sznurem/sznurami (ROPE256 / ROPE48_A..D) - walidacja węzłów, odległości, przejść warstw - aktualizacja relacji (R) i tablicy LUT256 - utrzym...
jbackk-lang/KHIPU
khipu/gipu.py
.py
5aef83932b371f05
7.15
1
""" lut256.py — LUT256 (modelPC.md, MODEL_PC_MEMORY.md, MODEL_PC_TOPLOGIC.md). LUT256[idx] -> NODE256 Wejście: idx = EMIT_INDEX(S,K). Wyjście: pełny stan topologiczny NODE256 (z domyślnie przypisanymi D/B/W/L/R). Modyfikowalna przez TIMDR i GIPU. """ import copy from .node256 import Node256, D, B, W, L, R, deri...
jbackk-lang/KHIPU
khipu/lut256.py
.py
47f4763d23c12dde
7.15
1
""" pipeline.py — SingleCPUSystem: pełny FLOW modelu jednoprocesorowego (modelPC.md / PRZEPŁYW_DANYCH, MODEL_PC_TOPLOGIC.md / FLOW). 1. CPU_CORE_16 pobiera word16 2. DETECT_SCREW -> S 3. DERIVE_DIRECTION -> K 4. TIMDR waliduje (S,K) 5. EMIT_INDEX -> idx 6. LUT256[idx] -> NODE256 7. NODE256 ...
jbackk-lang/KHIPU
khipu/pipeline.py
.py
b7a5a8dafb29775d
7.15
1
""" rope.py (w pakiecie khipu) — ROPE256: globalny sznur węzłów NODE256 (modelPC.md / ROPE_MEMORY, MODEL_PC_MEMORY.md, MODEL_PC_TOPLOGIC.md). Sznur w kolejności czasowej + relacje globalne (odległości, sprzężenia, rezonanse, przejścia warstw) + walidacja globalna (zgodność S/K, spójność przebiegu). W przeciwieństwie d...
jbackk-lang/KHIPU
khipu/rope.py
.py
82b2e6f407aa7b92
7.15
1
""" rope48.py — ROPE48: sznur pojedynczego CPU w architekturze TETRAGON_4CPU (MODEL_TETRAGON_4CPU.md, RESONANCE_COMM.md). 4 warstwy x 12 pozycji = 48 węzłów długość sznura = 48 (stała, izometria zachowana) brzeg domknięty (cykl) NAPRAWIONY BUG (patrz README.md / MODEL_TETRAGON_4CPU.md "Status implementacj...
jbackk-lang/KHIPU
khipu/rope48.py
.py
8f37146cd1cdd369
7.15
1
""" timdr.py — TIMDR: globalny walidator skrętu/kierunku (modelPC.md / VALIDATION_LAYER, MODEL_PC_TOPLOGIC.md, MODEL_TETRAGON_4CPU.md). Rola wg dokumentacji: - walidacja skrętu S - walidacja kierunku K - pilnowanie "osi 1/2 i φ" - może wymusić korektę S/K (globalnie, dla wielu CPU naraz) """ from .nod...
jbackk-lang/KHIPU
khipu/timdr.py
.py
39e8ce8d38127acf
7.15
1
""" visual.py — VISUAL_ENGINE + FRAME_BUFFER (MODEL_PC_VISUAL.md, MODEL_PC_TOPLOGIC.md). VISUAL_ENGINE tworzy obraz (FRAME) na podstawie sznura (ROPE256/ROPE48) i LUT256. Tryby PROJECTION_2D / PROJECTION_3D są tu zaimplementowane jako struktury danych (mapy: skręt->kolor, kierunek->wektor, itd.), a nie jako faktyczny ...
jbackk-lang/KHIPU
khipu/visual.py
.py
514da5460b76bfdc
7.15
1
""" Testy dla wsadowej (wektorowej) klasyfikacji CPUCore16 - patrz cpu.py sekcja "WSADOWA (WEKTOROWA) KLASYFIKACJA". Krzyżowa weryfikacja ze skalarną implementacją na losowych próbkach (nie tylko przykładach ręcznych) - to dokładnie ten rodzaj testu, którego brakowało przed naprawą błędu aliasingu LUT256 i niespójności...
jbackk-lang/KHIPU
tests/test_cpu_vectorized.py
.py
6d0f4dfb3c6123d5
7.65
1
from khipu.gipu import GIPUIntegrator from khipu.node256 import S, K, R, Node256 def test_relation_resonant_when_identical(): g = GIPUIntegrator() a = Node256(s=S.PLUS, k=K.RIGHT) b = Node256(s=S.PLUS, k=K.RIGHT) assert g.relation_between(a, b) == R.RESONANT def test_relation_independent_when_neutral(...
jbackk-lang/KHIPU
tests/test_gipu.py
.py
fbeb8417246d9554
7.65
1
""" Testy dla oryginalnych, prostych modułów `node.py` / `rope.py` z katalogu głównego repozytorium (format CTX/NODE do zapisu tekstowego, używany przez `test.py`). `test.py` sam w sobie tylko drukował wynik bez żadnej asercji — tutaj to samo zachowanie jest sprawdzone automatycznie. """ from node import Node from rope...
jbackk-lang/KHIPU
tests/test_legacy_rope.py
.py
48e0c82abb91707b
7.65
1
from khipu.pipeline import SingleCPUSystem def test_feed_grows_rope(): sys_ = SingleCPUSystem() sys_.feed(1234) sys_.feed(5678) assert len(sys_.rope) == 2 def test_feed_creates_frame(): sys_ = SingleCPUSystem() sys_.feed(1234) assert sys_.frames.latest() is not None def test_rope_directio...
jbackk-lang/KHIPU
tests/test_pipeline.py
.py
10ca673fdf487bf3
7.65
1
from khipu.tetragon import TetragonSystem def test_capacity_matches_documentation(): t = TetragonSystem() assert t.capacity_single_cpu() == 1536 assert t.capacity_total() == 6144 def test_capacity_with_resonance_around_8000(): t = TetragonSystem() lo, hi, mid = t.capacity_with_resonance() asse...
jbackk-lang/KHIPU
tests/test_tetragon.py
.py
9f7cab9140a78424
7.65
1
""" Test Factory to make fake objects for testing """ from datetime import date import factory from factory.fuzzy import FuzzyDate from service.models import Account class AccountFactory(factory.Factory): """Creates fake Accounts""" # pylint: disable=too-few-public-methods class Meta: """Persiste...
johnny-official/devops-capstone-project
tests/factories.py
.py
5783b57877528197
7.5
0
""" CLI Command Extensions for Flask """ import os from unittest import TestCase from unittest.mock import patch, MagicMock from click.testing import CliRunner from service.common.cli_commands import db_create class TestFlaskCLI(TestCase): """Test Flask CLI Commands""" def setUp(self): self.runner = ...
johnny-official/devops-capstone-project
tests/test_cli_commands.py
.py
c36053c66258d9d4
7.5
0
#!/usr/bin/env python3 """arXiv AI/LLM/Agent 论文抓取器。 通过 arXiv 官方 API(Atom XML)抓取最近 N 天、覆盖 cs.AI / cs.LG / cs.SE / cs.CL 分类下 AI Agent、LLM、模型等方向的论文,输出结构化 JSON 供下游选题/拆解消费。 要点: - 默认单次请求即可覆盖(最近 N 天 + 关键词命中量可控)。 - 遇到 429 / 5xx 自动退避重试,遵循 Retry-After。 - 选题判断由 Agent 层基于输出 JSON 完成,脚本不做选题,只抓取与排序。 用法: python3 fetch.py [--day...
Shakl0ne/agentsrc
tools/arxiv-pipeline/fetch.py
.py
b725262c18fbccb9
7
0
#!/usr/bin/env python3 """arXiv 论文 GitHub 热度补查。 读取 fetch.py 产出的 `arxiv_latest.json`,为论文补上 GitHub star 数, 作为选题排序的参考维度之一(真正选题仍由 Agent 综合判断)。 做法: - 优先从摘要提取显式 `github.com/owner/repo` 链接(精确命中,查仓库详情)。 - 否则按论文标题 + 主关键词去 GitHub 搜索仓库,取顶部最匹配项。 - 通过 `gh api`(复用已登录凭据,keyring)调用,规避未认证 60 次/小时限制。 注意:GitHub 搜索 API 认证后约 30 次/分钟,建议用...
Shakl0ne/agentsrc
tools/arxiv-pipeline/stars.py
.py
0d93d33e91ded124
7
0
#!/usr/bin/env python3 import os import sys import time import json import subprocess import urllib.request import urllib.error # ANSI Color Codes for premium terminal output NEON_GREEN = "\033[38;2;0;255;65m" NEON_MAGENTA = "\033[38;2;255;0;255m" NEON_CYAN = "\033[38;2;0;255;255m" NEON_YELLOW = "\033[38;2;255;255;0m"...
danindiana/lobster-graph
docs/sessions/2026-06-04T14-03-40_gpu_telemetry/telemetry_monitor.py
.py
855ec06dbbde6ae8
7
0
"""The ha_nlu integration: a deterministic, LLM-free Assist conversation agent. Setup only forwards to the ``conversation`` platform - all matching logic lives in ``engine.py``/``entities.py``/``service_call.py`` and is loaded lazily by ``NluConversationEntity`` itself. Generated one-shot and run-limited automations ...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/__init__.py
.py
df28f1cb7a274759
7
0
"""Explicit, confirmed and locally persisted spoken entity aliases.""" from __future__ import annotations import re from dataclasses import dataclass from .customization import parse_custom_aliases from .entities import EntitySnapshot, normalize_for_compare from .nlu.entity_resolution import ResolutionStatus, resolv...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/alias_learning.py
.py
53497f5fe771324d
7
0
"""Area name resolution: spoken/friendly room name -> area_id. Phase 7 (v2 plan, "Area Resolver 2.0"): scored resolution mirroring ``entities.resolve_entity_scored`` (Phase 6) - the same tier structure (exact, normalized exact, contains, reverse contains), adapted to areas (no entity_id/domain/device_class dimension -...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/areas.py
.py
6ccb1d4e02f0c59f
7
0
"""Language and selection helpers for trigger-preserving action edits.""" from __future__ import annotations import re from .automation_summary import AutomationSummary, CREATED_BY_HOMEINTENT from .entities import normalize_for_compare _EDIT_RE = re.compile( r"\b(?:ändere|aendere|ersetz\w*|füg\w*|fueg\w*|hinzu...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/automation_action_edit.py
.py
d7615c8f47342a70
7
0
"""Automation Metadata Store (HomeIntent V5 Teil 8/10, V5.30/V5.31/V5.32): per-automation identity/metadata for automations this integration created, kept in a sidecar JSON file physically separate from ``automations.yaml``. Cannot live as extra keys on the automation dict itself (the obvious first idea): confirmed ag...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/automation_metadata_store.py
.py
1bd1974259afc7bc
7
0
"""Persistent transaction journal for HomeIntent automation YAML writes.""" from __future__ import annotations import json import os from dataclasses import asdict, dataclass from typing import Any from homeassistant.util.file import write_utf8_file_atomic TRANSACTION_JOURNAL_FILENAME = "ha_nlu_automation_transacti...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/automation_transaction.py
.py
9e982419d6a9861c
7
0
"""Resolve local spatial references from an Assist input device.""" from __future__ import annotations import re from .areas import AreaSnapshot _LOCAL_REFERENCE_RE = re.compile( r"\b(?:hier|in\s+diesem\s+(?:raum|zimmer)|in\s+dieser\s+umgebung)\b", re.I, ) def materialize_local_reference(text: str, area:...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/conversation_location.py
.py
77b16833d0d42c77
7
0
"""Entity resolution: spoken/friendly name -> entity_id. Algorithm ported from xiaozhi_entity_mcp's ``_name_map()``/``_resolve()`` (https://github.com/pquandel2-alt/xiaozhi_entity_mcp): exact match on the lowercased friendly name first, then an unambiguous "contains" match, otherwise an explicit AMBIGUOUS/NOT_FOUND re...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/entities.py
.py
b16ddf4a14911fe9
7
0
"""Shared, order-independent entity/area/floor scope resolution.""" from __future__ import annotations import re from dataclasses import dataclass from .entities import EntitySnapshot, normalize_for_compare from .nlu.domain_operations import DOMAIN_WORDS as SHARED_DOMAIN_WORDS # This resolver belongs to the extend...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/entity_scope.py
.py
ca709f3686c90ace
7
0
"""Floor name resolution: spoken/friendly floor name -> floor_id. Phase 28 (v2 plan, "Hierarchical Locations"): mirrors ``areas.py``'s scored resolution (exact, normalized exact, contains, reverse contains) for floors, plus a resolver for the "oben"/"unten" (up/down) keywords - the plan's own example is "alle Lichter ...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/floors.py
.py
9af871331dcca573
7
0
"""Bridge from live Home Assistant state to the hass-free ``EntitySnapshot`` model the engine matches against. Selection logic ported from xiaozhi_entity_mcp's ``default_exposed_entities()``/ ``get_selected_entity_ids()`` (https://github.com/pquandel2-alt/xiaozhi_entity_mcp): explicit per-entity selection in config en...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/hass_entities.py
.py
6bd743521b425fea
7
0
"""Automation Action Semantic Model (HomeIntent V5 plan, Teil 4/10, V5.7-V5.12): ``ActionModel``/``ActionGroup`` are the AST for a (possibly sequenced, possibly parallel) automation action list ("mach das Flurlicht an, fahr die Rollläden hoch und stelle die Heizung auf 21 Grad"). Mirrors ``condition_model.py``'s "one t...
pquandel2-alt/ha-nlu-engine
custom_components/ha_nlu/nlu/action_model.py
.py
421456bf32196384
7
0
"""Execute exactly this copy of pip, within a different environment. This file is named as it is, to ensure that this module can't be imported via an import statement. """ # /!\ This version compatibility check section must be Python 2 compatible. /!\ import sys # Copied from setup.py PYTHON_REQUIRES = (3, 7) def...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/__pip-runner__.py
.py
127adf2a628ccd60
7
0
"""Build Environment used for isolation during sdist building """ import logging import os import pathlib import site import sys import textwrap from collections import OrderedDict from types import TracebackType from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union from pip._vendor.cert...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/build_env.py
.py
d444a9ab0d22ba94
7
0
"""Cache Management """ import hashlib import json import logging import os from pathlib import Path from typing import Any, Dict, List, Optional from pip._vendor.packaging.tags import Tag, interpreter_name, interpreter_version from pip._vendor.packaging.utils import canonicalize_name from pip._internal.exceptions i...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cache.py
.py
a4cca2d67da77dda
7
0
"""Logic that powers autocompletion installed by ``pip completion``. """ import optparse import os import sys from itertools import chain from typing import Any, Iterable, List, Optional from pip._internal.cli.main_parser import create_main_parser from pip._internal.commands import commands_dict, create_command from ...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py
.py
c18d893d96361238
7
0
"""Base Command class, and related routines""" import functools import logging import logging.config import optparse import os import sys import traceback from optparse import Values from typing import Any, Callable, List, Optional, Tuple from pip._vendor.rich import traceback as rich_traceback from pip._internal.cl...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cli/base_command.py
.py
002514a96919314d
7
0
"""A single place for constructing and exposing the main parser """ import os import subprocess import sys from typing import List, Optional, Tuple from pip._internal.build_env import get_runnable_pip from pip._internal.cli import cmdoptions from pip._internal.cli.parser import ConfigOptionParser, UpdatingDefaultsHel...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py
.py
95a0e9b2e04397a9
7
0
"""Base option parser setup""" import logging import optparse import shutil import sys import textwrap from contextlib import suppress from typing import Any, Dict, Generator, List, Tuple from pip._internal.cli.status_codes import UNKNOWN_ERROR from pip._internal.configuration import Configuration, ConfigurationError...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cli/parser.py
.py
b563fe2b5b92c672
7
0
import functools from typing import Callable, Generator, Iterable, Iterator, Optional, Tuple from pip._vendor.rich.progress import ( BarColumn, DownloadColumn, FileSizeColumn, Progress, ProgressColumn, SpinnerColumn, TextColumn, TimeElapsedColumn, TimeRemainingColumn, TransferSp...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/cli/progress_bars.py
.py
4a8e263e84a35e45
7
0
""" Package containing all pip commands """ import importlib from collections import namedtuple from typing import Any, Dict, Optional from pip._internal.cli.base_command import Command CommandInfo = namedtuple("CommandInfo", "module_path, class_name, summary") # This dictionary does a bunch of heavy lifting for he...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/__init__.py
.py
e6844ef4eddd336b
7
0
import os import textwrap from optparse import Values from typing import Any, List import pip._internal.utils.filesystem as filesystem from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.exceptions import CommandError, PipError from pip._inter...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/cache.py
.py
683477a4a4515fd7
7
0
import sys import textwrap from optparse import Values from typing import List from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import SUCCESS from pip._internal.utils.misc import get_prog BASE_COMPLETION = """ # pip {shell} completion start{script}# pip {shell} completion end ""...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/completion.py
.py
d9fae072171ef861
7
0
import logging import os import subprocess from optparse import Values from typing import Any, List, Optional from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.configuration import ( Configuration, Kind, get_configuration_files, ...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/configuration.py
.py
341e6e7fc1c85fcf
7
0
import importlib.resources import locale import logging import os import sys from optparse import Values from types import ModuleType from typing import Any, Dict, List, Optional import pip._vendor from pip._vendor.certifi import where from pip._vendor.packaging.version import parse as parse_version from pip._interna...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/debug.py
.py
01eb04203fb880f1
7
0
import hashlib import logging import sys from optparse import Values from typing import List from pip._internal.cli.base_command import Command from pip._internal.cli.status_codes import ERROR, SUCCESS from pip._internal.utils.hashes import FAVORITE_HASH, STRONG_HASHES from pip._internal.utils.misc import read_chunks,...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/hash.py
.py
11554ebaf1ada0f1
7
0
import logging from optparse import Values from typing import Any, Iterable, List, Optional, Union from pip._vendor.packaging.version import LegacyVersion, Version from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import IndexGroupCommand from pip._internal.cli.status_codes import ERROR, SUC...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/index.py
.py
706415480e5d02ce
7
0
import logging from optparse import Values from typing import Any, Dict, List from pip._vendor.packaging.markers import default_environment from pip._vendor.rich import print_json from pip import __version__ from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import Command from pip._internal....
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/inspect.py
.py
db048fb7dc9faf7a
7.5
0
import json import logging from optparse import Values from typing import TYPE_CHECKING, Generator, List, Optional, Sequence, Tuple, cast from pip._vendor.packaging.utils import canonicalize_name from pip._internal.cli import cmdoptions from pip._internal.cli.req_command import IndexGroupCommand from pip._internal.cl...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/commands/list.py
.py
2cd2fad35e813ef1
7
0
"""Configuration management setup Some terminology: - name As written in config files. - value Value associated with a name - key Name combined with it's section (section.name) - variant A single word describing where the configuration key-value pair came from """ import configparser import locale import os i...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/configuration.py
.py
8bf75e3c92a774f0
7
0
import abc from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata.base import BaseDistribution from pip._internal.req import InstallRequirement class AbstractDistribution(metaclass=abc.ABCMeta): """A base class for handling installable artifacts. The requirements for anythi...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/distributions/base.py
.py
8eb175562ede1b2a
7
0
from pip._internal.distributions.base import AbstractDistribution from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata import BaseDistribution class InstalledDistribution(AbstractDistribution): """Represents an installed package. This does not need any preparation as the r...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/distributions/installed.py
.py
348d8e82c807f620
7
0
import logging from typing import Iterable, Set, Tuple from pip._internal.build_env import BuildEnvironment from pip._internal.distributions.base import AbstractDistribution from pip._internal.exceptions import InstallationError from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata i...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/distributions/sdist.py
.py
49005d91ab574a28
7
0
from pip._vendor.packaging.utils import canonicalize_name from pip._internal.distributions.base import AbstractDistribution from pip._internal.index.package_finder import PackageFinder from pip._internal.metadata import ( BaseDistribution, FilesystemWheel, get_wheel_distribution, ) class WheelDistributio...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/distributions/wheel.py
.py
9be2785cefa0bc57
7
0
import functools import logging import os import pathlib import sys import sysconfig from typing import Any, Dict, Generator, Optional, Tuple from pip._internal.models.scheme import SCHEME_KEYS, Scheme from pip._internal.utils.compat import WINDOWS from pip._internal.utils.deprecation import deprecated from pip._inter...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/locations/__init__.py
.py
0e1f0b2561bc2d19
7
0
"""Locations where we look for configs, install stuff, etc""" # The following comment should be removed at some point in the future. # mypy: strict-optional=False # If pip's going to use distutils, it should not be using the copy that setuptools # might have injected into the environment. This is done by removing the...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/locations/_distutils.py
.py
7268ba87adf160d5
7
0
import logging import os import sys import sysconfig import typing from pip._internal.exceptions import InvalidSchemeCombination, UserInstallationInvalid from pip._internal.models.scheme import SCHEME_KEYS, Scheme from pip._internal.utils.virtualenv import running_under_virtualenv from .base import change_root, get_m...
Barath272000/Bug-fixer
.venv/lib/python3.12/site-packages/pip/_internal/locations/_sysconfig.py
.py
8f2355b547cc21fd
7
0
"""Trading calendars — session membership, bar grids, annualization, funding schedules. ONE calendar abstraction (buildabilityCritique.md ruling 3.3): dataDesign.md's ``TradingCalendar`` (``expected_bar_opens``, ``is_session``) and execDesign.md's ``BarCalendar`` (``periods_per_year``, bar arithmetic, funding instants...
arhancanli/canli-pit-lake
src/alphaforge/core/calendar.py
.py
af3d6d7dde04fe36
7
0
"""AlphaForge exception hierarchy. Every error raised by alphaforge code derives from :class:`AlphaForgeError` so callers can catch the whole family with one clause while letting genuine programming errors (``TypeError``, ``KeyError``, ...) propagate unchanged. """ from __future__ import annotations __all__ = [ ...
arhancanli/canli-pit-lake
src/alphaforge/core/errors.py
.py
bc694ae793816da2
7
0
"""THE merged Instrument model and its SCD2 store (buildabilityCritique.md ruling 3.2). One :class:`Instrument` unifies the data-design identity scheme (canonical ``instrument_id``, fee bps, SCD2 validity) with the execution-design trading fields (``can_short``, ``min_qty``). One name per concept: ``tick_size`` (min p...
arhancanli/canli-pit-lake
src/alphaforge/core/instruments.py
.py
3d23402d076ec3a3
7
0
"""Structured logging for AlphaForge (structlog over stdlib logging). Two sinks on the root logger, so both structlog-native and foreign stdlib records (ccxt, urllib3, ...) flow through identical processors: - console: human-readable dev renderer on stderr - JSONL file: ``<log_dir>/alphaforge.jsonl``, rotated by a SI...
arhancanli/canli-pit-lake
src/alphaforge/core/logging.py
.py
b4f5fabb323d2866
7
0
"""Symbol mapping: canonical instrument_id ↔ exchange symbol ↔ ccxt unified symbol. Canonical instrument identity (dataDesign.md §2.3, buildabilityCritique.md ruling 3.2): "<EXCHANGE>:<MARKET>:<EXCHANGE_SYMBOL>" e.g. "BINANCE:PERP:BTCUSDT" - ``EXCHANGE`` and ``EXCHANGE_SYMBOL`` are uppercase; ``MARKET`` is a ...
arhancanli/canli-pit-lake
src/alphaforge/core/symbols.py
.py
e3b4a84fba24764e
7
0
"""UTC time discipline and bar arithmetic — the temporal contract of AlphaForge. Conventions (load-bearing; see dataDesign.md §0 and buildabilityCritique.md ruling 3.1): - All timestamps are UTC. At API boundaries they are integer epoch **milliseconds** (:data:`Ms`). Naive datetimes are a programming error and rais...
arhancanli/canli-pit-lake
src/alphaforge/core/time.py
.py
aab6b78410850be4
7
0
"""Shared order/fill/position value types and enums (execDesign.md §2, re-based on epoch-ms). All timestamps are :data:`~alphaforge.core.time.Ms` (UTC epoch milliseconds) per buildabilityCritique.md ruling 3.1. All monetary amounts are quote-currency units (USDT in v1). Instruments are referenced by canonical ``instru...
arhancanli/canli-pit-lake
src/alphaforge/core/types.py
.py
b1461d92858688be
7
0
"""``EquitiesFlatFilesJob`` — resumable, idempotent daily-bar ingest from Polygon S3 flat files. This is the equities analogue of :class:`~alphaforge.data.ingest.backfill.BackfillJob`, but its unit of work is one trading **day** (the day-aggs panel file holding every ticker that traded), NOT a per-(instrument, dataset...
arhancanli/canli-pit-lake
src/alphaforge/data/ingest/equities.py
.py
73174fbe051cb6d5
7
0
"""``FundamentalsJob`` — resumable, idempotent PIT fundamentals ingest (Polygon financials). The fundamentals analogue of :class:`~alphaforge.data.ingest.backfill.BackfillJob`: its unit of work is one **instrument** (the financials API is per-ticker, not a daily panel like the flat-files bar ingest). For each instrume...
arhancanli/canli-pit-lake
src/alphaforge/data/ingest/fundamentals.py
.py
1b85f26d205e59e6
7
0
"""Retry policies and a request-weight rate budget for ingestion. Two orthogonal protections for every exchange-facing fetch loop: - :func:`transient_retry` — a tenacity ``Retrying`` factory for *transient* failures (network blips, 5xx, rate-limit responses): exponential backoff with full jitter, bounded attempts...
arhancanli/canli-pit-lake
src/alphaforge/data/ingest/retry.py
.py
ba42af1e006694c7
7
0
"""Instrument seeding: live listing merged with the Binance Vision archive (finding 1). The #1 critical leakage fix. Seeding the instrument store from the live endpoint alone (``DataSource.list_instruments``) bakes survivorship bias into every backtest: Binance's REST API only reports *currently listed* markets, so ev...
arhancanli/canli-pit-lake
src/alphaforge/data/ingest/seed.py
.py
23787b7ad2d48f95
7
0
"""``DataSource`` — the asset-agnostic market-data vendor interface. Implementations are dumb fetchers (dataDesign.md §4.1): they normalize a vendor's payloads to the canonical lake schemas in :mod:`alphaforge.data.schemas` and NEVER write to the lake themselves — persistence (dedupe, atomic replace, partial-bar write...
arhancanli/canli-pit-lake
src/alphaforge/data/sources/base.py
.py
e5b68349ebd77ab1
7
0
"""Lake layout — partition paths, glob patterns, and the tmp-file protocol. :class:`LakePaths` is the single source of truth for *where* lake files live; it performs path arithmetic plus read-only directory listing, never data I/O. Both the writer and the reader consume it, so the partition layout (delegated to :func:...
arhancanli/canli-pit-lake
src/alphaforge/data/store/lake.py
.py
c2d0452d754bdf45
7
0