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 |
|---|---|---|---|---|---|---|
"""Typed message payloads for distributed agent communication."""
from __future__ import annotations
from dataclasses import asdict, dataclass, field
from enum import StrEnum
from typing import Any
AgentUID = tuple[int, int, int]
MessageMode = str
class MessageKind(StrEnum):
"""Base catalog of communication in... | ccgsem/casmsocial | casmsocial/communication/types.py | .py | 107d426a960a9aee | 7.15 | 1 |
"""data utility functions for casmsocial"""
from dataclasses import dataclass, fields
from functools import cache
import duckdb
class InvalidTableIdentifier(ValueError):
"""Exception raised for invalid table identifiers."""
def __init__(self, table_name: str) -> None:
super().__init__(f"Invalid tab... | ccgsem/casmsocial | casmsocial/data_utilities.py | .py | 3ba032b6f4217fc9 | 7.15 | 1 |
"""Load and validate bundled Colorado Front Range dataset profiles."""
from __future__ import annotations
from importlib.resources import files
from typing import Literal
import yaml
from pydantic import BaseModel, ConfigDict, Field, model_validator
class ContractModel(BaseModel):
"""Strict base for public bui... | ccgsem/casmsocial | casmsocial/datasets/colorado_front_range/profiles.py | .py | 139b55e7d7bef4de | 7.15 | 1 |
"""Acquire and verify public inputs for the Colorado Front Range dataset."""
from __future__ import annotations
import hashlib
import json
from datetime import datetime, timezone
from importlib.resources import files
from pathlib import Path, PurePosixPath
from typing import Literal
from urllib.request import Request... | ccgsem/casmsocial | casmsocial/datasets/colorado_front_range/sources.py | .py | 7ff67a2c3b1b86e9 | 7.15 | 1 |
""""""
from datetime import datetime, timedelta
def get_closest_monday(current_date):
"""
Get the closest Monday to the given date.
If the current date is a Monday, return that date.
If the current date is before the next Monday, return the next Monday.
If the current date is after the last Monda... | ccgsem/casmsocial | casmsocial/date_utilities.py | .py | 74db695494af2731 | 7.15 | 1 |
"""
Author: Jon Cline
Created: 02 Dec 2024
Defining modelfactory interface
"""
from typing import ClassVar
from loguru import logger
from casmsocial.model import Model
# model factory implementation
__MODELS = {}
class Models:
"""Model Factory class.
The Model Factory class is responsible for creating m... | ccgsem/casmsocial | casmsocial/factory.py | .py | bd6bdfe082153da1 | 7.15 | 1 |
"""Geo Utility functions"""
import pyproj
from repast4py.space import BoundingBox as bb, ContinuousPoint as cpt
# Create a transformer object for the desired UTM zone
def latlon_to_utm(latitude, longitude) -> tuple:
"""Convert latitude and longitude to UTM coordinates.
Arguments:
latitude: Latitude ... | ccgsem/casmsocial | casmsocial/geo_utilities.py | .py | 02ccbadce9f95913 | 7.15 | 1 |
from dataclasses import dataclass
import repast4py.core as core
from casmsocial.data_utilities import create_dataclass_record_from_dict
@dataclass(slots=True)
class HouseholdData:
"""Household data class"""
household_id: int = 0
place_id: int = 0
household_size: int = 0
household_income: float ... | ccgsem/casmsocial | casmsocial/household.py | .py | 57323bd7e09082d9 | 7.15 | 1 |
"""
Author: Jon Cline
Created: 02 Dec 2024
Defining abstract Model interface
"""
from abc import ABC, abstractmethod
from mpi4py import MPI
class Model(ABC):
"""
The Model class encapsulates the simulation, and is
responsible for initialization (scheduling events, creating agents,
and the grid the ... | ccgsem/casmsocial | casmsocial/model.py | .py | 7a8a723f209975b9 | 7.15 | 1 |
"""Observer base class for CasmSocial models"""
import pyarrow as pa
from casmsocial.model import Model
class Observer:
"""Base class for all observers"""
def __init__(self, name, model: Model = None):
self.name = name
def initialize(self, model: Model) -> None:
"""Initialize the obser... | ccgsem/casmsocial | casmsocial/observer.py | .py | e085d08d36b55def | 7.15 | 1 |
"""
Parallel place update system using Numba + Threading hybrid approach.
This module provides high-performance parallel updates for Place objects in casmsocial,
combining Numba's compiled parallel loops with Python threading for coordination.
"""
import math
import os
import time
from concurrent.futures import Threa... | ccgsem/casmsocial | casmsocial/parallel_updates.py | .py | 5a9fee050a9efd5e | 7.15 | 1 |
import random
from typing import ClassVar
import networkx as nx
import numpy as np
from repast4py import core, schedule, space
class SocialLearningAgent(core.Agent):
# class attributes
behaviors: ClassVar[list[str]] = ["A", "Ā"] # Possible behaviors
@classmethod
def get_behaviors(cls):
"""R... | ccgsem/casmsocial | casmsocial/randmodels/general_learning_model.py | .py | dd0824ed19b1f17f | 7.15 | 1 |
"""Simulation time utilities."""
from __future__ import annotations
from datetime import datetime, timedelta
class SimTime:
"""Convenience wrapper around :class:`datetime.datetime`.
The class keeps simulation time normalized to minute resolution, exposes
helpers for frequently used calendar properties,... | ccgsem/casmsocial | casmsocial/sim_time.py | .py | b1c8ba8c0feceaca | 7.15 | 1 |
"""Generate time-resolved interactions from potential social ties.
The social-network input states who may interact. This module determines when
an interaction is possible; it deliberately does not assume that a tie is a
scheduled encounter.
"""
from __future__ import annotations
from collections.abc import Iterable... | ccgsem/casmsocial | casmsocial/social_interactions.py | .py | 99c303064f27cf10 | 7.15 | 1 |
from .Channels import Channel, VerticalMeasurePossibleChannel, MeasurementState
from pyVirtualLab.Helpers import RECURSIVE_SUBCLASSES
from aenum import Enum
import re
class Function(VerticalMeasurePossibleChannel):
TYPE_COMMAND_HEADER = 'F'
EQUATION_FORMAT = str()
PARAMS_STRING_PREFIX:str = "EQN,\""
PARAMS_STRING_... | Ben3094/pyVirtualLab | pyVirtualLab/Instruments/LeCroy2610N/Functions.py | .py | 98b21fc739fd2d1e | 7 | 0 |
from pyVirtualLab.VISAInstrument import Instrument
from pyVirtualLab.Helpers import GetProperty, SetProperty, roundScientificNumber
from time import time, sleep
import re
from .Triggers import Trigger, TRIGGERS_NAMES
from .Channels import Source, AuxSource, LineSource, AnalogChannel, DigitalChannel, WaveformMemoryChann... | Ben3094/pyVirtualLab | pyVirtualLab/Instruments/RohdeAndSchwarz/RTB2XXX/__init__.py | .py | bbf785df7a319c97 | 7 | 0 |
from copy import deepcopy
from typing import Any, Dict, List
from alerta.exceptions import ApiError
from alerta.models.alert import Alert
from alerta.webhooks import WebhookBase
from alerta.webhooks.prometheus import parse_prometheus
# Alerta's default alarm model hard-rejects severities outside its fixed
# set (ale... | fastlorenzo/containers | apps/alerta-web/webhook/alerta_prometheus_cluster.py | .py | a7fdf29c2e3e12e0 | 7 | 0 |
"""Export Open WebUI chats into the vault as transcripts.
Written into `8. OpenClaw/sessions/webui/`, from where the normal sync pass
picks them up like any other note — there is no separate ingestion path. The
vault stays the one durable store, so `ob sync --continuous` carries chats to
every Obsidian device alongsid... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/chats.py | .py | ab7902de47797366 | 7 | 0 |
"""Configuration for the Obsidian <-> Open WebUI bridge.
Import-safe: no environment reads or side effects happen at import time.
All configuration parsing happens inside load_config().
"""
import os
from dataclasses import dataclass, field
# Vault-relative directories that never reach any collection: Obsidian's own... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/config.py | .py | 1a3fa8c4e59aa961 | 7 | 0 |
"""Entry point: periodic sync loop plus the HTTP/MCP surface."""
import argparse
import asyncio
import contextlib
import logging
import sys
from collections.abc import AsyncIterator
from contextlib import asynccontextmanager
from typing import Any
from .chats import export_chats
from .config import Config, load_confi... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/main.py | .py | ed878ab17a42cb8f | 7 | 0 |
"""Turn Obsidian markdown into something worth embedding.
The vault is ~530 notes averaging 626 bytes, so a retrieved chunk is usually a
whole note. That makes per-note noise expensive: a Dataview query block is a
large fraction of a small note, and it carries no meaning for retrieval. 234 of
the 529 notes contain one... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/markdown.py | .py | 8403f89530654f3c | 7 | 0 |
"""Vault -> Open WebUI knowledge collections.
Idempotent by content hash of the *rendered* document, so a change to the
preprocessing in markdown.py correctly invalidates every note rather than
leaving stale text in the index.
"""
import asyncio
import hashlib
import logging
import os
from dataclasses import dataclas... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/sync.py | .py | 6cda719e94f8a2a0 | 7 | 0 |
"""Vault filesystem access: walking, routing, path safety, retention."""
import logging
import os
import re
import time
import unicodedata
from collections.abc import Iterator
LOG = logging.getLogger("obsidian-bridge.vault")
_SLUG_STRIP_RE = re.compile(r"[^\w\s-]", re.UNICODE)
_SLUG_SPACE_RE = re.compile(r"[\s_-]+",... | fastlorenzo/containers | apps/obsidian-bridge/src/bridge/vault.py | .py | 8d898d81e9774530 | 7 | 0 |
"""Entry point for zguard-basic: an Istio ext-authz that enforces HTTP Basic
authentication per host.
Each protected host maps to a list of ``username:hash`` htpasswd-style entries
(see :file:`/config/credentials.json`). The gateway forwards the original
``authorization`` header and the original host (as ``X-Original-... | fastlorenzo/containers | apps/zguard-basic/app/main.py | .py | dd2de6788c1d8f99 | 7 | 0 |
"""Entry point for the zguard application."""
import os
import ipaddress
import time
from urllib.parse import urlencode, urlparse
from fastapi import FastAPI, Request, Response, HTTPException
from fastapi.responses import RedirectResponse
import redis
TTL_SECONDS = int(os.getenv("TTL_SECONDS", "28800")) # 8h defaul... | fastlorenzo/containers | apps/zguard/app/main.py | .py | 87c620f2e2de2e4a | 7 | 0 |
#!/bin/env python3
# Copyright 2022-2026 Elliot Jordan
#
# 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 la... | autopkg/index | v1/build.py | .py | 4fb7fa8ca76cf9c9 | 7.24 | 2 |
from datetime import date
from export_lsd.models import OrdenRegistro
from export_lsd.utils import (
NOT_OS_INSSJP,
NOT_SIJP,
amount_txt_to_integer,
exclude_eventuales,
get_value_from_txt,
just_eventuales,
sync_format,
)
def process_reg1(cuit: str, periodo: date, employees: int, export_co... | lugezz/el_conta | export_lsd/tools/export_basic_txt.py | .py | 3e239cc80a7ff624 | 7.3 | 3 |
import os
import zipfile
from export_lsd.models import Formato931
NOT_SIJP = [27, 48, 99, '027', '048', '099']
NOT_OS_INSSJP = [27, 99]
def get_value_from_txt(txt_line: str, field_name: str) -> str:
resp = ''
qs = Formato931.objects.get(name=field_name)
if qs:
resp = txt_line[qs.fromm - 1:qs.fr... | lugezz/el_conta | export_lsd/utils.py | .py | 12a515441c03e3ae | 7.3 | 3 |
"""Configure the gbif_registrar package for use."""
from json import load, dump
from os import environ
def load_configuration(configuration_file):
"""Loads the configuration file as global environment variables for use
by the gbif_registrar functions.
Remove these environment variables with the unload_c... | EDIorg/gbif_registrar | src/gbif_registrar/configure.py | .py | 3bdbed551386f046 | 7.15 | 1 |
"""Register datasets with GBIF."""
import os.path
import tempfile
import pandas as pd
from gbif_registrar._utilities import (
_get_local_dataset_endpoint,
_expected_cols,
_get_local_dataset_group_id,
_get_gbif_dataset_uuid,
_read_registrations_file,
)
def initialize_registrations_file(file_path):... | EDIorg/gbif_registrar | src/gbif_registrar/register.py | .py | 6ac672435733323a | 7.15 | 1 |
"""Configure the test suite."""
import pytest
from gbif_registrar._utilities import _read_registrations_file
@pytest.fixture(name="eml")
def eml_fixture():
"""Create an EML XML string for testing."""
xml_content = """<?xml version="1.0" encoding="UTF-8"?>
<eml:eml packageId="knb-lter-ble.20.1" system="ht... | EDIorg/gbif_registrar | tests/conftest.py | .py | 9a1f30d166ef6b9c | 7.65 | 1 |
"""Test the configure.py module"""
from json import load
from os import environ
from gbif_registrar.configure import (
load_configuration,
unload_configuration,
initialize_configuration_file,
)
def test_load_configuration_creates_environmental_varaiables():
"""Test that the load_configuration functio... | EDIorg/gbif_registrar | tests/test_configure.py | .py | b09e01643dfe9c4c | 7.65 | 1 |
"""Test the upload.py module."""
from re import search
import pytest
from gbif_registrar._utilities import (
_read_registrations_file,
)
from gbif_registrar.register import register_dataset
from gbif_registrar.upload import upload_dataset
from gbif_registrar.configure import load_configuration, unload_configuratio... | EDIorg/gbif_registrar | tests/test_upload.py | .py | 9b025002c8fa603c | 7.65 | 1 |
"""
Rotation related functions for numpy arrays
"""
import numpy as np
from scipy.spatial.transform import Rotation
def dcm2euler(mats: np.ndarray, seq: str = 'zyx', degrees: bool = True):
"""Converts rotation matrix to euler angles
Args:
mats: (B, 3, 3) containing the B rotation matricecs
s... | gfmei/OCFNet | common/math/so3.py | .py | 5eb2ebcc87912e94 | 7 | 0 |
""" 3-d rigid body transformation group
"""
import torch
def identity(batch_size):
return torch.eye(3, 4)[None, ...].repeat(batch_size, 1, 1)
def inverse(g):
""" Returns the inverse of the SE3 transform
Args:
g: (B, 3/4, 4) transform
Returns:
(B, 3, 4) matrix containing the inverse... | gfmei/OCFNet | common/math_torch/se3.py | .py | f499df755398b4f1 | 7 | 0 |
"""
Misc utilities
"""
import argparse
from datetime import datetime
import logging
import os
import shutil
import subprocess
import sys
try:
import coloredlogs
except ImportError: # optional, only makes the console output prettier
coloredlogs = None
try:
import git
except ImportError: # optional, only ... | gfmei/OCFNet | common/misc.py | .py | b0496eaa23eb37e8 | 7 | 0 |
"""PyTorch related utility functions
"""
import logging
import os
import pdb
import shutil
import sys
import time
import traceback
import numpy as np
import torch
from torch.optim.optimizer import Optimizer
def dict_all_to_device(tensor_dict, device):
"""Sends everything into a certain device """
for k in t... | gfmei/OCFNet | common/torch.py | .py | 6585462a7fc8a74c | 7 | 0 |
"""
Author: Shengyu Huang
Last modified: 30.11.2020
"""
import os,sys,glob,torch
import numpy as np
from scipy.spatial.transform import Rotation
from torch.utils.data import Dataset
from lib.benchmark_utils import to_tsfm, get_correspondences, to_tensor
from lib.spconv_utils import sparse_quantize
class IndoorDataset... | gfmei/OCFNet | datasets/indoor.py | .py | ef29e320c4fb0a3d | 7 | 0 |
"""
spconv replacements for the MinkowskiEngine helpers this code base used to rely on.
MinkowskiEngine -> here
ME.utils.sparse_quantize(coords, ...) -> sparse_quantize(coords, ...)
ME.utils.sparse_collate(coords, feats) -> sparse_collate(coords, feats)
ME.SparseT... | gfmei/OCFNet | lib/spconv_utils.py | .py | 928004e3bff2cdf5 | 7 | 0 |
import time
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0.0
self.sq_sum = 0.0
self.count = 0
def update(self, val, n=1):
... | gfmei/OCFNet | lib/timer.py | .py | ed31bc792e41dd75 | 7 | 0 |
"""
General utility functions
Author: Shengyu Huang
Last modified: 30.11.2020
"""
import os,re,sys,json,yaml,random, argparse, torch, pickle
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import numpy as np
from scipy.spatial.transform import Rotation
from sklearn.neighbors import ... | gfmei/OCFNet | lib/utils.py | .py | b2e51e76033d9911 | 7 | 0 |
import logging
import models.simpleunet as simpleunets
import models.resunet as resunets
import models.ocfnet as ocfnets
MODELS = []
def add_models(module):
MODELS.extend([getattr(module, a) for a in dir(module) if 'Net' in a or 'MLP' in a])
add_models(simpleunets)
add_models(resunets)
add_models(ocfnets)
def ... | gfmei/OCFNet | models/__init__.py | .py | d94af3bbbf0906fe | 7 | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import spconv.pytorch as spconv
def get_norm(norm_type, num_feats, bn_momentum=0.05, D=-1):
if norm_type == 'BN':
return SparseBatchNorm(num_feats, momentum=bn_momentum)
elif norm_type == 'IN':
return SparseInstanceNorm(num_feats)
else:
... | gfmei/OCFNet | models/common.py | .py | ebe85f3b702e611b | 7 | 0 |
"""
Check that batched training is equivalent to feeding the pairs one by one.
python scripts/test_batch_equivalence.py configs/train/indoor.yaml --batch_size 3
The overlap-attention module is the only part of the network where points can influence
each other, so batching it is only correct if the masks really ke... | gfmei/OCFNet | scripts/test_batch_equivalence.py | .py | 8d9bff59b04879e9 | 7.5 | 0 |
from __future__ import annotations
import dataclasses
import json
import logging
from typing import Any
from urllib.parse import urlencode, urlparse
import requests
from chia.full_node.full_node_rpc_client import FullNodeRpcClient
from chia.types.blockchain_format.coin import Coin
from chia.types.coin_record import C... | Chia-Network/climate-token-driver | app/crud/chia.py | .py | a378bc51ba31e61e | 7.24 | 2 |
from hat.doit.c import (get_py_c_flags,
get_py_ld_flags,
get_py_ld_libs,
CBuild)
from .. import common
__all__ = ['task_pymodules_modbus',
'task_pymodules_modbus_obj',
'task_pymodules_modbus_dep',
'task_pymodules... | hat-open/hat-drivers | src_doit/pymodules/modbus.py | .py | a3a09c9e4b1f527b | 7.3 | 3 |
from hat.doit.c import (get_py_c_flags,
get_py_ld_flags,
get_py_ld_libs,
CBuild)
from .. import common
__all__ = ['task_pymodules_ssl',
'task_pymodules_ssl_obj',
'task_pymodules_ssl_dep',
'task_pymodules_ssl_clea... | hat-open/hat-drivers | src_doit/pymodules/ssl.py | .py | 65b21019ab4f48c0 | 7.3 | 3 |
import enum
import typing
from hat import util
class TpduType(enum.Enum):
DT = 0xF0
CR = 0xE0
CC = 0xD0
DR = 0x80
ER = 0x70
class DT(typing.NamedTuple):
"""Data TPDU"""
eot: bool
"""end of transmition flag"""
data: util.Bytes
class CR(typing.NamedTuple):
"""Connection requ... | hat-open/hat-drivers | src_py/hat/drivers/cotp/common.py | .py | 74ff1f06cc249d34 | 7.3 | 3 |
# ~/.claude/hooks/bash-review.py
# 判定の 3 層構造 (詳細は _bash_review_common.py のヘッダー参照):
# 1. 静的 DENY: sudo / curl 等、文脈を問わず危険 → 即拒否
# 2. 高リスク層: rm -r / force push / パッケージ導入等、文脈次第で正当
# → Gemini と Codex を並列実行する AND ゲート。両モデル ALLOW 一致時のみ
# 許可、両モデル DENY 一致時のみ deny、それ以外 (判定割れ/ASK/ERROR) は
# 両判定を添えて ask。片方説得で... | sardonyx0827/dotfiles | .claude/hooks/bash-review.py | .py | b51fffed66846341 | 7 | 0 |
#!/usr/bin/env python3
"""Render a markdown session report into one self-contained HTML page and open it.
Why this shape rather than a preview server:
The page is opened straight from `file://`, so it must not depend on anything
an opaque origin cannot do. That rules out ES modules -- Chrome fails the CORS
check on `... | sardonyx0827/dotfiles | .claude/skills/session-report/render_report.py | .py | 47569ce4c5ced345 | 7 | 0 |
"""Shared pytest fixtures and helpers for the dotfiles test suite.
Python hooks under .claude/hooks and .codex/hooks are top-level scripts
(no main() function): they read hook JSON from stdin, decide, and exit.
The `run_hook` fixture executes them with compile()+exec() against a
private globals dict so that:
- stdin ... | sardonyx0827/dotfiles | tests/conftest.py | .py | f1c1c4621b754484 | 7.5 | 0 |
"""Drift guards for the parts of the multi-runtime config that are still copied.
Agent bodies used to live here. They no longer do: `.codex/agents/*.toml` is
generated from `.claude/agents/*.md` by scripts/gen_codex_agents.py, and
tests/test_gen_codex_agents.py enforces that the committed output matches the
SSOT byte-... | sardonyx0827/dotfiles | tests/test_agent_parity.py | .py | a515fb17c6772d34 | 7.5 | 0 |
"""Tests for bash-review-launcher.sh (fail-closed startup wrapper,
.claude JSON-ask variant and .codex exit-2 variant).
The launchers exist because a bare `python3 .../bash-review.py` hook command
fails OPEN when the review cannot happen at all: both runtimes treat a hook
that cannot start (python3 missing, script mis... | sardonyx0827/dotfiles | tests/test_bash_review_launcher.py | .py | 44d16c968f58f66f | 7.5 | 0 |
"""Config wiring: settings / hook JSON must reference files that actually exist
in the repo, and must parse as valid JSON / TOML.
dotfiles' core job is wiring: a renamed hook, a path typo, or an invalid JSON /
TOML edit would silently break a real install while every other test stayed
green (the hooks themselves are t... | sardonyx0827/dotfiles | tests/test_config_wiring.py | .py | 42f544f7a79fb899 | 7.5 | 0 |
"""Figure counts: the agent / command / skill / test counts baked into the SVG
architecture diagrams must match the actual files in the repo.
The prose in README.md deliberately avoids hardcoding these counts, but the SVG
figures embed them as literal text (`N agents · N commands`, `N test suites`,
`agents (N ⇆ N)`, .... | sardonyx0827/dotfiles | tests/test_figure_counts.py | .py | 446896a4bb4cd319 | 7.5 | 0 |
"""Tests for _hook_common.sh (hook_log / hook_notify).
These run against the .claude copy; .codex reaches the same file through a
symlink, which test_hook_sync.py pins.
"""
import re
import subprocess
from conftest import REPO_ROOT
HOOK_COMMON = REPO_ROOT / ".claude/hooks/_hook_common.sh"
TIMESTAMP = re.compile(r"... | sardonyx0827/dotfiles | tests/test_hook_common.py | .py | 6863e7c7200168fd | 7.5 | 0 |
"""Structural guard: .codex's hooks reach .claude's shared libraries by path.
Three designs have held this invariant, each replacing the previous one's
failure mode:
1. Byte-identical tracked pairs kept in step by a drift test. Reactive -- it
only caught divergence once someone ran the suite, and it only watched t... | sardonyx0827/dotfiles | tests/test_hook_sync.py | .py | 000d9a3dd1519859 | 7.5 | 0 |
"""`vim.keymap.set/del` opts must spell the buffer option `buf`, not `buffer`.
Neovim 0.12 renamed the option; `runtime/lua/vim/keymap.lua` carries the
schedule in-tree:
TODO(skewb1k): soft-deprecate `buffer` option in 0.13, remove in 0.15.
Commit de046d2 ("refactor: migrate deprecated Neovim 0.12 APIs") swept t... | sardonyx0827/dotfiles | tests/test_nvim_keymap_opts.py | .py | 7f9340ce9968a655 | 7.5 | 0 |
"""Tab-lifecycle tests for `.config/nvim/lua/setup/functions/undotree_vimdiff.lua`.
`M.open_vimdiff()` opens a scratch-vs-current diff in its OWN tab and registers
cleanup so the diff can be unwound again. Two independent defects made that
cleanup destroy tabs it was never asked to touch:
- `close_diff_tab` ran a bar... | sardonyx0827/dotfiles | tests/test_nvim_undotree_tabs.py | .py | 210223a16e73e229 | 7.5 | 0 |
"""Tests for the session-report renderer.
The renderer turns a markdown report (with ```mermaid fences) into a single
self-contained HTML page that is opened straight from `file://`. Two of the
assertions here are not style preferences but the reason the design works at
all, so they must not be relaxed:
- The library... | sardonyx0827/dotfiles | tests/test_render_report.py | .py | 74cdc4d10791a287 | 7.5 | 0 |
"""Tests for scripts/secret_scan.py — the shared credential-scanner CLI.
The Vim/Neovim AI integration shells out to this before sending a payload to an
AI tool, so a secret is refused *at the editor* the same way the bash-review
hooks refuse it for Bash. It reuses `scan_secrets` from the hooks module (single
source o... | sardonyx0827/dotfiles | tests/test_secret_scan_cli.py | .py | 64d4980c3e1e1412 | 7.5 | 0 |
#!/usr/bin/env python3
"""将 8-14 天前的 commit 合并为一个,保持最近 7 天不变"""
import subprocess
import datetime
import os
def run(cmd, fatal=True, env=None):
"""执行 shell 命令,返回 (stdout, returncode)"""
r = subprocess.run(cmd, shell=True, capture_output=True, text=True, env=env)
if fatal and r.returncode != 0:
pr... | Left024/GameSaves | squash.py | .py | 6e5d1ddc279a2df9 | 7.3 | 3 |
#!/usr/bin/env python3
"""Generate the published .well-known/ discovery surface from source OOBIs.
This is a *reference* build script. The only thing standardized for consumers is
the published surface under .well-known/ that it emits; how you organize your
source is your business ("bring your own build-wellknown.py")... | GLEIF-IT/GLEIF-IT.github.io | scripts/build-wellknown.py | .py | 72e6e7d323db57ac | 7.35 | 4 |
"""LibreNMS inventory plugin for Nornir."""
from __future__ import annotations
import logging
import os
from typing import Any, NamedTuple
from urllib.parse import urlsplit, urlunsplit
import requests
from nornir.core.inventory import (
ConnectionOptions,
Defaults,
Group,
Groups,
Host,
Hosts,... | shamalawy/nornir-librenms | nornir_librenms/librenms_inventory.py | .py | 08b7f745262710d3 | 7.39 | 5 |
"""The init_nornir wrapper and entry-point registration."""
from __future__ import annotations
import responses
from nornir.core.plugins.inventory import InventoryPluginRegister
from nornir_librenms import LibreInventory, init_nornir
from .conftest import DEVICES_URL
@responses.activate
def test_init_nornir_passe... | shamalawy/nornir-librenms | tests/test_init_nornir.py | .py | c1c6d5af9f38155f | 7.89 | 5 |
"""The platform map is the part that silently dropped devices before."""
from __future__ import annotations
import pytest
from nornir_librenms import PLATFORM_MAP, LibreInventory, Platform, PlatformNotSupported
netmiko = pytest.importorskip("netmiko.ssh_dispatcher", reason="netmiko not installed")
@pytest.fixture... | shamalawy/nornir-librenms | tests/test_platform_map.py | .py | 7fabd5639dd4f1f2 | 7.89 | 5 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/api/documentation_api.py | .py | 47225e48417b4590 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/api/licenses_api.py | .py | 609c7242700caf1a | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_coating_with_compliance.py | .py | a503a9f9570c3360 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_impacted_substance.py | .py | 010171269f36189a | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_indicator_definition.py | .py | 6d1243f9945a9d88 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_indicator_result.py | .py | c3e634639f4c5bc1 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_legislation_with_impacted_substances.py | .py | f983c68aa04301f8 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_log_entry.py | .py | e321531942e0db25 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_material_reference.py | .py | 51773471958623d5 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_material_with_compliance.py | .py | 25521ebddf827c15 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_part_reference.py | .py | 2280f8764461fe39 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_part_with_compliance.py | .py | 016df178c2cc108d | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_preferred_units.py | .py | d3be8ce37f05b654 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_process_reference.py | .py | 4c6d33ce5fd9ff1e | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_request_config.py | .py | d0caba93418325d8 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_specification_reference.py | .py | 1738eba2193901bc | 7.65 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_specification_with_compliance.py | .py | 5276e6c95fd9f276 | 7.65 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_substance_with_compliance.py | .py | f3daaf841b2f3dc2 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_material_contributing_component.py | .py | 0f26608bd61027c2 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_material_summary.py | .py | 4f3fda811f81e36f | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_material_summary_entry.py | .py | 71f650493b000289 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_material_with_sustainability.py | .py | 955290b22c36b06d | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_phase_summary.py | .py | ad108b5a81ea880f | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_process_summary.py | .py | a0428ecf78ea6b26 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_process_summary_entry.py | .py | d8849d0643dd1fb8 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_process_with_sustainability.py | .py | 25f4f50b068ab378 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_transport_by_category_summary_entry.py | .py | c4e92f1a12b5e16a | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_transport_by_part_summary_entry.py | .py | de9482271e1efea5 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_transport_summary.py | .py | a402493645b856ac | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_transport_summary_entry.py | .py | b749b308c809453d | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_sustainability_transport_with_sustainability.py | .py | cbeb48a8ea9c8e1d | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_transport_reference.py | .py | 3c1dbe346acd754a | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/common_value_with_unit.py | .py | 08dd3c1a875f6c96 | 7.15 | 1 |
# Copyright (C) 2022 - 2026 Synopsys, Inc. and ANSYS, Inc. All rights reserved.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, includi... | ansys/grantami-bomanalytics-openapi | ansys-grantami-bomanalytics-openapi/src/ansys/grantami/bomanalytics_openapi/v1/models/get_available_licenses_response.py | .py | 32d82110556cedb4 | 7.15 | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.