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
""" core/line_mechanics.py Motore fisico non-lineare conforme a OCIMF MEG4 per calcoli di ormeggio e rigidezza elastica. Predisposto per validazione Lloyd's Register. """ import numpy as np import pandas as pd # Parametri curve di allungamento MEG4 (% Elongation = A * (T / MBL)^B) MATERIAL_ELONGATION_PARAMS = { "...
PANORAMA2026/moor2.0
core/line_mechanics.py
.py
57a9e98ebfcc8ede
7
0
""" utils/pdf_parser.py Parser dinamico per certificati d'ormeggio MEG4 e accessori. Supporta qualsiasi produttore mediante tokenizzazione flessibile, normalizzazione e conversione unificata. """ import re from pypdf import PdfReader # Dizionario di conversione al carico in Tonnellate Metriche (t) FORCE_CONVERSION = ...
PANORAMA2026/moor2.0
utils/pdf_parser.py
.py
dff6903d4dce5175
7
0
""" views/tab_history.py Storico ormeggi, degrado cavi e manutenzione predittiva. """ import pandas as pd import plotly.express as px import streamlit as st def ensure_table_exists(conn): """Crea la tabella 'line_history' se non esiste usando executescript per evitare errori SQL.""" try: cursor = con...
PANORAMA2026/moor2.0
views/tab_history.py
.py
945e6780e74811e0
7
0
""" views/tab_simulation.py Tab Simulazione Tensioni con grafico 2D colorato a semaforo in base alla % MBL. """ import numpy as np import plotly.graph_objects as go import streamlit as st import pandas as pd def get_tension_color(util_percent: float) -> str: """Restituisce il colore dinamico in base al livello d...
PANORAMA2026/moor2.0
views/tab_simulation.py
.py
5b7dee73ef82ef96
7
0
#!/usr/bin/env python3 """Generate UniEMind-Algo package skeleton per Software Architecture V0.1.""" from __future__ import annotations import shutil from pathlib import Path from typing import Any from architecture_v01 import ( COMMON_CHILDREN, MODULES, capability_readme_en, capability_readme_zh, ...
depthEmMind/UniEMind-Algo
scripts/bootstrap_architecture.py
.py
56c7b468f43139bd
7.15
1
"""Chessboard-based monocular camera intrinsic calibration (OpenCV). Aligned with UniEMind-Interfaces ``CalibrateSensor`` (``calibration_type=intrinsic``) and ``sensor_msgs/CameraInfo``. """ from __future__ import annotations from pathlib import Path from typing import Optional, Sequence import numpy as np from un...
depthEmMind/UniEMind-Algo
uniemind_algo/calibration_identification/camera/chessboard.py
.py
59fabf25cf047f28
7.15
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 큐에이플러스(QA+) 블로그 본문 이미지 실제 생성 + 호스팅 모듈. - OpenAI Images API(DALL-E 3)로 이미지를 생성해 base64로 받아 로컬 파일로 저장. - 저장한 이미지를 git commit + push해서 GitHub raw URL로 공개 접근 가능하게 만든다 (Blogger API가 파일 업로드를 지원하지 않아, 이미 있는 git push 인프라를 이미지 호스팅으로 재사용). """ import os import re import json ...
gohwansok-max/qaplus-os
scripts/blog_image_generator.py
.py
b9839c30f341a6ad
7
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 큐에이플러스(QA+) Blogger 자동 임시저장/발행 모듈 - OAuth 리프레시 토큰으로 액세스 토큰을 발급받아 Blogger API v3(posts.insert)를 호출한다. - 최초 1회, 로컬에서 scripts/get_blogger_refresh_token.py 로 리프레시 토큰을 발급받아야 한다. """ import os import json import requests BLOGGER_API_BASE = "https://www.googleapis.com/blogg...
gohwansok-max/qaplus-os
scripts/blogger_publisher.py
.py
bfaf06777eff1427
7
0
# -*- coding: utf-8 -*- """ 오디오 자산(BGM & SFX) 프로시저럴 생성기 - 외부 라이브러리 없이 순수 Python wave 모듈로 고음질 SFX 및 앰비언트 BGM 생성 """ import os import math import struct import wave BASE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) AUDIO_DIR = os.path.join(BASE_DIR, "outputs", "audio") os.makedirs(AUDIO_DIR, exi...
gohwansok-max/qaplus-os
scripts/generate_audio_assets.py
.py
5f07effd984897a2
7
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ GitHub raw URL을 즉석 파일 호스팅으로 쓰기 위한 공용 헬퍼. (Blogger 이미지, 인스타그램 릴스 video_url 등 "공개 URL이 필요한데 별도 호스팅이 없는" 경우에 재사용) """ import os import subprocess import urllib.parse GITHUB_REPO = "gohwansok-max/qaplus-os" GITHUB_BRANCH = "main" def _git(args, cwd): return subproc...
gohwansok-max/qaplus-os
scripts/git_push_helper.py
.py
c8266f0e5165b893
7
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 큐에이플러스(QA+) 페이스북 릴스 + 인스타그램 릴스 자동 업로드 모듈 (Meta Graph API) - 페이스북: 리졸버블 업로드로 파일을 직접 전송 (POST /{page-id}/video_reels) - 인스타그램: Graph API는 파일 직접 업로드가 아니라 "공개적으로 접근 가능한 video_url"을 요구하므로, 블로그 이미지 때와 동일한 방식으로 GitHub raw URL을 이용해 업로드한다. (git_push_helper.push_and_get_raw...
gohwansok-max/qaplus-os
scripts/meta_reels_uploader.py
.py
a0eb4282f7165ad2
7
0
# -*- coding: utf-8 -*- """ 큐에이플러스(QA+) 텔레그램 전송 모듈 - 생성된 1080x1920 세로형 쇼츠 MP4 영상을 텔레그램 톡방으로 직접 전송 - 환경변수 TELEGRAM_BOT_TOKEN 및 TELEGRAM_CHAT_ID 활용 """ import os import sys import requests if sys.platform == "win32": try: sys.stdout.reconfigure(encoding='utf-8') sys.stderr.reconfigure(encoding='utf-...
gohwansok-max/qaplus-os
scripts/telegram_sender.py
.py
71d094b511a0739b
7
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 큐에이플러스(QA+) 유튜브 쇼츠 자동 업로드 모듈 - OAuth 리프레시 토큰으로 액세스 토큰을 발급받아 YouTube Data API v3(videos.insert, resumable upload)를 호출한다. - Blogger와 동일한 Google Cloud 프로젝트/OAuth 클라이언트를 재사용하되, 스코프가 다르므로 리프레시 토큰은 scripts/get_youtube_refresh_token.py로 별도 발급받아야 한다. """ import os import js...
gohwansok-max/qaplus-os
scripts/youtube_uploader.py
.py
f95e3b2b09832e94
7
0
"""MeteoSwiss Weather: Home Assistant integration on the official Open Data platform. Sets up the two data coordinators (ADR-0002) and stores them, together with the resolved forecast point, station and forecast backend, on ``entry.runtime_data``. The weather platform consumes that handle; the sensor platform lands in...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/__init__.py
.py
bed852a26ba81091
7
0
"""Config flow for the MeteoSwiss Weather integration. Three-step setup: the user confirms a postal code (pre-filled from the HA location), optionally picks among multiple forecast points for that postal code, then picks a SwissMetNet station. All choices are derived from the official open data (ADR-0001); no app API ...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/config_flow.py
.py
cca1e04a7cc98740
7
0
"""Data update coordinators for MeteoSwiss Weather. Two coordinators back a config entry (ADR-0002): - :class:`StationCoordinator` polls the configured SwissMetNet station's 10-minute ``now`` file, revalidating it conditionally so an unchanged file costs a single 304. - :class:`ForecastCoordinator` checks the new...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/coordinator.py
.py
8e32ff41dd9a31f9
7
0
"""Forecast backend seam (ADR-0002). The daily forecast is assembled from the bulk CSV files today; MeteoSwiss has announced a per-point OGC Features API for the end of 2026. Both live behind :class:`ForecastBackend`, so swapping to the point API when it ships is a contained change that never reaches the coordinator o...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/backend.py
.py
5ba6a56cff6f7cd8
7
0
"""Constants for the pure-Python OGD client. Duplicated from the integration's ``const.py`` on purpose: this package imports nothing from Home Assistant (ADR-0001) so it can move to PyPI unchanged. Keep the values here identical to the ones there. """ from __future__ import annotations # Official MeteoSwiss open dat...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/const.py
.py
beb7ae14e057e4c0
7
0
"""Local forecast: resolve a postal code to a point, parse the daily files. Reads the official ``ch.meteoschweiz.ogd-local-forecasting`` files (ADR-0001). Columns are addressed by header, never by position (docs/ogd.md §E4). The daily parameter files are small (order of 5 MB together); the hourly files are the whole t...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/forecast.py
.py
726641f61d36ad93
7
0
"""Conditional HTTP text fetch, shared by the station and forecast clients. One helper, ``get_text``, that carries an ``ETag`` / ``Last-Modified`` pair across calls so an unchanged file costs a single 304 (ADR-0002). Reused by the current-observations client (#4) and the forecast client (#10). """ from __future__ imp...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/http.py
.py
f78affa8256b23db
7
0
"""STAC discovery for the local-forecast runs (docs/ogd.md §E4). The local forecast is published as one CSV per parameter per hourly run; the files of a run land over a few minutes, so the newest run in the catalogue is often still incomplete. :func:`latest_run` picks the newest run that already carries every paramete...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/stac.py
.py
4e4cdb55f7981416
7
0
"""SwissMetNet stations: metadata, nearest-station search, current values. Reads the official ``ch.meteoschweiz.ogd-smn`` files (ADR-0001). Column positions are never hard-coded: every file is parsed by its header, so an added column upstream does not silently shift a value (docs/ogd.md §A1). """ from __future__ impo...
chriguschneider/hass-meteoswiss-weather
custom_components/meteoswiss_weather/ogd/stations.py
.py
ab65cc2ee5dbde6d
7
0
#!/usr/bin/env python3 """Regenerate the brand icon set shipped with this integration. Home Assistant shows the default puzzle-piece icon until brand images exist for the domain. Since HA 2026.3 a custom integration can ship them itself in a ``brand/`` folder, which the brands proxy API serves in preference to the bra...
chriguschneider/hass-meteoswiss-weather
scripts/generate_brands_icon.py
.py
e3b1eea8d01bc6d9
7
0
"""Shared pytest fixtures for the MeteoSwiss Weather integration tests. ``enable_custom_integrations`` (autouse) ensures that every test which requests the ``hass`` fixture loads the custom component from the repo tree rather than from an installed package. Tests that do not use ``hass`` (the pure-Python OGD tests) ar...
chriguschneider/hass-meteoswiss-weather
tests/conftest.py
.py
c2621a1c26334e19
7.5
0
"""Guard CHANGELOG.md format and coverage. Verifies that CHANGELOG.md exists and contains a section header for the version currently declared in manifest.json, so a version bump without a matching changelog section fails on every push, not only on tag push. """ from __future__ import annotations import json import r...
chriguschneider/hass-meteoswiss-weather
tests/test_changelog.py
.py
dcd6aa0f4f9cb9eb
7.5
0
"""Constant invariants that the ADRs pin down. Stdlib-only (no ``hass`` fixture): these guard the traffic-budget cadences (ADR-0002) so a future edit that shortens them fails loudly here. """ from __future__ import annotations from datetime import timedelta from custom_components.meteoswiss_weather.const import ( ...
chriguschneider/hass-meteoswiss-weather
tests/test_const.py
.py
06f9d660a971f7ae
7.5
0
"""Pure metadata tests: no Home Assistant required. Guards the "keep in sync" footgun called out in const.py: the version must be identical in manifest.json and const.py. Also asserts the manifest and hacs.json carry what hassfest / HACS expect, and that the zip release asset is wired end to end. Runs in milliseconds,...
chriguschneider/hass-meteoswiss-weather
tests/test_metadata.py
.py
f41d7cd2a2ad84a5
7.5
0
#!/usr/bin/env python3 """Refresh the trimmed fixture files from the live MeteoSwiss open data. Stdlib-only (urllib, csv, io, json, pathlib). Hits the network — run on a machine with internet access when upstream schemas or content change. Writes directly to ``tests/fixtures/``; review the diff before committing. Usa...
chriguschneider/hass-meteoswiss-weather
tests/tools/refresh_fixtures.py
.py
6e6ddcb0f88c9ac3
7.5
0
#!/usr/bin/env python3 import re from collections import Counter from pathlib import Path URL_REGEX = re.compile(r"https?://[^\s)]+") FENCE_OPEN_REGEX = re.compile(r"^(\s{0,3})(`{3,}|~{3,})(.*)$") # A line that is nothing but a fence marker plus an optional info string, at ANY # indentation. Used ONLY to scrub leaked...
Harvardhao/claude-lie-detector
.agents/skills/caveman-compress/scripts/validate.py
.py
8c993f9a0e04ef40
7
0
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT """ This module provides the startup helpers for the import of scans and plugins. Loading order: 1. Built-in 2. Optional __all__: - Plugin classes register themselves via decorators at import time....
hz-b/kiwi-scan
src/kiwi_scan/__init__.py
.py
5ca216e930fd53d2
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from typing import Any, ClassVar, Dict, Mapping, Optional, Type, Union from kiwi_scan.actuator.single import AbstractActuator from kiwi_scan.actuator_concrete.single_epics import EpicsActuator from ...
hz-b/kiwi-scan
src/kiwi_scan/actuator/factory.py
.py
791c5c957af2bac7
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import threading import time from typing import Any, Optional, Sequence from kiwi_scan.actuator.single import AbstractActuator from kiwi_scan.datamodels import ActuatorConfig class MultiActuator(A...
hz-b/kiwi-scan
src/kiwi_scan/actuator/multi.py
.py
20ba4887db0f0b16
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging import threading from abc import ABC, abstractmethod from dataclasses import dataclass from typing import Any, Callable, Dict, Mapping, Optional from kiwi_scan.datamodels import Actua...
hz-b/kiwi-scan
src/kiwi_scan/actuator/single.py
.py
58d85f5a972a63ee
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging import threading import time from typing import Any, Optional from kiwi_scan.actuator.single import AbstractActuator from kiwi_scan.datamodels import ActuatorConfig logger = logging....
hz-b/kiwi-scan
src/kiwi_scan/actuator_concrete/single_simulation.py
.py
2cca212d602e3af7
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging from typing import Sequence from kiwi_scan.actuator.multi import MultiActuator from kiwi_scan.actuator.single import AbstractActuator from kiwi_scan.datamodels import ActuatorConfig f...
hz-b/kiwi-scan
src/kiwi_scan/actuator_concrete/undulator.py
.py
4cc7744765e6084b
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging import os from typing import Optional import pandas as pd logger = logging.getLogger(__name__) def get_kiwi_data_dir_from_environ(): """ Returns the absolute path from KIWI_...
hz-b/kiwi-scan
src/kiwi_scan/data/loader.py
.py
19cef4ad3ab62b11
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging from dataclasses import dataclass from typing import Any, Dict, List, Optional, Tuple import numpy as np import pandas as pd logger = logging.getLogger(__name__) @dataclass class Me...
hz-b/kiwi-scan
src/kiwi_scan/data/metadata_loader.py
.py
46aae2611998e7de
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import logging import threading import time from typing import Any, Callable, Dict, Optional import epics logger = logging.getLogger(__name__) _CA_LOCK = threadi...
hz-b/kiwi-scan
src/kiwi_scan/epics_wrapper.py
.py
5fb7c967cd46706b
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import logging from datetime import datetime, timezone from pathlib import Path from typing import Any, Optional, Sequence, Union from kiwi_scan.data.loader impor...
hz-b/kiwi-scan
src/kiwi_scan/export/loader.py
.py
fbe54d9acc03408c
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT """ Abstract export model for kiwi-scan conversion tools. """ from __future__ import annotations import logging from dataclasses import dataclass, field from datetime import datetime from pathlib ...
hz-b/kiwi-scan
src/kiwi_scan/export/model.py
.py
1879da727c438bed
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import logging from abc import ABC, abstractmethod from pathlib import Path from typing import Callable, Dict, List from .model import ExportBundle logger = logg...
hz-b/kiwi-scan
src/kiwi_scan/export/writer_base.py
.py
623339a346e95371
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin fuer Materialien und Energie GmbH # SPDX-License-Identifier: MIT """Datamodels and parsing helpers for the generic kiwi-scan IOC API.""" from __future__ import annotations from dataclasses import dataclass from enum import IntEnum from typing import Any, Iterab...
hz-b/kiwi-scan
src/kiwi_scan/ioc/datamodels.py
.py
9d967940f35d0fd4
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin fuer Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import logging from dataclasses import dataclass, field from typing import TYPE_CHECKING, Dict, List, Optional from .controller import ScanIOCController from .dat...
hz-b/kiwi-scan
src/kiwi_scan/ioc/factory.py
.py
98bbda50afbfd118
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from abc import ABC, abstractmethod class BaseMonitor(ABC): @abstractmethod def start(self, signal_names, headers=None): """Handle a new data point.""" @abstractmethod ...
hz-b/kiwi-scan
src/kiwi_scan/monitor/base.py
.py
ce9d2471e7c4ba50
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import logging from typing import Any, Dict, Iterable, List, Optional from kiwi_scan.monitor.base import BaseMonitor from kiwi_scan.monitor.row_format import Moni...
hz-b/kiwi-scan
src/kiwi_scan/monitor_concrete/print.py
.py
c01d339d170c446d
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT import logging import os import time import weakref from abc import ABC, abstractmethod from datetime import datetime, timezone from typing import Any, Dict, List, Optional from kiwi_scan.actuator.s...
hz-b/kiwi-scan
src/kiwi_scan/plugin/base.py
.py
5955f8ac11b20c0b
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin für Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import math import time from typing import Any, Dict, List, Optional, Tuple from kiwi_scan.actuator.single import AbstractActuator, PvEvent from kiwi_scan.epics_w...
hz-b/kiwi-scan
src/kiwi_scan/plugin_concrete/logging.py
.py
d00e7ba3210ce865
7.3
3
# SPDX-FileCopyrightText: 2026 Helmholtz-Zentrum Berlin fuer Materialien und Energie GmbH # SPDX-License-Identifier: MIT from __future__ import annotations import math import time from typing import Any, Dict, List, Optional from kiwi_scan.plugin.base import ScanPlugin from kiwi_scan.plugin.registry import register_...
hz-b/kiwi-scan
src/kiwi_scan/plugin_concrete/timestamp_performance.py
.py
899fbb559fd1b9ff
7.3
3
"""Strict no-tools AI classification for one contextual Telegram mention.""" from __future__ import annotations from dataclasses import dataclass from typing import Any, Literal, Protocol from pydantic import ValidationError from tawg_bot.conversation_context import ConversationContext from tawg_bot.models import B...
trustless-ai/tawg-daily-contribution
src/tawg_bot/ai_router.py
.py
b47bdcfeb2664768
7.15
1
"""Deterministic boundary for current-knowledge and local-alias corrections.""" from __future__ import annotations from tawg_bot.unit_of_work import RepositoryUnitOfWork from tawg_bot.vault_transaction import VaultTransaction, VaultTransactionEngine class CorrectionRejected(ValueError): """Raised when a propose...
trustless-ai/tawg-daily-contribution
src/tawg_bot/corrections.py
.py
f6563311754971cc
7.15
1
"""Token-safe HTTP helpers for external source adapters.""" from __future__ import annotations from collections.abc import Mapping from typing import Any import httpx class SafeHttpError(RuntimeError): """An HTTP failure whose message intentionally omits request URLs.""" class SafeJsonHttpClient: def __i...
trustless-ai/tawg-daily-contribution
src/tawg_bot/http.py
.py
57d236aff4bc4d81
7.15
1
"""Stable public identifiers for source records.""" import re _SEGMENT = re.compile(r"^[A-Za-z0-9._-]+$") def _validated_segment(value: object, *, name: str) -> str: segment = str(value).strip() if not segment or not _SEGMENT.fullmatch(segment): raise ValueError(f"{name} must contain only letters, n...
trustless-ai/tawg-daily-contribution
src/tawg_bot/ids.py
.py
859e2564cdb98127
7.15
1
"""Isolated repository checkouts for replay-safe operations.""" from __future__ import annotations import asyncio from collections.abc import Awaitable, Callable, Sequence from dataclasses import dataclass from pathlib import Path from tempfile import TemporaryDirectory from typing import Literal, Protocol, TypeVar ...
trustless-ai/tawg-daily-contribution
src/tawg_bot/repository_session.py
.py
5819992b7f28d962
7.15
1
""" mega_downloader.py - Descarga archivos de MEGA con barra de progreso en Telegram y terminal """ import re import logging import subprocess from pathlib import Path logger = logging.getLogger(__name__) def _progress_bar(pct: int, width: int = 10) -> str: filled = int(width * pct / 100) return '▓' * fille...
JhonClD/ZeroTwo
downloaders/mega_downloader.py
.py
5ce82dd514a5af97
7
0
""" download_handler.py - Manejador del comando /download """ from pyrogram import filters, enums from pyrogram.types import Message def register(app): """Registra el handler del comando /download""" @app.on_message(filters.command("download")) async def download_command(client, message: Message): ...
JhonClD/ZeroTwo
handlers/download_handler.py
.py
14bf2a1257032fb8
7
0
""" start_handler.py - Manejador del comando /start """ from pyrogram import filters, enums from pyrogram.types import Message def register(app): """Registra el handler del comando /start""" @app.on_message(filters.command("start")) async def start_command(client, message: Message): """Comando /...
JhonClD/ZeroTwo
handlers/start_handler.py
.py
4e4d09846afc68c5
7
0
"""Harrier -- the loading layer and repository layout. The loader lives here rather than in the validator so that the catalogue is parsed exactly once per process and in exactly one way. Anything that reads the repository -- the validator today, the artefact builder later -- reads it through this module, so no consume...
kabiri-labs/harrier
harrier/__init__.py
.py
060dc1ccf2cdb825
7
0
"""The published artefact: one self-contained HTML file. Everything the reader needs is embedded, because the file is opened from a laptop on an engagement network and must not emit a request a monitored target could observe. No stylesheet, no script, no font, no image is fetched. The data travels as one JSON blob and...
kabiri-labs/harrier
harrier/build.py
.py
d0cc2535f5fa1056
7
0
"""The attack chain, derived from the facts units declare. Nothing here is stored in the repository. A unit says what must already be true for it to be possible and what becomes true when it succeeds; the edges follow. Writing the edges down instead would mean maintaining several hundred of them by hand, and a stale e...
kabiri-labs/harrier
harrier/chain.py
.py
8666280922cec654
7
0
"""Command-line surface. Exit statuses are part of the contract, because CI depends on them: 0 success, 1 the repository was rejected, 2 the invocation was wrong. """ from __future__ import annotations import argparse import sys from pathlib import Path from typing import Dict, List, Optional import yaml from . im...
kabiri-labs/harrier
harrier/cli.py
.py
3ac0b4b14cef71b3
7
0
"""The link between a standard's test cases and the units that cover them. The catalogue holds this relation on the topic: `refs.wstg` names the test cases a topic claims. Read in that direction it answers "what does this topic cover", which is the question an author has. The question a *tester* has is the other one -...
kabiri-labs/harrier
harrier/standard.py
.py
3431abfe4ceab9b6
7
0
"""Shared fixtures. Every mutation test works on a copy of the real repository rather than a hand-built miniature. A miniature drifts from the thing it stands in for, and then the suite passes while the repository is broken -- so the fixture is the repository, with one thing deliberately changed. """ from __future__ ...
kabiri-labs/harrier
tests/support.py
.py
047062d70d7b8743
7.5
0
"""The command line. Exit statuses are the contract CI depends on.""" import io import unittest from contextlib import redirect_stderr, redirect_stdout from harrier.cli import EXIT_FAILED, EXIT_OK, EXIT_USAGE, main from tests.support import REPO_ROOT, Sandbox def run(argv): out, err = io.StringIO(), io.StringIO...
kabiri-labs/harrier
tests/test_cli.py
.py
b6ace08a7d26c99f
7.5
0
"""The content rules: oracle, kind, outline status, and the vague-language gates. These are the rules a reviewer would have to apply by reading, which is exactly why they are applied mechanically instead. """ import json import re import unittest import yaml from harrier.validate import validate from tests.support ...
kabiri-labs/harrier
tests/test_content_rules.py
.py
d8c65bc1c914f287
7.5
0
"""The rules that make non-overlap mechanical rather than a matter of care. Every test here is a negative one: it asserts that something is rejected. A suite that only checks the good cases cannot tell a working rule from one that has quietly stopped firing, and a rule that has stopped firing looks exactly like a repo...
kabiri-labs/harrier
tests/test_identifiers_and_axes.py
.py
54a8d2bb0c4dff8d
7.5
0
"""The repository itself passes, and the counts it publishes are true.""" import collections import unittest from harrier.chain import Chain from harrier.validate import coverage, validate from tests.support import REPO_ROOT, messages class TheRealRepository(unittest.TestCase): def test_it_validates(self): ...
kabiri-labs/harrier
tests/test_repository_is_valid.py
.py
1c11e8b0d6b09499
7.5
0
"""Content-safety and supply-chain properties of the repository itself.""" import re import unittest from tests.support import REPO_ROOT class TheLoaderNeverExecutesDocumentContent(unittest.TestCase): """The catalogue is contributor-submitted YAML. Full loading would let a document construct arbitrary Pytho...
kabiri-labs/harrier
tests/test_safety.py
.py
affe529cd7d880be
7.5
0
"""The link from a test case of the standard to the units that cover it. The catalogue stores this relation one way round -- a topic names the test cases it claims -- which answers the author's question. The tester's question is the other one: the scope sheet says `WSTG-INPV-05`, so what is opened. It was always deriv...
kabiri-labs/harrier
tests/test_standard_index.py
.py
845620fad91e74df
7.5
0
"""The vocabularies and the pinned standard. Everything downstream resolves against these, so a defect here would surface later as many failures with no obvious common cause. """ import unittest from harrier.validate import validate from tests.support import messages from tests.test_identifiers_and_axes import Sandb...
kabiri-labs/harrier
tests/test_vocabularies_and_standards.py
.py
a90955692796d6b7
7.5
0
"""The workflows, checked the way everything else here is checked. This project's own supply chain is part of its threat model -- it says so in the authoring rules -- and a workflow is the one place in the repository that runs somebody else's code with a token in the environment. So the properties that keep that safe ...
kabiri-labs/harrier
tests/test_workflows.py
.py
4b233b55f8d44c1d
7.5
0
"""Basic tests for Lanhu MCP Server""" import sys from pathlib import Path # Add project root to path project_root = Path(__file__).parent.parent sys.path.insert(0, str(project_root)) def test_python_version(): """Test that Python version is 3.10 or higher""" assert sys.version_info >= (3, 10), "Python 3.10...
cancelaura/myMcp
tests/test_basic.py
.py
5cf7674875e43bcd
7.5
0
# 由账号2生成 # 静态分析器(照搬 warden analysis.rs 精神——轻量版适配 Aegis action-catalog.yaml)。 # 检查:①重复 action name ②同 scope 风险冲突 ③audit 缺失 ④redteam_fixtures 缺失。 # 用法:python contracts/codegen/analyze_action_catalog.py # 退出码:0=通过 / 1=发现问题 / 2=解析错误 import sys import pathlib import yaml CATALOG = pathlib.Path(__file__).resolve().parent.p...
bear20252026/aegis-dual-platform
aegis-专家评审包/contracts/codegen/analyze_action_catalog.py
.py
c65ddbb628fe47d3
7.15
1
#!/usr/bin/env python3 """generate_csharp.py —— contracts/codegen(蓝图阶段 B——由契约生成 C# 模型)。 从 contracts/schemas/*.json 生成 C# record(与阶段 C Aegis.Windows.Contracts 对齐——不手工维护平行 Schema——蓝图)。属性由 schema required/properties 驱动。 """ from __future__ import annotations import json import pathlib import sys SCHEMAS = pathlib.Path...
bear20252026/aegis-dual-platform
aegis-专家评审包/contracts/codegen/generate_csharp.py
.py
b1b933b51ea31f80
7.15
1
#!/usr/bin/env python3 """generate_kotlin.py —— contracts/codegen(蓝图阶段 B——由契约生成 Kotlin 模型)。 从 contracts/schemas/*.json 生成 Kotlin data class(与阶段 D android/contracts 对齐——不手工维护平行 Schema——蓝图)。属性由 schema required/properties 驱动。 """ from __future__ import annotations import json import pathlib import sys SCHEMAS = pathli...
bear20252026/aegis-dual-platform
aegis-专家评审包/contracts/codegen/generate_kotlin.py
.py
b9299e9ee8ca5c79
7.15
1
#!/usr/bin/env python3 """verify_contract_compatibility.py —— contracts/codegen(蓝图阶段 B——契约兼容性)。 阶段 B 完成标准:Schema/C#/Kotlin/Python fixture 对同一组合法/非法输入得到一致 结果——跨语言一致(Rust/C#/Kotlin reference + Python fixture——同一 contracts vectors)。校验:schemas/vectors JSON 有效 + 生成的 C#/Kotlin 模型与 schema properties 一致(不平行 Schema——蓝图)。 """ ...
bear20252026/aegis-dual-platform
aegis-专家评审包/contracts/codegen/verify_contract_compatibility.py
.py
da6d03f7ae10a681
7.15
1
"""asset_scheme.py —— 随包资产的安全自定义 scheme(aegisasset://)。 背景:新标签页(setHtml + CSP `img-src 'none'`)默认不允许任何图片/外部 资源。为了把随包壁纸安全地渲染进 NTP,而**不放宽为任意 http/file 加载**, 这里注册一个只读的自定义 scheme: aegisasset://wallpapers/aurora-magenta.jpg 安全边界(P0): - **白名单**:只允许命中 `WALLPAPERS` 常量中登记的固定文件名,任何 其他路径一律 404——不存在"用 url 拼出任意文件"的面。 - **防...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/asset_scheme.py
.py
1d7f4c10cc4683f2
7.15
1
"""backdrop.py —— Windows 系统级亚克力/Mica 背景(单文件单职责)。 职责:在 Windows 11 上为浏览器主窗口启用系统级背景材质(Mica / Acrylic),让窗口背景呈现毛玻璃效果 —— 比 CSS backdrop-filter 更贴近 苹果风格(原生 DWM 材质,含窗口圆角与系统级模糊)。 设计原则(S5): - **尽力而为(best-effort)**:依赖 DWM API(dwmapi.dll)与 Win11 版本号;任何一步失败(非 Win11 / 无窗口句柄 / API 不可用)都静默 返回 False,绝不抛异常 —— 浏览器功能不受影响。 - **静默降级*...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/backdrop.py
.py
c2675c21168a3113
7.15
1
"""browser_import.py —— 解析 Chrome / Edge 书签(单文件单职责)。 职责:定位并解析 Chrome / Edge 的 Bookmarks 文件(JSON 格式), 输出扁平书签列表 [{title, url}, ...] 供导入向导使用。 设计原则(与项目 P0 一致): - **只做解析**:本模块不写任何存储(写入由 BookmarkStore 承担), 返回纯数据,便于单测与复用; - **防御式解析**:文件缺失 / JSON 损坏 / 字段缺失一律静默跳过, 绝不抛异常(导入是可选功能,失败不影响浏览); - **只提取 url 节点**:递归遍历 folder,跳过空标题...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/browser_import.py
.py
f86fce9be249fb8b
7.15
1
"""credential_guard.py —— 凭据脱敏(单文件单职责:内存凭据不落地强化)。 背景(2026-08-15):借鉴 FreeDom 反 dump(os_no_dump:undumpable + no core,KNOWLEDGE_BASE 第 14 节)的"凭据值不落地"理念——Aegis 凭据 主路径已走环境变量(Gradle 签名 AEGIS_KEYSTORE_*)与 keyring(Windows Credential Manager),本模块为**纵深防御**:日志/崩溃报告写入前屏蔽 常见凭据值(防御式脱敏,不改变功能)。 用法:crash_reporter 日志写入前经 redact() 过滤(见...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/credential_guard.py
.py
3aa99d290d087344
7.15
1
"""features.py —— R-05 整改(功能注册表——只有接线的功能可展示)。 体验/功能审查(R-05):大量配置字段/孤立模块无用户入口(影子功能—— "存在配置字段/存在孤立模块/文档中宣称"不能替代真实产品能力)。 本模块建立功能注册表(FeatureSpec)——每个产品能力同时拥有:领域服务、 用户入口、可用性、设置 schema——**未实现不注册**(不能仅因 config 有 字段就展示给用户——实施手册 R-05)。产品文档/UI 从 FEATURES 自动生成 可用功能表,禁止手写夸大的功能清单。 """ from dataclasses import dataclass from typing...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/features.py
.py
b6e3c394c7b82c9c
7.15
1
"""fingerprint.py —— 可选指纹/隐身设备配置(单文件单职责,默认关闭)。 借鉴 ShardBrowser / CloakBrowser 的"设备配置文件"思路,但遵循 Aegis 的**如实 UA** 安全第一原则: - **默认关闭**:除非配置显式指定 `fingerprint_profile`,否则一律使用 浏览器自身的真实 UA(app/browser.py 的 honest_ua),本模块不生效; - **纯数据 + 纯函数**:只提供设备配置文件目录与 UA 生成,不持有 窗口/网络引用,可离线单测; - **不伪造指纹**:本模块仅提供 **UA 字符串**(User-Agent)层面的...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/fingerprint.py
.py
795414bddb847a86
7.15
1
"""fingerprint_pipeline.py —— 指纹防护管道(红蓝对抗安全加固版)。 红方深度攻击向量(精英级): - ATK-1: 原型链检测——Object.getOwnPropertyNames/getPropertyDescriptor 可发现代理 - ATK-2: WebRTC IP 泄露——RTCPeerConnection 暴露真实 IP - ATK-3: AudioContext/Battery/Network API 指纹泄露 - ATK-4: CSS 指纹泄露——@font-face 枚举 + 媒体查询指纹 - ATK-5: Error.stack 泄露——代理函数的调用栈暴露注入层 - ATK-6...
bear20252026/aegis-dual-platform
aegis-专家评审包/legacy/windows-pywebview/app/fingerprint_pipeline.py
.py
dd8204c91b50b763
7.15
1
"""Append-only in-memory audit ledger.""" from __future__ import annotations from dataclasses import dataclass from datetime import datetime, timezone import hashlib import json from typing import Any, Iterable # ── L12.2 §C operation 闸值域(园主落刀):LedgerEvent.operation 的合法值全集 ── # 基准是「账面实际值域」而非 models.py 的 Literal:第四个旧...
wubian87/fermion-fleet
fleet/fermion_garden/ledger.py
.py
719ec872bd61b3ae
7
0
"""Deterministic zero-network lexical scorer used by the v0.1 baseline.""" from __future__ import annotations from collections import Counter import copy import math import re from typing import Iterable from .models import ContextItem _TOKEN = re.compile(r"[A-Za-z0-9_]+|[\u3400-\u9fff]+") def tokenize(text: str)...
wubian87/fermion-fleet
fleet/fermion_garden/lexical.py
.py
4da5bb5f34df6e7b
7
0
"""Stable data contracts for ctx-key v0.1.""" from __future__ import annotations from dataclasses import dataclass, field from typing import Any, Literal, Mapping Action = Literal["record", "select", "keep", "evict", "recall", "retain", "conflict"] @dataclass(frozen=True, slots=True) class ContextItem: """One ...
wubian87/fermion-fleet
fleet/fermion_garden/models.py
.py
9e6b62526259a6d7
7
0
"""Repo-root pytest conftest. Hosts the hexagonal marker collection hook from the repo root so every item gathered under ``src/cadrumo/...`` passes through the same enforcement surface. The hook body lives in :mod:`cadrumo.tests._marker_hook`; this conftest is a thin wrapper. Also hosts the project-branded ``CADRUMO_...
nevenincs/cadrumo
conftest.py
.py
ae79d4ea04ad5519
7.65
1
"""Production-derived leaf-condition-scenario coverage for operator evaluation. The evaluator consumes resolved production declarations rather than storing a second action expectation in a scenario fixture. A matrix row keeps the resolved manifest profile intact: the profile owns the failed-condition and scenario ide...
nevenincs/cadrumo
dev/agent_eval/_action_coverage.py
.py
31825aa63f983c5d
7.15
1
"""The data flywheel: promote a live failure into a golden regression scenario. A live subagent-persona failure is not just a red run — it becomes a NEW golden scenario so the same failure cannot recur unnoticed. Promotion is deliberately conservative: the promoted scenario pins the ORIGINAL scenario's declared expect...
nevenincs/cadrumo
dev/agent_eval/_flywheel.py
.py
6198f438a6ff534a
7.15
1
"""Live subagent-persona harness: drive the real console, capture the trajectory. Capabilities are measured by LIVE subagent personas — a language-model (or scripted) driver plays a harness persona over a REAL MCP client session against the REAL ``cadrumo-mcp`` server, and every ``tools/call`` round-trip, narration, a...
nevenincs/cadrumo
dev/agent_eval/_live_harness.py
.py
edd232a3eebe0bc4
7.15
1
"""Determinism-replay for operator tool calls. Captures golden tool-call records (the tool name, its arguments, and the resolved invocation) and replays them, asserting the resolution is byte-identical. A non-deterministic mapping is an assurance failure in regulated work: the same operator action must always project ...
nevenincs/cadrumo
dev/agent_eval/_replay.py
.py
5d215d552372ad62
7.15
1
"""The measurement report: what the live persona runs proved, in one artefact. The deliverable to the operator: after a live measurement run, one typed report (and its markdown rendering) states the harness's measured capability — scenarios run, passed, and failed per persona; the two hard invariants' observed counts ...
nevenincs/cadrumo
dev/agent_eval/_report.py
.py
5beaf2bb13011689
7.15
1
"""Shared real-CLI support for agent evaluation tests. The helpers in this module project the live command-schema registry and invoke the cached production CLI command tree. They delegate command discovery, work-unit creation, and envelope decoding to canonical codebase authorities so eval tests do not grow parallel o...
nevenincs/cadrumo
dev/agent_eval/tests/_real_cli_support.py
.py
2369c605fb7256c4
7.65
1
"""Tests for production-derived operator action coverage.""" from __future__ import annotations import inspect import pytest from pydantic import ValidationError from .._action_coverage import ( LeafConditionScenario, LeafConditionScenarioMatrix, leaf_condition_scenario_matrix, production_leaf_condi...
nevenincs/cadrumo
dev/agent_eval/tests/test_action_coverage.py
.py
9124729290003ae7
7.65
1
"""HITL confirmation gate wiring for the operator golden-task eval. Guards against a HITL / confirmation bypass: an autonomous agent optimising for completion may pass ``--yes``, a failure mode no human persona would reproduce (a human has no reason to bypass their own confirmation). The ``PreToolUse`` gate is the ope...
nevenincs/cadrumo
dev/agent_eval/tests/test_confirmation_gate_golden.py
.py
645af89cf06e6f7d
7.65
1
"""Faithfulness gate wired end-to-end for the operator golden-task eval. Guards against a hallucinated numeric - the load-bearing risk for regulated filing narration, since a plausible-looking but fabricated casilla value reads as authoritative to an operator who cannot tell it apart from a real one. This module disp...
nevenincs/cadrumo
dev/agent_eval/tests/test_faithfulness_golden.py
.py
9bbc936987a0a3a7
7.65
1
"""Lifecycle-contradiction golden gate for the operator eval. Guards against wrong lifecycle sequencing surfacing as a cross-surface contradiction: ``modelo readiness`` reporting ``ready: True`` for a modelo whose ``work`` verb is blocked. This is the enforcement surface for the "Contradictions between surfaces are a ...
nevenincs/cadrumo
dev/agent_eval/tests/test_lifecycle_contradiction_golden.py
.py
a84d69e3ac106f4b
7.65
1
"""Live harness capture plus the live scorer's five semantics. Captures one real scripted-persona session against the real ``cadrumo-mcp`` server over stdio, then scores trajectories with the REAL faithfulness check injected from ``cadrumo_harness.mcp`` and the live-write / handoff leaf sets injected from their single...
nevenincs/cadrumo
dev/agent_eval/tests/test_live_harness.py
.py
89077ef52b5ffd70
7.65
1
"""Unit-lane structural cover for two live-scoring properties. Both properties are exercised by ``test_live_harness.py``, but every test in that module is ``integration``-marked, so the default ``-m unit`` selection deselects all of them. Two deliberate mutations were therefore able to survive a green ``-m unit`` run ...
nevenincs/cadrumo
dev/agent_eval/tests/test_live_scoring_properties.py
.py
2f03a31d66fac249
7.65
1
"""The operator numeric value-oracle is grounded in real AEAT figures. The operator relays computed casilla values; whether those values are correct is reconciled against an authoritative external oracle, never hand-computed from the registry formula under test (``aeat-quality-gates``). For Modelo 100 that oracle alre...
nevenincs/cadrumo
dev/agent_eval/tests/test_m100_aeat_numeric_oracle.py
.py
c6a184be78b77c26
7.65
1
"""Golden-task eval gate for the modelo-130 preparation workflow. Asserts the shipped scenario passes every dimension - its tool trajectory resolves against the live CLI surface, follows the modelo lifecycle order, is consistent with the shipped skill playbook, and the resolved revision's casillas carry their registry...
nevenincs/cadrumo
dev/agent_eval/tests/test_modelo_130_golden.py
.py
13976a46a8d3a23b
7.65
1