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 |
|---|---|---|---|---|---|---|
"""Flatten/unflatten a CONDITIONING-shaped structure for pickle-free storage.
CONDITIONING is an arbitrary nesting of list/tuple/dict/None/str/int/float/
bool/torch.Tensor (e.g. [[tensor, {"pooled_output": None,
"minimax_token_tags": tensor, "minimax_keyframes": [{"latent": tensor, ...}]}]]).
flatten_tensors() pulls e... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | minimaxh3_clipcache/serialize.py | .py | 134d6d194dcc8f52 | 7 | 0 |
"""Atomic, pickle-free disk cache for CONDITIONING results, keyed by fingerprint.
Two files per entry: "<fingerprint>.safetensors" (tensors) and
"<fingerprint>.json" (the skeleton from minimaxh3_clipcache.serialize.flatten_tensors).
Both are written to a temp file in cache_dir and moved into place with
os.replace(), w... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | minimaxh3_clipcache/store.py | .py | 4d1b45a873498763 | 7 | 0 |
"""Phase 23: stock == cached-MISS == cached-HIT equivalence, plus a
downstream MiniMaxH3AddGuide chain, against the REAL Qwen3-VL MiniMax H3
encoder. Standalone script (no ComfyUI server -- fewer moving parts to run
unsupervised), meant to run under a hard external timeout.
Fully sequential -- ONE resident ~27GB encod... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | scripts/test_stock_vs_cache.py | .py | d0f464527f5205b3 | 7.5 | 0 |
"""Integration-level invalidation tests for CachedClipProxy (phase 21).
test_fingerprint.py already proves compute_fingerprint() itself is sensitive
to each of these inputs. This file proves the same MISS/HIT decisions
actually propagate end to end through CachedClipProxy.tokenize() ->
encode_from_tokens_scheduled() -... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | tests/test_invalidation_integration.py | .py | 28d9427fabec63bc | 7.5 | 0 |
"""Unit tests for minimaxh3_clipcache.loader: resolve_clip_stat() and
build_clip_loader_fn(). No GPU, no real encoder load -- comfy.sd.load_clip
is monkeypatched with a call counter to prove the returned loader is lazy.
"""
import pytest
import comfy.sd
import folder_paths
from minimaxh3_clipcache.loader import buil... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | tests/test_loader.py | .py | d4719e634ef7e30e | 7.5 | 0 |
"""CachedClipProxy must reject a conditioning tensor whose hidden dim isn't
the MiniMax H3 encoder's (MINIMAX_H3_HIDDEN_DIM = 5120). This is the guard
against a clip_name pointing at the wrong checkpoint (e.g. a Gemma encoder,
hidden dim 3840) -- without it the mismatch only surfaces much later as a
cryptic matmul erro... | Mu5hr00moO/ComfyUI-MiniMaxH3-CLIPCached | tests/test_output_validation.py | .py | dabbadecb66f013a | 7.5 | 0 |
"""Typed Gate blockers and deterministic recovery selection."""
from dataclasses import asdict, dataclass
import re
from typing import Literal
BlockerCategory = Literal[
"verification", "implementation", "defect", "harness", "convergence"
]
@dataclass(frozen=True)
class GateBlocker:
code: str
category:... | yezhwi/superpowers-engineering-harness | src/harness/blockers.py | .py | fa3c2ed70536cdb2 | 7.24 | 2 |
"""Harness initialization core (guide sections 8-13).
Non-destructive by construction: existing files are skipped, never
overwritten; directories created only when missing.
"""
from dataclasses import dataclass, field
from pathlib import Path
from harness import templates as templates_mod
from harness.templates impo... | yezhwi/superpowers-engineering-harness | src/harness/init.py | .py | db9051d474ce155f | 7.24 | 2 |
"""Git repository root discovery (guide section 7)."""
from pathlib import Path
class RepositoryNotFoundError(Exception):
"""Raised when no git repository root is found above the start path."""
def find_git_root(start: Path) -> Path:
"""Walk up from `start` until a directory containing `.git` is found.
... | yezhwi/superpowers-engineering-harness | src/harness/repository.py | .py | ec89fdba986f2515 | 7.24 | 2 |
"""Deterministic task state machine for the Engineering Harness.
Single source of truth for the fixed state enum and legal transition
table (spec docs/engineering-harness-v0.1.md sections 6.1-6.3).
"""
from typing import Dict, Set
STATES = frozenset({
"CREATED",
"CLASSIFIED",
"SPECIFYING",
"PLANNED",... | yezhwi/superpowers-engineering-harness | src/harness/state_machine.py | .py | 85cdc939cc86ddbd | 7.24 | 2 |
"""Template locator (guide section 22): locate templates relative to this
repository, never a hard-coded absolute path."""
from importlib import resources
def templates_dir():
"""Return templates bundled with installed ``harness`` package."""
directory = resources.files("harness").joinpath("templates")
i... | yezhwi/superpowers-engineering-harness | src/harness/templates.py | .py | f85a68d9f0d4423f | 7.24 | 2 |
"""Shared Git workspace facts for evidence, Gate, status, and review scope."""
from dataclasses import dataclass
import hashlib
import subprocess
from pathlib import Path
class WorkspaceError(RuntimeError):
"""Git repository state cannot be read deterministically."""
@dataclass(frozen=True)
class WorkspaceSnap... | yezhwi/superpowers-engineering-harness | src/harness/workspace.py | .py | c4896afdcb213d8f | 7.24 | 2 |
"""v0.2 complexity finding persistence."""
import json
import sys
from pathlib import Path
import yaml
import pytest
from jsonschema import ValidationError
REPO = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(REPO / "scripts"))
from complexity import validate_complexity_finding, write_complexity_re... | yezhwi/superpowers-engineering-harness | tests/test_complexity_review.py | .py | a19b53ca6cd8edc1 | 7.74 | 2 |
"""TASK-010: persisted impact analysis control plane."""
import subprocess,sys
from pathlib import Path
import yaml
REPO=Path(__file__).resolve().parent.parent
def cli(cwd,*a): return subprocess.run([sys.executable,'-m','harness.cli',*a],cwd=cwd,capture_output=True,text=True,env={'PYTHONPATH':str(REPO/'src'),'PATH':'/u... | yezhwi/superpowers-engineering-harness | tests/test_impact_control_plane.py | .py | 21a9559eaf970ca4 | 7.74 | 2 |
"""TASK-010: impact plan required before VERIFYING."""
import subprocess,sys
from pathlib import Path
import yaml
REPO=Path(__file__).resolve().parent.parent
def cli(cwd,*a): return subprocess.run([sys.executable,'-m','harness.cli',*a],cwd=cwd,capture_output=True,text=True,env={'PYTHONPATH':str(REPO/'src'),'PATH':'/usr... | yezhwi/superpowers-engineering-harness | tests/test_impact_verification_gate.py | .py | a3af71e7ede67a89 | 7.74 | 2 |
"""v0.2 Minimal Implementation Decision contract."""
import sys
from pathlib import Path
import pytest
from jsonschema import ValidationError
REPO = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(REPO / "scripts"))
from complexity import validate_minimal_decision, write_minimal_decision
def _check(... | yezhwi/superpowers-engineering-harness | tests/test_minimal_implementation.py | .py | 8b9f44786ff373f0 | 7.74 | 2 |
"""
Demo script showing how the assistant would process commands
This works in non-interactive environments
"""
import sys
import time
from assistant import Assistant
def demo_text_mode():
"""Demonstrate the assistant in text mode with simulated inputs"""
print("=== Assistant Demo (Text Mode) ===")
print(... | VishnuMatli/Kutti_Agent | demo.py | .py | a4106d4e12dd1790 | 7 | 0 |
import tkinter as tk
from tkinter import scrolledtext
import threading
import queue
import time
import os
import sys
# Add the current directory to the path so we can import assistant
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from assistant import Assistant
class GuiAssistant:
def __init__(s... | VishnuMatli/Kutti_Agent | gui_assistant.py | .py | fb245fc485df5f46 | 7 | 0 |
import speech_recognition as sr
import pyttsx3
import threading
import time
import subprocess
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
class VoiceAssistant:
def __init__(self):
self.recognizer = sr.Recognizer()
self.microphone = sr.Microphon... | VishnuMatli/Kutti_Agent | voice_assistant.py | .py | cdcaa0f07d4df1d2 | 7 | 0 |
"""语言定义:编译命令、运行命令、文件名约定。
命令依据工具链检测结果实时生成(检测缓存失效后可刷新重建)。
compile/run 回调签名统一为 (toolchain, source_name, mem_mb)。
"""
from __future__ import annotations
import os
from typing import Optional
from ..config import LANGUAGE_LABELS
def _exe(name: str) -> str:
return name + (".exe" if os.name == "nt" else "")
def mak... | wqdongezard/codecoach | backend/app/executor/languages.py | .py | 031dcbd3b62709c1 | 7.15 | 1 |
"""LLM 文本净化:把模型误输出的「字面转义序列」还原为真实字符。
背景:部分模型在 JSON 字符串里表达换行时,会把换行写成两个字符的反斜杠+n
(解析后仍是字面 ``\\n``),前端因此显示成失控的 "\n" 文本且不换行。
本模块把这类「孤立转义」还原为真实字符(``\\n`` → 换行、``\\r``、``\\t``)。
规则(刻意保守,避免破坏合法内容):
- 只有「孤立」反斜杠参与还原:单个 ``\\`` 后跟 ``n/r/t``;
- 成对反斜杠(``\\\\``,表示字面反斜杠)原样保留;
- 因此代码里的合法转义(如 C++ 的 ``'\\n'``、Python 的 ``"\\n"``)不会被改坏
... | wqdongezard/codecoach | backend/app/textutil.py | .py | 81ae3b0be4028af0 | 7.15 | 1 |
#!/usr/bin/env python3
"""
authority_build.py — Phase 5c: AUTHORITY-SCOPE / UNTRUSTED-INSTRUCTION test-set builder.
WHAT THIS PROVES (PDF §11 headline neuron/base safety claim):
"the promotion gate keeps false patterns AND untrusted instructions from becoming
permanent knowledge" + "authority-scope protections".
... | 02-dino/dinomem | benchmark/authority/authority_build.py | .py | 8bd64ddb4cb32a81 | 7.24 | 2 |
#!/usr/bin/env python3
"""
authority_run.py — Phase 5c: AUTHORITY-SCOPE / UNTRUSTED-INSTRUCTION runner (one arm).
Imports mem_authority.py from the arm's procedures/ (base OR neuron overlay) and
calls the write-side gate on each labeled case, then grades the outcome against
gold. DIRECT-CALL, no LLM, no lab archive ->... | 02-dino/dinomem | benchmark/authority/authority_run.py | .py | f8dcfd08ec6fd719 | 7.24 | 2 |
#!/usr/bin/env python3
"""
entityres_run.py — Phase 5e: ENTITY-RESOLUTION runner (one arm).
WHAT THIS PROVES (PDF §2 "entity/relationship reasoning" — currently 0 coverage):
Real transcripts refer to the same entity by varying surface forms ("Alice",
"Alice Chen", "A. Chen"). If the graph treats each as a distinct... | 02-dino/dinomem | benchmark/entityres/entityres_run.py | .py | 911e19f521669f25 | 7.24 | 2 |
#!/usr/bin/env python3
"""lab_embed_index.py — build a LAB-LOCAL memory embedding index for the neuron arm.
WHY THIS EXISTS
---------------
The neuron L2/L3 stages (memory_graph.py, memory_synthesis.py) read per-chunk
EMBEDDINGS from a sqlite index resolved via DINOMEM_MEMORY_DB (default: the REAL
production openclaw-... | 02-dino/dinomem | benchmark/longmemeval/lab_embed_index.py | .py | 1f15a55ccd5783ed | 7.24 | 2 |
#!/usr/bin/env python3
"""memory_search_shim.py — in-sandbox stand-in for the NATIVE memory_search tool.
WHY THIS EXISTS
hybrid_recall fuses FOUR fuzzy legs: docs_search, session_search, graph_search,
and memory_external. The first three are CLI tools it subprocesses itself. The
fourth (memory_external) is NOT a... | 02-dino/dinomem | benchmark/longmemeval/memory_search_shim.py | .py | decad97bd09fb111 | 7.24 | 2 |
#!/usr/bin/env python3
"""
pattern_build.py — Phase 4 (4a): LATENT-PATTERN / RELATIONSHIP test-set builder.
WHAT PHASE 4a PROVES (and Phases 1-3 cannot):
Phases 1-3 test facts that were STATED (retrieve / track / dedup an explicit
fact). 4a tests facts that were NEVER stated but are ENTAILED by a chain of
stated... | 02-dino/dinomem | benchmark/pattern/pattern_build.py | .py | 5b71a11e3595cae0 | 7.24 | 2 |
#!/usr/bin/env python3
"""
peerrep_build.py — Phase 6: PEER-REPRESENTATION test-set builder (extract_user).
WHAT THIS PROVES (the audit gap: a whole extraction pipeline that RAN but was
UNSCORED). dinomem stores memory from every DM peer via extract_user.py, deriving
per-person profiles to memory/peers/<platform>_<id>... | 02-dino/dinomem | benchmark/peerrep/peerrep_build.py | .py | d5fb950a9d8db5ec | 7.24 | 2 |
#!/usr/bin/env python3
"""Single source of truth for dinomem's cheap / non-reasoning model.
AUTO-LINKED to your compaction model, so ONE anchor controls everything:
change `agents.defaults.compaction.model` in openclaw.json and every
non-reasoning dinomem LLM call (extraction, review, ...) follows automatically.
No se... | 02-dino/dinomem | procedures/_cheap_model.py | .py | 0710ebfc9a01e0b9 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Auto Session Reset Orchestrator
Runs session reset then memory extraction sequentially.
Failure in memory extraction does NOT affect session reset.
Usage:
python3 procedures/auto_session_reset.py
Cron (unchanged from original):
*/15 * * * * cd DINOMEM_WORKSPACE_PLACEHOLDER && python3 p... | 02-dino/dinomem | procedures/auto_session_reset.py | .py | 922354592cc36990 | 7.24 | 2 |
#!/usr/bin/env python3
"""
Cleanup bare daily memory files created by OpenClaw memoryFlush.
Companion for startupContext + daily flush (see README → startupContext + daily flush).
These bare `memory/YYYY-MM-DD.md` files exist ONLY to feed OpenClaw's
startupContext (last-N-days injection on /new and /reset). dinomem i... | 02-dino/dinomem | procedures/cleanup_startup_daily.py | .py | 53c0af51a901e76b | 7.24 | 2 |
#!/usr/bin/env python3
"""commit_reason.py — the DROP side of two-tier semantic git-commit subjects.
WHY
A meaningful memory write (a promotion graduating, a fact superseded, a done-note
resolved, a cross-head dedup-merge) ALREADY knows WHY it happened — that reason
is a structured string the caller holds in han... | 02-dino/dinomem | procedures/commit_reason.py | .py | 5d73ee26f0cbfc20 | 7.24 | 2 |
#!/usr/bin/env python3
"""BLOCK UNTIL CI ON A COMMIT IS DECIDED, SO THE HARNESS CAN WAKE THE SESSION.
★★ WHY THIS EXISTS — THE STALL trimcrae SAW, DIAGNOSED. On 2026-08-27 a cycle ended its turn with an
"In flight" board reading `CI tests on 8b22933, adda6f6, 0743ac1`, and then nothing happened for two
hours until a h... | trimcrae/Rare-cancers | research/autonomy/await_ci.py | .py | a2072cf26c2ea568 | 7.15 | 1 |
#!/usr/bin/env python3
"""THE ONE PLACE THAT MINTS AN ID IN THIS LOOP (AUT-PROP-013).
⛔⛔ NOTHING ALLOCATED AN ID OF ANY KIND HERE, AND THE SAME COLLISION FIRED THREE TIMES.
Every session computed the next id as `max(committed) + 1` over the same committed state, so
concurrency was outside the derivation BY CONSTRUCTIO... | trimcrae/Rare-cancers | research/autonomy/ids.py | .py | fe094f7b37067139 | 7.15 | 1 |
#!/usr/bin/env python3
"""THE ONE PLACE THAT NAMES WHAT A CYCLE RECEIPT MUST RECORD ABOUT ITS FAN-OUT.
⛔⛔ WHY THIS FILE EXISTS, AND WHY THE OBVIOUS FIX WAS THE WRONG ONE (AUT-PD-013, 2026-08-27).
`health.py`'s `fanout_is_governed` reads `subagents.max_concurrent` from every receipt. CYC-0017
measured, against the live... | trimcrae/Rare-cancers | research/autonomy/receipt_schema.py | .py | fe0f194cd34910b2 | 7.15 | 1 |
#!/usr/bin/env python3
"""The producer for the publish bar's file-backed clauses — the half that had none.
⛔⛔ WHY THIS FILE EXISTS. `publish_bar.py` is the publication permission. Three of its clauses
read a committed artifact: `hardening-state/<PUB>.json` (clause 1), `preflight-receipts/<sha>.json`
(clause 2) and `re... | trimcrae/Rare-cancers | research/autonomy/record_bar_evidence.py | .py | 300b85bea61a2dc2 | 7.15 | 1 |
#!/usr/bin/env python3
"""WHICH FINISHED LOOP SESSIONS ARE SAFE TO ARCHIVE — the decision, as committed logic.
★★ WHY THIS EXISTS. Every cycle spawns or is spawned as a session, and nothing ever closed one.
Measured 2026-08-27 by trimcrae, who had to ask: of the 40 most recent sessions on the account, 32
were archived... | trimcrae/Rare-cancers | research/autonomy/session_reaper.py | .py | 068caacc88d040c2 | 7.15 | 1 |
#!/usr/bin/env python3
"""The one push channel the autonomy loop has, and the only thing that can report its own death.
⛔⛔ THE FAILURE THIS EXISTS FOR IS THE QUIETEST ONE AVAILABLE. `health.py` grades the loop and
commits the board — but a red board committed to a repository nobody is reading tells nobody. If the
driv... | trimcrae/Rare-cancers | research/autonomy/stall_alarm.py | .py | b52a98d954e83c03 | 7.15 | 1 |
#!/usr/bin/env python3
"""A worker's STATUS is not its PROGRESS, and only one of them can be trusted.
⛔⛔ MEASURED 2026-08-27, AND trimcrae FOUND IT BEFORE THE LOOP DID. A seat was dispatched, died on
its FIRST message, and `ListAgents` reported it `running` for 2 h 36 m. The driver relayed that
status as "in flight" s... | trimcrae/Rare-cancers | research/autonomy/tests/test_a_dead_holder_parks_an_item.py | .py | 3a9dd4a673308d6e | 7.65 | 1 |
#!/usr/bin/env python3
"""The ranker must survive the ledger it actually ranks (AUT-PD-019).
⛔⛔ THE DEFECT: `priority.py` — the thing that decides what the loop works on next — exited 1 on
every invocation against the committed ledger. `KeyError: 'score_inputs'`, at the line that records
the evidenced-block penalty. `... | trimcrae/Rare-cancers | research/autonomy/tests/test_priority_ranks_the_hand_filed_entries_too.py | .py | d079e1185e61541f | 7.65 | 1 |
"""How many clauses the publish bar has is `len(CLAUSES)`. Nothing may say it in words.
⛔⛔ WHY THIS EXISTS, FOUND 2026-08-27. `clause_7_readable_enough_to_review` landed in commit
648114fb2 at 12:41 PM ET. The count "six" was then wrong in NINE places at once:
research/autonomy/publish_bar.py ... | trimcrae/Rare-cancers | research/autonomy/tests/test_the_clause_count_is_never_typed.py | .py | 3eab7b74c5ca87ca | 7.65 | 1 |
#!/usr/bin/env python3
"""Generate the two display-item tables of the fusion-junction ASO JOURNAL article.
⛔ WHY THIS EXISTS AS A GENERATOR RATHER THAN AS PROSE IN THE MANUSCRIPT. The journal article is a
second document restating sequences the preprint already carries, and this programme has already had
a parallel co... | trimcrae/Rare-cancers | research/manuscripts/aso_journal_tables.py | .py | 779618f216a9122a | 7.15 | 1 |
#!/usr/bin/env python3
"""Build a paper's aiXiv submission metadata FROM the manuscript, so the two cannot disagree.
⛔ WHY A GENERATOR RATHER THAN A HAND-WRITTEN JSON. The metadata is what a third party publishes as
the version of record; the manuscript is what a reader is told. Retyping a title or an abstract into
a ... | trimcrae/Rare-cancers | research/manuscripts/build_aixiv_metadata.py | .py | ac164aeb3a0f1aec | 7.15 | 1 |
#!/usr/bin/env python3
"""Build the Word (.docx) manuscript a Nucleic Acid Therapeutics submission actually needs.
⛔ WHY THIS EXISTS AT ALL, AND IT IS NOT A CONVENIENCE. Read at primary source 2026-08-23 and
captured verbatim to `research/literature/nat-submission-guidelines-2026-08-23.md`:
"The preferred format ... | trimcrae/Rare-cancers | research/manuscripts/build_submission_docx.py | .py | 955f177de34ad0f3 | 7.15 | 1 |
#!/usr/bin/env python3
"""Does the census's word "covered" survive being TESTED? Ablation, not inspection.
⛔⛔ WHY THIS EXISTS — THE ROUND-16 DIAGNOSIS, WHICH IS ONE LEVEL ABOVE ROUND 15'S.
`claim_coverage.py` was written because fifteen review rounds would not converge: every blocker was
a surface with zero instrumen... | trimcrae/Rare-cancers | research/manuscripts/claim_ablation.py | .py | a9d711408b037e7c | 7.15 | 1 |
"""Typed data-core failures converted to ToolEnvelope errors at boundaries."""
from __future__ import annotations
from typing import Any
# 只有上游可恢复故障才允许重试;契约、歧义、未找到等语义错误重试没有意义。
RETRYABLE_CODES: frozenset[str] = frozenset(
{
"DATA_SOURCE_ERROR",
"RATE_LIMITED",
"UPSTREAM_TIMEOUT",
}
)
... | Shaaaaaaaaark/akshare-fund-advisor | src/fund_advisor_data_core/errors.py | .py | a83a3b42c88d4e77 | 7 | 0 |
"""AKShare-backed fund provider functions."""
from __future__ import annotations
from typing import Any
import pandas as pd
from fund_advisor_data_core.audit import SUPPORTED_AKSHARE_VERSION
from fund_advisor_data_core.errors import DataCoreError
class AKShareFundProvider:
"""Thin provider wrapper around AKSh... | Shaaaaaaaaark/akshare-fund-advisor | src/fund_advisor_data_core/providers/akshare/funds.py | .py | 1caeeebf3dff9f00 | 7 | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
from functools import partial, reduce
from operator import mul
from timm.lay... | Jeneveuxpas/iREPA | jit/models/mocov3_vit.py | .py | 15d0c0e4fbf631da | 7 | 0 |
import torch.nn as nn
import math
ALL_PROJECTION_LAYER_TYPES = ["mlp", "linear", "conv"]
def build_mlp(hidden_size, projector_dim, z_dim, **kwargs):
return nn.Sequential(
nn.Linear(hidden_size, projector_dim),
nn.SiLU(),
nn.Linear(projector_dim, projector_dim),
nn.SiLU(),
... | Jeneveuxpas/iREPA | jit/projectors.py | .py | b7b4e18749d52b8e | 7 | 0 |
"""Spatial normalization for vision encoder features."""
import torch
ALL_SPNORM_METHODS = ["none", "zscore"]
def spatial_zscore(feat: torch.Tensor, alpha: float = 1.0, eps: float = 1e-6) -> torch.Tensor:
"""
Z-score normalization along spatial dimension.
Args:
feat: (B, T, D) patch tokens
... | Jeneveuxpas/iREPA | jit/spnorm.py | .py | 8d73e99de3ef3e05 | 7 | 0 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Samples a large number of images from a pre-trained SiT model using DDP.
Subsequently saves a .npz file that can be us... | Jeneveuxpas/iREPA | ldm/generate.py | .py | 6c8a624a03ac1252 | 7 | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
from functools import partial, reduce
from operator import mul
from timm.lay... | Jeneveuxpas/iREPA | ldm/models/mocov3_vit.py | .py | 6ba63bdd48475a46 | 7 | 0 |
#!/usr/bin/env python3
"""Morning briefing generator for last30days.
Synthesizes accumulated findings into formatted briefings.
The Python script collects the data; the agent (via SKILL.md) does the
beautiful synthesis. This script provides the structured data.
Usage:
python3 briefing.py generate # D... | babuyana/last30days-skill | skills/last30days/scripts/briefing.py | .py | d4881d16493f5504 | 7 | 0 |
"""Bird X search client for the v3.0.0 last30days pipeline.
Uses a vendored subset of @steipete/bird v0.8.0 (MIT License) to search X
via Twitter's GraphQL API. No external `bird` CLI binary needed - just Node.js.
See scripts/lib/vendor/bird-search/package.json for authoritative version.
"""
import json
import os
imp... | babuyana/last30days-skill | skills/last30days/scripts/lib/bird_x.py | .py | bf38b6798370fc14 | 7 | 0 |
"""Bluesky search via AT Protocol (requires app password).
Uses bsky.social for auth and api.bsky.app for post search (the canonical
authenticated AppView). The previous default `public.api.bsky.app` is the
unauthenticated public mirror, which BunnyCDN now blocks for searchPosts
regardless of auth header (verified 202... | babuyana/last30days-skill | skills/last30days/scripts/lib/bluesky.py | .py | af7bbaa68f6944a5 | 7 | 0 |
"""Chrome and Brave cookie extraction for macOS.
Extracts cookies from Chromium-based browser SQLite databases using only
stdlib modules and the system openssl CLI (ships with macOS). Zero pip
dependencies.
Chromium on macOS uses v10 encryption (AES-128-CBC with Keychain-stored key).
Chrome and Brave share the same a... | babuyana/last30days-skill | skills/last30days/scripts/lib/chrome_cookies.py | .py | eeb8f99b92cfc9aa | 7 | 0 |
"""Candidate clustering and representative selection."""
from __future__ import annotations
import re
from . import dedupe, schema
CLUSTERABLE_INTENTS = {"breaking_news", "opinion", "comparison", "prediction"}
# Words too common to signal shared topic between clusters.
_ENTITY_STOPWORDS = frozenset({
"the", "a... | babuyana/last30days-skill | skills/last30days/scripts/lib/cluster.py | .py | fa9fb8905552e7bb | 7 | 0 |
"""Discover peer entities ("competitors") for a topic via web search.
Mirrors the `resolve.auto_resolve()` pattern: fan out 2-3 web searches via
`grounding.web_search()`, then extract capitalized entity candidates from
titles and snippets with deterministic text mining. No LLM call — the
hosting reasoning model can al... | babuyana/last30days-skill | skills/last30days/scripts/lib/competitors.py | .py | a76c5d679b7f3c93 | 7 | 0 |
"""Browser cookie extraction for last30days.
Extracts cookies from local browser databases (Firefox, Chrome, Brave, Safari)
to enable zero-config authentication for services like X/Twitter.
Only uses Python stdlib — no external dependencies.
"""
import configparser
import functools
import logging
import platform
imp... | babuyana/last30days-skill | skills/last30days/scripts/lib/cookie_extract.py | .py | 9d34ea3a8565eae8 | 7 | 0 |
"""Date utilities for last30days skill."""
from datetime import datetime, timedelta, timezone
from typing import Optional, Tuple
def get_date_range(days: int = 30) -> Tuple[str, str]:
"""Get the date range for the last N days.
Returns:
Tuple of (from_date, to_date) as YYYY-MM-DD strings
"""
... | babuyana/last30days-skill | skills/last30days/scripts/lib/dates.py | .py | ae4ec6455021c82e | 7 | 0 |
"""Digg AI 1000 source for last30days.
Shells out to ``digg-pp-cli`` (read-only, no auth required) to surface
clustered stories curated from ~1000 high-signal AI accounts on X. Each
cluster carries a published TLDR, a curatorial rank, and a list of X
posts that can be fetched as inline quotes.
Activation gate: this s... | babuyana/last30days-skill | skills/last30days/scripts/lib/digg.py | .py | 95a2845d4751efb5 | 7 | 0 |
"""Entity extraction from initial search results for supplemental searches."""
import re
from collections import Counter
from typing import Any, Dict, List
# Handles that appear too frequently to be useful for targeted search.
# These are generic/platform accounts, not topic-specific voices.
GENERIC_HANDLES = {
"... | babuyana/last30days-skill | skills/last30days/scripts/lib/entity_extract.py | .py | b041031039819155 | 7 | 0 |
"""Parallel multi-entity fan-out for the --competitors flag.
The orchestrator accepts a `main_runner()` for the topic and a
`competitor_runner(entity)` for each peer. It parallelizes their execution
via a `ThreadPoolExecutor` and collects per-entity Reports. Per-entity
failures are logged and dropped; the run survives... | babuyana/last30days-skill | skills/last30days/scripts/lib/fanout.py | .py | 43f21244f9bd1bf1 | 7 | 0 |
"""Hacker News search via Algolia API (free, no auth required).
Uses hn.algolia.com/api/v1 for story discovery and comment enrichment.
No API key needed - just HTTP calls via stdlib urllib.
"""
import datetime
import html
import math
import sys
import time
from concurrent.futures import ThreadPoolExecutor, as_complet... | babuyana/last30days-skill | skills/last30days/scripts/lib/hackernews.py | .py | 95db30a3bf441ee7 | 7 | 0 |
"""HTTP utilities for last30days skill (stdlib only)."""
import json
import re
import socket
import sys
import time
import urllib.error
import urllib.request
from typing import Any, Dict, Optional, Union
from urllib.parse import urlencode
from . import log as _log
DEFAULT_TIMEOUT = 30
def log(msg: str):
"""Log... | babuyana/last30days-skill | skills/last30days/scripts/lib/http.py | .py | 42c6ac265d5456c6 | 7 | 0 |
"""Instagram Reels search via ScrapeCreators API for /last30days.
Uses ScrapeCreators REST API to search Instagram Reels by keyword, extract
engagement metrics (views, likes, comments), and fetch video transcripts.
Requires SCRAPECREATORS_API_KEY in config. 100 free API calls, then PAYG.
API docs: https://scrapecreat... | babuyana/last30days-skill | skills/last30days/scripts/lib/instagram.py | .py | cda8c8558e6cdc9b | 7 | 0 |
"""Shared logging utilities for last30days skill."""
import os
import sys
DEBUG = os.environ.get("LAST30DAYS_DEBUG", "").lower() in ("1", "true", "yes")
def debug(msg: str) -> None:
"""Log debug message to stderr (only when LAST30DAYS_DEBUG is set)."""
if DEBUG:
sys.stderr.write(f"[DEBUG] {msg}\n")
... | babuyana/last30days-skill | skills/last30days/scripts/lib/log.py | .py | 11c4d61cdb5b1ff9 | 7 | 0 |
"""Perplexity Sonar Pro / Deep Research via OpenRouter API.
Queries Perplexity models through OpenRouter for AI-synthesized research
with citation annotations. Returns normalized items with synthesis text
and individual citation entries.
"""
from __future__ import annotations
import sys
from urllib.parse import urlp... | babuyana/last30days-skill | skills/last30days/scripts/lib/perplexity.py | .py | 70859e7296035936 | 7 | 0 |
"""Pinterest search via ScrapeCreators API for /last30days.
Uses ScrapeCreators REST API to search Pinterest by keyword, extract
engagement metrics (saves, comments), and return pin descriptions.
Requires SCRAPECREATORS_API_KEY in config. 100 free API calls, then PAYG.
API docs: https://scrapecreators.com/docs
"""
i... | babuyana/last30days-skill | skills/last30days/scripts/lib/pinterest.py | .py | a6ac5085c900072b | 7 | 0 |
"""Engine-side query-quality pre-flight.
Detects Class 1 (demographic shopping) keyword-trap queries and returns a
structured REFUSE message. The caller (scripts/last30days.py main()) writes
the message to stderr and exits code 2. No pipeline work runs on a doomed
query; the model sees the REFUSE on stderr and asks th... | babuyana/last30days-skill | skills/last30days/scripts/lib/preflight.py | .py | 0fafa53bc63a44ad | 7 | 0 |
"""Post-research quality score and upgrade nudge.
Computes a quality score based on 5 core sources and builds
a nudge message describing what the user missed and how to fix it.
"""
from typing import List
# The 5 core sources
CORE_SOURCES = ["hn", "polymarket", "x", "youtube", "reddit"]
# Labels for display
SOURCE... | babuyana/last30days-skill | skills/last30days/scripts/lib/quality_nudge.py | .py | 69b6d58abea8171c | 7 | 0 |
"""Shared query preprocessing utilities: noise-word stripping, core subject
extraction, and compound term detection. Used by all search modules."""
import re
from typing import FrozenSet, List, Optional, Set
# Common multi-word prefixes stripped from all queries (identical across modules)
PREFIXES = [
'what are t... | babuyana/last30days-skill | skills/last30days/scripts/lib/query.py | .py | 6bc2e0649034cdb2 | 7 | 0 |
"""Reddit thread enrichment with real engagement metrics.
Supports two backends:
1. ScrapeCreators API (preferred) - no rate limits, 1 credit/call
2. reddit.com/.json (fallback) - free but 429-prone
"""
import re
from typing import Any, Dict, List, Optional
from urllib.parse import urlparse
from . import http, dates... | babuyana/last30days-skill | skills/last30days/scripts/lib/reddit_enrich.py | .py | 652a9c5abecf22f3 | 7 | 0 |
"""Keyless Reddit pipeline: tiered free search + comment enrichment.
Replaces the dead ``.json`` free path. Discovery tiers, cheapest/most-likely
first; enrichment then runs on whatever was discovered:
Tier 0 one-shot legacy ``.json`` search — demoted. Datacenter IPs get 403,
but a residential machine (w... | babuyana/last30days-skill | skills/last30days/scripts/lib/reddit_keyless.py | .py | 72d69b54dad5ba3e | 7 | 0 |
"""Reddit public ``.json`` search module (demoted to keyless Tier 0).
Reddit's public ``.json`` endpoints now return HTTP 403 from most contexts
(shreddit anti-bot), so this is no longer the primary free path. The keyless
pipeline (see reddit_keyless.py) still calls ``search`` as a cheap one-shot
Tier 0 attempt — a re... | babuyana/last30days-skill | skills/last30days/scripts/lib/reddit_public.py | .py | 88a70d514b932e7a | 7 | 0 |
"""Keyless Reddit discovery via public RSS/Atom feeds.
Reddit's ``.json`` search endpoints now return HTTP 403 (shreddit anti-bot).
RSS feeds still serve HTTP 200 with no API key, so this module uses them for
post discovery, replacing ``reddit_public.search`` as the free search path.
Two feed families are combined an... | babuyana/last30days-skill | skills/last30days/scripts/lib/reddit_rss.py | .py | 11621cd978fcb9fa | 7 | 0 |
"""Keyless Reddit comment enrichment via shreddit /svc endpoints.
Reddit's ``{thread}.json`` endpoint now returns HTTP 403. The shreddit partial
endpoint ``/svc/shreddit/comments/r/{sub}/t3_{id}`` still serves HTTP 200 HTML
with no API key, embedding each comment as a ``<shreddit-comment>`` custom
element whose start-... | babuyana/last30days-skill | skills/last30days/scripts/lib/reddit_shreddit.py | .py | 6ef2ead75c660c83 | 7 | 0 |
"""Shared token-overlap relevance scoring for search result ranking.
The score is intentionally query-centric:
- exact phrase matches should score very high
- partial matches should pay a meaningful penalty
- matches on generic words alone ("odds", "review") should not pass as relevant
"""
import re
from typing impor... | babuyana/last30days-skill | skills/last30days/scripts/lib/relevance.py | .py | b9f776f9f8e5d4fb | 7 | 0 |
"""Reranking with LLM-scored relevance and demotion of low-confidence candidates."""
from __future__ import annotations
import json
import re
from . import http, providers, query, schema
# Penalty applied when a candidate does not mention the primary entity
# from the topic in its title or snippet. Picked empirica... | babuyana/last30days-skill | skills/last30days/scripts/lib/rerank.py | .py | 419c52fc08144c41 | 7 | 0 |
"""Auto-resolve subreddits, X handles, and current events context for a topic.
Uses web search (Brave/Exa/Serper) to discover relevant communities and context
before the planner runs. This is the engine-side equivalent of SKILL.md Steps
0.55/0.75 which use Claude Code's WebSearch tool.
"""
from __future__ import anno... | babuyana/last30days-skill | skills/last30days/scripts/lib/resolve.py | .py | b23f3dd54d6ede09 | 7 | 0 |
"""
Safari binary cookie extractor for macOS.
Parses ~/Library/Cookies/Cookies.binarycookies (unencrypted binary format)
using only stdlib. Zero pip dependencies.
Reference: github.com/mdegrazia/Safari-Binary-Cookie-Parser
"""
from __future__ import annotations
import io
import struct
import sys
from pathlib import... | babuyana/last30days-skill | skills/last30days/scripts/lib/safari_cookies.py | .py | 4d66c27cbf5725cc | 7 | 0 |
#!/usr/bin/env python3
"""PostToolUse hook: fast syntax gate on edited Python files.
Blanket `tsc --noEmit` is intentionally NOT run here — `tsc` hangs in this repo
(see CLAUDE.md Build Tools). Instead we do the cheap, high-signal check the repo
already relies on: `ast.parse` on any edited .py file, which catches the
... | 0xSoftBoi/suwappubot | .claude/hooks/parse-check.py | .py | 7689063397369a41 | 7.3 | 3 |
#!/usr/bin/env python3
"""Stop hook: distill the finished session's transcript into one journal line.
This is the telemetry half of the self-improving harness (see
docs/harness/self-improving.md). Every session appends exactly one compact
JSON record to .claude/harness/journal/YYYY-MM.jsonl capturing friction
signals ... | 0xSoftBoi/suwappubot | .claude/hooks/session-journal.py | .py | 7d6ff0388dea3025 | 7.3 | 3 |
#!/usr/bin/env python3
"""SessionStart hook: surface the things that have historically killed a session.
Cheap, read-only, never blocks. Prints a short WARN banner so the conductor sees
the hazard on turn 0 instead of discovering it at commit time:
1. Unset git identity -> forced a clean commit rebuild in a past se... | 0xSoftBoi/suwappubot | .claude/hooks/session-preflight.py | .py | 714269e2abaadba7 | 7.3 | 3 |
#!/usr/bin/env python3
"""Close-to-tray demo — system tray with a native menu (lumiview .dev4).
- Close the window → the app hides to the tray instead of quitting.
- Right-click the tray icon for the menu (Show / Quit); left-click
toggles the window (``menu_on_left_click=False`` frees the left
button for ``on_left... | HarcicYang/Neony | demo_tray.py | .py | 3bf2549565748c02 | 7.15 | 1 |
#!/usr/bin/env python3
"""Build the standalone gallery executable with Nuitka (onefile).
Mirrors the Nuitka step in ``.github/workflows/packaging.yml``:
1. sync dev deps + install Nuitka[onefile]
2. build ``neony.gallery.__main__`` as a single-file executable
3. rename the artifact to ``neony-gallery_<os>... | HarcicYang/Neony | scripts/build_nuitka.py | .py | 8de5e1e4984926d9 | 7.15 | 1 |
#!/usr/bin/env python3
"""Run the full project check suite in one pass and summarize the results.
Mirrors the checks in ``.github/workflows/ci.yml``:
ruff check . ruff format --check .
pyrefly check
pytest -v --tb=short (smoke tests excluded by default)
npm test (vi... | HarcicYang/Neony | scripts/check_all.py | .py | 2c5877401fc5ad42 | 7.15 | 1 |
"""Internal helpers for :class:`~neony.application.app.NeonApplication` —
per-window runtime state (``_Entry``), the built-in keyframes injected
into every window, the style-deferred event set, and the small platform
helpers (native file-drop metadata, ``eval_js`` result decoding,
clipboard-read fallback messaging, the... | HarcicYang/Neony | src/neony/application/_helpers.py | .py | fe399bb3f5664207 | 7.15 | 1 |
"""Pydantic configuration models for NeonApplication.
Groups LumiView's ``Window.create`` parameters into focused sub-models
so applications configure by concern instead of a single god-method
with ~50 keyword arguments.
"""
from __future__ import annotations
from typing import Any
from lumiview import CloseBehavio... | HarcicYang/Neony | src/neony/application/config.py | .py | 5b6cf5a1e0ea3bcc | 7.15 | 1 |
"""System-native file dialogs — the app-facing seam.
``show_dialog`` shells out to the platform's own picker (zenity on
Linux, osascript on macOS, PowerShell on Windows, tkinter fallback —
see :mod:`neony._dialog_worker`) inside an executor thread so the
asyncio loop never blocks while the dialog is up. The worker's ... | HarcicYang/Neony | src/neony/application/dialogs.py | .py | 5c12d09733999dc3 | 7.15 | 1 |
"""Internal panel-host machinery: a scrollable column of slot Divs where
exactly one slot is visible at a time. Owns the visibility toggle (and
the replayed entrance animation) that keeps pane roots cached and
mounted — switching never moves DOM elements, so pane state (input
values, scroll offsets) survives switches.... | HarcicYang/Neony | src/neony/application/elements/_panels.py | .py | 4653948889430ae5 | 7.15 | 1 |
"""Accordion / Collapsible — expandable sections in a single scroll flow.
A :class:`Collapsible` is one titled row that toggles a content panel
between hidden and visible (replaying the built-in ``neony-drop-in``
entrance animation on every expand). An :class:`Accordion` stacks
collapsibles; with ``multiple``
(the de... | HarcicYang/Neony | src/neony/application/elements/accordion.py | .py | 08c3105c04a00602 | 7.15 | 1 |
"""Avatar component — a circular or square user thumbnail.
With ``src`` the avatar shows the image (cropped by ``object-fit``); with
only ``name`` it falls back to a one-letter initial on an accent disc; with
neither it shows an empty placeholder. An optional ``badge`` (a corner
:class:`Badge`) is overlaid — the avat... | HarcicYang/Neony | src/neony/application/elements/avatar.py | .py | da0be02008ea72b4 | 7.15 | 1 |
"""Badge component — a small status label or corner count.
Two shapes share one class:
- ``position="inline"`` (default) — a pill that flows with text, tinted by
``variant`` (accent / danger / success / neutral).
- ``position="top-right"`` etc. — the same pill absolutely positioned as a
count badge. The componen... | HarcicYang/Neony | src/neony/application/elements/badge.py | .py | 8e30a13c5d0cd044 | 7.15 | 1 |
"""Button component — themed, glass-tinted, chainable events."""
from __future__ import annotations
from typing import Literal
from neony.application.theme import Theme, stub
from neony.dom import BoxShadow, Color, DOMElement, DomEvent, Shadow, Span, Styles, Transition
from neony.dom import Button as _ButtonElem
fr... | HarcicYang/Neony | src/neony/application/elements/button.py | .py | cbd41de5ced1fd69 | 7.15 | 1 |
"""Card component — a titled content panel.
A card stacks an optional header (a title + subtitle, or a custom header
slot, with an optional right-aligned action row), a body of arbitrary
children, and an optional footer (commonly a right-aligned button row
above a separator). ``glass=True`` swaps the solid surface fo... | HarcicYang/Neony | src/neony/application/elements/card.py | .py | e0c21ac242f18153 | 7.15 | 1 |
"""CascadingDropdown — a selector with nested option branches."""
from __future__ import annotations
from collections.abc import Sequence
from typing import Any, Self
from neony.application.theme import stub
from neony.dom import Button as _ButtonElem
from neony.dom import Color, Div, DomEvent, Filter, Span, Styles
... | HarcicYang/Neony | src/neony/application/elements/cascading_dropdown.py | .py | 188ef64c92bb8342 | 7.15 | 1 |
"""Checkbox component — custom-styled, stateful, chainable events.
The native WebKitGTK checkbox is replaced with a themed rounded box:
``appearance: none`` strips the system look, and the checked state is
driven by the component itself — accent background + white check SVG.
"""
from __future__ import annotations
im... | HarcicYang/Neony | src/neony/application/elements/checkbox.py | .py | 8bdf936b733b20dd | 7.15 | 1 |
"""ComboBox component — editable text with a themed suggestion popup.
The native ``<datalist>`` suggestion popup is rendered by the OS/UI
process and cannot be themed, so the suggestions are drawn here: a
glass panel of native ``<button>`` rows anchored below the input,
filtered by prefix as you type.
Keyboard: Arrow... | HarcicYang/Neony | src/neony/application/elements/combobox.py | .py | ed17b58f3fe01423 | 7.15 | 1 |
"""Dialog component — a modal overlay with a themed scrim and a
centered panel.
The root is a fixed, full-viewport layer (``z-index: 1000``) that shows
/hides as a whole — the scrim is a keyed child, so clicks inside the
panel resolve to panel-descendant keys and never hit the scrim's close
handler. Close paths: scri... | HarcicYang/Neony | src/neony/application/elements/dialog.py | .py | 84013f33f83fe600 | 7.15 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.