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 |
|---|---|---|---|---|---|---|
"""Code execution output envelope: format / truncate / overflow-to-file.
The exec node (`_exec.py`) runs agent code and collects its merged stdout+stderr
stream; this module turns that raw stream into the "Code execution output:"
envelope fed back to the LLM. Split out from `_exec.py` to keep that file's line
budget —... | zhiyuan-zhang0206/Ava | agent/graph/_exec_output.py | .py | 7c5471cbe3012914 | 7 | 0 |
"""Owned lifetime of one disposable ``execute_code`` process tree.
Each run has exactly one direct-child reap task, one domain-close task, and one
reader-join task. POSIX owns a process group. Windows owns a Job Object whose
handle survives root exit and kills every non-breakaway member when closed.
"""
from __future... | zhiyuan-zhang0206/Ava | agent/graph/_exec_process.py | .py | ed08291475c617ac | 7 | 0 |
"""Exec-subprocess protocol — request/result envelopes and typed
(de)serialization, shared by the parent (`agent/graph/_exec_subprocess.py`)
and the child entry (`agent/exec_child.py`).
Two envelope files per run, both under `<exec_dir>/<agent_id>/` and chmod 0600 (the
snapshot carries the agent's full message history... | zhiyuan-zhang0206/Ava | agent/graph/_exec_protocol.py | .py | b8d6a5b71c6fce66 | 7 | 0 |
"""Exec outcome sum type — the mutually exclusive result variants one
`execute_code` run produces, plus the priority constructor and the
parent-side placeholder for a crash that happened in a child process.
Moved out of `agent/graph/_exec.py` (2026-08, exec-subprocess work) so the
subprocess machinery (`agent/graph/_e... | zhiyuan-zhang0206/Ava | agent/graph/_exec_result.py | .py | 5b9e46790ba9c9a2 | 7 | 0 |
"""Streaming output plumbing for the exec node: capture the exec child's
stdout/stderr and publish it incrementally for live frontend display.
`StreamingTextIO` is the sink `contextlib.redirect_stdout/stderr` writes into —
bounded by `exec_output_accumulation_max_chars`, so a runaway print loop is
truncated head+tail ... | zhiyuan-zhang0206/Ava | agent/graph/_exec_stream.py | .py | 6539eb3410a02e41 | 7 | 0 |
"""Exec subprocess mechanics — the parent side: spawn / poll / signal / kill /
collect one disposable child per execute_code call.
The parent polls every 50ms and owns teardown through direct-child reap,
root-independent process-domain close, and a bounded output-reader join. POSIX
owns a new process group; Windows ow... | zhiyuan-zhang0206/Ava | agent/graph/_exec_subprocess.py | .py | 4da39d02206a8332 | 7 | 0 |
"""Interrupt-in-node RAII.
When entering an interruptible section (the LLM stream or code execution), the
node uses `async with subscribe_interrupt(...) as event:` to get an
asyncio.Event; the context manager spawns a background task that watches for a
durable interrupt inbound (kind 'cancel' or 'terminate') for this ... | zhiyuan-zhang0206/Ava | agent/graph/_interrupt.py | .py | 8e38d7b5ea4575b8 | 7 | 0 |
"""Chunk assembly + final-message validation for the llm node.
``_assemble_final_message`` folds the streamed ``AIMessageChunk`` list into one
``AIMessage`` via chunk addition, then runs the fail-fast validators:
``_sanitize_thinking_blocks`` (DeepSeek thinking-delta drift repair) and
``_validate_stop_reason`` (missin... | zhiyuan-zhang0206/Ava | agent/graph/_llm_chunk.py | .py | 5361a9392a54fac9 | 7 | 0 |
"""Stream-layer failure taxonomy + consecutive-error tracking for the llm node.
Owns every fail-fast exception the llm node raises (the ``LLMStreamError``
hierarchy, ``FatalLLMStreamError``, ``FatalProviderError``), the provider-error
classification helpers (``shared.lm.errors.classify_error`` → structured log →
optio... | zhiyuan-zhang0206/Ava | agent/graph/_llm_errors.py | .py | 0fcc4bb57de3db6f | 7 | 0 |
"""The relevance filter passive recall runs between retrieval and injection.
Vector search always returns its top-k. However weak the match, notes come back
— so recall without a filter injects its top-k every turn, and a note that
merely shares a word with the question arrives looking like context the agent
should ac... | zhiyuan-zhang0206/Ava | agent/graph/_memory_filter.py | .py | 85697080519fbf02 | 7 | 0 |
"""Passive memory recall: content-triggered injection of memory-pool notes.
Where `memory_index_note` (this plugin's `notes.py`) keeps the standing index
(MEMORY.md) permanently in front of the agent, passive recall reaches into the
*rest* of the pool: before a turn woken by new inbound, it runs a semantic
search keye... | zhiyuan-zhang0206/Ava | agent/graph/_memory_recall.py | .py | 3b4ecdc8fafc67f9 | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Unpack the Playwright evidence the Unsloth payload smuggled home.
Kaggle's ``kernels output`` returns the whole of ``/kaggle/working``, and the
shared launcher deliberately does not take it: a previous ... | Datta0/unsloth-staging-3 | .github/scripts/kaggle_studio_ci/collect_evidence.py | .py | 11dd813d19611dbd | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Is this run's step count one that can train anything? Answered before paying.
``max_steps`` is a free-text ``workflow_dispatch`` input, and both ways of
getting it wrong cost a Kaggle session and report... | Datta0/unsloth-staging-3 | .github/scripts/kaggle_t4_ci/check_steps.py | .py | 44c0d46816a2bd15 | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Turn collected Kaggle evidence into a job summary and an exit code.
The only place that decides whether the workflow goes red, on a deliberately
narrow line: red means the payload RAN on a T4 and disagr... | Datta0/unsloth-staging-3 | .github/scripts/kaggle_t4_ci/report.py | .py | 9ddf4de12ffc8d74 | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Select the newest SemVer-tagged desktop release carrying a required asset."""
from __future__ import annotations
import argparse
import json
import re... | Datta0/unsloth-staging-3 | .github/scripts/resolve-desktop-release.py | .py | 9120f23b948b4e5d | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Four turns through both SDKs, twice, against a running Unsloth server.
Two properties at once. The conversation is built so that turns 2 and 4 are only
answerable from the e... | Datta0/unsloth-staging-3 | .github/scripts/studio_smoke/multi_turn_chat.py | .py | d3e0e17f8807badb | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Build a pre-quantized transformer checkpoint for the Unsloth diffusion fast path.
Quantise a model's dense bf16 DiT transformer ONCE and save the quantized state dict, so
th... | Datta0/unsloth-staging-3 | scripts/build_prequant_checkpoint.py | .py | 3cf4276240f7d9f8 | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Build a pre-cast text-encoder checkpoint for the Unsloth TE prequant path.
Apply the runtime layerwise-fp8 STORAGE cast (``diffusion_precision._cast_fp8``) to a
model's dens... | Datta0/unsloth-staging-3 | scripts/build_te_prequant_checkpoint.py | .py | e37d8d4df44e043d | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Diff two `package-lock.json` files and flag NEW install-script deps.
A `"hasInstallScript": true` package runs preinstall/install/postinstall
hooks on every `npm ci` -- the lever ... | Datta0/unsloth-staging-3 | scripts/check_new_install_scripts.py | .py | df1b16534ddb4600 | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Probe two candidate levers from the optimization research, on the real GGUF path:
* `coordinate_descent_tuning` (Inductor) -- lossless extra kernel autotuning.
* FirstBl... | Datta0/unsloth-staging-3 | scripts/leverage_probe.py | .py | c42e3fc0e7e5aefc | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Refuse backend source that needs a newer interpreter than the matrix floor.
A pull request runs Backend CI on the NEWEST interpreter only. Every older... | Datta0/unsloth-staging-3 | scripts/lint_backend_python_floor.py | .py | ad4b1c4c12b9ab75 | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Refuse silent llama-server parallel-slot downgrades.
#7717 clamped `--parallel` to 1 whenever MTP resolved, so a batched API caller
lost 4x throughput with nothing but a log line ... | Datta0/unsloth-staging-3 | scripts/lint_no_parallel_clamp.py | .py | a067e440ae70bc52 | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved.
"""Refuse dangerous GitHub Actions trigger patterns at PR time.
Bans patterns behind the TanStack GHSA-g7cv-rxg3-hmpx compromise:
1. `pull_request_target` -- runs a fork's workflow... | Datta0/unsloth-staging-3 | scripts/lint_workflow_triggers.py | .py | 6d394a2d9af19556 | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Render the macOS DMG install-window background.
Writes studio/src-tauri/dmg/background.tiff, the image Finder draws behind the
app icon and the Applic... | Datta0/unsloth-staging-3 | scripts/make_dmg_background.py | .py | d4fb01df56f5c45d | 7 | 0 |
#!/usr/bin/env python
# coding: utf-8
"""
Convert Jupyter notebooks (.ipynb) to executable Python scripts (.py).
Converts IPython magics to plain Python:
!command -> subprocess.run('command', shell=True)
%cd path -> os.chdir('path')
%env VAR=value -> os.environ['VAR'] = 'value'
%%f... | Datta0/unsloth-staging-3 | scripts/notebook_to_python.py | .py | debebbf79aea3b79 | 7 | 0 |
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Eager vs online preparation, measured through Unsloth's real training path.
Drives ``UnslothTrainer.load_model`` -> ``prepare_model_for_training`` ->
``load_and_format_datas... | Datta0/unsloth-staging-3 | scripts/online_tokenization_ab.py | .py | acbb6cc092408022 | 7 | 0 |
#!/usr/bin/env python3
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
"""Which SDPA backends tolerate a dense bool attn_mask, and at what cost, at Hunyuan's real
joint shape (B=1, H=16, N=50345, D=128, bf16)? Decides whether ... | Datta0/unsloth-staging-3 | scripts/sdpa_mask_backend_probe.py | .py | 1fa8aa91064dc32e | 7 | 0 |
"""Summarise `cost_usd` across the JSON files sitting in one directory.
Written 2026-08-23 as the POSITIVE CONTROL for the instruction-count experiment
described in eval/instrfollow/DESIGN.md. It obeys all sixteen pool instructions at
once, which is also what establishes that the sixteen are mutually satisfiable and
t... | teonimesic/game-stack-bakeoff | eval/instrfollow/fixtures/gold_probe.py | .py | 515000ae9becaf56 | 7 | 0 |
"""Cost summariser -- the VARIANT control for eval/instrfollow/DESIGN.md.
This obeys all sixteen pool instructions, and obeys almost every one of them by a
different legitimate route from gold_probe.py: single-quoted main guard, abspath
rather than resolve, explicit sys.exit codes rather than raise SystemExit, absolut... | teonimesic/game-stack-bakeoff | eval/instrfollow/fixtures/variant_probe.py | .py | d0dd02f8724eed1f | 7 | 0 |
#!/usr/bin/env python3
"""Which deterministic criteria have ever fired, on which stacks, and were they right?
Two questions, deliberately separated:
1. HAS it fired? - answerable from stored results
2. COULD it fail a CORRECT submission? - answerable only by construction
A criterion that has never fire... | teonimesic/game-stack-bakeoff | eval/judge/audit_criteria.py | .py | 1cd8b0807e669bde | 7 | 0 |
"""DELIBERATELY BROKEN CONTROL FIXTURE - do not treat this as a real game.
This is the BROKEN control for the evaluator. Everything here is *technically*
fine and completely useless:
* `just check`, `just lint`, `just test` and `just verify` all exit 0;
* `just film` emits twelve valid 640x400 PNGs that are a fla... | teonimesic/game-stack-bakeoff | eval/judge/fixtures/broken/game.py | .py | 8de5ca51365cdb2a | 7 | 0 |
"""DELIBERATELY FAKE CONTROL FIXTURE - do not treat this as a real game.
This is the ADVERSARIAL control for the evaluator. It is built to look like a
working Pong submission and to be wrong in every way that matters:
* the ball position is a closed-form function of the tick number - nothing is
integrated, noth... | teonimesic/game-stack-bakeoff | eval/judge/fixtures/ref_adversarial_pong/game.py | .py | ba7632bbc71cd0bf | 7 | 0 |
from collections.abc import AsyncIterator
from typing import Annotated
import psycopg
from fastapi import Cookie, Depends, Header, HTTPException, Request
from app.db import get_pool
from app.embeddings.base import EmbeddingProvider
from app.services.auth import (
CREDENTIAL_SESSION,
SCOPE_READ_WRITE,
Auth... | jeongeundev/OpenArchive | backend/app/api/deps.py | .py | 9a1431fb949dd12d | 7 | 0 |
"""연결이 끊긴 요청을 한 번 다시 태우는 미들웨어.
`ARCHITECTURE.md`의 "애플리케이션이 담당하는 복구 로직"에서 API 몫에 해당한다. 풀의
`check=check_connection`은 **대여 시점**의 죽은 연결만 걸러내므로, 처리 도중 끊긴
경우는 남는다. 재시도가 미들웨어에 있는 이유는 핸들러에 이미 주입된 연결을 다시 써봐야
소용이 없기 때문이다 — 요청 전체를 다시 태워야 의존성이 새로 풀리고 풀에서 새 연결을 빌린다.
**쓰기는 재시도하지 않는다.** COMMIT이 서버에 닿은 뒤 응답만 잃은 경우와 아예 닿지
못한 경우를 구분할 ... | jeongeundev/OpenArchive | backend/app/api/retry.py | .py | 279b207cabc08023 | 7 | 0 |
"""`openarchive` 명령 — 설치와 계정 복구를 담당하는 운영자 CLI (ADR-039·ADR-040).
Web UI·REST·MCP와 같은 자리의 인터페이스이며, 로직을 새로 쓰지 않고 코어를 재사용한다.
마이그레이션 적용은 `app.migrations.run_migrations`, 준비 상태 판정은
`app.services.system.get_system_status`가 그대로 한다.
**하지 않는 것**: API·워커·프론트 기동, DB 자동 탐색, 문서 공급. init은 DB를 준비된
상태로 만들고 다음 단계를 안내하는 데서 끝난다.
`rese... | jeongeundev/OpenArchive | backend/app/cli.py | .py | 2149e5593552b698 | 7 | 0 |
"""커넥션 풀만 제공한다. import 시 부작용이 없어야 한다 (ADR-012).
MCP 서버와 워커가 이 패키지를 함께 쓰므로, import가 곧 접속이 되면 세 프로세스가
각자 풀을 연다. 그래서 풀은 `get_pool()`을 처음 부를 때 만들고, 실제로 커넥션을
여는 것은 호출부가 `await pool.open()`으로 명시한다.
"""
from psycopg_pool import AsyncConnectionPool
from app.config import get_settings
_pool: AsyncConnectionPool | None = Non... | jeongeundev/OpenArchive | backend/app/db.py | .py | f15732435d121fb1 | 7 | 0 |
"""임베딩 프로바이더 선택 (ARCHITECTURE.md "임베딩 프로바이더").
질의 임베딩도 문서 임베딩과 같은 프로바이더를 써야 한다 — 벡터 공간이 다르면 검색이
에러 없이 무의미해진다. 그래서 프로바이더를 **고르는 것**과 **예열하는 것**을 이 모듈에
함께 둔다.
"""
import asyncio
import logging
from app.config import get_settings
from app.embeddings.base import EMBEDDING_DIM, EmbeddingProvider
from app.embeddings.fake ... | jeongeundev/OpenArchive | backend/app/embeddings/__init__.py | .py | f44e910ea3c71bd9 | 7 | 0 |
"""임베딩 프로바이더의 계약 (ARCHITECTURE.md "임베딩 프로바이더").
운영 경로는 `LocalProvider`(BGE-M3) 하나뿐이다. 상용 API 기반 프로바이더는 만들지
않는다 — 대회 규정 [별표2]가 "외부 API 호출을 통해서만 작동하는 API 전용 모델"을
금지한다 (ADR-003). `FakeProvider`는 테스트 전용이다.
프로바이더가 둘뿐이라 추상 기반 클래스도 레지스트리도 두지 않는다. Protocol 하나가
확장 지점을 드러내는 것으로 충분하다.
"""
from typing import Protocol
# `docume... | jeongeundev/OpenArchive | backend/app/embeddings/base.py | .py | c18d57b0e991b1fd | 7 | 0 |
"""테스트용 결정론적 임베딩 (ADR-003).
편의 장치가 아니라 **이 프로젝트 TDD의 핵심 인프라**다. BGE-M3는 약 2GB이고 첫
로딩에 수십 초가 걸린다 — 워커·검색 테스트를 매번 그 위에서 돌릴 수는 없다. 파이프라인
전체를 CI 속도로 검증하려면 모델 없이 같은 성질을 내는 대역이 필요하다.
"같은 성질"이 무엇인지가 이 파일의 설계 전부다.
- **프로세스 간 안정성**: 문서 벡터는 워커가, 질의 벡터는 API가 만든다. 서로 다른
프로세스이므로 내장 `hash()`를 쓰면 벡터 공간이 프로세스마다 달라진다
(`PYTHONHAS... | jeongeundev/OpenArchive | backend/app/embeddings/fake.py | .py | 3bbf9e359562f050 | 7 | 0 |
"""BGE-M3 임베딩 프로바이더 — 운영 경로 (ADR-003).
`BAAI/bge-m3`는 MIT 라이선스에 1024차원, 로컬에서 직접 구동된다. 대회 규정 [별표2]가
요구하는 "독립 구동 가능성"을 충족하며, 상용 API 모델은 애초에 쓸 수 없다.
배칭·캐싱·폴백 체인·재시도는 만들지 않는다 (ARCHITECTURE.md 임베딩 프로바이더 절).
"""
from typing import Any
from app.embeddings.base import EMBEDDING_DIM
INSTALL_HINT = (
"sentence-transform... | jeongeundev/OpenArchive | backend/app/embeddings/local.py | .py | fad6118900ab9fc6 | 7 | 0 |
"""빌드된 프론트엔드를 API와 같은 오리진에서 서빙한다 (ADR-041).
Node 런타임을 사용자 쪽에서 없애기 위한 것이다. `STATIC_EXPORT=1 npm run build`가
내놓은 산출물을 패키지에 동봉하고, 여기서 그대로 내려준다. 같은 오리진이므로 개발
서버가 쓰던 `/api/*` 프록시(next.config의 rewrites)도 필요 없어진다.
"""
from __future__ import annotations
from pathlib import Path
from fastapi import FastAPI
from fastapi.resp... | jeongeundev/OpenArchive | backend/app/frontend.py | .py | 5deb05bf11914688 | 7 | 0 |
"""번호 붙은 raw SQL 파일을 순서대로 적용하는 소형 러너 (ADR-005).
호출 주체는 둘이다 — 상시 프로세스 중에서는 API 서버 하나, 그리고 운영자가 명시적으로
부르는 `openarchive init` (ADR-012 개정, ADR-039). 워커·MCP 서버는 스키마가 이미 준비된
것으로 가정하고 이 모듈을 부르지 않는다 — 상시 프로세스 셋이 같은 마이그레이션을 경쟁
실행하는 상황 자체를 없애는 것이 분산 락보다 단순하다. init은 일회성 동기 명령이라 그
경쟁에 들어가지 않는다.
커넥션은 여기서 직접 열고 닫는다. `app.db`의 풀을 ... | jeongeundev/OpenArchive | backend/app/migrations.py | .py | 0639d0aaeaed79c0 | 7 | 0 |
"""비밀번호 해시와 서버 측 세션을 관리하는 인증 서비스."""
import base64
import hashlib
import hmac
import secrets
from datetime import UTC, datetime, timedelta
from typing import Literal
from uuid import UUID
import psycopg
from psycopg.rows import dict_row
from app.config import get_settings
# 대화형 로그인에 충분히 비싸면서 테스트·데모 호스트의 메모리를 과도하게 쓰... | jeongeundev/OpenArchive | backend/app/services/auth.py | .py | cdaf04533a9ed20d | 7 | 0 |
"""문서 본문을 임베딩 단위로 자르는 순수 함수 (ARCHITECTURE.md "청킹").
DB도 모델도 파일시스템도 시간도 건드리지 않는다. 워커의 나머지 부분(트랜잭션·잠금·
재시도)과 분리해 두어야 청킹 규칙만 밀리초 단위로 검증할 수 있다.
길이 단위는 **문자 수**다. 토크나이저로 세면 모델 의존성이 생겨 순수 함수가 아니게
되고, BGE-M3의 8192 토큰 한도에 1,000자는 충분히 여유가 있다 (ADR-003).
"""
import re
# 빈 줄 = 문단 경계. 줄 끝에 공백이 남아 있어도 경계로 본다 — 편집기나 PDF 파서를
# 거친 ... | jeongeundev/OpenArchive | backend/app/services/chunking.py | .py | 9c4fca1c9d3c3adc | 7 | 0 |
"""열람 가능한 문서를 관계 그래프의 덩어리로 묶고 덩어리 사이 연결을 집계한다.
화면 이름은 「관계 지도」다. 묶는 축은 주제도 태그도 아니고 저장된 관계뿐이므로
(태그는 덩어리에 이름을 붙일 때만 쓴다) 이름이 주제를 약속하지 않게 두었다.
"""
from collections import Counter, defaultdict
from dataclasses import dataclass
from uuid import UUID
import networkx as nx
import psycopg
from networkx.algorithms.community im... | jeongeundev/OpenArchive | backend/app/services/clusters.py | .py | f9c0cf37baf35378 | 7 | 0 |
"""열람 가능한 문서 관계를 기준으로 정리 후보를 집계한다."""
from dataclasses import dataclass
from uuid import UUID
import psycopg
from app.services.visibility import VISIBLE_TO_USER
ITEM_LIMIT = 10
# overlaps는 "자기 대목 중 상대 문서에서 최근접 이웃을 찾은 비율"이며 내용 동일성이 아니다.
# 이웃 판정이 순위 기반(절대 거리 임계 없음)이라 주제가 가까운 문서끼리는 모든 대목이 서로
# 최근접이 되어 비율이 1.0에 붙는다. 실 ... | jeongeundev/OpenArchive | backend/app/services/diagnostics.py | .py | babe6057e8f75729 | 7 | 0 |
"""위키링크를 조회하는 사용자의 열람 범위에서 해석한다."""
from dataclasses import dataclass
from uuid import UUID
import psycopg
from app.services.documents import ensure_visible
from app.services.visibility import VISIBLE_TO_USER
RESOLVE_LINKS_SQL = f"""
SELECT l.target_title, d.id
FROM document_links l
LEFT JOIN documents d
ON d.tit... | jeongeundev/OpenArchive | backend/app/services/links.py | .py | 46debc6a2072de32 | 7 | 0 |
"""업로드 파일 바이트에서 추출 텍스트를 만드는 순수 함수.
DB·네트워크·파일시스템을 건드리지 않고 메모리 안에서만 처리한다. 반환된 추출
텍스트만 저장하며, 입력으로 받은 원본 파일 바이트는 보관하지 않는다 (ADR-017).
빈 추출 결과의 거부는 이 모듈 밖에서 한다 — 판정은 `services/documents.py`가
`EmptyExtractedText`로 하고, 400 응답 매핑은 `app/main.py`의 예외 핸들러가 한다.
이 모듈은 스캔 이미지 PDF처럼 텍스트가 없는 파일도 예외로 바꾸지 않고 빈 문자열을
그대로 반환한다.
"""
impo... | jeongeundev/OpenArchive | backend/app/services/parsing.py | .py | cdd23ccec2e52f21 | 7 | 0 |
"""문서의 관련 문서와 동일 텍스트 문서를 조회하는 서비스."""
from dataclasses import dataclass
from uuid import UUID
import psycopg
from app.services.documents import ensure_visible
from app.services.search import MAX_K
from app.services.visibility import VISIBLE_TO_USER
# 태그 빈도를 셀 이웃 문서 수. 추천 개수(limit)와 다르다 — 이웃에서 모은 태그를
# 빈도순으로 정렬한 뒤 l... | jeongeundev/OpenArchive | backend/app/services/related.py | .py | bc132c734b20bf8d | 7 | 0 |
"""정형 필터와 벡터 유사도를 한 SQL로 결합하는 검색 서비스."""
import asyncio
from dataclasses import dataclass
from uuid import UUID
import psycopg
from app.embeddings.base import EmbeddingProvider
from app.services.visibility import VISIBLE_TO_USER
from app.vectors import to_pgvector_literal
EF_SEARCH = 200
CANDIDATE_MULTIPLIER = 5
# ... | jeongeundev/OpenArchive | backend/app/services/search.py | .py | a415c8f91608ff6f | 7 | 0 |
"""Data models for the Budget Thuis API responses (stdlib only)."""
from __future__ import annotations
from dataclasses import dataclass, field
from datetime import date, datetime
from zoneinfo import ZoneInfo
_AMS = ZoneInfo("Europe/Amsterdam")
def _dt(value: str) -> datetime:
# API sends ISO-8601, usually wi... | jdolieslager/aiobudgetthuis | src/aiobudgetthuis/models.py | .py | 0472d0efdc26ed4d | 7 | 0 |
# -*- coding: utf-8 -*-
"""Shared helpers for the battery-passport requirement extractors.
One extractor per canonical source. An extractor parses; it does not judge.
Where a source does not say whether something must be present, the record says
"unclear" rather than guessing, and the unclear ones are counted so they ... | dev365code/aas-submodel-validate | data/battery-passport/tools/_common.py | .py | 3e6184c2b91f449f | 7 | 0 |
# -*- coding: utf-8 -*-
"""Derive a requirement index from IDTA submodel template files (AAS JSON).
What the source states, and this reads:
* the element tree, by idShort path;
* the SMT/Cardinality qualifier on each element -- One, ZeroToOne, OneToMany,
ZeroToMany -- which is where a template says what must b... | dev365code/aas-submodel-validate | data/battery-passport/tools/extract_idta_smt.py | .py | c7ef9ae70edd8cf4 | 7 | 0 |
# -*- coding: utf-8 -*-
"""Derive a requirement index from the Battery Pass data attribute longlist (XLSX).
The longlist is a spreadsheet: one row per data attribute, with a column per
battery category saying whether that attribute is required for it, a column
naming the legal provision behind it, and columns for acce... | dev365code/aas-submodel-validate | data/battery-passport/tools/extract_longlist.py | .py | e0cb99a3573e48fc | 7 | 0 |
"""Result types and the severity vocabulary.
The shape is inherited from this project's older siblings (iirds-validate,
vdi2770): a Violation is one concrete wrong thing, a Rule is the check
that found it, a Finding is the pair with everything a person needs — and
every rule carries a `fix` sentence, because a validat... | dev365code/aas-submodel-validate | src/aas_submodel_validate/model.py | .py | 77d23c80099d6dab | 7 | 0 |
"""Rendering a report for a person at a terminal."""
from __future__ import annotations
from .model import Report, Severity
def _safe(text) -> str:
"""A field that came out of an untrusted package, made safe to print.
A subject path can contain an attacker-chosen idShort, and a raw
escape byte on a term... | dev365code/aas-submodel-validate | src/aas_submodel_validate/report.py | .py | 3f5f872dda978b44 | 7 | 0 |
"""IDTA 02035-2, the Digital Battery Passport's Handover Documentation.
A second published template answering to IDTA 02004's submodel
semanticId, over twenty-two of that template's thirty-eight rows, with
two of them relaxed -- and sixteen made stricter by the same edit,
because a wider match set tightens every row w... | dev365code/aas-submodel-validate | src/aas_submodel_validate/rules/dbp.py | .py | 5caab445303609a1 | 7 | 0 |
"""Did the input bring a submodel this tool knows how to judge?
This is the one question that belongs to the tool rather than to any
template, and it has to be asked once. A presence rule per template
would contradict itself the moment a second template arrived: a
Technical Data file would fail Handover's rule and a H... | dev365code/aas-submodel-validate | src/aas_submodel_validate/rules/detect.py | .py | 940eb4dbbbc62caa | 7 | 0 |
"""Which of two templates answered, when both wear one identifier.
IDTA 02035-2 declares IDTA 02004's submodel semanticId exactly --
`0173-1#01-AHF578#003`, a ModelReference with one Submodel key, under the
same idShort -- and asks for less (docs/divergences.md #26). A file that
says AHF578 might mean either, and the ... | dev365code/aas-submodel-validate | src/aas_submodel_validate/rules/profiles.py | .py | f0a79b06d8e7e563 | 7 | 0 |
"""Suite-wide observation: which rules ever actually fire.
A rule that produces no finding anywhere in the whole suite has never
been observed to work -- it may be correct and merely untested; it may
be dead, and the two are indistinguishable from inside. Every report the
suite produces through runner.run is observed,... | dev365code/aas-submodel-validate | tests/conftest.py | .py | 5547ccec8c8fa24d | 7.5 | 0 |
"""The flags a pipeline reaches for, each with its contract."""
from __future__ import annotations
import copy
import json
import pytest
from aas_submodel_validate.cli import main
from aas_submodel_validate.registry import all_rules
from builders import env_json, hd_env
# The one copy of the published shape. Import... | dev365code/aas-submodel-validate | tests/test_cli_flags.py | .py | 160fc2a1fb986c1a | 7.5 | 0 |
"""The OPC chain, verified link by link.
An .aasx is not "a ZIP with files in it": the payload is found by
following relationships, and a container whose chain is broken has no
payload however plausible its entry names look. Every test that breaks a
link expects a refusal that names the missing link.
"""
from __future... | dev365code/aas-submodel-validate | tests/test_container.py | .py | 3c75746a21ae1954 | 7.5 | 0 |
"""IDTA 02035-2's pack: what it asks, and what it stops asking.
The pack exists because two published templates answer to one submodel
identifier and do not want the same things. So the tests that matter are
comparisons: the same file is clean under one and faulted under the
other, and every row of the second table ca... | dev365code/aas-submodel-validate | tests/test_dbp_rules.py | .py | fff5fe121a65790f | 7.5 | 0 |
"""The IDTA 02035-2 table, and the one thing it has that 02003 did not.
02003 was a different template with a different identifier: whatever the
generator got wrong there, the walk could still tell the two apart from
outside. 02035-2 cannot be told apart from outside. Its submodel
semanticId is 02004's, to the charact... | dev365code/aas-submodel-validate | tests/test_dbp_tables.py | .py | 01f5ee411e411567 | 7.5 | 0 |
"""SMT-D1: is any submodel this tool knows even here?
The silent-pass lesson from the sibling validators, applied from day
one: a validator pointed at an environment containing no submodel it
knows must say so loudly, because "no findings" is also what a perfect
package looks like. And when the miss is near — right st... | dev365code/aas-submodel-validate | tests/test_detect.py | .py | 97fda06d31c8bfa1 | 7.5 | 0 |
"""The walk never guesses which template it is walking.
Every navigation function took the table as an optional argument, so a
rule that forgot it read 02004's. `KeyError` would have made that loud;
the two tables share a label — `ClassificationSystem`, naming a
different element in each — so forgetting is silent, and... | dev365code/aas-submodel-validate | tests/test_engine_seam.py | .py | 622205a0b6b755ea | 7.5 | 0 |
"""Every generated rule fires, and the golden fixture fires none.
The mutation per row is chosen by what the row demands: a required
element is removed; an optional one is injected twice (over its maximum);
a required child of an optional list gets its list injected empty. If
any row's id never appears, that rule is d... | dev365code/aas-submodel-validate | tests/test_generated_rules.py | .py | aedb938783ffee80 | 7.5 | 0 |
"""Every generated 02003 rule fires, and the golden fixture fires none.
Same contract as the 02004 suite, with one branch 02004 never needed. Its
rows were all bounded — a required element could be removed, an optional
one injected past its maximum. 02003 has five rows the template bounds at
neither end (0..*), and no... | dev365code/aas-submodel-validate | tests/test_generated_rules_td.py | .py | deac7dc982a5197a | 7.5 | 0 |
"""The metamodel layer is relayed, never re-implemented.
aas-core3.0's verification runs inside every validation and reports
through the `meta` channel: warnings by default (the official published
example itself carries 77), errors under --strict-meta. This project's
own rules never restate an AASd constraint -- one d... | dev365code/aas-submodel-validate | tests/test_meta_channel.py | .py | 4eb588f87041a63f | 7.5 | 0 |
"""外部资源查询客户端:Danbooru / Gelbooru(画师/角色触发词)+ Civitai 镜像(生成配方)。
2026-08-11 v2.0.0 新增:
- Danbooru 公开 API(需自定义 UA),支持画师/角色触发词与高频 tag 聚合
- Gelbooru DAPI(json=1),artist:/character: 命名空间搜索,支持别名查询
- civitai.red 镜像兼容 Civitai 官方 v1 API(/api/v1/images 的 meta 即完整生成配方),
可选 API key(Authorization: Bearer)
"""
from __future__ impo... | nagato9star/astrbot_plugin_comfyui_direct | external_search.py | .py | 81a03ba25fbd86d7 | 7.15 | 1 |
# -*- coding: utf-8 -*-
"""调用 CLI 的两个入口。MCP 服务器与浏览器界面共用这一份。
为什么收在一处
--------------
这两个函数原先只存在于 MCP 服务器里。界面要能发起采集与建基线时,
最省事的做法是复制一份 —— 而本项目已经因为「同一个判分器缺陷存在于
两处、只修了一处」付过代价。门面层只负责拼命令行和转手结果,
测量逻辑只有 CLI 一份实现,这一条不能因为多了个宿主就打折。
run_cli 同步调一次,拿退出码与 JSON
spawn_cli 脱离式起一个长任务,立刻返回 pid
"""
import os
import subprocess
... | CJH0220/modelprobe | mprobe/cli_bridge.py | .py | ed7f0d627c1ab498 | 7 | 0 |
# -*- coding: utf-8 -*-
"""聚合算法:把各维度分数合成总分。
为什么不用简单加权平均
----------------------
加权平均有三个问题,在「每维只有几道题」的场景下均会实际发生:
1. **不区分样本量。** 2 道题的维度和 11 道题的维度同等对待,前者的噪声
会被原样搬进总分。多跑一轮就可能让总分跳几分,但模型什么都没变。
2. **不惩罚不确定性。** 数据越少的模型反而可能因为运气好而排名靠前。
3. **短板会被掩盖。** 某维度接近 0 分,只要其他维度够高,总分依然好看——
但实际使用时,一个维度崩掉往往就意味着不能用。
对策
----
- **收缩**:每... | CJH0220/modelprobe | mprobe/engine/aggregate.py | .py | 87aed98c5b8b2b07 | 7 | 0 |
# -*- coding: utf-8 -*-
"""三态判定。
正常 normal 分数 >= 阈值
观察 watch 单次低于阈值
告警 alert 连续 N 次低于阈值(N = 2,临时基线 N = 3)
为什么不是「低于阈值就告警」
--------------------------
算过账:阈值取 μ−2σ 时,单轮误报率约 2.3%。日频跑一年 =
365 × 0.023 ≈ **8.4 次假警报**。连续两轮才报的话,
误报率降到 0.023² ≈ 0.05%,一年约 **0.2 次**。
代价是慢一天发现真问题。这个交换是划算的:真的降智不会只持续一天,
而一年八次假警... | CJH0220/modelprobe | mprobe/monitor/judge.py | .py | cc5ecf39c78f8896 | 7 | 0 |
# -*- coding: utf-8 -*-
"""监控登记表:要监控哪些端点,各自什么节奏,现在开着还是关着。
和 `schedule.py` 的分工
-----------------------
`schedule` 管的是「系统里有没有那个计划任务」,任务一卸,它的备忘
(`data/schedule.json`)也跟着删。那对任务来说是对的 —— 备忘描述的是
一个存在的任务。
但**关停一个监控不等于不再需要它**。出差两周、端点临时下线、
先停下来查一个告警 —— 这些场景要的是「停掉,但下次别再重填一遍
地址、时间、频率」。所以登记表单独存一份:
schedule.json 任务的备忘,任务没了就... | CJH0220/modelprobe | mprobe/monitor/registry.py | .py | 0017e7a045193b46 | 7 | 0 |
# -*- coding: utf-8 -*-
"""路径解析。全项目只有这一处知道文件在哪。
`data/` 是唯一可写的目录。`banks/` 与 `profiles/` 随版本发布,**只读**——
运行期写入题库目录,等于让每台机器的题库悄悄分叉。
"""
import os
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
BANKS = os.path.join(ROOT, "banks")
PROFILES = os.path.join(ROOT, "profiles")
CONFIG = os.path.join(ROOT, ... | CJH0220/modelprobe | mprobe/paths.py | .py | 61206718769868dd | 7 | 0 |
# -*- coding: utf-8 -*-
"""配额快照的存储。独立一张表,不和测评结果混在一起。
为什么单独建表而不是塞进 runs
------------------------------
`runs` 的每一行是「一次测评」,主键是 run_id,字段全是分数与 token。
配额快照是「某天某账号某模型用了多少」,两者唯一的共同点是都有时间戳。
硬塞进去要么加一堆恒为空的列,要么用 summary 那个 JSON 字段当垃圾桶
—— 后者查起来只能全表扫描 JSON。
一天一个账号一个模型只留一条
----------------------------
同一天重复采集是正常的(手动点一次、定时又跑一次),后写... | CJH0220/modelprobe | mprobe/quota/store.py | .py | d45a82919c317e21 | 7 | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""校验「运行时零第三方依赖」这个声称是**真的**。零请求、零花费。
## 为什么要有这个
`requirements.txt` 为空是一句声称,不是一个事实。任何人加一行
`import requests` 都会使它失效,而失效不会有任何报错 ——
本机装过那个包,代码就照常跑。问题只在换机器部署时才暴露。
更要紧的一层:依赖树的版本变动可能改变判分结果,而这种变动
不体现在 `bank_rev` 上,于是**不可比性无法被检测到**。
零依赖不是简洁偏好,是可比性的前提。
## 校验三处是否互相一致
1. 代码里实际出现... | CJH0220/modelprobe | tools/check_deps.py | .py | 4c2e6e8ca88a6187 | 7 | 0 |
"""Shared storage for the pasted-links inbox — now backed by SQLite
(agent/db.py) instead of links_inbox.json (see the webapp's DB-migration:
CLAUDE.md's Structure section on agent/db.py).
Public API is unchanged on purpose: link_server.py (writes/deletes) and
monitor.py (reads pending entries, marks them processed) b... | aidude/research-mem0 | agent/links_store.py | .py | 80634825139ef2ad | 7 | 0 |
"""On-demand deep research on a specific paper — local PDF, arXiv link, or
any URL (Nature etc., with the caveat that paywalled sources only yield
whatever's actually fetchable, usually the abstract).
Unlike the digest/monitor, this is not scheduled — you invoke it per paper.
Default provider is Anthropic (reasoning q... | aidude/research-mem0 | agent/paper.py | .py | e6cce06030def541 | 7 | 0 |
"""Tavily web search — used for research retrieval and claim fact-checking.
Defaults to Tavily's "advanced" search depth with per-result images and
favicons enabled: at that depth Tavily returns each result's own scraped
`images` list and `favicon`, not just a query-level image pool — that's
what lets the digest attac... | aidude/research-mem0 | agent/search.py | .py | 08738b73e48107fd | 7 | 0 |
"""Background job runner for the webapp — starts each pipeline as an OS
subprocess via the existing scripts/run_*.sh wrappers (so Docker/twopac env
selection stays exactly as it already is on the CLI, and two jobs needing
different envs can run concurrently without conflict), tracks status in
SQLite, and indexes the re... | aidude/research-mem0 | agent/webapp/jobs.py | .py | c83c5e1cd67e6157 | 7 | 0 |
import open3d as o3d
import numpy as np
import json
import os
import glob
from datetime import datetime
from typing import List, Dict, Optional
class ModelViewer:
def __init__(self):
self.mesh = None
self.annotations = []
self.annotation_visuals = []
self.vis = None
# 标注颜色... | fantisticftb/SIXHM-Exterior-Wall-Hollow-Detection | SA-NERF/Geo-Euclidean semantic mapping engine/.idea/01(01).py | .py | 284a63d351c63ee5 | 7 | 0 |
#!/usr/bin/env python3
"""irag_distill.py — diagnostic distillation for MCP Light Memory.
Stdlib-first mechanism for extracting valuable conclusions from large tool
outputs (console, terminal, builds, lints, tests). The goal is to reduce
5000-line output to a short knowledge conclusion like:
"Test X fails because Y... | PeterPirog/mcp-light-memory | .agents/skills/internal-rag/irag_distill.py | .py | bab31746155fcdd7 | 7 | 0 |
#!/usr/bin/env python3
"""irag_ephemeral.py — ephemeral observations layer for MCP Light Memory.
A separate, bounded, TTL-based storage for raw tool outputs (console, terminal,
builds, lints, tests) that are NOT durable Markdown memory. Observations flow
through a lifecycle:
raw tool output -> ephemeral observation... | PeterPirog/mcp-light-memory | .agents/skills/internal-rag/irag_ephemeral.py | .py | 740c892a7e4b7113 | 7 | 0 |
#!/usr/bin/env python3
"""Git hook installer for INTERNAL_RAG.
Installs optional Git hooks that call `irag.py`:
- post-commit: lightweight checkpoint after each commit (metadata only)
- post-checkout: mark checkpoint as STALE so context triggers recovery
- pre-push: run `guard` and warn (never block) i... | PeterPirog/mcp-light-memory | .agents/skills/internal-rag/irag_hooks.py | .py | d75388641fa43c7b | 7 | 0 |
#!/usr/bin/env python3
"""Evidence freshness tests (P1 hardening, ADR-016).
Verifies that `_evidence_state_for_sources` derives:
- "present" for existing local path-like evidence
- "missing" for deleted local path-like evidence
- "unverifiable" for URLs, symbols, malformed, absolute-outside-root, empty
... | PeterPirog/mcp-light-memory | tests/test_evidence_freshness.py | .py | 068a929e639657ad | 7.5 | 0 |
#!/usr/bin/env python3
"""A1 regression: fingerprint cache must never hide uncommitted tracked changes.
Correctness model (irag.py project_fingerprint):
- the tracked working-tree/index diff is ALWAYS hashed fresh, even when
use_cache=True — a cached fingerprint must not mask a modified tracked file;
- the untracked... | PeterPirog/mcp-light-memory | tests/test_fingerprint_cache.py | .py | 38b0859c9b2909d5 | 7.5 | 0 |
#!/usr/bin/env python3
"""Move completed entries from claude-todo.md to claude-todo-done.md.
Each `### ` entry runs from its header line to just before the next
`### ` / `## ` / `---` boundary (or EOF). Done entries are conventionally
marked with a struck-through header, e.g.:
### ~~Short title~~ — FIXED 2026-06-... | binate/explorations | scripts/move_done.py | .py | baadd3b5ca8819e2 | 7 | 0 |
"""Welcome to Reflex! This file outlines the steps to create a basic app."""
import reflex as rx
from rxconfig import config
class State(rx.State):
"""The app state."""
def index() -> rx.Component:
# Welcome Page (Index)
return rx.container(
rx.color_mode.button(position="top-right"),
... | rajath-raman/reflex | reflex/.templates/apps/blank/code/blank.py | .py | c2bcbd1375630bba | 7 | 0 |
"""Mixin that allow tasks to run during the whole app lifespan."""
from __future__ import annotations
import asyncio
import contextlib
import dataclasses
import functools
import inspect
from collections.abc import Callable, Coroutine
from starlette.applications import Starlette
from reflex.utils import console
from... | rajath-raman/reflex | reflex/app_mixins/lifespan.py | .py | f6badd5546349c7c | 7 | 0 |
"""Middleware Mixin that allow to add middleware to the app."""
from __future__ import annotations
import dataclasses
import inspect
from reflex.event import Event
from reflex.middleware import HydrateMiddleware, Middleware
from reflex.state import BaseState, StateUpdate
from .mixin import AppMixin
@dataclasses.d... | rajath-raman/reflex | reflex/app_mixins/middleware.py | .py | 04a85ed235053b5f | 7 | 0 |
"""Define the base Reflex class."""
from pydantic.v1 import BaseModel
class Base(BaseModel):
"""The base class subclassed by all Reflex classes.
This class wraps Pydantic and provides common methods such as
serialization and setting fields.
Any data structure that needs to be transferred between th... | rajath-raman/reflex | reflex/base.py | .py | 3a1ebae102f77d91 | 7 | 0 |
"""Templates to use in the reflex compiler."""
from __future__ import annotations
from jinja2 import Environment, FileSystemLoader, Template
from reflex import constants
from reflex.constants import Hooks
from reflex.utils.format import format_state_name, json_dumps
from reflex.vars.base import VarData
def _sort_h... | rajath-raman/reflex | reflex/compiler/templates.py | .py | 79606d241aeb894c | 7 | 0 |
"""Top-level component that wraps the entire app."""
from reflex.components.base.fragment import Fragment
from reflex.components.component import Component
from reflex.vars.base import Var
class AppWrap(Fragment):
"""Top-level component that wraps the entire app."""
@classmethod
def create(cls) -> Compo... | rajath-raman/reflex | reflex/components/base/app_wrap.py | .py | e4afe6caf62f1cf7 | 7 | 0 |
"""A bare component."""
from __future__ import annotations
from collections.abc import Iterator, Sequence
from typing import Any
from reflex.components.component import BaseComponent, Component, ComponentStyle
from reflex.components.tags import Tag
from reflex.components.tags.tagless import Tagless
from reflex.envir... | rajath-raman/reflex | reflex/components/base/bare.py | .py | 8efe874ad962c6c0 | 7 | 0 |
"""Display the title of the current page."""
from reflex.components.el.elements.base import BaseHTML
from reflex.vars.base import Var
class RawLink(BaseHTML):
"""A component that displays the title of the current page."""
tag = "link"
# The href.
href: Var[str]
# The type of link.
rel: Var... | rajath-raman/reflex | reflex/components/base/link.py | .py | 419e01e625a5c374 | 7 | 0 |
"""Display the title of the current page."""
from __future__ import annotations
from reflex.components.base.bare import Bare
from reflex.components.el import elements
from reflex.components.el.elements.metadata import Meta as Meta # for compatibility
from reflex.vars.base import Var
class Title(elements.Title):
... | rajath-raman/reflex | reflex/components/base/meta.py | .py | e69306402670c432 | 7 | 0 |
"""Wrapper for the script element. Uses the Helmet component to manage the head."""
from __future__ import annotations
from reflex.components import el as elements
from reflex.components.core.helmet import helmet
from reflex.utils import console
class Script(elements.Script):
"""Wrapper for the script element."... | rajath-raman/reflex | reflex/components/base/script.py | .py | b8285355eb67d2c4 | 7 | 0 |
"""A component that automatically scrolls to the bottom when new content is added."""
from __future__ import annotations
import dataclasses
from reflex.components.el.elements.typography import Div
from reflex.constants.compiler import MemoizationDisposition, MemoizationMode
from reflex.utils.imports import ImportDic... | rajath-raman/reflex | reflex/components/core/auto_scroll.py | .py | cc21cfe4caffb0b0 | 7 | 0 |
"""Breakpoints utility."""
from __future__ import annotations
from typing import TypeVar
breakpoints_values = ["30em", "48em", "62em", "80em", "96em"]
breakpoint_names = ["xs", "sm", "md", "lg", "xl"]
def set_breakpoints(values: tuple[str, str, str, str, str]):
"""Overwrite default breakpoint values.
Args... | rajath-raman/reflex | reflex/components/core/breakpoints.py | .py | ee7346f44c23bdb9 | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.