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 |
|---|---|---|---|---|---|---|
"""Live map streaming response models (GET /v1/p2maps/livemap).
Part of roombapy_prime.models (split into a package for navigability,
session 55). See roombapy_prime/models/__init__.py for the full
picture and docs/internal/PRIME_APP_GAP_ANALYSIS_2026-07-11.md for the
evidence trail behind any individual field."""
fro... | johnnyh1975/roombapy-prime | roombapy_prime/models/livemap.py | .py | 5a077717511a9105 | 7.42 | 6 |
"""The response of `POST /v1/time-estimates`.
CONFIRMED, and it took an APK pass to get here. The endpoint was
implemented long before anyone knew what came back: the only test used
`{"minutes": 30}`, invented. The real key is `estimate`, and the unit
travels beside it rather than in the name.
The shape, from the ven... | johnnyh1975/roombapy-prime | roombapy_prime/models/time_estimates.py | .py | 5b97c6caeab285c8 | 7.42 | 6 |
"""Tests for roombapy_prime.aws_sigv4.
The frozen-clock test below pins the EXACT signature output that was
manually verified (during development, not as an automated test
dependency) to be byte-for-byte identical to ha_roomba_plus's original
cloud_api.py::_AWSSignatureV4 for the same inputs -- see
docs/archive/FINDIN... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_aws_sigv4.py | .py | 247025253e6d2ec3 | 7.92 | 6 |
class TestAFavouriteCommandCarriesItsInitiator:
"""`_favorite_from_json` read eleven fields of a stored command def
and dropped `initiator`, so `to_json()` omitted the key entirely.
The one region command CONFIRMED working on hardware
(@Echovictor37) carries `initiator: "rmtApp"`. That was the only
... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_favorites.py | .py | 5aa79b4102b175f4 | 7.92 | 6 |
"""ID validation, anchored on real IDs.
The alphabet came from the firmware image; these two IDs came from a
live diagnostics download (a mission ID and a config-entry ID). If the
validator rejected either, the validator would be wrong, not the ID.
"""
from __future__ import annotations
from roombapy_prime.ids impor... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_ids.py | .py | 75a4c495f2057c42 | 7.92 | 6 |
"""Tests for roombapy_prime's top-level public API surface.
NEW (session 57). Previously the package's __init__.py exported
nothing at all -- every consumer had to reach into internal submodules
directly. These tests exist so a future refactor can't silently drop
one of these names from the top level without a test fa... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_init.py | .py | a7e8f8fe53176d0b | 7.92 | 6 |
"""Tests for live map decoding."""
from __future__ import annotations
import pytest
class TestLiveMapIsZlibCompressed:
"""CONFIRMED FROM A REAL FIELD CAPTURE (DaRealGuGu, and almost
certainly the same cause as chairstacker's long-standing blank live
map): the payload arrives zlib-compressed and was being... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_livemap.py | .py | eee2a7b62852b525 | 7.92 | 6 |
class TestRingClosingPointIsDropped:
"""REAL FIELD FAILURE (DaRealGuGu). Resending two untouched zones
came back HTTP 500 -- a server error rather than a 400, which fits
a payload that parses but then breaks something downstream.
The cause: a GeoJSON LinearRing repeats its first coordinate as its
... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_map_editing.py | .py | ee5686a1d77ab6cb | 7.92 | 6 |
class TestUnknownScheduleFieldsSurviveAWrite:
"""The server is ahead of the app this model was built from.
`is_smart_clean_fav` arrives on real schedules and appears nowhere in
APK 2.2.4 — neither in Kotlin nor natively. Writing a schedule is
read-modify-write, so without a passthrough every write si... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_schedules_dnd.py | .py | 9a3dae83035a243f | 7.92 | 6 |
"""The response of `POST /v1/time-estimates`.
The endpoint was implemented long before anyone knew what came back:
the only test used `{"minutes": 30}`, invented. The real key is
`estimate`, and the unit travels beside it rather than in the name.
Tested against the vendor's own simulator response, three levels deep.
... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_time_estimates.py | .py | b035996352598552 | 7.92 | 6 |
"""Enforces the one-way dependency between the library core and the
diagnostic tooling.
The direction was already respected before tools/ existed, purely by
discipline -- this makes it structural. It matters beyond tidiness:
tools/ registers console scripts, several of which MOVE A REAL ROBOT.
Keeping the core free of... | johnnyh1975/roombapy-prime | roombapy_prime/tests/test_tools_boundary.py | .py | 753c3b3572987888 | 7.92 | 6 |
"""The vendor's own value sets, as data rather than as prose.
WHY THIS EXISTS, stated plainly because the reason is a mistake rather
than a design.
A full decode of iRobot app 3.0.0 produced 541 Dart enums, 89 SDK
models, 223 Kotlin serialisers, 35 capability gates and 24 writable
settings. All of it was read. Then s... | johnnyh1975/roombapy-prime | roombapy_prime/vendor_reference.py | .py | 2103ed305d2c473b | 7.42 | 6 |
#!/usr/bin/env python3
"""Every value set in this library, checked against the vendor's own.
WHY THIS EXISTS, stated plainly because the reason is a mistake made
repeatedly and not a hypothetical.
The APK research produced 607 vendor enums. Working from it by SEARCHING
-- grepping for the name you expect -- fails in ... | johnnyh1975/roombapy-prime | scripts/check_vendor_value_sets.py | .py | e693bdd29fc5c822 | 7.42 | 6 |
#!/usr/bin/env python3
"""Checks README.md's stated version and test count against the actual
project state, adapted from the same-purpose script in ha_roomba_plus's
own CI pipeline ("version-badge hung two releases behind 3.4.0, unnoticed").
Two things checked here, both found stale by hand (not by CI) multiple
times... | johnnyh1975/roombapy-prime | scripts/check_version_badge.py | .py | 8c5a6e10f7fd12c2 | 7.42 | 6 |
"""Wind, rain and ice protection for awnings.
The one part of awning support that is not comfort. An awning left out in a
gust is a repair bill, so this module has priority over everything else in the
integration – including the master switch and both automation switches.
That is a deliberate break with the order tha... | fschubi/shutter_pilot | custom_components/shutter_pilot/awning_guard.py | .py | dba5be4e2c4401a6 | 7.63 | 17 |
"""Brightness sensor logic - per area (brightness mode)."""
from __future__ import annotations
import asyncio
import logging
from datetime import datetime, time, timedelta
from typing import Any
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassis... | fschubi/shutter_pilot | custom_components/shutter_pilot/brightness.py | .py | 5892291032823e55 | 7.63 | 17 |
"""Check that a cover actually reached the requested position.
Radio-driven shutters lose commands now and then. Without this check the
integration stores the requested position as fact and keeps making decisions
on a value the cover never reached – for instance skipping an automated open
because it believes the shutt... | fschubi/shutter_pilot | custom_components/shutter_pilot/cover_verify.py | .py | 0b61975090d2b5a1 | 7.63 | 17 |
"""Persistent cover position storage across Home Assistant restarts."""
from __future__ import annotations
import logging
from datetime import datetime, timedelta
from typing import Any, Literal
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.storage import Store
from .const import... | fschubi/shutter_pilot | custom_components/shutter_pilot/position_store.py | .py | 8d615e251dbd423f | 7.63 | 17 |
"""Shared schedule maths: weekday detection, random jitter, trigger times.
This module is deliberately free of side effects so the trickier parts of the
scheduling logic can be unit-tested without a running Home Assistant.
"""
from __future__ import annotations
import logging
import random
from datetime import date,... | fschubi/shutter_pilot | custom_components/shutter_pilot/schedule_times.py | .py | b459e45f79497619 | 7.63 | 17 |
"""Time-based scheduler for shutter up/down (per area, time/sun modes)."""
from __future__ import annotations
import asyncio
import logging
from datetime import datetime
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.util import dt as dt... | fschubi/shutter_pilot | custom_components/shutter_pilot/scheduler.py | .py | 7d5b4ba81c47ccb7 | 7.63 | 17 |
"""Shutter Pilot services - open_group, close_group, sun_protect_group (area-based)."""
from __future__ import annotations
import asyncio
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
import voluptuous as vol
from .const import (
DOMAIN,
CON... | fschubi/shutter_pilot | custom_components/shutter_pilot/services.py | .py | 13fb135eb0b71d6a | 7.63 | 17 |
"""Automatic ventilation: drive to the ventilation position on conditions.
Until now ventilating was purely manual – a service and a dashboard button.
This adds the automation branch that was asked for in the forum: name a couple
of entities that all have to hold, and the shutters open that far by themselves.
Ranking... | fschubi/shutter_pilot | custom_components/shutter_pilot/ventilation.py | .py | a8a0f8aa24b7412c | 7.63 | 17 |
"""Fetch today's weather forecast for use as a shading condition.
Since Home Assistant 2024.4 forecasts are no longer exposed as attributes of
the weather entity. They have to be requested through the `weather.get_forecasts`
service, which returns its data as a service response.
The values land in `hass.data[DOMAIN][... | fschubi/shutter_pilot | custom_components/shutter_pilot/weather_data.py | .py | d38d593edbfb39f6 | 7.63 | 17 |
"""Helper to check window state and apply lock protection (Aussperrschutz)."""
from __future__ import annotations
from typing import Any
from homeassistant.core import HomeAssistant
from .const import (
CONF_WINDOW_ENTITY_ID,
CONF_WINDOW_ENTITY_ID_2,
CONF_WINDOW_OPEN_STATE,
CONF_WINDOW_TILTED_ENTITY... | fschubi/shutter_pilot | custom_components/shutter_pilot/window_helper.py | .py | 2c7a9c0024a99a87 | 7.63 | 17 |
"""Window trigger logic - React to window open/close for shutters."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.event import async_track... | fschubi/shutter_pilot | custom_components/shutter_pilot/window_trigger.py | .py | 80f438f2838168be | 7.63 | 17 |
"""Shared fixtures for the Shutter Pilot test suite."""
from __future__ import annotations
from unittest.mock import patch
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry
from custom_components.shutter_pilot.const import (
AREA_MODE_TIME,
CONF_AREA_DOWN_ID,
CONF_AR... | fschubi/shutter_pilot | tests/conftest.py | .py | e6109c3628be09ab | 8.13 | 17 |
"""Rollläden ohne Positionsrückmeldung (Wunsch von Viktor, ESP Somfy RTS).
Einseitiger Funk antwortet nicht. Jede Prüfung, die eine Position braucht, gab
deshalb auf – womit Fenstertrigger und automatisches Lüften für solche Antriebe
stillschweigend abgeschaltet waren.
Im Blind-Modus rechnet Shutter Pilot stattdessen... | fschubi/shutter_pilot | tests/test_blind_drive.py | .py | 7e44a1bc08fef7e6 | 8.13 | 17 |
"""Sonnenrelative Grenzen im Helligkeitsmodus.
Der Fall aus dem Forum: Ein Gewitter am Nachmittag drückt die Helligkeit unter
die Schwelle, und die Rollläden schließen am helllichten Tag. Die Uhrzeitfenster
können „frühestens ab Sonnenuntergang minus 60 Minuten" nicht ausdrücken, weil
der Sonnenuntergang durchs Jahr w... | fschubi/shutter_pilot | tests/test_brightness_sun_bounds.py | .py | 3c29c01a90689238 | 8.13 | 17 |
"""Antriebe, die keine Position kennen.
Viele Markisenmotoren – und etliche aeltere Rollladenantriebe – koennen nur
auf, stop und zu. `cover.set_cover_position` wirft dort, und seit 2.8.0 wird
eine gescheiterte Fahrt jede Minute wiederholt: aus einem stummen Fehler waere
also eine Endlosschleife geworden.
Die Tilt-Fa... | fschubi/shutter_pilot | tests/test_cover_no_position.py | .py | b515b15f11d747ad | 7.13 | 17 |
"""Tests for the drive verification.
Radio-driven shutters lose commands. Before this, the requested position was
stored as fact, so the integration kept deciding on a value the cover never
reached. Inspired by the "Cover Hardware" section of the NACC blueprint.
"""
from __future__ import annotations
from unittest.m... | fschubi/shutter_pilot | tests/test_cover_verify.py | .py | d63324e1f430d36d | 8.13 | 17 |
"""heinzies dritte Meldung: der nachgeholte Rollladen blieb morgens unten.
Sein Ablauf, Schritt für Schritt:
1. abends fahren alle Rollläden runter
2. einer bleibt oben, weil sein Fenster offen ist – die Fahrt wird vorgemerkt
3. Fenster zu, der Rollladen holt die Fahrt nach
4. am nächsten Morgen fahren alle hoch – **... | fschubi/shutter_pilot | tests/test_drive_after_close_phase.py | .py | bc1211e4bda0caa1 | 8.13 | 17 |
"""Frostschutz – Anregung von Linos aus dem Forum.
Bei erfüllter Bedingung soll der Rollladen nicht ganz schließen, damit die
Lamellen nicht am Fensterbrett festfrieren. Dieselbe Mechanik wie die
abweichende Schließposition für laue Abende, nur mit umgekehrter
Vergleichsrichtung: Frost heißt "kälter als", nicht "wärme... | fschubi/shutter_pilot | tests/test_frost_protection.py | .py | 86a687ad15117860 | 8.13 | 17 |
"""Tests for per-shutter shading geometry, season window and partial close.
Forum feedback:
- Linos has rooms whose windows face different directions, so elevation and
azimuth must be settable per shutter, not just per area.
- Schlumperdix uses a season helper: 60000 lux means shading in summer, but
welcome warmth... | fschubi/shutter_pilot | tests/test_geometry_and_season.py | .py | a8b961e1edc4e0e3 | 8.13 | 17 |
"""Globaler Mindestabstand zwischen Fahrbefehlen (Wunsch von Linos).
Bei Funk (433 MHz, HmIP) verschlucken die Empfänger Befehle, die gleichzeitig
ankommen. Die Verzögerung je Bereich hilft dort nicht: jeder Bereich fährt in
einem eigenen Task, zwei Bereiche feuern also weiterhin im selben Moment.
Gedrosselt wird des... | fschubi/shutter_pilot | tests/test_min_drive_gap.py | .py | 3fd66a79c8f662fc | 8.13 | 17 |
"""Die Vorhersagesensoren heissen jetzt in der Sprache der Oberfläche.
Vorher waren sie hart deutsch – auch für einen englischen Nutzer. Genau daran
ist im Forum jemand gescheitert, der nach „forecast" gesucht hat.
Der heikle Teil daran ist nicht die Übersetzung, sondern dass bestehende
Installationen ihre Entitäts-I... | fschubi/shutter_pilot | tests/test_sensor_names.py | .py | 446ed7c44b32ebc7 | 8.13 | 17 |
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "cb-events >=10.0.0",
# "rich >=15.0.0",
# ]
# ///
"""Example script demonstrating event handling with cb-events.
Usage:
uv run examples/event_handling.py --events-url "https://eventsapi.chaturbate.com/events/<user>/<token>/"
Or, with CB_EVEN... | MountainGod2/cb-events | examples/event_handling.py | .py | 11a6aa2087a4907c | 7.48 | 8 |
"""Async HTTP client for polling the Chaturbate Events API."""
from __future__ import annotations
import asyncio
import logging
from contextlib import suppress
from enum import Enum, auto
from http import HTTPStatus
from typing import TYPE_CHECKING, Final
from urllib.parse import quote, unquote
from aiohttp import C... | MountainGod2/cb-events | src/cb_events/_client.py | .py | 1f80423f0b3dbf78 | 7.48 | 8 |
"""Client configuration model for EventClient.
Defines immutable settings for polling timeout, retries, and event
validation behavior.
"""
from __future__ import annotations
from typing import TYPE_CHECKING, ClassVar
from pydantic import BaseModel, ConfigDict, Field, model_validator
from ._exceptions import AUTH_E... | MountainGod2/cb-events | src/cb_events/_config.py | .py | c1378b88ef0e13a3 | 7.48 | 8 |
"""Exception hierarchy for cb_events.
Defines structured client and HTTP error types with optional status code and
truncated response text.
"""
from __future__ import annotations
from http import HTTPStatus
from typing import Final
from ._compat import override
from ._utils import truncate_text
AUTH_ERROR_STATUS_C... | MountainGod2/cb-events | src/cb_events/_exceptions.py | .py | c71eb238164716c6 | 7.48 | 8 |
"""Pydantic event models used by cb_events.
Models are immutable and accept camelCase API payloads while exposing
snake_case attributes.
"""
from __future__ import annotations
import logging
from enum import StrEnum
from typing import TYPE_CHECKING, ClassVar, TypeVar
from pydantic import (
BaseModel,
Config... | MountainGod2/cb-events | src/cb_events/_models.py | .py | 46b4ab85cedc202a | 7.48 | 8 |
"""Request execution and retry helpers for EventClient."""
from __future__ import annotations
import asyncio
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, NoReturn
import stamina
from aiohttp.client_exceptions import ClientError
from ._exceptions import EventsError, build_http_error
if... | MountainGod2/cb-events | src/cb_events/_request.py | .py | f2d34bc158343325 | 7.48 | 8 |
"""Async event routing primitives.
Provides decorator-based registration and dispatch for typed and wildcard
event handlers.
"""
from __future__ import annotations
import logging
from collections.abc import Awaitable, Callable
from inspect import iscoroutinefunction
from itertools import chain
from typing import TYP... | MountainGod2/cb-events | src/cb_events/_router.py | .py | 00aa6f9e285c6386 | 7.48 | 8 |
"""Shared utilities for cb-events."""
from __future__ import annotations
from enum import StrEnum
from typing import TYPE_CHECKING, Final
if TYPE_CHECKING:
from collections.abc import Collection
from yarl import URL
TRUNCATE_LENGTH: Final[int] = 200
"""Maximum response_text length kept on exceptions."""
... | MountainGod2/cb-events | src/cb_events/_utils.py | .py | 4bf83010d251a274 | 7.48 | 8 |
"""Core tests for client initialization, configuration and utils."""
import logging
from unittest.mock import AsyncMock
from urllib.parse import quote
import pytest
from aiohttp.client_exceptions import ClientError
from pydantic import ValidationError
from yarl import URL
from cb_events import AuthError, ClientConfi... | MountainGod2/cb-events | tests/client/test_client.py | .py | c98fb204fde96dae | 7.98 | 8 |
"""Internal branch coverage tests for EventClient internals."""
from __future__ import annotations
import asyncio
import pytest
from aioresponses import aioresponses
from cb_events import ClientConfig, EventClient, EventsError
from cb_events._client import TESTBED_URL
from tests.helpers import make_events_url
asy... | MountainGod2/cb-events | tests/client/test_client_internal.py | .py | b4fbfa97eb4f72de | 7.98 | 8 |
"""Validation tests for :class:`cb_events.ClientConfig`."""
import pytest
from pydantic import ValidationError
from cb_events import ClientConfig
def test_default_configuration() -> None:
"""Default config should have sensible retry and timeout values."""
config = ClientConfig()
assert config.timeout =... | MountainGod2/cb-events | tests/client/test_config.py | .py | 2463b61f019bac11 | 7.98 | 8 |
"""Test configuration and shared fixtures."""
import re
from collections.abc import AsyncIterator, Iterator
from contextlib import AbstractAsyncContextManager, asynccontextmanager
from typing import Protocol
from unittest.mock import AsyncMock
import pytest
import stamina
from aioresponses import aioresponses
from c... | MountainGod2/cb-events | tests/conftest.py | .py | 0bd6e95b7d85df5f | 7.98 | 8 |
"""Shared helper utilities for test modules."""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from cb_events import EventType
if TYPE_CHECKING:
from collections.abc import Iterable, Mapping
SAMPLE_EVENT_TYPES: tuple[EventType, EventType] = (EventType.TIP, EventType.USER_ENTER)
"""Two... | MountainGod2/cb-events | tests/helpers.py | .py | 48c752a0485574a5 | 7.98 | 8 |
"""Tests for exception hierarchy and messaging."""
import pytest
from cb_events import (
AuthError,
ClientRequestError,
EventsError,
HttpStatusError,
RateLimitError,
ServerError,
)
from cb_events._exceptions import build_http_error
from cb_events._utils import truncate_text
@pytest.mark.para... | MountainGod2/cb-events | tests/test_exceptions.py | .py | 452ea2f273bfaa3e | 7.98 | 8 |
"""End-to-end integration tests for the public surface."""
import asyncio
import os
import re
from importlib.metadata import version
import pytest
from aioresponses import aioresponses
from cb_events import AuthError, ClientConfig, Event, EventClient, EventType, Router, __version__
from tests.conftest import EventCl... | MountainGod2/cb-events | tests/test_integration.py | .py | 6148e84997300d08 | 7.98 | 8 |
"""Model validation tests for :mod:`cb_events.models`."""
import logging
from typing import Any
import pytest
from cb_events import Event, EventType, Message, RoomSubject, Tip, User
@pytest.mark.parametrize("event_type", EventType)
def test_event_type_mapping(event_type: EventType) -> None:
"""Every EventType ... | MountainGod2/cb-events | tests/test_models.py | .py | 928e56d10bc79953 | 7.98 | 8 |
"""Illustrative AI service with explicit engineering controls."""
import logging
from opentelemetry import trace
from pydantic import BaseModel, Field
from tenacity import retry, stop_after_attempt, wait_exponential
logger = logging.getLogger(__name__)
tracer = trace.get_tracer("ready-ai-project")
class Question(B... | deepikasidana89/enterprise-ai-engineering-framework | examples/ready-ai-project/app.py | .py | 41c910d3108d761b | 7.42 | 6 |
from __future__ import annotations
from pathlib import Path
from .models import RepositoryContext
from .exceptions import InvalidRepositoryPathError
class RepositoryLoader:
"""Load and validate a repository path and create a RepositoryContext.
Phase 1: validates path, verifies directory, derives project na... | deepikasidana89/enterprise-ai-engineering-framework | src/earf/repository.py | .py | 020bdbc8b0440860 | 7.42 | 6 |
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
"""This script sets up the vs-code settings for the Isaac Lab project.
This script merges the python.analysis.extraPaths from ... | shivam-sood00/Gurukul | .vscode/tools/setup_vscode.py | .py | f6074d90f8df4425 | 7.5 | 9 |
"""Script to play a checkpoint if an RL agent from CusRL."""
"""Launch Isaac Sim Simulator first."""
import argparse
import os
import sys
from isaaclab.app import AppLauncher
# add argparse arguments
parser = argparse.ArgumentParser(description="Evaluate an RL agent with CusRL.")
parser.add_argument("--video", acti... | shivam-sood00/Gurukul | scripts/reinforcement_learning/cusrl/play.py | .py | 434d1b3393f608b3 | 7.5 | 9 |
"""Script to train RL agent with CusRL."""
"""Launch Isaac Sim Simulator first."""
import argparse
import os
import re
import sys
from isaaclab.app import AppLauncher
# local imports
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
# add argparse arguments
parser = argparse.ArgumentP... | shivam-sood00/Gurukul | scripts/reinforcement_learning/cusrl/train.py | .py | 8bd6d65d261d8508 | 7.5 | 9 |
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import annotations
import argparse
import random
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ... | shivam-sood00/Gurukul | scripts/reinforcement_learning/rsl_rl/cli_args.py | .py | 0f6d985abc187cc6 | 7.5 | 9 |
from __future__ import annotations
from contact_trail_runner import ContactTrailOnPolicyRunner
class RealTeacherOnPolicyRunner(ContactTrailOnPolicyRunner):
"""On-policy runner that forwards REAL policy attention metrics to the active logger."""
def _log_contact_trail_metrics(self, iteration: int) -> None:
... | shivam-sood00/Gurukul | scripts/reinforcement_learning/rsl_rl/real_teacher_runner.py | .py | 9a59784158b5ddad | 7.5 | 9 |
"""This script demonstrates how to use the interactive scene interface to setup a scene with multiple prims.
.. code-block:: bash
# Usage
python replay_npz.py -f path_to_motion.npz
"""
"""Launch Isaac Sim Simulator first."""
import argparse
import numpy as np
import torch
from isaaclab.app import AppLaunc... | shivam-sood00/Gurukul | scripts/tools/beyondmimic/replay_npz.py | .py | cec02f150ea5c4d1 | 7.5 | 9 |
"""Candidate interface template — the one clean, swappable boundary.
ADAPT: rename `Candidate`, set the method(s) to YOUR harness surface (a retriever, summarizer,
context assembler, memory system...). Keep it small (1-4 methods) and pure where possible, so two
candidates are directly comparable. The proposer rewrites... | gabrielmoreira/agent-skills-mirror | mirrors/repos/001TMF@harness-forge/skills/meta-harness/assets/candidate_base-template.py | .py | 167d82d18977fe8f | 7.63 | 17 |
"""$0 deterministic scorer template — the inner loop.
ADAPT: load_corpus() + score_quality() are YOUR domain. The contract the outer loop depends on:
this prints/writes a quality (0..1, higher better), a cost (lower better), and a min_quality
(worst record — used for the do-no-harm floor).
THE CARDINAL RULE: score_qu... | gabrielmoreira/agent-skills-mirror | mirrors/repos/001TMF@harness-forge/skills/meta-harness/assets/scorer-template.py | .py | 291c780889144a0c | 7.63 | 17 |
"""Deterministic floor-respecting Pareto frontier over a Meta-Harness run log.
Reuse this instead of re-implementing the frontier each search (especially in skill+/loop mode).
The convention matches the templates: quality is maximized, cost is minimized, and any candidate
whose worst-record quality (`min_quality`) is ... | gabrielmoreira/agent-skills-mirror | mirrors/repos/001TMF@harness-forge/skills/meta-harness/scripts/pareto.py | .py | ba7038aee1ac256e | 7.63 | 17 |
#!/usr/bin/env python3
"""Draw the containers that are ACTUALLY running from `docker inspect` output.
Where composeimports.py reads the *declared* stack (compose file), this reads
the *live* one: pipe `docker inspect` of the running containers and it maps the
real topology — every container, the user networks they are... | gabrielmoreira/agent-skills-mirror | mirrors/repos/Agents365-ai@drawio-skill/skills/drawio-skill/scripts/dockerimports.py | .py | 7a06bcc73f754b01 | 7.63 | 17 |
#!/usr/bin/env python3
"""Convert a .drawio into Mermaid flowchart text (diagrams-as-code).
The other reverse tool, `explain.py`, turns a diagram into prose; this turns it
into a **Mermaid `flowchart`** you can paste into a Markdown file and have
GitHub / GitLab / docs render natively — handy when you want the diagram... | gabrielmoreira/agent-skills-mirror | mirrors/repos/Agents365-ai@drawio-skill/skills/drawio-skill/scripts/drawio2mermaid.py | .py | c6bc00fd9d3e7f3f | 7.63 | 17 |
"""PDF Table Downloader for the WizzAir AYCF Availability table."""
import contextlib
import tempfile
from datetime import datetime
from pathlib import Path
import typer
import fetch as fetchlib
import parse as parselib
DEFAULT_AVAILABILITY_URL = "https://multipass.wizzair.com/aycf-availability.pdf"
app = typer.Typ... | markvincevarga/wizzair-aycf-availability | main.py | .py | 51e7b4bff2de96f2 | 7.5 | 9 |
from collections.abc import Generator
from typing import Optional, Union
from dify_plugin.entities.model.llm import LLMMode, LLMResult
from dify_plugin.entities.model.message import PromptMessage, PromptMessageTool
from yarl import URL
from dify_plugin import OAICompatLargeLanguageModel
class QiniuLargeLanguageModel(... | qiniu/dify-plugin | ai-models-provider/models/llm/llm.py | .py | 31533381d9ed53c8 | 7.42 | 6 |
import logging
from dify_plugin.entities.model import ModelType
from dify_plugin.errors.model import CredentialsValidateFailedError
from dify_plugin import ModelProvider
logger = logging.getLogger(__name__)
class QiniuProvider(ModelProvider):
"""
七牛云 AI 模型提供商实现类
提供七牛云 AI 模型的接入能力,支持多种大语言模型
"""
... | qiniu/dify-plugin | ai-models-provider/provider/qiniu_ai.py | .py | 9c07542904ca5ab5 | 7.42 | 6 |
import logging
from typing import Any
from dify_plugin import ToolProvider
from dify_plugin.errors.tool import ToolProviderCredentialValidationError
from qiniu import Auth, BucketManager
logger = logging.getLogger(__name__)
class QiniuProvider(ToolProvider):
"""
七牛云工具提供商实现类
提供七牛云存储工具能力,支持文件上传功能
... | qiniu/dify-plugin | storage-tools/provider/qiniu_tools.py | .py | 289037ecb19a5a63 | 7.42 | 6 |
import json
import logging
from collections.abc import Generator
from typing import Any
from qiniu import Auth, put_data, BucketManager
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
from dify_plugin.errors.tool import ToolProviderCredentialValidationError
logger = logging.getLog... | qiniu/dify-plugin | storage-tools/tools/file_upload.py | .py | 448776aa158f4227 | 7.42 | 6 |
import json
import logging
import requests
from collections.abc import Generator
from typing import Any
from qiniu import Auth
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
from dify_plugin.errors.tool import ToolProviderCredentialValidationError
logger = logging.getLogger(__nam... | qiniu/dify-plugin | storage-tools/tools/get_file_content.py | .py | ee3ea75674220e0a | 7.42 | 6 |
import json
import logging
from collections.abc import Generator
from typing import Any
from qiniu import Auth, BucketManager
from dify_plugin import Tool
from dify_plugin.entities.tool import ToolInvokeMessage
from dify_plugin.errors.tool import ToolProviderCredentialValidationError
logger = logging.getLogger(__name... | qiniu/dify-plugin | storage-tools/tools/list_buckets.py | .py | bc6eeedac51c0965 | 7.42 | 6 |
"""Shared helpers for the MoLight integration."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.components.light import (
ATTR_SUPPORTED_COLOR_MODES,
COLOR_MODES_BRIGHTNESS,
COLOR_MODES_COLOR,
ColorMode,
LightEntityFeature,
)
from homeassistant.const impor... | jharris4/molight | custom_components/molight/helpers.py | .py | 72f217db5565c50a | 7.57 | 13 |
"""Virtual Remote — drive lights from remote-control button event entities.
A Virtual Remote config entry's runtime lives here rather than in an entity
(its only entity is the diagnostic Last Action sensor, see sensor.py). It
subscribes to the state changes of the `event` entities Home Assistant
exposes per physical b... | jharris4/molight | custom_components/molight/remote.py | .py | 18d312eed3f84ab9 | 7.57 | 13 |
"""Diagnostic Last Action sensor for MoLight Virtual Remote entries.
Every Virtual Remote entry gets one "<name> Last Action" sensor. Its state is
the last action the remote executed (turn_on, brightness_down, preset_1, ...),
with the source button, the resolved click kind, the raw event_type, and the
time as attribut... | jharris4/molight | custom_components/molight/sensor.py | .py | 2ce732e6734616e1 | 7.57 | 13 |
"""Companion Auto-off switch for MoLight Virtual Lights.
Every Virtual Light config entry gets one "<name> Auto-off" switch. ON (the
default) means normal behavior; OFF suspends all of the light's automatic
turn-offs — exactly like a configured keep-on entity being on — until it is
turned back on. Turn-ons and manual ... | jharris4/molight | custom_components/molight/switch.py | .py | 9583fb10919feb7c | 7.57 | 13 |
#!/usr/bin/env python3
"""Print the pip requirements Home Assistant would lazy-install at runtime.
Walks the manifest.json dependency closure of the given integration domains
(default: default_config) and prints each integration's pinned `requirements`,
one per line — suitable for `pip install -r`. Pre-installing thes... | jharris4/molight | scripts/gather_ha_requirements.py | .py | 216cf7d7b23f5bf2 | 7.57 | 13 |
"""Persistent simulated entities for live MoLight acceptance tests."""
from __future__ import annotations
import logging
from copy import deepcopy
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import Hom... | jharris4/molight | tests/e2e/testbed/molight_testbed/__init__.py | .py | c188e931f303bc87 | 8.07 | 13 |
"""Simulated binary sensors for live MoLight acceptance tests."""
from __future__ import annotations
from functools import partial
from typing import Any
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
fr... | jharris4/molight | tests/e2e/testbed/molight_testbed/binary_sensor.py | .py | 6feea24e8da6552c | 8.07 | 13 |
"""Config flow for the MoLight end-to-end testbed."""
from __future__ import annotations
from typing import Any
from homeassistant import config_entries
from .const import DOMAIN
class TestbedConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Create the singleton testbed config entry."""
VERSION = ... | jharris4/molight | tests/e2e/testbed/molight_testbed/config_flow.py | .py | a583b3b369bcc212 | 8.07 | 13 |
"""Shared entity implementation for the MoLight testbed."""
from __future__ import annotations
from typing import Any
from homeassistant.helpers.entity import Entity
from . import TestbedController
from .const import DOMAIN
class TestbedEntity(Entity):
"""Base for a stateful entity controlled by the acceptanc... | jharris4/molight | tests/e2e/testbed/molight_testbed/entity.py | .py | 49d84b5ec9e07da6 | 8.07 | 13 |
"""Simulated event entities for live MoLight acceptance tests."""
from __future__ import annotations
from typing import Any
from homeassistant.components.event import EventDeviceClass, EventEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.hel... | jharris4/molight | tests/e2e/testbed/molight_testbed/event.py | .py | 20b5479c225ce578 | 8.07 | 13 |
"""Simulated lights for live MoLight acceptance tests."""
from __future__ import annotations
from copy import deepcopy
from functools import partial
from typing import Any
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP_KELVIN,
ATTR_RGB_COLOR,
ATTR_TRANSITION,
ATTR_X... | jharris4/molight | tests/e2e/testbed/molight_testbed/light.py | .py | 202f216126b54e18 | 8.07 | 13 |
"""Simulated selects for live MoLight acceptance tests."""
from __future__ import annotations
from typing import Any
from homeassistant.components.select import SelectEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform im... | jharris4/molight | tests/e2e/testbed/molight_testbed/select.py | .py | 0858f1f32c91d8d5 | 8.07 | 13 |
"""Simulated sensors for live MoLight acceptance tests."""
from __future__ import annotations
from typing import Any
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import LIGHT_LUX
from homeassistant.core impor... | jharris4/molight | tests/e2e/testbed/molight_testbed/sensor.py | .py | 967a2b980a5bf957 | 8.07 | 13 |
"""Entry lifecycle tests: setup/unload plumbing and per-type platform guards."""
from __future__ import annotations
from collections import Counter
from typing import TYPE_CHECKING
from unittest.mock import AsyncMock, patch
import pytest
from homeassistant.helpers import entity_registry as er
from pytest_homeassista... | jharris4/molight | tests/test_init.py | .py | 7facf7a9c66fe8af | 8.07 | 13 |
"""Member writes under MoLight's own context are judged, not blindly ignored.
Home Assistant keeps a service call's context on the targeted entity for five
seconds, so a human change right after a MoLight command arrives under
MoLight's context. Only writes consistent with the command count as echoes.
"""
from __futu... | jharris4/molight | tests/test_light_echo.py | .py | 537c6d939c812736 | 7.07 | 13 |
"""Tests for adopting already-active occupancy into an on light.
Occupancy normally takes the light over on its own rising edge. When it is
already on while the light turns on (manual/physical after a manual off, or
suppressed earlier by bright/window), or when the gate suppressing it lifts
(illuminance turning dark, ... | jharris4/molight | tests/test_light_occupancy_adoption.py | .py | d91f36bec05d0038 | 7.07 | 13 |
"""Options-edit (entry reload) tests for the MoLight Virtual Light.
Editing a virtual light's options reloads its config entry, which tears the
entity down and re-creates it mid-flight. These tests pin what happens when
that reload lands while the light is in each running state: the re-created
entity re-seeds from the... | jharris4/molight | tests/test_light_options.py | .py | e293680c11169958 | 7.07 | 13 |
"""Tests for Virtual Light turn-on selections."""
from __future__ import annotations
from datetime import timedelta
from typing import TYPE_CHECKING, Any
import pytest
from homeassistant.const import EVENT_CALL_SERVICE
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
fr... | jharris4/molight | tests/test_light_selection.py | .py | 0d4e0f10f9459b6a | 7.07 | 13 |
"""Tests for the release preparation script."""
from __future__ import annotations
import json
import shutil
import subprocess
import sys
from pathlib import Path
import pytest
PROJECT_ROOT = Path(__file__).resolve().parent.parent
RELEASE_SCRIPT = PROJECT_ROOT / "scripts" / "release"
GIT = shutil.which("git")
def... | jharris4/molight | tests/test_release.py | .py | 21ed236b930d940e | 8.07 | 13 |
#!/usr/bin/env python3
"""atlas drift detection — range resolution, covers matching, work packets.
A doc is stale iff a file matching one of its `covers` globs changed between its
OWN frontmatter `code_rev` and the effective "now" ref (`head_ref`, "HEAD" unless
overridden). Detection is O(changed files x docs) with no... | Atom-oh/oh-my-cloud-skills | plugins/atlas/skills/atlas/scripts/atlas_drift.py | .py | 91a80c40a437d732 | 7.62 | 16 |
#!/usr/bin/env python3
"""atlas doc model, validator, and INDEX.md generator.
The atlas wiki is a directory of markdown pages, each carrying YAML frontmatter
(title / description / covers / related / code_rev / updated). This module is the
single owner of that model: atlas_drift.py and atlas_sync.py import it and must... | Atom-oh/oh-my-cloud-skills | plugins/atlas/skills/atlas/scripts/atlas_index.py | .py | c17965d52e539280 | 7.62 | 16 |
#!/usr/bin/env python3
"""Geometric QA for a .drawio diagram — the "is it clean enough to look like PPT?" gate.
`validate_drawio.py` checks that the XML is well-formed (no silent truncation).
This script checks the *layout* — the things a human designer fixes intuitively and
the LLM gets subtly wrong, which is what ma... | Atom-oh/oh-my-cloud-skills | plugins/aws-content-plugin/skills/architecture-diagram/scripts/lint_layout.py | .py | 265bba980fd24147 | 7.62 | 16 |
#!/usr/bin/env python3
"""Compute clean orthogonal edge waypoints for a .drawio file.
Messy, crossing arrows are the #1 reason AWS diagrams look bad. Auto-routing
(`orthogonalEdgeStyle` with no waypoints) cuts straight through sibling icons.
This helper computes explicit, channel-based orthogonal routes so parallel ed... | Atom-oh/oh-my-cloud-skills | plugins/aws-content-plugin/skills/architecture-diagram/scripts/route_edges.py | .py | a79c905c44c79084 | 7.62 | 16 |
#!/usr/bin/env python3
"""Snap every cell's position to the grid — mechanical alignment so the diagram
stops looking 1-5px "off".
The LLM hand-picks coordinates and lands a few pixels off; `lint_layout.py` *detects*
that drift, this script *fixes* it. Run it after writing the .drawio and before export:
write .dra... | Atom-oh/oh-my-cloud-skills | plugins/aws-content-plugin/skills/architecture-diagram/scripts/snap_grid.py | .py | cbd08c21859b4d53 | 7.62 | 16 |
"""SQLite schema definitions and migration helpers for the daydream archive index.
Centralises all DDL constants (CREATE TABLE, CREATE INDEX, UPSERT) and the
idempotent migration helpers that bring a live database up to the current
schema version. Imported exclusively by ``daydream.archive.index``; callers
outside tha... | existential-birds/daydream | daydream/archive/_schema.py | .py | 5061bd648002b750 | 7.66 | 20 |
"""Git metadata capture for archived runs.
Captures branch, commit SHA, remote URL, and repo slug from the target
directory at archive time. Each ``git_ops`` call is independent with a
5-second timeout so a single git failure doesn't block the others.
Exports:
GitContext: Dataclass holding captured git metadata.
... | existential-birds/daydream | daydream/archive/git_context.py | .py | c2ae5327c6ae5baf | 7.66 | 20 |
"""Opt-in HuggingFace dataset repo upload of daydream run bundles.
Resolves the 2-tier ``trajectory_hub_repo`` source (CLI flag -> env var) and
uploads a completed run bundle (``~/.daydream/archive/runs/<session_id>/``)
to a private HuggingFace dataset repo, one folder per run keyed by session id.
The target checkout'... | existential-birds/daydream | daydream/archive/hub.py | .py | 56807e13a73bf854 | 7.66 | 20 |
"""Per-phase pipeline state derivation for archived runs.
Derives per-phase terminal states (merge/fix/test) and the ``pipeline_status``
aggregate from existing deep artifacts + phase events — no new runtime
instrumentation. Separates pipeline outcome from archive finalization so a run
that merged-failed and never tes... | existential-birds/daydream | daydream/archive/pipeline.py | .py | 01eb0d61ee1f9cfd | 7.66 | 20 |
"""Executable provenance capture for archived runs.
Records the immutable Daydream executable that produced a run: version,
install source, resolved commit, dirty state, and opt-in container digest.
This lives in its own ``daydream.*`` namespace and is never conflated with
the target-repository ``git.*`` / ``code_cont... | existential-birds/daydream | daydream/archive/provenance.py | .py | 69ce131499ec742c | 7.66 | 20 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.