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
""" Cross-sensor overlay API. Serves a viewer the information it needs to draw several sensors together WITHOUT having reprojected anything: each layer arrives in its own CRS, with its own provenance and its own unknowns, plus a clearly-labelled derived extent so the client can place it on a map. The composition endp...
eeb03/den-repo
api/routes/overlays.py
.py
904644c14a4d3a9c
7
0
""" Provenance as a first-class API surface. Every rendered object should be able to say where each of its numbers came from. These endpoints answer that for the three things a viewer draws: a survey frame, a record, and an anomaly candidate. Nothing here computes provenance -- `schemas.provenance` projects it from f...
eeb03/den-repo
api/routes/provenance.py
.py
de3d5a7572c76686
7
0
from typing import Optional from fastapi import APIRouter, Depends, HTTPException, Query from auth.dependencies import get_current_user from ingestion.sources import SOURCE_REGISTRY, SourceAPIError, OpenTopographyConnector, USGSConnector router = APIRouter() @router.get("/{source_name}/search") def search_source(s...
eeb03/den-repo
api/routes/sources.py
.py
9901ad4484899ab1
7
0
""" The spatial reference API. ONE DOMAIN, THREE OPERATIONS. Inspect the spatial state, declare something, read the history. The alternative -- a `PUT /crs`, a `PUT /vertical-datum`, a `POST /geo-tie` and three more -- would spread one concept across six endpoints that each need their own authorisation, their own audi...
eeb03/den-repo
api/routes/spatial.py
.py
28400f89a98c23e8
7
0
""" Synchronized-view API. Resolves one selection into every view, answering per view instead of pretending all views can show everything. A client renders what resolves and displays the reason for what does not. """ from typing import Optional from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.orm...
eeb03/den-repo
api/routes/views.py
.py
2e60513a23afc831
7
0
""" What a password-reset email says, and how it looks. SEPARATE FROM TRANSPORT ON PURPOSE. Rendering the message and delivering it are different concerns with different failure modes: one is a string, the other is a network call. Keeping them apart means the wording, the escaping and the absence-of-secrets can be tes...
eeb03/den-repo
auth/email_content.py
.py
93dc8de996aa2be4
7
0
""" Getting a reset link to a person. THE SEAM, AND WHAT PLUGS INTO IT. One interface with a single method, and four implementations chosen explicitly by configuration. The password-reset route holds only the interface, so it cannot tell -- and must never be able to tell -- which provider is installed. ResendMailer...
eeb03/den-repo
auth/mailer.py
.py
2fa086265d4db85b
7
0
""" Password hashing. WHY PBKDF2-HMAC-SHA256 AND NOT bcrypt/argon2. - It is in the standard library (`hashlib.pbkdf2_hmac`), so this adds NO dependency to a project that currently has none for authentication. Nothing here is invented: PBKDF2 is specified in RFC 8018, is NIST-recommended, and is the algo...
eeb03/den-repo
auth/passwords.py
.py
029369adf8ed2399
7
0
""" Password-reset tokens: minting, and consuming exactly once. THE TOKEN IS A CREDENTIAL, so it is handled like one. 256 bits from `secrets.token_urlsafe` -- never `random`, which is a Mersenne Twister whose future output is predictable from a few hundred observed values. Only its SHA-256 hash reaches the database; t...
eeb03/den-repo
auth/reset.py
.py
f3d5d310f06e8cbf
7
0
""" Server-side sessions in an HTTP-only cookie. WHY SESSIONS AND NOT JWT. - LOGOUT HAS TO MEAN SOMETHING. A JWT is valid until it expires; revoking one needs a server-side denylist, which is a session table wearing a disguise. Here logout deletes a row and the credential is dead immediately. - No depende...
eeb03/den-repo
auth/sessions.py
.py
86e13d150d602ba6
7
0
""" Benchmark-local trace/target association. NOT localisation. This records which traces of a benchmark scan sit over which published target, in the benchmark's own grid indices. It produces no absolute coordinate and makes no accuracy claim. It is exact rather than nearest-neighbour, and that is a property of the d...
eeb03/den-repo
benchmark/association.py
.py
e72d0326b363dcd7
7
0
""" Ingestion of the acquired BAM concrete GPR benchmark. Reads the archives exactly as downloaded. Nothing is extracted in place, nothing is rewritten, and no value is rescaled. WHICH FILE THE AMPLITUDES COME FROM, and why it is not the DZT. The archives carry the same measurement three ways: native GSSI `.DZT`, pe...
eeb03/den-repo
benchmark/bam_ingest.py
.py
4205ee24ee77e45f
7
0
""" The benchmark's target ground truth, in the smallest form detection scoring needs. Everything here comes from `benchmark/bam_pk266_targets.json`, which is a HAND TRANSCRIPTION from publications: the data repository ships no geometry file of any kind. That origin travels with every object as `provenance="transcribe...
eeb03/den-repo
benchmark/bam_truth.py
.py
2aa669ed00b523c8
7
0
""" A benchmark, pinned: which units, which labels, which policies, which version. WHY A VERSION AT ALL. Ground truth is part of the scientific definition of a result, not configuration around it. "AUC 0.4452" means nothing without knowing which units were scored, what counted as a negative, and what was excluded -- a...
eeb03/den-repo
benchmark/definition.py
.py
1dab2aa411fcaa49
7
0
""" Activity-level scoring of the detector against 4TU trial-trench truth. THE RESOLUTION IS THE ACTIVITY, and that is forced by the source rather than chosen: 4TU withholds trench coordinates, so nothing here matches a candidate to a utility. Every metric is a per-activity count or a comparison between groups of acti...
eeb03/den-repo
benchmark/fourtu_scoring.py
.py
20c92d260d10fab1
7
0
""" Duplicate evaluation units in a benchmark corpus. WHY THIS EXISTS. A benchmark score treats its units as independent. If two units are built from byte-identical measurements they are not independent, and every statistic computed over them -- a separation AUC, a rank correlation, a per-unit rate -- is computed over...
eeb03/den-repo
benchmark/leakage.py
.py
17acfb8dad767a91
7
0
""" How much ground truth is needed before a detector improvement can be believed? THE QUESTION STAGE 14 ASKS. Not "is the detector good" but "if it got better, would this benchmark notice?" Those are different questions, and the second has an answer that does not depend on any detector: it depends on how many indepen...
eeb03/den-repo
benchmark/power.py
.py
3ea103c005bfec15
7
0
# -*- coding: utf-8 -*- # Copyright (c) 2022 - 2026 Ricardo Bartels. All rights reserved. # # wordpress-hash-event-api # # This work is licensed under the terms of the MIT license. # For a copy, see file LICENSE.txt included in this # repository or visit: <https://opensource.org/licenses/MIT>. from typing import ...
bb-Ricardo/wordpress-hash-event-api
common/misc.py
.py
53f2e1fb1ae52f45
7.15
1
# -*- coding: utf-8 -*- # Copyright (c) 2022 - 2026 Ricardo Bartels. All rights reserved. # # wordpress-hash-event-api # # This work is licensed under the terms of the MIT license. # For a copy, see file LICENSE.txt included in this # repository or visit: <https://opensource.org/licenses/MIT>. import configparser...
bb-Ricardo/wordpress-hash-event-api
config/__init__.py
.py
e3668e71f36a2c3e
7.15
1
# -*- coding: utf-8 -*- # Copyright (c) 2022 - 2026 Ricardo Bartels. All rights reserved. # # wordpress-hash-event-api # # This work is licensed under the terms of the MIT license. # For a copy, see file LICENSE.txt included in this # repository or visit: <https://opensource.org/licenses/MIT>. from pydantic_setti...
bb-Ricardo/wordpress-hash-event-api
config/models/__init__.py
.py
4f0aa72227b9cb0e
7.15
1
# -*- coding: utf-8 -*- # Copyright (c) 2022 - 2026 Ricardo Bartels. All rights reserved. # # wordpress-hash-event-api # # This work is licensed under the terms of the MIT license. # For a copy, see file LICENSE.txt included in this # repository or visit: <https://opensource.org/licenses/MIT>. import json from re...
bb-Ricardo/wordpress-hash-event-api
listmonk/handler.py
.py
bd54f4565015e903
7.15
1
import re import os import sys import ast from enum import Enum from datetime import datetime import chess import chess.pgn import yaml from github import Github import src.markdown as markdown import src.selftest as selftest # TODO: Use an image instead of a raw link to start new games class Action(Enum): UNKN...
daemon-node-byte/daemon-node-byte
main.py
.py
418dc6acc53a2cb7
7.3
3
import math from astronomy_types import ( Coordinate2D, Coordinate3D, Degrees, Scalar, SemiMajorAxis, SemiMinorAxis, EccentricAnomaly, Vector2D, Vector3D, ) from afmaths.operation import add, multiply, negate, subtract from afmaths.physics.space.type_conversion_helpers import make_...
Arturius771/afmaths
lib/afmaths/geometry/transformations.py
.py
6dc392da3f7764d5
7
0
from afmaths.operation import divide_by, multiply, subtract, termial from astronomy_types import Coordinate2D def slope_gradiant(point1: Coordinate2D, point2: Coordinate2D) -> float: """Calculates the slope between two points""" ##https://www.bbc.co.uk/bitesize/topics/zvhs34j/articles/z4ctng8 return divi...
Arturius771/afmaths
lib/afmaths/graph.py
.py
f8ed6b8ac7c93e03
7
0
import math import statistics from afmaths.operation import add, divide_by, subtract, summation def list_sort(number_list: list[float]) -> list[float]: return sorted(number_list) def list_length(number_list: list[float]) -> int: return len(number_list) def list_sum(number_list: list[float]) -> float: ...
Arturius771/afmaths
lib/afmaths/list.py
.py
064d74667093a526
7
0
from astronomy_types import Distance, Scalar, Second, Acceleration, Velocity from afmaths.constants import STANDARD_GRAVITY from afmaths.operation import add, divide_by from afmaths.physics.kinematics import displacement, velocity_after_duration def height_from_acceleration( acceleration: Acceleration, durat...
Arturius771/afmaths
lib/afmaths/physics/ballistics.py
.py
7d8a1e45b51167be
7
0
from afmaths.constants import PLANCK_CONSTANT, STEFAN_BOLTZMANN_CONSTANT from afmaths.operation import SQUARE, divide_by, exponentiate, multiply from afmaths.physics.physics import inverse_square_law from afmaths.afmath_types import Area from astronomy_types import Distance def flux_density(luminosity: float, distanc...
Arturius771/afmaths
lib/afmaths/physics/electromagnetism.py
.py
5b1924f656437513
7
0
from astronomy_types import ( Acceleration, Coordinate2D, Coordinate3D, Displacement, Position, PositionVector, Scalar, Second, Vector2D, Vector3D, Velocity, ) from afmaths.geometry.geometry import area_rectangle from afmaths.graph import slope_gradiant from afmaths.operatio...
Arturius771/afmaths
lib/afmaths/physics/kinematics.py
.py
6ef910088192fda8
7
0
import math from afmaths.geometry.geometry import area_of_sphere from afmaths.afmath_types import ( AngularMomentum, Force, Impulse, Mass, Momentum, Torque, ) from afmaths.operation import ( HALF, SQUARE, divide_by, multiply, ratio, subtract, ) from astronomy_types import...
Arturius771/afmaths
lib/afmaths/physics/physics.py
.py
93d8d9069e8c57ab
7
0
import datetime import math from astronomy_types import ( Date, Day, DaysOfWeek, DecimalTime, Epoch, FullDate, Hour, JulianDate, Longitude, Minute, Month, Obliquity, Radians, Scalar, Second, Time, Year, ) from afmaths.constants import ( HOURS_PER_...
Arturius771/afmaths
lib/afmaths/physics/space/astronomy/time_functions.py
.py
1911fbf56fad7e04
7
0
from dataclasses import replace import math from typing import Callable from afmaths.constants import ( EARTH_MU, EARTH_RADIUS, GRAVITATIONAL_CONSTANT, SECONDS_PER_DAY, SIDEREAL_DAY, UNIT_VECTOR_XY_PLANE, ) from afmaths.geometry.transformations import ( ellipse_perimeter_coordinate_from_ecc...
Arturius771/afmaths
lib/afmaths/physics/space/celestial_mechanics/celestial_mechanics.py
.py
6f4dfdd5d533a614
7
0
import math from astronomy_types import ( Distance, EccentricAnomaly, Eccentricity, GravitationalParameter, MeanAnomaly, MeanMotion, OrbitalElements, Rate, Scalar, SemiMajorAxis, SemiLatusRectum, Second, TrueAnomaly, ) from afmaths.constants import EARTH_MU, SECONDS...
Arturius771/afmaths
lib/afmaths/physics/space/celestial_mechanics/time.py
.py
753534d240714341
7
0
import math from astronomy_types import ( Distance, Epoch, GeographicCoordinates, OrbitalElements, PositionVector, Scalar, Second, Inclination, Latitude, Degrees, ) from afmaths.constants import ( SECONDS_PER_DAY, ) from afmaths.operation import ( negate, ) from afmaths....
Arturius771/afmaths
lib/afmaths/physics/space/engineering/astrodynamics/ground_track.py
.py
e5ae45540ffeec61
7
0
import math from astronomy_types import ( Distance, Eccentricity, EquatorialCoordinates, GravitationalParameter, OrbitalElements, Radians, Ratio, Scalar, Second, SemiMajorAxis, StateVector, Velocity, Inclination, ) from afmaths.constants import ( EARTH_MU, ) from ...
Arturius771/afmaths
lib/afmaths/physics/space/engineering/astrodynamics/maneuvers.py
.py
3f21814f55639c29
7
0
from astronomy_types import ( Distance, PositionVector, StateVector, Vector3D, VelocityVector, ) from afmaths.afmath_types import OrbitalDirection from afmaths.constants import EARTH_MU from afmaths.physics.space.celestial_mechanics.celestial_mechanics import ( angular_momentum, nadir_vector...
Arturius771/afmaths
lib/afmaths/physics/space/engineering/astrodynamics/orbital_directions.py
.py
f3c3ed116392134b
7
0
from dataclasses import replace from astronomy_types import ( Anomaly, Distance, EccentricAnomaly, Eccentricity, GravitationalParameter, OrbitalElements, Radians, Ratio, Scalar, Second, SemiMajorAxis, TrueAnomaly, ) from afmaths.constants import ( EARTH_MU, ) from af...
Arturius771/afmaths
lib/afmaths/physics/space/engineering/astrodynamics/phase_orbit.py
.py
98dd78bfca67acea
7
0
from astronomy_types import Degrees, MeanMotion, Radians, Scalar, Second from afmaths.constants import EARTH_ANGULAR_VELOCITY, MEAN_SOLAR_DAY from afmaths.operation import divide_by, multiply from afmaths.physics.space.celestial_mechanics.celestial_mechanics import ( angular_velocity_from_period, ) from afmaths.phy...
Arturius771/afmaths
lib/afmaths/physics/space/engineering/astrodynamics/westward_drift.py
.py
76902c5a0ae1bde7
7
0
from astronomy_types import ( Anomaly, ArgumentOfPeriapsis, Day, Eccentricity, FullDate, GravitationalParameter, Inclination, JulianDate, MeanAnomaly, MeanMotion, OrbitalElements, Radians, Rate, Ratio, RightAscension, Scalar, Second, StateVector, ...
Arturius771/afmaths
lib/afmaths/physics/space/engineering/two_line_elements.py
.py
dc83b84fec8606f1
7
0
from __future__ import annotations from collections.abc import Mapping from typing import Any import requests def build_url(base_url: str, *path_parts: str) -> str: """ Join a base URL and path components without introducing duplicate slashes. """ return "/".join( [ base_url.rstr...
Arturius771/afmaths
lib/afmaths/physics/space/external/http_helpers.py
.py
25c94efbdedfedd6
7
0
from __future__ import annotations import os import time from pathlib import Path import requests from afmaths.constants import SECONDS_PER_HOUR from afmaths.physics.space.external.http_helpers import build_url, send_request SPACE_TRACK_BASE_URL = "https://www.space-track.org" LOGIN_URL = build_url( SPACE_TRAC...
Arturius771/afmaths
lib/afmaths/physics/space/external/space_track_api.py
.py
5d5a54cab5ba16b9
7
0
"""Export functionality for missing data analysis reports and visualizations. This module provides comprehensive export capabilities for missing data analysis results, supporting multiple file formats and automated report generation. It enables researchers to save their analysis outputs for documentation, sharing, and...
maximtrp/scikit-na
src/scikit_na/_export.py
.py
be81f453d44a5cac
7.35
4
"""Matplotlib-backed visualization.""" from __future__ import annotations __all__ = ["plot_corr", "plot_heatmap", "plot_hist", "plot_kde", "plot_stats"] from collections.abc import Sequence from typing import List from matplotlib.axes import Axes from matplotlib.patches import Patch from matplotlib.typing import Co...
maximtrp/scikit-na
src/scikit_na/mpl/_mpl.py
.py
f177a0f801609297
7.35
4
"""Tests for the report module.""" import logging from unittest.mock import patch import numpy as np import pandas as pd import pytest from pandas import DataFrame # Try to import ipywidgets, skip tests if not available try: from ipywidgets import widgets from src.scikit_na import report IPYWIDGETS_AVA...
maximtrp/scikit-na
tests/test_report.py
.py
78fc5b5677c2a85b
7.85
4
import numpy as np import pandas as pd import pytest from pandas import DataFrame, read_csv from pytest import fixture from src import scikit_na as na @fixture(name="data") def fixture_data(): return read_csv("./tests/titanic_dataset.csv") @fixture(name="simple_data") def fixture_simple_data(): """Create s...
maximtrp/scikit-na
tests/test_summary.py
.py
c22db0b6dbd37b23
7.85
4
import time import os import pymysql.cursors import pymysql.err import datetime, time def run_sql_file(filename, connection): ''' The function takes a filename and a connection as input and will run the SQL query on the given connection ''' MYSQL_OPTION_MULTI_STATEMENTS_ON = 0 start ...
wcmc-its/ReCiterDB
setup/setupReciterDB.py
.py
a5332b6f6db8482e
7.24
2
""" auditAbstracts.py -- one-shot forensic audit of reporting_abstracts. Pulls rows where LENGTH(abstract) >= AUDIT_LENGTH_THRESHOLD, fetches the DynamoDB ground truth for each PMID via the same path abstractImport.py uses, and classifies each row: CLEAN DB matches Dynamo (long but legitimate abstract)...
wcmc-its/ReCiterDB
update/auditAbstracts.py
.py
717fe9c00f2cba4f
7.24
2
#!/usr/bin/env python3 """One-shot repair for SCOPUS ExternalArticle rows written during the 2026-07-16 prod cutover with journalOrVenue / authors attributes MISSING. The source of truth is the DynamoDB "ExternalArticle" table; reciterdb.external_article is a TRUNCATE+RELOAD projection, so this backfills DynamoDB and r...
wcmc-its/ReCiterDB
update/backfill_external_article_fields.py
.py
ef468e636d667eae
7.24
2
#!/usr/bin/env python3 """ETL: scan the ExternalArticle DynamoDB table -> reciterdb.external_article (MySQL). Projects the manually-added external-source publications (Publication Manager "Add publication" -> OpenAlex / Scopus, ReCiter #661/#662) into the reporting DB so external pubs surface in reciterdb reporting (R...
wcmc-its/ReCiterDB
update/retrieveExternalArticles.py
.py
1187995ebaa4ae36
7.24
2
# retrieveReporter.py # # Pulls grant metadata and pub-grant linkages from NIH RePORTER # (https://api.reporter.nih.gov/v2/) and reconciles them against the # ReCiter-derived person_article_grant table. # # Two API loops: # 1. POST /projects/search filtered by WCM org name → grant_reporter_project # 2. POST /public...
wcmc-its/ReCiterDB
update/retrieveReporter.py
.py
662371e0746e8588
7.24
2
#!/usr/bin/env python """ Usage ./add_notebook_quotes.py /path/to/input /path/to/output """ import ast import re from typing import Iterable, List, Tuple from sys import argv # A column-0 triple-quote docstring opener, with the optional raw-string prefix. # The prefix is load-bearing for LaTeX-carrying tutorial pr...
PyAutoLabs/PyAutoHands
autohands/add_notebook_quotes.py
.py
48898a4b4a76d648
7.24
2
#!/usr/bin/env python """ Aggregate per-job JSON result files into a consolidated release readiness report. Usage: python aggregate_results.py <results-dir> --output report.json --markdown report.md """ import json import re import subprocess import sys from argparse import ArgumentParser from pathlib import Path...
PyAutoLabs/PyAutoHands
autohands/aggregate_results.py
.py
62ec1ba0f25229b0
7.24
2
#!/usr/bin/env python3 """Leg 4 of PyAutoBuild#126 — dataset allowlist guard. Asserts that every tracked file under `dataset/` in the current workspace is covered by that workspace's `.gitignore` allowlist (the `!dataset/...` re-include lines). This makes the `git add -f` leak (fixed in pre_build) unable to recur: if ...
PyAutoLabs/PyAutoHands
autohands/check_dataset_allowlist.py
.py
dcdae335d286d447
7.24
2
#!/usr/bin/env python3 """ Navigator / workspace catalogue checker. Two independent checks, runnable locally or in CI: (a) Path existence (HARD FAIL) Scan the workspace's navigator / instruction files for repo-relative ``scripts/...`` and ``notebooks/...`` references and confirm each resolves on d...
PyAutoLabs/PyAutoHands
autohands/check_navigator.py
.py
a252d74f2e172a7c
7.24
2
#!/usr/bin/env python """Fail when a workspace script leaves a gradient multi-start search unbatched. Every ``af.MultiStart*`` search (``MultiStartProdigy``, ``MultiStartAdam``, ``MultiStartADABelief``, ``MultiStartLion``) defaults to ``n_starts=48`` and ``batch_size=None``. ``batch_size=None`` evaluates all 48 starts...
PyAutoLabs/PyAutoHands
autohands/check_search_memory.py
.py
0f4c391b43deb234
7.24
2
import os import shutil import subprocess import sys import time from argparse import ArgumentParser from pathlib import Path import build_util import generate_autofit parser = ArgumentParser() parser.add_argument("project", type=str, help="The project to generate notebooks for") parser.add_argument( "--report-di...
PyAutoLabs/PyAutoHands
autohands/generate.py
.py
94ccffc426516725
7.24
2
#!/usr/bin/env python """ Generate release notes from merged PRs and create GitHub Releases. For downstream repos (PyAutoGalaxy, PyAutoLens), includes upstream changes from dependency repos. Usage: python generate_release_notes.py --version <version> --repo <owner/repo> [--dry-run] """ import json import re impo...
PyAutoLabs/PyAutoHands
autohands/generate_release_notes.py
.py
993e1f8ad9a43d65
7.24
2
""" Generate an LLM-facing catalogue of an autolens-style workspace from script docstrings. This module is the companion to ``generate.py``: where ``generate.py`` converts each ``scripts/**/*.py`` into a Jupyter notebook, this module walks the *same* set of scripts (via the shared :func:`generate.iter_script_paths` se...
PyAutoLabs/PyAutoHands
autohands/navigator.py
.py
ca48f33f4f14c940
7.24
2
"""Emit the shell reproduction command for a single workspace script. Given a path to a workspace script (e.g. `autogalaxy_workspace_test/scripts/imaging/visualization.py`), print the exact shell command `autohands run_python` would have used to execute it — including all environment variables from the workspace's `co...
PyAutoLabs/PyAutoHands
autohands/repro_command.py
.py
b55cb8a8e216870f
7.24
2
import dataclasses import datetime import json import os import sys from enum import Enum from pathlib import Path from typing import List, Optional # The consolidated per-entry timing dataset written alongside every report. # # Why a second file rather than more keys on the per-run JSON: the per-run # ``<project>__<d...
PyAutoLabs/PyAutoHands
autohands/result_collector.py
.py
baef1d6a8b56c03c
7.24
2
#!/usr/bin/env python """ Run workspace scripts across one or more workspaces and produce summary reports. Usage: python run_all.py # all 10 workspaces python run_all.py autolens # just autolens_workspace python run_all.py autolens_test autofit # specific workspa...
PyAutoLabs/PyAutoHands
autohands/run_all.py
.py
0923bfa277bf22d7
7.24
2
#!/usr/bin/env python """Build the #pipreleases Slack payload for a release outcome. On a successful LIVE release, enrich the Slack post with the **full PyAutoLens release notes** — which already aggregate upstream Fit/Array/Galaxy changes via the "Upstream Changes" section written by ``generate_release_notes.py`` — p...
PyAutoLabs/PyAutoHands
autohands/slack_release_notes.py
.py
b7596082ca023e53
7.24
2
"""Validate a workspace's env profiles at PR time — no script execution. Migration step 1 of docs/env_profile_redesign.md (#161): parse BOTH profiles (``config/build/profile_smoke.yaml`` and ``profile_release.yaml``), resolve every script under each, and fail loudly on config errors that today surface only as the next...
PyAutoLabs/PyAutoHands
autohands/validate_env_profiles.py
.py
90e2b8126e68ccd7
7.24
2
"""Tests for bin/autohands — the CLI registry is complete and well-formed. `bin/autohands help` is documented (AGENTS.md, the file's own header) as *the* registry of what is a CLI verb. Before this module nothing enforced that: seven modules in `autohands/` had grown `__main__` blocks without ever appearing in `help`,...
PyAutoLabs/PyAutoHands
tests/test_autohands_registry.py
.py
a99a6396f9395eb9
7.74
2
"""tests/test_board.py — the PyAutoHands Dashboard renderer (autohands/board.py). Render is pure (snapshot in → string out), so everything here runs from fixtures — no network. Fixture names are deliberately fake (SomeOrg, RepoA): this file is not on the tenant-firewall allowlist, so no instance fact may appear. The c...
PyAutoLabs/PyAutoHands
tests/test_board.py
.py
0ee0248663912388
7.74
2
"""Regression tests for ``clone_seed.substitute`` — the Clone Agent's name substitution. The skill-prefix rule (``al_ -> ac_``, built from the package initials in ``PyAutoBrain/agents/conductors/clone/_clone.py``) exists to rename skill files at birth: ``al_fit_model.md -> ac_fit_model.md``. As a bare ``str.replace`` ...
PyAutoLabs/PyAutoHands
tests/test_clone_seed_substitute.py
.py
8cc1740244617a62
7.74
2
"""Tests that generate.py validates the project before destroying anything. `generate.py` clears the whole ``notebooks/`` tree, and until this was fixed the only rejection of an unknown project happened inside the per-script loop that runs *after* that rmtree — so running it on an unregistered project deleted 113 trac...
PyAutoLabs/PyAutoHands
tests/test_generate_validates_project.py
.py
4b88b67d1a75908d
7.74
2
import socket import sys from urllib.parse import quote import fs import fs.ftpfs import fs.smbfs from fs.sshfs import SSHFS from fs.walk import Walker from .filepass_config import ConnectionDetails, FilepassMethod # File Transfer Types def sftp_connection(logger, conn_details: ConnectionDetails): """ Estab...
cityofkamloops/filepass
src/filepass/filepass.py
.py
f33409738d225c3b
7.15
1
"""Nox sessions.""" import os import shutil import sys from pathlib import Path import nox from nox import Session, session os.environ.update({"PDM_IGNORE_SAVED_PYTHON": "1"}) package = "a10sa_script" python_versions = ["3.14", "3.13", "3.12", "3.11"] nox.needs_version = ">= 2021.6.6" nox.options.sessions = ( "...
bhrevol/a10sa-script
noxfile.py
.py
c3052476ed14aec9
7.24
2
import asyncio import time from abc import abstractmethod from contextlib import AbstractAsyncContextManager, AsyncExitStack from types import TracebackType from typing import TypeVar from loguru import logger from ..command.base import BaseCommand from ..exceptions import A10SAError from ..script.base import BaseScr...
bhrevol/a10sa-script
src/a10sa_script/player/player.py
.py
275c609c3b2653eb
7.24
2
"""Base script module.""" from abc import abstractmethod from collections.abc import Iterable, Iterator, MutableSequence from dataclasses import dataclass from typing import Any, BinaryIO, Generic, TypeAlias, TypeVar, overload from sortedcontainers import SortedList from ..command import BaseCommand _T = TypeVar("_...
bhrevol/a10sa-script
src/a10sa_script/script/base.py
.py
26b50c759c860b46
7.24
2
"""Funjack funscript script module.""" import io import json from collections.abc import Iterator from dataclasses import asdict, dataclass from typing import Any, BinaryIO from loguru import logger from ..command import PositionWithDurationCommand, VorzePositionCommand from ..exceptions import ParseError from .base...
bhrevol/a10sa-script
src/a10sa_script/script/funscript.py
.py
358a5976a494fbe0
7.24
2
"""LPEG/Afesta VCSX script module.""" from abc import abstractmethod from collections.abc import Iterable from typing import Any, BinaryIO, ClassVar, Self from ..command.vorze import ( VorzePositionCommand, VorzeRotateCommand, VorzeVibrateCommand, ) from ..exceptions import ParseError from ..utils import ...
bhrevol/a10sa-script
src/a10sa_script/script/vcsx.py
.py
f7179c8cb897d690
7.24
2
"""Generic utilities.""" import sys from typing import Literal, TypeAlias, Union if sys.version_info >= (3, 11): from asyncio import TaskGroup as TaskGroup else: from taskgroup import TaskGroup as TaskGroup _ByteOrder: TypeAlias = Union[Literal["little"], Literal["big"]] def to_uint(data: bytes, byteorder...
bhrevol/a10sa-script
src/a10sa_script/utils.py
.py
1bf66218fc22a587
7.24
2
"""Test cases for generic commands.""" import pytest from buttplug import DeviceOutputCommand, OutputType from a10sa_script.command import PositionCommand from a10sa_script.command import PositionWithDurationCommand from a10sa_script.command import RotateCommand from a10sa_script.command import VibrateCommand @pyte...
bhrevol/a10sa-script
tests/command/test_command.py
.py
fb72ee80471d5558
7.74
2
"""Test cases for generic scripts.""" from collections.abc import Sequence import pytest from a10sa_script.command import BaseCommand from a10sa_script.script import BaseScript from a10sa_script.script import ScriptCommand class _TestCommand(BaseCommand): # pragma: no cover def to_buttplug(self, *args, **kwar...
bhrevol/a10sa-script
tests/script/test_script.py
.py
1f4a264cbd43a5e3
7.74
2
"""Test cases for Vorze scripts.""" import io from pathlib import Path import pytest from a10sa_script.command.vorze import VorzePositionCommand from a10sa_script.command.vorze import VorzeRotateCommand from a10sa_script.command.vorze import VorzeVibrateCommand from a10sa_script.exceptions import ParseError from a10...
bhrevol/a10sa-script
tests/script/test_vorze.py
.py
5a69df3297a536e3
7.74
2
"""Test cases for the __main__ module.""" import pytest from click.testing import CliRunner from a10sa_script import __main__ @pytest.fixture def runner() -> CliRunner: """Fixture for invoking command-line interfaces.""" return CliRunner() def test_main_succeeds(runner: CliRunner) -> None: """It exits...
bhrevol/a10sa-script
tests/test_main.py
.py
796fb552ae4aed11
7.24
2
"""The allowlist: the thing that stops xfeeds from causing an outage. This is applied *after* every other stage. If a legitimate address reaches a published feed, somebody's traffic gets dropped, so a failure to build the allowlist is a hard error that aborts the run rather than a warning that degrades it. Publishing ...
neilweitzel/xfeeds
src/xfeeds/allowlist.py
.py
ab263051fea24db0
7.15
1
from collections import defaultdict from pathlib import Path from typing import Annotated import typer import yaml from pydantic import ValidationError from xfeeds.config import get_active_voting_classes, load_registry from xfeeds.log import configure_logging from xfeeds.models import Registry, SourceConfig app = ty...
neilweitzel/xfeeds
src/xfeeds/cli.py
.py
801f0c965e84fe1f
7.15
1
"""HTTP fetching for sources. Two independent caching mechanisms operate here and they solve different problems: * ``min_interval_seconds`` protects the *upstream*. AbuseIPDB permits five blacklist calls per day and Spamhaus requires automated fetches to be at least an hour apart, so we must not hit them more oft...
neilweitzel/xfeeds
src/xfeeds/collectors/base.py
.py
063cb3c56a7947eb
7.15
1
from pathlib import Path import yaml from xfeeds.models import Registry def load_registry(yaml_path: Path) -> Registry: """Load and validate sources.yaml, applying defaults to each source.""" with open(yaml_path, "r", encoding="utf-8") as f: raw_data = yaml.safe_load(f) # We manually merge the ...
neilweitzel/xfeeds
src/xfeeds/config.py
.py
7fd0ae55b9c52c87
7.15
1
"""IP to ASN and country enrichment, for aggregate reporting only. This module exists to support :mod:`xfeeds.insights`, which publishes statistics *about* the data rather than the data itself. Nothing here ever reaches a feed file. The mapping comes from iptoasn.com, which is dedicated to the public domain under PDD...
neilweitzel/xfeeds
src/xfeeds/enrich.py
.py
1da032cb48399f7b
7.15
1
"""Safety filters. Every rule here exists to prevent a specific kind of harm. Order matters and is fixed: 1. non-global addresses - reserved space must never be published 2. CIDR width cap - one bad wide prefix can black-hole a whole ISP 3. allowlist - legitimate infrastructure, applied last so no...
neilweitzel/xfeeds
src/xfeeds/filters.py
.py
6c726d06cf74efa2
7.15
1
import ipaddress import os from datetime import datetime from enum import Enum from typing import Any from pydantic import BaseModel, Field, model_validator IPAddress = ipaddress.IPv4Address | ipaddress.IPv6Address IPNetwork = ipaddress.IPv4Network | ipaddress.IPv6Network IPOrNet = IPAddress | IPNetwork class Band(...
neilweitzel/xfeeds
src/xfeeds/models.py
.py
aae82d011dad1f57
7.15
1
"""Independence-weighted confidence scoring. This is the core of the product and the easiest thing to get subtly wrong. Most public IP blocklists are not independent of each other. Measured overlaps show IPsum contains 35% of Blocklist.de and 64% of Binary Defense; Emerging Threats' compromised-ips list is 95% identi...
neilweitzel/xfeeds
src/xfeeds/score.py
.py
11e38d5be01e89d8
7.15
1
"""Persisted state, so xfeeds has a memory across runs. Two things need to survive between runs: * ``first_seen`` - when we first observed an indicator. Recomputing it every run would make every address look brand new and destroy the history. * aged-out records - an indicator no longer reported by anybody must even...
neilweitzel/xfeeds
src/xfeeds/state.py
.py
36ff7912d3132251
7.15
1
from django.shortcuts import render from django.utils import timezone from drf_spectacular.utils import OpenApiParameter, extend_schema from rest_framework import status from rest_framework.generics import ListAPIView, GenericAPIView from rest_framework.permissions import IsAuthenticatedOrReadOnly from rest_framework.r...
access-ci-org/Operations_Warehouse_Django
Operations_Warehouse_Django/allocations/views.py
.py
b23c807da30d0ad4
7.24
2
def get_best_org_details( org_list ): ''' find org with the largest quantity of non-null fields ''' keys = [ 'organization_name', 'organization_url', 'organization_abbreviation', 'organization_logo_url', 'organization_id', ] scores = [0] * len(org_list) for i ...
access-ci-org/Operations_Warehouse_Django
Operations_Warehouse_Django/cider/utils.py
.py
0d9268c13efde480
7.24
2
""" Example script for testing the Azure ttk theme Author: rdbende License: MIT license Source: https://github.com/rdbende/ttk-widget-factory """ import tkinter as tk from tkinter import ttk class App(ttk.Frame): def __init__(self, parent): ttk.Frame.__init__(self) # Make the app responsive ...
HelloMorrisMoss/mahlo_popup
Azure-ttk-theme-main/Azure-ttk-theme-main/example.py
.py
e9f1ba06f867f7e6
7
0
import contextlib import datetime import errno import os import time from typing import Any, Callable from sqlalchemy.types import TIMESTAMP, TypeDecorator class Timestamp(TypeDecorator): impl = TIMESTAMP def process_bind_param(self, value, dialect): if value is None: return None ...
HelloMorrisMoss/mahlo_popup
flask_server_files/helpers.py
.py
f8aba248d576a8ec
7
0
"""A wrapper class that will hold the column values and recreate a model instance when needed.""" class ModelWrapper: def __init__(self, model_instance): self._model_instance = model_instance for key in self._model_instance.__table__.columns.keys(): this_val = getattr(self._model_inst...
HelloMorrisMoss/mahlo_popup
flask_server_files/models/model_wrapper.py
.py
2d9b9593a6852b74
7
0
"""The resource for working on the database table. FOR DEVELOPMENT.""" import datetime from flask_restful import reqparse, Resource from flask_server_files.sqla_instance import fsa from log_and_alert.log_setup import lg def create_tables(): """Recreate the database tables.""" from untracked_config.developme...
HelloMorrisMoss/mahlo_popup
flask_server_files/resources/database.py
.py
f5713ed04f8c2eeb
7
0
import json import os import sys import tkinter as tk from tkinter import ttk # Add project root to path so we can import widgets project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) if project_root not in sys.path: sys.path.append(project_root) from help_window.article_viewer import Arti...
HelloMorrisMoss/mahlo_popup
help_window/article_demo.py
.py
1257a529bb9090bb
7
0
import os import tkinter as tk from tkinter import ttk from typing import List, Dict, Callable from help_window import lg from .utils.article_processor import process_article_data from .utils.path_utils import resolve_resource_path from .utils.scaling import calculate_dimensions from .utils.touch_scroller import Touch...
HelloMorrisMoss/mahlo_popup
help_window/article_viewer.py
.py
9132de23b7c11afb
7
0
import json import os from typing import List, Dict from help_window import lg class ContentManager: """ Manages loading, parsing, and caching of help article templates. """ def __init__(self, content_dir: str, cache_file: str = "help_cache.json"): self.content_dir = content_dir self...
HelloMorrisMoss/mahlo_popup
help_window/content_manager.py
.py
1b0b5017d675f17f
7
0
import json import os import shutil from typing import List, Dict from help_window import lg def update_all_references(content_dir: str, old_path: str, new_path: str): """ Scans all JSON articles in content_dir and updates any references from old_path to new_path. Paths should be relative to project root...
HelloMorrisMoss/mahlo_popup
help_window/editor/file_manager.py
.py
aab83c5630e77028
7
0
from datetime import datetime from flask_sqlalchemy import SQLAlchemy db = SQLAlchemy() class ContentVersion(db.Model): """ Represents a snapshot of the help content at a specific point in time. """ __tablename__ = 'content_versions' id = db.Column(db.Integer, primary_key=True) timestamp = ...
HelloMorrisMoss/mahlo_popup
help_window/flask_server_files/models/version.py
.py
0b6950f3e1f1ae05
7
0
import tkinter as tk from tkinter import ttk from typing import List, Dict, Callable from help_window.utils.touch_scroller import TouchScroller class NavFrame(ttk.Frame): """ Navigation sidebar for help articles. Displays articles grouped by sections with large, touchscreen-friendly buttons. """ ...
HelloMorrisMoss/mahlo_popup
help_window/nav_frame.py
.py
edfe63b25d042965
7
0
import hashlib import json import os import shutil from typing import Dict, Tuple def get_file_hash(file_path: str) -> str: """Calculates SHA-256 hash of a file.""" sha256_hash = hashlib.sha256() with open(file_path, "rb") as f: for byte_block in iter(lambda: f.read(4096), b""): sha256...
HelloMorrisMoss/mahlo_popup
help_window/utils/cas_manager.py
.py
cc1893b6e4d81c1c
7
0
from typing import Dict, Any # Global override for role _role_override = None def set_role_override(role: str): """Sets a global override for the instance role.""" global _role_override if role in ("server", "subscriber"): _role_override = role def get_settings() -> Dict[str, Any]: """Loads...
HelloMorrisMoss/mahlo_popup
help_window/utils/config.py
.py
58876bf64546346c
7
0