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 |
|---|---|---|---|---|---|---|
import logging
import numpy as np
import pandas as pd
from typing import List, Dict, Any, Tuple
from datetime import datetime, timezone
from sklearn.cluster import DBSCAN, KMeans
from sklearn.ensemble import IsolationForest
from sklearn.preprocessing import StandardScaler
logger = logging.getLogger(__name__)
class ... | rudra496/EdgeBrain | backend/app/ml/clustering.py | .py | 774610c61d8374ec | 7.45 | 7 |
import logging
import numpy as np
import pandas as pd
from typing import List, Dict, Any, Tuple, Optional
from datetime import datetime, timedelta, timezone
from sklearn.ensemble import RandomForestRegressor, GradientBoostingRegressor
from sklearn.linear_model import Ridge, ElasticNet
from sklearn.pipeline import Pipe... | rudra496/EdgeBrain | backend/app/ml/forecaster.py | .py | dab58c2468fe43b2 | 7.45 | 7 |
import pytest
import numpy as np
import pandas as pd
from datetime import datetime, timedelta, timezone
from app.ml.forecaster import TimeSeriesForecaster
from app.ml.clustering import AnomalyClusterEngine
def generate_mock_sensor_data(n_points=1000, anomaly_indices=None):
"""Generates a massive synthetic dataset... | rudra496/EdgeBrain | backend/tests/test_ml_massive.py | .py | 301de2f200d54d1f | 7.95 | 7 |
"""
EdgeBrain Device Simulator
============================
Simulates realistic IoT sensor data and publishes via MQTT.
Devices:
- Room 1: Temperature, Motion, Energy, Humidity, Light
- Room 2: Temperature, Motion, Energy
- Server Room: Temperature, Humidity, Energy
Features:
- Realistic patterns (time-of-day... | rudra496/EdgeBrain | device-simulator/simulator.py | .py | 2d5359e3a8167e5a | 7.45 | 7 |
"""
Example: Image Classification on Raspberry Pi
This script demonstrates how an edge device like a Raspberry Pi can run
an image classification model and report the results to EdgeBrain.
It classifies an image and sends a confidence score or label to the system.
Requirements:
- paho-mqtt
Usage:
python image_cl... | rudra496/EdgeBrain | examples/image_classification.py | .py | ba5700efc643100f | 7.45 | 7 |
"""
Example: Object Detection with Webcam
This script demonstrates how to integrate a webcam object detection model
with EdgeBrain. It captures frames from a camera, runs a simulated object
detection model, and publishes the number of detected persons to the
EdgeBrain system via MQTT.
Requirements:
- paho-mqtt
- open... | rudra496/EdgeBrain | examples/object_detection.py | .py | 3df4bad9cae5b98c | 7.45 | 7 |
"""
Example: Sentiment Analysis on Text
This script demonstrates integrating a text-based AI task with EdgeBrain.
It performs sentiment analysis on incoming text streams (e.g., social media
mentions or customer feedback) and publishes the sentiment score.
Requirements:
- paho-mqtt
Usage:
python sentiment_analysi... | rudra496/EdgeBrain | examples/sentiment_analysis.py | .py | 09c5de12e36540ac | 7.45 | 7 |
#!/usr/bin/env python3
"""Step 3 — HAR graph surgery + genai external resources.
Two structural rewrites of the parsed HAR, both fixing mismatches between
what the graph declares and what the genai runtime actually writes into the
HEF inputs at run time (see docs/findings/ for the full evidence):
**RoPE surgery.** Th... | l-nmch/hailo-10h-llm-compiler | pipeline/s3_surgery_and_resources.py | .py | 3ca3c95b7c4c2e36 | 7.45 | 7 |
#!/usr/bin/env python3
"""Greedy generation through the BASE scope only — no KV-cache involved.
The base network scope (`<scope>` without the `__prefill`/`__tbt` suffix)
runs the whole sequence in one shot. Driving it in a greedy loop (recompute
the full prefix each step) validated that the compiled model itself is
so... | l-nmch/hailo-10h-llm-compiler | runtime/diagnostics/generate_base_scope.py | .py | 3d3b651cc16adc91 | 7.45 | 7 |
#!/usr/bin/env python3
"""Hot-patch the hailo-config.json embedded in an already-compiled HEF,
without recompiling the graph (weights/CCWs are never touched).
Uses the SDK's official HefWrapper API (protobuf + offset-based sections) —
no reverse engineering of the binary format. New config bytes are appended
to the ad... | l-nmch/hailo-10h-llm-compiler | runtime/diagnostics/hotpatch_hailo_config.py | .py | 8a4fae509c659b40 | 7.45 | 7 |
#!/usr/bin/env python3
"""Low-level prefill + token-by-token probe of a compiled KV-cache HEF.
Drives the ``__prefill`` and ``__tbt`` network groups directly through the
low-level InferModel API — bypassing genai entirely — to compare on-chip
activations against a float32 Hugging Face reference. This is the tool that
... | l-nmch/hailo-10h-llm-compiler | runtime/diagnostics/manual_prefill_tbt_test.py | .py | d054730945d0d1ce | 7.95 | 7 |
"""Shared helpers for building raw HEF inputs by hand (diagnostics).
The genai runtime normally constructs these inputs host-side. When debugging
below that layer (manual prefill/tbt runs through the low-level InferModel
API), you must reproduce its exact conventions:
- **attention mask**: additive float mask (0 allo... | l-nmch/hailo-10h-llm-compiler | runtime/diagnostics/runtime_inputs.py | .py | 7bd02e5e9d923e1d | 7.45 | 7 |
#!/usr/bin/env python3
"""Robust genai.LLM generation with subprocess isolation and retries.
Wraps genai_worker.py: each generation attempt runs in a fresh, isolated
subprocess with a hard parent-side timeout, and failed attempts are retried
with exponential backoff. This absorbs a known host-side HailoRT failure
mode... | l-nmch/hailo-10h-llm-compiler | runtime/genai_generate.py | .py | 9c5eb203225b9763 | 7.45 | 7 |
# %% [markdown]
# # VTK to USD Converter Test Notebook
#
# This notebook demonstrates ConvertVTKToUSD for converting VTK files to USD format.
#
# The library is based on the ParaViewConnector architecture from Omniverse but simplified for file-based conversion only.
#
# ## Features
#
# - **File Format Support**: VTK le... | Project-MONAI/physiotwin4d | experiments/Convert_VTK_To_USD/convert_vtk_to_usd_using_class.py | .py | b29814a111f0119e | 7.52 | 10 |
"""Create a mid-slice composite volume from a directory of MHA images."""
import argparse
import re
from pathlib import Path
from typing import Optional
import itk
import numpy as np
DEFAULT_IMAGE_REGEX = r"^pm00.*_init\.mha$"
OUTPUT_FILENAME = "composite.mha"
def select_directory() -> Optional[Path]:
"""Open ... | Project-MONAI/physiotwin4d | experiments/Heart-GatedCT-OptimizedLongitudinalRegistration/composite_time_series_mid_slice.py | .py | b1c927a44bc07938 | 7.52 | 10 |
"""Summarize registration Dice and landmark RMSE results across experiments.
For every ``results_*`` directory under a base directory this script reads:
- ``registration_dice_init.csv`` with columns
``subject_id, method, stem, label, dice`` (one row per subject / time point
/ anatomy label).
- ``registration_land... | Project-MONAI/physiotwin4d | experiments/Heart-GatedCT-OptimizedLongitudinalRegistration/registration_results_analysis.py | .py | 279f11e01534513b | 7.52 | 10 |
# %%
import os
from typing import Optional
import itk
import numpy as np
from data_dirlab_4d_ct import DataDirLab4DCT
from physiotwin4d.image_tools import ImageTools
from physiotwin4d.register_images_icon import RegisterImagesICON
from physiotwin4d.segment_chest_total_segmentator import SegmentChestTotalSegmentator
f... | Project-MONAI/physiotwin4d | experiments/Lung-GatedCT_To_USD/0-register_dirlab_4dct.py | .py | 028c578e762327e0 | 7.52 | 10 |
# %%
from pathlib import Path
import itk
import numpy as np
import pyvista as pv
from data_dirlab_4d_ct import DataDirLab4DCT
from physiotwin4d.contour_tools import ContourTools
from physiotwin4d import ConvertVTKToUSD
from physiotwin4d.segment_chest_total_segmentator import SegmentChestTotalSegmentator
# Defensive:... | Project-MONAI/physiotwin4d | experiments/Lung-GatedCT_To_USD/1-make_dirlab_models.py | .py | 8289a530654a7954 | 7.52 | 10 |
"""
class pmDataDirLab4dCT:
This module contains the pmDataDirLab4DCT class, which is used to store the
data for the DirLab 4DCT dataset.
DirLab-4DCT's raw ``.mhd``/``.img`` volumes are not in Hounsfield units; run
``data/DirLab-4DCT/fix_downloaded_data.py`` (backed by
``DataDownloadTools.FixDirLab4DCTData``) once to ... | Project-MONAI/physiotwin4d | experiments/Lung-GatedCT_To_USD/data_dirlab_4d_ct.py | .py | 488894ebed9c6e9d | 7.52 | 10 |
# %%
import os
from typing import Optional
import itk
import numpy as np
from data_dirlab_4d_ct import DataDirLab4DCT
from physiotwin4d.image_tools import ImageTools
from physiotwin4d.register_images_icon import RegisterImagesICON
from physiotwin4d.segment_nv_segment_ct_mri import SegmentNVSegmentCTMRI
from physiotwi... | Project-MONAI/physiotwin4d | experiments/Lung-GatedCT_To_USD_NV/0-register_dirlab_4dct.py | .py | 037266de957b7e05 | 7.52 | 10 |
# %%
from pathlib import Path
import itk
import numpy as np
import pyvista as pv
from data_dirlab_4d_ct import DataDirLab4DCT
from physiotwin4d import ConvertVTKToUSD
from physiotwin4d.contour_tools import ContourTools
from physiotwin4d.segment_nv_segment_ct_mri import SegmentNVSegmentCTMRI
# Defensive: today this s... | Project-MONAI/physiotwin4d | experiments/Lung-GatedCT_To_USD_NV/1-make_dirlab_models.py | .py | 9b1e8ff7838b1817 | 7.52 | 10 |
"""Hard limits for unattended runs — a PreToolUse hook, not a dialog.
A task with ``skip_permissions`` runs Claude Code with
``--dangerously-skip-permissions``: nothing asks the human any more, so
nothing stops the agent either. A PreToolUse hook does — it sees the command
before it runs and fires whatever the permiss... | ivanarama/PromptPilot | promptpilot/guard.py | .py | 7bd0743d54fe0314 | 7.59 | 14 |
"""Telegram authorization — phone-based access control."""
import json
import os
import sys
from pathlib import Path
from .config import DB_DIR, _atomic_write_json
def _users_file() -> Path:
return DB_DIR / "tg_users.json"
def _norm_phone(p) -> str:
"""Compare phones by digits only: Telegram may or may no... | ivanarama/PromptPilot | promptpilot/tg_auth.py | .py | baf0914933b4d4a2 | 7.59 | 14 |
"""Сколько сожжено — по всем сессиям Claude Code на машине, а не только по нашим.
Дашборд стоимости считал деньги, выдирая регуляркой строку `Cost: $X` из текста
результата задачи. herdr-задачи такой строки не дают вообще — интерактивная
сессия не отдаёт stream-json, — поэтому чем больше работы уходит в herdr, тем
сле... | ivanarama/PromptPilot | promptpilot/usage.py | .py | 2563238c792fec5d | 7.59 | 14 |
"""Version and update checking."""
import json
import urllib.request
from datetime import datetime, timedelta, timezone
from pathlib import Path
__version__ = "0.5.0"
_RELEASES_URL = "https://api.github.com/repos/ivanarama/PromptPilot/releases/latest"
_CACHE_FILE = Path.home() / ".promptpilot" / "version-check.json"... | ivanarama/PromptPilot | promptpilot/version.py | .py | 85e583b47f302c5c | 7.59 | 14 |
"""Git worktrees for tasks — the agent edits its own checkout, not yours.
A task with ``worktree=True`` runs in a linked checkout of its ``working_dir``
repository on branch ``pp/t<id>``, so:
* the user's work tree keeps its own uncommitted state while the agent works;
* the result is a branch — reviewable as a d... | ivanarama/PromptPilot | promptpilot/worktree.py | .py | 0f98644137d34012 | 7.59 | 14 |
"""
Shared fixtures for create_define_json tests.
The core challenge is that USDMDefineJSONProcessor.__init__ opens a USDM file
from disk and instantiates CDISCLibraryClient (which requires a real API key).
We handle this by:
1. Providing a minimal but structurally complete USDM fixture file.
2. Patching CDISCLibr... | cdisc-org/data-definition-engine | src/define-xml/tests/conftest.py | .py | 480bd4c5e904e6a3 | 7.92 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class AnnotatedCRF(define_object.DefineObject):
""" create Define-XML v2.1 AnnotatedCRF and leaf element objects """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
... | cdisc-org/data-definition-engine | src/generators/define/annotatedCRF.py | .py | 3e14db32dc36ad89 | 7.42 | 6 |
from typing import Any
from odmlib.define_2_1 import model as DEFINE
import define_object
class CodeLists(define_object.DefineObject):
"""Create Define-XML v2.1 CodeList element objects."""
def __init__(self) -> None:
super().__init__()
# self.igd: Any | None = None
def create_define_obj... | cdisc-org/data-definition-engine | src/generators/define/codeLists.py | .py | ee2be70461ed4f0e | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class Comments(define_object.DefineObject):
""" create a Define-XML v2.1 CommentDef element template """
def __init__(self):
super().__init__()
self.lookup_oid = None
self.igd = None
def create_define_objects(self,... | cdisc-org/data-definition-engine | src/generators/define/comments.py | .py | 817eb363b426894b | 7.42 | 6 |
import define_object
class ConceptProperties(define_object.DefineObject):
"""Create Define-XML v2.1 CodeList elements for concept properties."""
def __init__(self):
super().__init__()
def create_define_objects(self, template, objects, lang, acrf):
"""
parse the define-template and... | cdisc-org/data-definition-engine | src/generators/define/conceptProperties.py | .py | ba8d7142ca045d7f | 7.42 | 6 |
import define_object
class Concepts(define_object.DefineObject):
"""Create Define-XML v2.1 CodeList elements for biomedical concepts."""
def __init__(self):
super().__init__()
def create_define_objects(self, template, objects, lang, acrf):
"""
parse the define-template and create ... | cdisc-org/data-definition-engine | src/generators/define/concepts.py | .py | 7cc4e6cdde2156cf | 7.42 | 6 |
import define_object
class Conditions(define_object.DefineObject):
""" cache DDS conditions for use by WhereClauses to build RangeCheck elements """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
"""
parse the DDS temp... | cdisc-org/data-definition-engine | src/generators/define/conditions.py | .py | 42ca8c7832143639 | 7.42 | 6 |
import argparse
from lxml import etree
def transform_xml(xml_path, xsl_path, output_path):
"""
Transforms an XML file using an XSLT stylesheet.
Args:
xml_path (str): Path to the XML file.
xsl_path (str): Path to the XSLT stylesheet file.
output_path (str, optional): Path to save the... | cdisc-org/data-definition-engine | src/generators/define/define2html.py | .py | 458b377b1597db28 | 7.42 | 6 |
from abc import ABC
import logging
from typing import Any
from odmlib.define_2_1 import model as DEFINE
from constants import DEFAULT_LANGUAGE
class DefineObject(ABC):
"""Abstract base class for all Define-XML loader classes."""
def __init__(self) -> None:
self.lang: str = DEFAULT_LANGUAGE
s... | cdisc-org/data-definition-engine | src/generators/define/define_object.py | .py | 90551d77c6feaa63 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
from typing import Any
class Dictionaries(define_object.DefineObject):
""" create Define-XML v2.1 CodeList elements with ExternalCodeList references """
def __init__(self):
super().__init__()
def create_define_objects(
... | cdisc-org/data-definition-engine | src/generators/define/dictionaries.py | .py | b2b0610e73cd6080 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class Documents(define_object.DefineObject):
""" create a Define-XML v2.1 leaf element template """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
"""
... | cdisc-org/data-definition-engine | src/generators/define/documents.py | .py | fdce561f02d76f48 | 7.42 | 6 |
from typing import Any
from odmlib.define_2_1 import model as DEFINE
import define_object
import itemRefs
import items
import valueLevel as VL
from constants import TRIAL_DESIGN_DOMAINS, NON_REPEATING_DOMAINS, DEFAULT_PURPOSE
MAX_SUBCLASS_DEPTH = 4
class ItemGroups(define_object.DefineObject):
""" create a Defin... | cdisc-org/data-definition-engine | src/generators/define/itemGroups.py | .py | e08cffafe2aee084 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
from odmlib import permissive
import define_object
class ItemRefs(define_object.DefineObject):
""" create a Define-XML v2.1 ItemRef element objects """
def __init__(self):
super().__init__()
self.lookup_oid = None
self.igd = None
se... | cdisc-org/data-definition-engine | src/generators/define/itemRefs.py | .py | 5d9875d28b5ee20c | 7.42 | 6 |
from typing import Any
from odmlib.define_2_1 import model as DEFINE
from odmlib import permissive
import define_object
class Items(define_object.DefineObject):
"""Create Define-XML v2.1 ItemDef element objects."""
def __init__(self) -> None:
super().__init__()
self.lookup_oid: str | None = N... | cdisc-org/data-definition-engine | src/generators/define/items.py | .py | f99ecc86ace451f7 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class Methods(define_object.DefineObject):
""" create a Define-XML v2.1 MethodDef element """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
"""
parse ... | cdisc-org/data-definition-engine | src/generators/define/methods.py | .py | c3c6774a560e26be | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import datetime
import uuid
class ODM:
def __init__(self, context: str = "Other", file_oid: str | None = None):
self.context = context
self.attrs = self._set_attributes(file_oid)
def create_root(self):
"""Instantiate and return the odmlib ... | cdisc-org/data-definition-engine | src/generators/define/odm.py | .py | 5ea645c098ea36d0 | 7.42 | 6 |
from typing import Any
from odmlib.define_2_1 import model as DEFINE
import methods
import define_object
class PostProcessing:
"""
Base class for post-processing Define-XML elements.
"""
def __init__(self, define_objects: dict[str, list[Any]], template_objects: dict[str, list[Any]], is_xpt: bool, lang:... | cdisc-org/data-definition-engine | src/generators/define/post_processing.py | .py | 9f908c4e9f0be441 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class Standards(define_object.DefineObject):
""" create a Define-XML v2.1 Standards element template """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
"""
... | cdisc-org/data-definition-engine | src/generators/define/standards.py | .py | c77c4fdd56140b7a | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class Study(define_object.DefineObject):
""" create a Define-XML v2.1 Study element template and initialize the MetaDataVersion template """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_o... | cdisc-org/data-definition-engine | src/generators/define/study.py | .py | 11c451a49e5ed3f2 | 7.42 | 6 |
"""
Pytest configuration and fixtures for template2define tests.
"""
import os
import sys
from pathlib import Path
import pytest
import tempfile
import shutil
PROJECT_ROOT = Path(__file__).parent.parent
sys.path.insert(0, str(PROJECT_ROOT))
@pytest.fixture(autouse=True)
def _chdir_project_root():
"""
The gen... | cdisc-org/data-definition-engine | src/generators/define/tests/conftest.py | .py | bd5af998851c58e4 | 7.92 | 6 |
"""
Tests for dictionaries.Dictionaries.
Define-XML v2.1 represents an external dictionary (e.g. MedDRA, WHODrug, SNOMED)
as a CodeList element carrying an ExternalCodeList child rather than enumerated
CodeListItems. These tests exercise the dictionaries loader directly against the
DDS JSON `dictionaries` section shap... | cdisc-org/data-definition-engine | src/generators/define/tests/test_dictionaries.py | .py | 1bb00019f26bbcd1 | 7.92 | 6 |
"""
Unit tests for Items._add_optional_itemdef_attributes, focused on the
displayFormat -> SignificantDigits/Length fallback (the issue-78 workaround).
The fallback parses obj['displayFormat'] (e.g. "8.3") into a Length /
SignificantDigits pair when the study JSON omits them. The hardened version must:
* never raise... | cdisc-org/data-definition-engine | src/generators/define/tests/test_itemdef_attributes.py | .py | 82f94f904eea1d3c | 7.92 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
import items
class ValueLevel(define_object.DefineObject):
""" create a Define-XML v2.1 ValueListDef element template """
def __init__(self):
super().__init__()
self.lookup_oid = None
self.vld = None
def create_def... | cdisc-org/data-definition-engine | src/generators/define/valueLevel.py | .py | 058c3f79ad4afd01 | 7.42 | 6 |
from odmlib.define_2_1 import model as DEFINE
import define_object
class WhereClauses(define_object.DefineObject):
""" create a Define-XML v2.1 WhereClauseDef element objects """
def __init__(self):
super().__init__()
def create_define_objects(self, template, define_objects, lang, acrf):
... | cdisc-org/data-definition-engine | src/generators/define/whereClauses.py | .py | b85db0f8260ffda0 | 7.42 | 6 |
#!/usr/bin/env python3
"""Compare .github/labels.json against a repository's live labels.
The manifest is the reviewable source of truth for the label taxonomy, but GitHub
applies an issue-form label only if the label already exists in the repository and
drops it silently otherwise. A manifest nothing checks against t... | liatrio-labs/claude-code-gauntlet | .github/labels_diff.py | .py | fceb23544dd16d62 | 7.56 | 12 |
"""Adapter: post_review.py --dry-run payload -> vendored-scorer candidates.json.
Converts the ``post-review-payload.json`` emitted by ``scripts/post_review.py
--dry-run`` into the ``candidates.json`` shape the vendored MIT scorer consumes
at its dedup->judge entry point (step2 extraction is skipped — deep-review
comme... | liatrio-labs/claude-code-gauntlet | bench/adapter/adapt.py | .py | e6ebd1432d92c8fa | 7.56 | 12 |
"""PR-granular checkpointing for bench runs (spec H3).
A run's per-PR status lives in one JSON file per golden URL under
``{run_dir}/state/``. The on-disk files are the source of truth, so a
killed pass loses at most the single PR that was mid-flight and a fresh
process can resume by reading state back.
Resume semant... | liatrio-labs/claude-code-gauntlet | bench/runner/checkpoint.py | .py | ad329ba6a240de0e | 7.56 | 12 |
"""Cost/token parsing for the ``claude -p --output-format json`` result envelope.
The envelope (probe artifact 33) exposes ``total_cost_usd`` (float), an aggregate
``usage`` object of token classes, and ``modelUsage`` keyed by model id -> per-model
usage. ``parse_costs`` collapses those into the numbers the ledger rec... | liatrio-labs/claude-code-gauntlet | bench/runner/costs.py | .py | e97c7e80fb4fbffb | 7.56 | 12 |
"""Append-only experiment ledger (spec H8).
Each scored run contributes exactly one NDJSON row to
``bench/experiments.jsonl``. The ledger is append-only: rows already written
are never rewritten, so history is immutable and safe to read concurrently.
``append_row`` validates that the row carries the required schema k... | liatrio-labs/claude-code-gauntlet | bench/runner/ledger.py | .py | 30d13099404255c1 | 7.56 | 12 |
"""Bare-mirror + worktree lifecycle with a SHA input-drift guard.
Each golden PR is reviewed from a `git worktree` checked out of a cached bare
mirror of its repo. Before the worktree is created, the pinned head/base SHAs
(from `golden/shas.json`) are re-verified against the mirror's live pull ref so a
force-push or r... | liatrio-labs/claude-code-gauntlet | bench/runner/mirrors.py | .py | 0eb9b0df154e51ad | 7.56 | 12 |
#!/usr/bin/env python3
"""Fake ``claude`` binary for invoke.py tests. Placed on PATH as ``claude``.
Behavior is selected by env ``FAKE_CLAUDE_MODE``:
ok -> canned "Headless config:" echo (8 bench knobs) + a success result
envelope (total_cost_usd 1.23, modelUsage, usage, empty
... | liatrio-labs/claude-code-gauntlet | bench/tests/fakes/fake_claude.py | .py | 2a5a56d608308b93 | 8.06 | 12 |
"""Tests for bench/adjudicator/adjudicate.py.
No network, no keys: the HTTP transport is injected. Covers the two pure
context builders (``slice_hunk`` boundary/nearest/missing-path behavior and
``file_context`` clamping) and the ``adjudicate`` parse/retry contract.
"""
import json
import sys
import unittest
from pat... | liatrio-labs/claude-code-gauntlet | bench/tests/test_adjudicator.py | .py | 1bbfeddb63d86afd | 8.06 | 12 |
"""Contract: headless-mode.md Headless config echo includes identity receipts."""
import re
import unittest
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[2]
HEADLESS = REPO_ROOT / "skills" / "code-gauntlet" / "references" / "headless-mode.md"
class HeadlessEchoIdentityContractTest(unittest.T... | liatrio-labs/claude-code-gauntlet | bench/tests/test_headless_echo_contract.py | .py | 099ee222abe3cbcd | 8.06 | 12 |
"""Tests for bench/report.py — the regenerable performance dashboard.
Offline: no network, no keys. A small synthetic ledger + minimal baselines dict
exercise the grouping/collapse, tile derivation, anchor bars, and self-contained
HTML invariants; a final pair of tests runs the generator against the real
committed dat... | liatrio-labs/claude-code-gauntlet | bench/tests/test_report.py | .py | 02a37bdcf61b9b10 | 7.06 | 12 |
#!/usr/bin/env python3
"""Print the SessionStart hook payload carrying docs/style/session-context.md.
Reads the generated style carrier (scripts/build_style_artifacts.py) and prints one JSON
object on stdout in the shape a Claude Code SessionStart hook expects. A broken or missing
carrier must never block session star... | liatrio-labs/claude-code-gauntlet | scripts/emit_style_context.py | .py | 4ae11b03d49322d4 | 7.56 | 12 |
# /// script
# dependencies = [
# "huggingface-hub",
# "pyyaml",
# ]
# ///
# Copyright 2026 The Spyre-Inference Authors.
#
# 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.ap... | torch-spyre/spyre-inference | .github/cache_config/manage_cache.py | .py | 5bc06cc5a97244cc | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | .github/scripts/generate_vllm_benchmark_matrix.py | .py | 16342ccfa55ee2b9 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | .github/scripts/ingest_vllm_benchmarks.py | .py | 63d6320395cc3e39 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | .github/scripts/run_vllm_benchmarks.py | .py | 8d43e6718642179b | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | docs/mkdocs/hooks/generate_examples.py | .py | cbd643986f745c6b | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | docs/mkdocs/hooks/url_schemes.py | .py | 6e72bddfacae90a0 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agree... | torch-spyre/spyre-inference | experimental/attention_backend/paged_vector_add.py | .py | fc791481432e4dd5 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | scripts/pr_reminder/pr_reminder.py | .py | 3853647ff9689658 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/__init__.py | .py | 1a1541963d0be209 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/gemma_rms_norm.py | .py | f4f00158228b0a21 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/head_pad.py | .py | a6f6c414a3a6d884 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/lazy_compile.py | .py | ff9d7d0803b81e07 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/linear.py | .py | 6da4a72ee923ce36 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/logits_processor.py | .py | 2eaf4d6774e3032e | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/parallel_lm_head.py | .py | c6aa3f74c7df5c8f | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/rms_norm.py | .py | 47ec83c94e43caeb | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/rotary_embedding.py | .py | b3073fd72b1c71bc | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/utils.py | .py | 66a2b453f7614a63 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/custom_ops/vocab_parallel_embedding.py | .py | 673a87b0d6a3a120 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/distributed/spyre_communicator.py | .py | b48651bc1e239a40 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/models/token_type_adapter.py | .py | 133dd2011c6672dd | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/transformers_backend.py | .py | bb4df478c4fd533e | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/v1/attention/attn_layer.py | .py | 0274b24ec7c8165f | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/v1/attention/backends/spyre_encoder_attn.py | .py | e3d7b6e9915a0b88 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/v1/pool/spyre_pooler.py | .py | f59b76ddd9954948 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/v1/worker/spyre_shape_bucketer.py | .py | 5dea86018be234d3 | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | spyre_inference/v1/worker/spyre_worker.py | .py | 8c5d54046b94b14a | 7.48 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | tests/attention/test_spyre_encoder_attn.py | .py | b5259003b1ae5808 | 7.98 | 8 |
# Copyright 2026 The Spyre-Inference Authors.
#
# 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 or agreed to... | torch-spyre/spyre-inference | tests/custom_ops/test_activation.py | .py | 4c0d30e1ac141cf1 | 7.98 | 8 |
#!/usr/bin/env python3
"""Build an IOC "time machine" index from the git history of the published feed.
Every collection run commits ``public/iocs/latest.jsonl``, so the git history is
an append-only archive of *what the public threat landscape looked like at time
T, with what score, confirmed by which sources*. This ... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | scripts/build_history_index.py | .py | 2e132b0036603f0e | 7.57 | 13 |
#!/usr/bin/env python3
"""Look up an indicator's history in the SwiftIOC time-machine index.
Answers, from free auditable public data: *was this IP/domain/URL/hash publicly
known-bad, when did it first appear, how did its score move, and which sources
confirmed it?* Build the index first with ``build_history_index.py`... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | scripts/ioc_timeline.py | .py | f0f0f17f8cb3d0ea | 7.57 | 13 |
"""Orchestration: fan out to parsers concurrently, dedupe, and aggregate."""
from __future__ import annotations
import inspect
import time
from concurrent.futures import ThreadPoolExecutor, as_completed
from datetime import datetime, timedelta
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from .f... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/collect.py | .py | d3449a7d191c35f6 | 7.57 | 13 |
"""Free-text indicator extraction (used by RSS/universal parsers)."""
from __future__ import annotations
import logging
import re
from collections.abc import Iterable as IterableABC
from typing import Any, Callable, Iterable, List, Optional, Tuple, cast
import iocextract
from .models import BTC_INLINE_RE, CVE_RE, JA... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/extract.py | .py | 50e067259d855087 | 7.57 | 13 |
"""Bogon-IP and well-known-benign-host filtering."""
from __future__ import annotations
import ipaddress
from typing import Set, Tuple
from .models import _URL_HEAD_RE, _split_authority, refang
# ---------------- false-positive / bogon filtering ----------------
# Values that are never actionable threat indicators ... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/fp.py | .py | f568f8939966840c | 7.57 | 13 |
"""Shared HTTP session, user-agent pool, and lazy feedparser loader.
``cli.py`` mutates ``_SAVE_RAW_DIR`` / ``HTTP_DEBUG`` on *this* module object
(``http_client._SAVE_RAW_DIR = ...``) rather than importing and rebinding
those names locally — a local rebind would only affect cli.py's own
namespace, not the globals ``h... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/http_client.py | .py | 796eb8c4af6f31ca | 7.57 | 13 |
"""Console/file logging setup."""
from __future__ import annotations
import json
import logging
from pathlib import Path
from typing import Optional
from .http_client import logger
from .models import iso, now_utc
# ---------------- logging ----------------
class JsonLineFormatter(logging.Formatter):
def format... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/logging_utils.py | .py | d9e5a33912b14aca | 7.57 | 13 |
"""Core data model, timestamp helpers, defang/normalize, and classification.
No other ``swiftioc`` submodule is imported here — this is the dependency
floor everything else (scoring, parsers, writers, collect, cli) builds on.
"""
from __future__ import annotations
import ipaddress
import re
from dataclasses import da... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/models.py | .py | 98e81f5579725b12 | 7.57 | 13 |
"""Relevance scoring, corroboration, retention, and living-feed merge."""
from __future__ import annotations
import json
from dataclasses import fields as dataclass_fields
from datetime import datetime, timedelta
from pathlib import Path
from typing import Dict, List, Optional, Tuple
from .fp import is_false_positive... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/scoring.py | .py | 112e2796054d6122 | 7.57 | 13 |
"""Output writers: CSV/TSV/JSON/JSONL, STIX 2.1, MISP feed, RSS, badge, history."""
from __future__ import annotations
import csv
import json
import re
import uuid
from dataclasses import asdict
from pathlib import Path
from typing import Any, Dict, List, Optional
from .http_client import logger
from .models import I... | PKHarsimran/SwiftIOC-Automated-Threat-Intelligence-Collector | swiftioc/writers.py | .py | c7f930ded81195be | 7.57 | 13 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.