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 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/gsm8k.py | .py | b67a4b58eb97a1a8 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/gsm8k_multiturn_sft.py | .py | ef4c0fda2bda9e34 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
# Copyright 2023-2024 SGLang Team
# Copyright 2025 ModelBest Inc. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | chendy25/iclr-tb-opd | examples/data_preprocess/gsm8k_multiturn_w_tool.py | .py | 23d290f6dd0620a9 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
# Copyright 2023-2024 SGLang Team
# Copyright 2025 ModelBest Inc. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | chendy25/iclr-tb-opd | examples/data_preprocess/gsm8k_tool_agent_loop.py | .py | 2c73421b3782bf9b | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/hellaswag.py | .py | 322a5e9510249e8c | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/math_dataset.py | .py | 5aed4c3126163723 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/openr1mm.py | .py | db79236748724a4f | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
# Copyright 2023-2024 SGLang Team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | chendy25/iclr-tb-opd | examples/data_preprocess/preprocess_search_r1_dataset.py | .py | 7bceaaf07bf8a44f | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | examples/data_preprocess/tinyllava_video_r1.py | .py | 253adbc45d56b4ef | 7 | 0 |
"""HTTP client for the Atropos Trajectory API."""
import time
import requests
class AtroposClient:
"""HTTP client for the Atropos trajectory API with retry/backoff."""
def __init__(self, api_url: str = "http://localhost:8000", max_retries: int = 3, retry_delay: float = 1.0):
self.api_url = api_url.... | chendy25/iclr-tb-opd | recipe/atropos/atropos_client.py | .py | 517b3d93691ce1b1 | 7 | 0 |
"""Convert Atropos ScoredData dicts to verl DataProto format.
ScoredData format (from Atropos):
tokens: [[int, ...], ...] — prompt+response sequences (group_size items)
masks: [[int, ...], ...] — -100 for prompt, token IDs for response
scores: [float, ...] — per-sequence sc... | chendy25/iclr-tb-opd | recipe/atropos/atropos_data.py | .py | 7475237a5eadaee8 | 7 | 0 |
"""CPU-only HTTP proxy between atropos environments and verl's internal vLLM.
Handles three request formats used across all atropos environments:
- /generate: legacy atropos format (token IDs + logprob dicts) — translates to /v1/completions
- /v1/completions: OpenAI completions — forwards with model name override
- /v... | chendy25/iclr-tb-opd | recipe/atropos/generate_proxy.py | .py | 4afc0e940257e898 | 7 | 0 |
"""Tests for scored_data_to_dataproto conversion."""
import pytest
from recipe.atropos.atropos_data import _find_response_start, scored_data_to_dataproto
def _make_scored_data(
prompt_tokens: list[int],
response_tokens: list[int],
score: float,
advantages: list[float] | None = None,
overrides: di... | chendy25/iclr-tb-opd | recipe/atropos/tests/test_atropos_data.py | .py | 23103bf39b97e410 | 7.5 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | recipe/char_count/create_dataset.py | .py | 1fd951534cbd784f | 7 | 0 |
# Copyright 2025 CollabLLM team and/or its affiliates
# Copyright 2025 Bytedance Ltd. and/or its affiliates
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | chendy25/iclr-tb-opd | recipe/collabllm/process_dataset.py | .py | 8879e33e8872663d | 7 | 0 |
# Copyright 2025 CollabLLM team and/or its affiliates
# Copyright 2025 Bytedance Ltd. and/or its affiliates
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... | chendy25/iclr-tb-opd | recipe/collabllm/reward_function.py | .py | 8a3fc14507564af3 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
# Copyright 2023-2024 SGLang Team
# Copyright 2025 ModelBest Inc. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#... | chendy25/iclr-tb-opd | recipe/dance_grpo/dance_grpo_mindspeed_mm/actor.py | .py | effcf77b6887770c | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | recipe/dance_grpo/dance_grpo_mindspeed_mm/config/actor.py | .py | 9a4b846d6ebf2ad5 | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | recipe/dance_grpo/dance_grpo_mindspeed_mm/config/optimizer.py | .py | b4b149a1130dcaff | 7 | 0 |
# Copyright 2024 Bytedance Ltd. and/or its affiliates
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | chendy25/iclr-tb-opd | recipe/dance_grpo/dance_grpo_mindspeed_mm/main_dance.py | .py | 0ba8532c33987c33 | 7 | 0 |
'''
Author: Sai Vignesh Golla
License: MIT License
https://opensource.org/license/mit
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Loads user settings saved by the local control panel (see app.py) from
`user_config.json` at the project root, and applies them over the Python
def... | naveencreation/Linkedin-Job-Applier | config/_overrides.py | .py | 3424d7cde12c7849 | 7 | 0 |
'''
Author: Sai Vignesh Golla
LinkedIn: https://www.linkedin.com/in/saivigneshgolla/
Copyright (c) 2024-2026 Sai Vignesh Golla
License: MIT License
https://opensource.org/license/mit
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Support me: https://github.com/sp... | naveencreation/Linkedin-Job-Applier | modules/__deprecated__/resume_generator.py | .py | 69eb6faa97497344 | 7 | 0 |
'''
Author: Sai Vignesh Golla
LinkedIn: https://www.linkedin.com/in/saivigneshgolla/
Copyright (c) 2024-2026 Sai Vignesh Golla
License: MIT License
https://opensource.org/license/mit
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Support me: https://github.com/sp... | naveencreation/Linkedin-Job-Applier | modules/clickers_and_finders.py | .py | c63e5da82f42c596 | 7 | 0 |
'''
Author: Sai Vignesh Golla
LinkedIn: https://www.linkedin.com/in/saivigneshgolla/
Copyright (c) 2024-2026 Sai Vignesh Golla
License: MIT License
https://opensource.org/license/mit
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Support me: https://github.com/sp... | naveencreation/Linkedin-Job-Applier | modules/helpers.py | .py | 44dedf2ac18d1105 | 7 | 0 |
'''
Author: Sai Vignesh Golla
LinkedIn: https://www.linkedin.com/in/saivigneshgolla/
Copyright (c) 2024-2026 Sai Vignesh Golla
License: MIT License
https://opensource.org/license/mit
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Support me: https://github.com/sp... | naveencreation/Linkedin-Job-Applier | modules/validator.py | .py | 88c375be988c4243 | 7 | 0 |
'''
Author: Sai Vignesh Golla
License: MIT License (https://opensource.org/license/mit)
GitHub: https://github.com/GodsScion/Auto_job_applier_linkedIn
Shared fixtures and a custom test-summary printed after every run:
failing tests first, then counts (ran / passed / failed / skipped), then an
overall verdict lin... | naveencreation/Linkedin-Job-Applier | tests/conftest.py | .py | 2869155cc48226dc | 7.5 | 0 |
'''
Unit tests for config/_overrides.py — the non-breaking layer that lets the
control panel override config/*.py defaults via user_config.json. A regression
here silently breaks configuration, so the guarantees are worth pinning down:
* only keys that ALREADY exist as module globals are overridden,
* unknown keys... | naveencreation/Linkedin-Job-Applier | tests/test_config_overrides.py | .py | f90d2d7a06c15ba5 | 7.5 | 0 |
"""CLI entry point: ``python -m animageo file.ggb -o out.svg``.
Renders a GeoGebra ``.ggb`` file into one of two tracks:
- **static vector** (``svg`` / ``pdf`` / ``eps`` / ``tikz``) — the construction
is built once and serialised by an ``export*`` method;
- **render** (``png`` / ``gif`` / ``mp4`` / ``webm`` / ``mov... | ivaleo/animageo | animageo/__main__.py | .py | c9ef2a2e47c041c1 | 7 | 0 |
"""Export-canvas layout helpers.
This module separates the source/reference canvas from the physical export
canvas. The renderer can then scale geometry to the requested output size
while resolving style pixel values against the original/reference scale.
"""
from __future__ import annotations
from dataclasses import ... | ivaleo/animageo | animageo/export_layout.py | .py | 8b5616f4e46efcd9 | 7 | 0 |
"""Assemble the JSXGraph board into HTML / JS / JSON output."""
from __future__ import annotations
import json
from typing import Dict
from .builder import BoardModel
from .options import JSXGraphOptions
from .spec import board_to_spec
def _cdn(opt: JSXGraphOptions) -> Dict[str, str]:
v = opt.jsxgraph_version
... | ivaleo/animageo | animageo/exporters/jsxgraph/document.py | .py | 531c5204a3c6bbf8 | 7 | 0 |
"""JSXGraph export orchestration.
Builds the board model from the construction graph, assembles the requested
output (html/js/json) and logs a coverage report (which elements are live vs
static), mirroring the parser's unsupported-command diagnostics.
"""
from __future__ import annotations
import logging
import os
fr... | ivaleo/animageo | animageo/exporters/jsxgraph/exporter.py | .py | 221576c1dd0dc6ee | 7 | 0 |
"""Declarative, versioned board spec — ``animageo-board/v1``.
The structured, **eval-free** representation of a board: a topologically-ordered
list of elements plus an interactive-input schema. Each element carries its
AnimaGeo *semantic* identity (``role`` / ``kind`` / source ``detail`` /
``tracksDrag``) **and** a co... | ivaleo/animageo | animageo/exporters/jsxgraph/spec.py | .py | df40db86451cd839 | 7.5 | 0 |
"""Resolved style → JSXGraph attributes.
Reads through the same ``style.resolver`` the renderer uses, so GGB import →
overlay → explicit ``elem.style`` behave identically. Sizes are pixels in both
AnimaGeo and JSXGraph, so no unit conversion is needed.
"""
from __future__ import annotations
from typing import Any, Di... | ivaleo/animageo | animageo/exporters/jsxgraph/style_map.py | .py | 321bdef8938734be | 7 | 0 |
"""TikZ export orchestration.
``export_tikz`` walks the scene's drawable elements in z-order, dispatches each
to its emitter, collects labels to emit last, and assembles a TikZ snippet or a
standalone document via :class:`TikZDocument`.
"""
from __future__ import annotations
import logging
import os
from typing impor... | ivaleo/animageo | animageo/exporters/tikz/exporter.py | .py | 9191c805b2cea335 | 7 | 0 |
"""Configuration for TikZ export.
A small immutable bundle of knobs controlling how a construction is rendered
into TikZ. Sensible defaults reproduce the SVG look (96-dpi pixel mapping, real
LaTeX labels, viewport clipping).
"""
from __future__ import annotations
from dataclasses import dataclass, field
from typing i... | ivaleo/animageo | animageo/exporters/tikz/options.py | .py | 7d1d475c2c38538c | 7 | 0 |
"""Resolved style → TikZ path/option fragments.
These helpers turn the values produced by the style resolver into TikZ option
strings (``draw=agc0, line width=0.6pt, opacity=0.8, dashed``) and colour-macro
references. All px→pt conversion goes through :class:`TikzContext`.
"""
from __future__ import annotations
from ... | ivaleo/animageo | animageo/exporters/tikz/style_map.py | .py | a6565b52046e6abf | 7 | 0 |
"""Point <-> curve-parameter (tparam) math for every path type.
Single home for the coords -> parameter projections used by the GGB
importer, ``Construction.get_independents`` / ``tparam_from_coords`` and
the keyframe animation system. GeoGebra itself never stores the path
parameter in .ggb files: it re-projects the s... | ivaleo/animageo | animageo/geo/tparam.py | .py | 98bce55d929b58f3 | 7 | 0 |
"""Shared utility functions for type checking and value parsing."""
def is_number(s):
"""Check if a value can be interpreted as a float."""
try:
float(s)
return True
except (ValueError, TypeError):
return False
def is_angle_degrees(s):
"""Check if a string represents an angle... | ivaleo/animageo | animageo/geo/utils.py | .py | f683afd87be62dc1 | 7 | 0 |
"""Path-B exec-based DSL engine for AnimaGeo.
Entry point: :func:`run`. Transforms the user's code so every
Construction-level assignment routes through the registrar, then execs
the compiled result against a sandboxed namespace.
Pipeline::
code: str
│
├─► dsl.transform ── ast.parse + NodeTransforme... | ivaleo/animageo | animageo/parsers/dsl/__init__.py | .py | 1dc8289c460ef467 | 7 | 0 |
"""Re-generate ``namespace.pyi`` from the currently discovered commands.
Run this after adding a new command to ``geo/lib_commands.py`` so
that ``from animageo.dsl import *`` exposes the new factory name to
IDEs.
Usage::
python3 -m animageo.parsers.dsl._regen_stubs
Prints a diff of commands currently in lib_com... | ivaleo/animageo | animageo/parsers/dsl/_regen_stubs.py | .py | bd0cafac008ffc01 | 7 | 0 |
"""Auto-generate ``<basename>_stubs.pyi`` from a loaded ``Construction``.
Invoked by :meth:`AnimaGeoScene.loadGGB` (via ``generate_stubs=True``,
default). Produces a PEP-561 stub file next to the source ``.ggb``
with type declarations for every loaded element, so DSL files can::
from scene10_stubs import *
and g... | ivaleo/animageo | animageo/parsers/dsl/stub_gen.py | .py | ef76c03cb8747482 | 7 | 0 |
#!/usr/bin/env python3
# gitfession - digs through git history for the stuff you thought you deleted
#
# works anywhere python3 + git do: windows, mac, linux, whatever. no third-party
# deps on purpose so it runs on a fresh box with zero setup.
import argparse
import json
import math
import os
import re
import shutil
... | blavese/gitfession | gitfession.py | .py | 721c617cefe0f249 | 7 | 0 |
"""HTML parsing with lxml when available, html.parser otherwise.
Calibre ships lxml. The GitHub plugin zip is pure Python so a system
Python fallback (no lxml) still works.
"""
from __future__ import annotations
from bs4 import BeautifulSoup, FeatureNotFound
_PARSER = ""
def html_parser() -> str:
"""Parser na... | BlakeASmith/fanfic-organizer | ao3kit/htmlsoup.py | .py | ad2c08f82c7a7e2b | 7 | 0 |
"""Shared process helpers for detached ao3kit jobs.
Pid files, daemon spawn, SIGTERM stop, log tail/follow, and atomic JSON.
Used by ``ao3kit.jobs`` and the tag-cache warmer.
"""
from __future__ import annotations
import json
import os
import signal
import subprocess
import sys
import time
from datetime import datet... | BlakeASmith/fanfic-organizer | ao3kit/proc.py | .py | 0e771ccc6eb7a212 | 7 | 0 |
"""Suggest tag names from the local SQLite cache (no AO3 fetch).
AO3 disallows ``/autocomplete/`` in robots.txt, so plugin text fields and
``python -m ao3kit tags suggest`` rank names already stored in the tag cache
(plus optional extra names from the Calibre library).
"""
from __future__ import annotations
import a... | BlakeASmith/fanfic-organizer | ao3kit/tags/suggest.py | .py | b2a89180e754dab6 | 7 | 0 |
# -*- coding: utf-8 -*-
"""Calibre custom column setup for a new fanfic library.
Column labels/names match the FanFicFare layout used in the existing fanfic
library so a *new* Calibre library can look the same. This module never
opens or writes a library on its own — callers decide when to create columns
(import into ... | BlakeASmith/fanfic-organizer | calibre-plugin/columns.py | .py | 616ce652528433be | 7 | 0 |
# -*- coding: utf-8 -*-
"""Plan native EPUB downloads for library books that are missing a file.
Calibre-free so pytest can import this module without Calibre.
"""
from __future__ import annotations
from typing import Any
REASON_NO_AO3 = 'no AO3 URL or work id on this book'
REASON_HAS_EPUB = 'already has an EPUB'
... | BlakeASmith/fanfic-organizer | calibre-plugin/epub_plan.py | .py | ef0ccf1de9c6f708 | 7 | 0 |
# -*- coding: utf-8 -*-
"""Load AO3 scrape results from JSONL or an import zip."""
from __future__ import annotations
import json
import tempfile
import zipfile
from pathlib import Path
from typing import Any, Iterator
MANIFEST_NAME = 'results.jsonl'
EPUB_DIRNAME = 'epubs'
def iter_jsonl_records(path: str | Path) ... | BlakeASmith/fanfic-organizer | calibre-plugin/jsonl_loader.py | .py | 1b95d315d365e634 | 7 | 0 |
# -*- coding: utf-8 -*-
"""Calibre-compatible version tuple that Preferences → Plugins can display as SemVer.
Calibre renders ``plugin.version`` with ``'.'.join(map(str, plugin.version))``.
A 3-int tuple can only show ``X.Y.Z``. This tuple subclass still *compares* as
``(major, minor, patch)`` (so Calibre's numeric ch... | BlakeASmith/fanfic-organizer | calibre-plugin/plugin_version.py | .py | 685e477e758e8a34 | 7 | 0 |
"""Implement audit behavior."""
from types import SimpleNamespace
from sqlalchemy.orm import Session
from atlaso.app.models import AuditEvent
from atlaso.app.operational_logging import log_audit_event
def record_audit(
db: Session,
*,
actor: str,
action: str,
resource_type: str,
resource_id... | mdaneri/Atlaso | atlaso/app/audit.py | .py | f49e72e4fa287997 | 7.15 | 1 |
"""Validate privacy-safe KMIP interoperability traces against a bounded contract."""
from __future__ import annotations
import argparse
import hashlib
import json
from collections import Counter
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Iterable
CONTRACT_PATH = Path(__file__)... | mdaneri/Atlaso | atlaso/app/kmip/trace.py | .py | 217424054b6dc4db | 7.15 | 1 |
"""Minimal, bounded KMIP 1.4 TTLV codec."""
from __future__ import annotations
import struct
from dataclasses import dataclass
from enum import IntEnum
from typing import Iterable
MAX_MESSAGE_BYTES = 1_048_576
MAX_NESTING_DEPTH = 16
MAX_NODE_COUNT = 4096
class TtlvError(ValueError):
"""Raised when TTLV is malf... | mdaneri/Atlaso | atlaso/app/kmip/ttlv.py | .py | 498efaffe92f2369 | 7.15 | 1 |
"""Validate management-network values shared by appliance entry points."""
from __future__ import annotations
import re
from dataclasses import dataclass
from ipaddress import IPv4Address, IPv6Address, ip_address, ip_interface
class ManagementNetworkValidationError(ValueError):
"""Report an invalid or internall... | mdaneri/Atlaso | atlaso/app/management_network.py | .py | b01c3db292e534e7 | 7.15 | 1 |
"""OpenAPI metadata and enforcement helpers for Atlaso's versioned API."""
from inspect import getdoc
from typing import Any
from fastapi.routing import APIRoute
from atlaso.app.schemas import ProblemDetails
class DocumentedAPIRoute(APIRoute):
"""Use an endpoint's explicit documentation as its success-response... | mdaneri/Atlaso | atlaso/app/openapi.py | .py | 0aa810962dd3c203 | 7.15 | 1 |
"""Configure redacted file and syslog output for operational events."""
from __future__ import annotations
import logging
import re
import socket
from dataclasses import dataclass
from logging.handlers import RotatingFileHandler, SysLogHandler
from pathlib import Path
from typing import Any
from sqlalchemy import se... | mdaneri/Atlaso | atlaso/app/operational_logging.py | .py | b78d19730ac0dfa0 | 7.15 | 1 |
"""Render consistent problem responses and browser-login redirects."""
from urllib.parse import quote
from uuid import uuid4
from fastapi import FastAPI, HTTPException, Request
from fastapi.exceptions import RequestValidationError
from fastapi.responses import JSONResponse, RedirectResponse
from atlaso.app.ui_routes... | mdaneri/Atlaso | atlaso/app/problem.py | .py | 5f7a4d99b1cb2435 | 7.15 | 1 |
"""Own Dashboard and Monitor API v1 transport handlers."""
from __future__ import annotations
import socket
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Annotated, Any
from fastapi import APIRouter, Depends, Query
from sqlalchemy import desc, select
from sqlalche... | mdaneri/Atlaso | atlaso/app/routers/api_v1/dashboard_monitor.py | .py | fad66b15a5f3efc9 | 7.15 | 1 |
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Annotated, Any
from fastapi import APIRouter, Depends, HTTPException
from fastapi import Path as ApiPath
from sqlalchemy import func, select
from sqlalchemy.exc import IntegrityError
f... | mdaneri/Atlaso | atlaso/app/routers/api_v1/firewall.py | .py | 7b4c9fd17dc7df50 | 7.15 | 1 |
"""Own Appliance Settings API v1 transport handlers."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Annotated, Any
from fastapi import APIRouter, Depends
from sqlalchemy import select
from sqlalchemy.orm import Session
from at... | mdaneri/Atlaso | atlaso/app/routers/api_v1/settings.py | .py | 9f70633fb425b6f5 | 7.15 | 1 |
"""Own VCF workflow API v1 status transport handlers."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Annotated, Any
from fastapi import APIRouter, Depends
from sqlalchemy import select
from sqlalchemy.orm import Session
from a... | mdaneri/Atlaso | atlaso/app/routers/api_v1/vcf_workflows.py | .py | 80dcfb01b0df88c7 | 7.15 | 1 |
"""Characterize Atlaso route and OpenAPI contracts deterministically."""
from __future__ import annotations
from collections.abc import Mapping, Sequence
from copy import deepcopy
from dataclasses import dataclass
from typing import Any, cast
from fastapi import APIRouter, FastAPI
from atlaso.app.routers.registry i... | mdaneri/Atlaso | atlaso/app/routers/contracts.py | .py | ee7e6ccfa9783bd2 | 7.15 | 1 |
"""Own Dashboard and Monitor management UI transports."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from typing import Any
from fastapi import APIRouter, Depends, Query, Request
from fastapi.responses import HTMLResponse, JSONResponse
from sqla... | mdaneri/Atlaso | atlaso/app/routers/ui/dashboard_monitor.py | .py | e258c17fd0c142c4 | 7.15 | 1 |
"""Pre-execution ACP edit approval helpers.
This module is intentionally isolated from the generic tool registry. ACP binds
an edit approval requester in a ContextVar for the duration of one ACP agent run;
CLI, gateway, and other sessions leave it unset and therefore bypass this guard.
"""
from __future__ import ann... | maheshwetlit/crypto-signal-bot | acp_adapter/edit_approval.py | .py | d7378886d6663562 | 7.15 | 1 |
"""CLI entry point for the hermes-agent ACP adapter.
Loads environment variables from ``~/.hermes/.env``, configures logging
to write to stderr (so stdout is reserved for ACP JSON-RPC transport),
and starts the ACP agent server.
Usage::
python -m acp_adapter.entry
# or
hermes acp
# or
hermes-acp
... | maheshwetlit/crypto-signal-bot | acp_adapter/entry.py | .py | 7cb4be5532a03450 | 7.15 | 1 |
"""ACP permission bridging for Hermes dangerous-command approvals."""
from __future__ import annotations
import asyncio
import logging
from concurrent.futures import TimeoutError as FutureTimeout
from itertools import count
from typing import Callable
from acp.schema import (
AllowedOutcome,
PermissionOption... | maheshwetlit/crypto-signal-bot | acp_adapter/permissions.py | .py | 57001c99a5c04d6c | 7.15 | 1 |
"""Derive ACP session-provenance metadata from the existing compression chain.
This is an additive Hermes extension surfaced under ACP ``_meta.hermes`` so
existing ACP clients ignore it. It carries no new persisted state: everything
is derived on demand from the ``sessions`` table (``parent_session_id`` /
``end_reason... | maheshwetlit/crypto-signal-bot | acp_adapter/provenance.py | .py | 138ffc113f473a9d | 7.15 | 1 |
"""Helpers for translating OpenAI-style tool schemas to Gemini's schema subset."""
from __future__ import annotations
from typing import Any, Dict
# Gemini's ``FunctionDeclaration.parameters`` field accepts the ``Schema``
# object, which is only a subset of OpenAPI 3.0 / JSON Schema. Strip fields
# outside that sub... | maheshwetlit/crypto-signal-bot | agent/gemini_schema.py | .py | a34dcdea0e3e0174 | 7.15 | 1 |
"""Lightweight internationalization (i18n) for Hermes static user-facing messages.
Scope (thin slice, by design): only the highest-impact static strings shown
to the user by Hermes itself -- approval prompts, a handful of gateway slash
command replies, restart-drain notices. Agent-generated output, log lines,
error t... | maheshwetlit/crypto-signal-bot | agent/i18n.py | .py | da00908c79517514 | 7.15 | 1 |
#!/usr/bin/env python3
"""SynOmega vs AiZynthFinder on all 1000 ChEMBL targets (budget-aligned).
Reproduces every AiZynthFinder-comparison number in the paper (solved rate,
per-target agreement, and the wall-clock efficiency contrast) from:
- ./aizynth_out.json.gz (AiZynthFinder, depth/width/bud... | zbc0315/synomega | benchmark/aizynth_comparison/compare_aizynth.py | .py | 5603126e3c365fed | 7.15 | 1 |
#!/usr/bin/env python3
"""Wilcoxon signed-rank test on paired node expansions, simplify vs original.
On the targets solved by BOTH models, is the per-target reduction in node
expansions under the simplifying constraint statistically significant?
Pairs by canonical SMILES. Run: python paired_stats.py
"""
import csv
imp... | zbc0315/synomega | benchmark/efficiency_coverage/paired_stats.py | .py | 48f0c799404a35b1 | 7.15 | 1 |
#!/usr/bin/env python3
"""Bootstrap 95% CI for the Spearman rho of the SynOmega score vs SAscore /
SCScore / RAscore over the 1000-target set.
Deterministic (fixed seed) so the reported CI is reproducible. Uses the same
merged data as analyze_scores.py. Run: python bootstrap_ci.py
"""
import os
import numpy as np
impo... | zbc0315/synomega | benchmark/synthesizability_baselines/bootstrap_ci.py | .py | 96a841ea9e4757e5 | 7.15 | 1 |
#!/usr/bin/env python3
"""From all_routes.jsonl, pull candidate targets for the Figure 3(e) route-comparison:
the simplify-model best route is short (<=2 steps) and the original-model best route
is longer (>=4 steps), both fully solved to purchasable building blocks.
Each candidate dumps every reaction step as 'product... | zbc0315/synomega | benchmark/target_set/extract_candidates.py | .py | e8bbd3639ce4ef6f | 7.15 | 1 |
#!/usr/bin/env python3
"""Extract the original-model and simplify-model best routes for a list of targets,
dumping each route tree to JSONL. Used to find illustrative examples where the two
models reach the same building blocks by different routes (e.g. the original model
detouring through a protecting-group step). Run... | zbc0315/synomega | benchmark/target_set/extract_routes.py | .py | 7bc35726b9677684 | 7.15 | 1 |
"""Generate the documentation's quantitative charts as self-contained SVGs.
Every number here is transcribed from the SynOmega JCIM paper (main text + SI)
and the module evaluation reports; nothing is synthesised. Re-run after editing
the data tables below:
python synomega/docs/figures/make_figures.py
Output: SV... | zbc0315/synomega | docs/figures/make_figures.py | .py | 1e3c1b761964c61d | 7.15 | 1 |
"""Efficiency impact of the plausibility filter on single-step and multi-step.
Same molecules, two configs (filter off / on). Reports single-step per-call
latency and multi-step wall-clock + search expansions + solve rate, so the cost
of screening is separated from its effect on the search itself.
"""
import argparse,... | zbc0315/synomega | scripts/bench_plausibility.py | .py | 7abf5f6944a3d285 | 7.15 | 1 |
"""Calibrate the single-step plausibility-filter threshold on held-out reactions.
For each held-out REAL reaction (product P, true reactants R_true), run the
single-step model on P and score every candidate with the dual-tower plausibility
model. Two signals drive the threshold:
* true-disconnection scores -> the t... | zbc0315/synomega | scripts/calibrate_plausibility_threshold.py | .py | bd119527ce63db4c | 7.15 | 1 |
"""synomega — retrosynthesis toolkit.
Three layers, deliberately decoupled:
synthesizability is this target reachable from purchasable material?
↑
search multi-step route planning over an AND-OR graph
↑
singlestep product SMILES -> ranked reactant candidates
Quick st... | zbc0315/synomega | src/synomega/__init__.py | .py | 6dfb996109064d9b | 7.15 | 1 |
"""Molecule handling: canonicalization, identity keys, caching.
Identity model
--------------
A molecule's *identity* is its InChIKey. We use InChIKey rather than canonical
SMILES because the building-block stock comes from an external source
(eMolecules) written by a different toolkit — InChIKey survives that round t... | zbc0315/synomega | src/synomega/chem/mol.py | .py | 53c6c4da670b29b3 | 7.15 | 1 |
"""Reaction objects and reaction-SMILES helpers."""
from __future__ import annotations
from dataclasses import dataclass, field
from .mol import Molecule, canonicalize
@dataclass(frozen=True)
class Conditions:
"""Reaction conditions.
Reserved for a future condition-prediction model (solvent / temperature ... | zbc0315/synomega | src/synomega/chem/reaction.py | .py | e403450a80212f70 | 7.15 | 1 |
"""Download-on-demand for the default pretrained model and building-block stock.
A pip wheel cannot carry hundreds of megabytes of weights and data (PyPI's file
limits, and it would force every install to pull them). So the default assets are
hosted as **GitHub Release assets** and fetched into a local cache the first... | zbc0315/synomega | src/synomega/data.py | .py | bd63ad1c77c64a54 | 7.15 | 1 |
"""Forward reaction prediction interface.
Where a `SingleStepModel` turns a product into ranked reactant sets, a
`ForwardModel` turns a reactant set into ranked product candidates. It is a
separate base class: a forward model is not a `SingleStepModel`, so the planner
does not consume it.
"""
from __future__ import a... | zbc0315/synomega | src/synomega/forward/base.py | .py | bee2d4ffa65f69b3 | 7.15 | 1 |
"""Wrap a single-step (retro) model so every candidate disconnection is verified
by a forward model — a round-trip / forward-backward consistency check.
For each candidate ``reactants -> target`` the retro model proposes (tagged with
the retro ``template_id``), the forward model is run on those ``reactants`` and
its t... | zbc0315/synomega | src/synomega/forward/consistency_filter.py | .py | 1f8f58be7a77a4c6 | 7.15 | 1 |
"""The `Planner` facade — the one object most users need."""
from __future__ import annotations
from pathlib import Path
from .search.base import Budget, SearchResult
from .singlestep.base import SingleStepModel
from .singlestep.cache import CachedModel
from .stock.base import BuildingBlockSet
class Planner:
"... | zbc0315/synomega | src/synomega/planner.py | .py | 1749358baf0545ca | 7.15 | 1 |
"""Wrap a single-step model so every prediction is screened by the dual-tower
plausibility model.
For each candidate disconnection ``reactants -> target``, the plausibility model
scores how likely those reactants really give the target. Candidates below
``threshold`` are **dropped**; everything else is left exactly as... | zbc0315/synomega | src/synomega/plausibility/filter.py | .py | 90d0f0594438db9c | 7.15 | 1 |
"""Load the dual-tower plausibility model and score reactions.
``PlausibilityScorer.score_reactions([(reactants, product), ...])`` returns a
plausibility probability in ``[0, 1]`` for each reaction — how likely the given
reactants actually produce that product. Reactant/product graphs are cached, so
scoring many candi... | zbc0315/synomega | src/synomega/plausibility/scorer.py | .py | cafabb5818426ad5 | 7.15 | 1 |
"""Best-first search over the AND-OR graph.
Maintains a priority queue of unexpanded molecules ordered by
`g + h` — accumulated reaction cost plus the value function's estimate of what
remains. With `ZeroValue` this is uniform-cost search; with a heuristic it is
greedy A*.
Frontier nodes are expanded in batches so GP... | zbc0315/synomega | src/synomega/search/bfs.py | .py | 599f1f10aca98bdd | 7.15 | 1 |
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Python logging.
# Th... | greatgc-flow/peerhub | alembic/env.py | .py | 59c148ae73843d3e | 7 | 0 |
"""Real Codex adapter implementation for Stage 3."""
from __future__ import annotations
import json
from collections.abc import Sequence
from typing import cast
from peerhub.adapters.contract import (
AdapterRequest,
ArtifactSpec,
Capability,
DecodedOutput,
DecoderEvent,
DecoderEventKind,
... | greatgc-flow/peerhub | peerhub/adapters/codex_adapter.py | .py | 7c7a122afb786ab7 | 7 | 0 |
"""Built-in peer-adapter registry for runtime composition."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from pathlib import Path
from types import MappingProxyType
from typing import TypeAlias
from peerhub.adapters.agy_adapter import RealAgyAda... | greatgc-flow/peerhub | peerhub/adapters/registry.py | .py | 5062ddd24418d6ee | 7 | 0 |
"""Happy-path orchestration for one prompt dispatched to multiple peers."""
from __future__ import annotations
import hashlib
from dataclasses import dataclass
from pathlib import Path
from peerhub.adapters.contract import AdapterRequest, SessionAction
from peerhub.adapters.registry import ResolvedPeerTarget, resolv... | greatgc-flow/peerhub | peerhub/application/broadcast.py | .py | 56012abffb95c9c0 | 7 | 0 |
"""Fake reference adapter for Slice 5 TDD.
Step 3 (this session, 2026-08-02) implements exactly the piece that has a
concrete, testable oracle: ``interpret_chunk``/``finalize_decoded_output``,
against DT-02's exact byte-in/lines-out expectations. ``prompt_policy``,
``plan_invocation``, ``new_decoder``, and ``interpret... | greatgc-flow/peerhub | peerhub/builtins/fake_adapter.py | .py | 4d0e8cdef00f1bf7 | 7 | 0 |
"""Immutable runtime context and low-level dependency protocols."""
from __future__ import annotations
from dataclasses import dataclass
from pathlib import Path
from typing import Protocol, runtime_checkable
@runtime_checkable
class Clock(Protocol):
"""A source of deterministic logical or UTC timestamps."""
... | greatgc-flow/peerhub | peerhub/core/context.py | .py | 16780c286acec8b0 | 7 | 0 |
"""Execution certainty, process terminal evidence, and deadline primitives."""
from __future__ import annotations
from dataclasses import dataclass
from enum import Enum
class ExecutionCertainty(str, Enum):
"""Canonical execution-certainty vocabulary frozen by Protocol V1."""
NOT_STARTED = "NOT_STARTED"
... | greatgc-flow/peerhub | peerhub/core/execution.py | .py | a6cc75cf232a89ba | 7 | 0 |
"""Authenticated caller identity for trusted application boundaries."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Protocol, cast
import psutil
from peerhub.core.errors import ActorUnauthorizedError
from peerhub.core.protocol import require_text
@dataclass(frozen=True,... | greatgc-flow/peerhub | peerhub/core/identity.py | .py | f634d52ab225eeec | 7 | 0 |
from __future__ import annotations
from collections.abc import Sequence
from peerhub.core.context import Clock, IdSource
from peerhub.state.contract import StateStore
from .contract import (
ArtifactManifestRecord,
ArtifactMetadata,
)
from .unit_of_work import DispatchUnitOfWork, FaultInjector, _NoFaultInjec... | greatgc-flow/peerhub | peerhub/dispatch/artifact_coordination.py | .py | 91eeaa67f902bfd5 | 7 | 0 |
"""Capability authority types and pure binding invariants.
This module is intentionally independent of persistence and dispatch
coordination. Admission, replay, and dispatch gates can therefore reuse the
same validators without duplicating authority logic.
"""
from __future__ import annotations
from dataclasses imp... | greatgc-flow/peerhub | peerhub/dispatch/capability.py | .py | 0e81c85e3b8e8095 | 7 | 0 |
"""Minimal concrete capability policy and enforcement-evidence providers.
Errata Section 7.1 makes ``CapabilityPolicy`` and
``PeerEnforcementEvidenceProvider`` injected dependencies of
``AdmissionCoordinator``. This module supplies the smallest concrete
implementations that satisfy the fail-closed requirements of Sec... | greatgc-flow/peerhub | peerhub/dispatch/capability_policy.py | .py | e0bd57bee27d6f75 | 7 | 0 |
"""Dedicated lease-heartbeat background worker.
Ratified design: SLICE5-KICKOFF-R1.md "Process runner backend + lease
heartbeat RATIFIED" (Option B -- dedicated background task, never
piggybacked on chunk events as the sole mechanism).
The heartbeat worker runs in a dedicated background thread, renewing
the lease on ... | greatgc-flow/peerhub | peerhub/dispatch/heartbeat.py | .py | b64f8a5c8c97ecdb | 7 | 0 |
"""Subprocess.Popen-based pipe runner for non-interactive dispatch.
This is the default, non-interactive runner backend per the ratified
Slice 5 design (SLICE5-KICKOFF-R1.md "Process runner backend + lease
heartbeat RATIFIED"). It spawns a process via ``subprocess.Popen``
with ``PIPE`` stdout/stderr, reads output, an... | greatgc-flow/peerhub | peerhub/dispatch/pipe.py | .py | 9d9b9260c33df10e | 7 | 0 |
"""Align every AF3 pose to the experimental crystal structure, for an overlaid view.
For each system:
1. download the real crystal from RCSB (these CAMEO targets are now released PDB entries),
2. clean it to {protein + the one ground-truth ligand},
3. superpose each of AF3's 5 pose models onto the crystal by pro... | rafwiewiora/foldarium | benchmark/prep/align_to_xtal.py | .py | 0afa225c1753498c | 7 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.