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 |
|---|---|---|---|---|---|---|
"""Free@Home CarbonMonoxideSensor Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class CarbonMonoxideSensor(Base):
"""Free@Home CarbonMonoxideSensor Class."""
_state_refresh_pairings: list[Pairing] ... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/carbon_monoxide_sensor.py | .py | dee28a6b5c08c558 | 7.48 | 8 |
"""Free@Home DesDoorOpenerActuator Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class DesDoorOpenerActuator(Base):
"""Free@Home DesDoorOpenerActuator Class."""
_state_refresh_pairings: list[Pairin... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/des_door_opener_actuator.py | .py | 14e8e910313900a0 | 7.48 | 8 |
"""Free@Home DesDoorRingingSensor Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class DesDoorRingingSensor(Base):
"""Free@Home DesDoorRingingSensor Class."""
_state_refresh_pairings: list[Pairing] ... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/des_door_ringing_sensor.py | .py | ec359920e07c305f | 7.48 | 8 |
"""Free@Home ForceOnOffSensor Class."""
import enum
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class ForceOnOffSensorState(enum.Enum):
"""An Enum class for the force on off sensor states."""
unknown = Non... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/force_on_off_sensor.py | .py | c173ec388b03fc2d | 7.48 | 8 |
"""Free@Home MovementDetector and BlockableMovementDetector Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class MovementDetector(Base):
"""Free@Home MovementDetector Class."""
_state_refresh_pairin... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/movement_detector.py | .py | 56896fffe59f82a4 | 7.48 | 8 |
"""Free@Home RainSensor Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class RainSensor(Base):
"""Free@Home RainSensor Class."""
_state_refresh_pairings: list[Pairing] = [
Pairing.AL_RAIN_AL... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/rain_sensor.py | .py | d0a461379ce4d4f4 | 7.48 | 8 |
"""Free@Home RoomTemperatureController Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class RoomTemperatureController(Base):
"""Free@Home RoomTemperatureController Class."""
_state_refresh_pairings:... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/room_temperature_controller.py | .py | 7c3d10fc69481fc1 | 7.48 | 8 |
"""Free@Home SmokeDetector Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class SmokeDetector(Base):
"""Free@Home SmokeDetector Class."""
_state_refresh_pairings: list[Pairing] = [
Pairing.A... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/smoke_detector.py | .py | bcc476bb4d2e0ef6 | 7.48 | 8 |
"""Free@Home TemperatureSensor Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class TemperatureSensor(Base):
"""Free@Home TemperatureSensor Class."""
_state_refresh_pairings: list[Pairing] = [
... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/temperature_sensor.py | .py | 67d2ce110970697c | 7.48 | 8 |
"""Free@Home Trigger Class."""
import logging
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
_LOGGER = logging.getLogger(__name__)
class Trigger(Base):
"""Free@Home Trigger Class."""
def __init__(
se... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/trigger.py | .py | aadfd84f35efd7f2 | 7.48 | 8 |
"""Free@Home Virtual BrightnessSensor Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualBrightnessSensor(Base):
"""Free@Home Virtual BrightnessSensor Class."""
_state_refresh_pairings: ... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_brightness_sensor.py | .py | 55f025a624eeeb74 | 7.48 | 8 |
"""Free@Home Virtual EnergyInverter Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualEnergyInverter(Base):
"""Free@Home Virtual EnergyInverter Class."""
_state_refresh_pairings: list[P... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_energy_inverter.py | .py | 9798dcfa5270baea | 7.48 | 8 |
"""Free@Home Virtual RainSensor Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualRainSensor(Base):
"""Free@Home Virtual RainSensor Class."""
_state_refresh_pairings: list[Pairing] = [
... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_rain_sensor.py | .py | 48d8ba3beb974ba7 | 7.48 | 8 |
"""Free@Home Virtual RoomTemperatureController."""
import logging
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
_LOGGER = logging.getLogger(__name__)
class VirtualRoomTemperatureController(Base):
"""Free@Home... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_room_temperature_controller.py | .py | 14541ace5c48a189 | 7.48 | 8 |
"""Free@Home Virtual SwitchActuator class."""
# import enum
import logging
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
_LOGGER = logging.getLogger(__name__)
class VirtualSwitchActuator(Base):
"""Free@Home V... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_switch_actuator.py | .py | eb92fc5dd4a00da8 | 7.48 | 8 |
"""Free@Home Virtual TemperatureSensor Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualTemperatureSensor(Base):
"""Free@Home Virtual TemperatureSensor Class."""
_state_refresh_pairing... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_temperature_sensor.py | .py | 8b8763b7daf6ff64 | 7.48 | 8 |
"""Free@Home Virtual Trigger class."""
import logging
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..trigger import Trigger
if TYPE_CHECKING:
from ...device import Device
_LOGGER = logging.getLogger(__name__)
class VirtualTrigger(Trigger):
"""Free@Home Virtual Trigger Clas... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_trigger.py | .py | 2afa71f80e4f46be | 7.48 | 8 |
"""Free@Home Virtual WindSensor Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualWindSensor(Base):
"""Free@Home Virtual WindSensor Class."""
_state_refresh_pairings: list[Pairing] = [
... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_wind_sensor.py | .py | 090a2221f29f37bc | 7.48 | 8 |
"""Free@Home Virtual WindowDoorSensor Class."""
from typing import TYPE_CHECKING, Any
from ...bin.pairing import Pairing
from ..base import Base
if TYPE_CHECKING:
from ...device import Device
class VirtualWindowDoorSensor(Base):
"""Free@Home Virtual WindowDoorSensor Class."""
_state_refresh_pairings: ... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/virtual/virtual_window_door_sensor.py | .py | 47ca0f8b4c91924b | 7.48 | 8 |
"""Free@Home WindSensor Class."""
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class WindSensor(Base):
"""Free@Home WindSensor Class."""
_state_refresh_pairings: list[Pairing] = [
Pairing.AL_WIND_SP... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/wind_sensor.py | .py | 5e708d7d8be15bd6 | 7.48 | 8 |
"""Free@Home WindowDoorSensor Class."""
import enum
from typing import TYPE_CHECKING, Any
from ..bin.pairing import Pairing
from .base import Base
if TYPE_CHECKING:
from ..device import Device
class WindowDoorSensorPosition(enum.Enum):
"""
An Enum class for window/door sensor possible positions.
H... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/channels/window_door_sensor.py | .py | 79f8433469bb048b | 7.48 | 8 |
"""ABB-Free@Home Device class."""
from typing import Any
from .api import FreeAtHomeApi
from .bin.function import Function
from .bin.interface import Interface
from .channels.base import Base
from .const import FUNCTION_CHANNEL_MAPPING, FUNCTION_VIRTUAL_CHANNEL_MAPPING
from .floorplan import Floorplan
class Device:... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/device.py | .py | caf4a721325c9346 | 7.48 | 8 |
"""ABB-Free@Home FloorPlan class for managing floor and room data."""
class Floorplan:
"""Manages floor plan data for Free@Home devices and channels."""
def __init__(self, floorplan_data: dict[str, dict] | None = None) -> None:
"""Initialize the FloorPlan class."""
self._floors: dict[str, dic... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/floorplan.py | .py | 0c40205b6600b80d | 7.48 | 8 |
"""ABB-Free@Home wrapper for interacting with the ABB-free@home API."""
from .api import FreeAtHomeApi
from .bin.interface import Interface
from .channels.base import Base
from .device import Device
from .floorplan import Floorplan
class FreeAtHome:
"""Provides a class for interacting with the ABB-free@home API.... | kingsleyadam/local-abbfreeathome | src/abbfreeathome/freeathome.py | .py | b9a8adca778b3a71 | 7.48 | 8 |
"""Shared test fixtures for the ABB-Free@Home test suite."""
from inspect import signature
from unittest.mock import Mock
import aiohttp.client_reqrep
import pytest
from src.abbfreeathome.floorplan import Floorplan
@pytest.fixture(scope="session", autouse=True)
def _patch_aiohttp_clientresponse_stream_writer():
... | kingsleyadam/local-abbfreeathome | tests/conftest.py | .py | 700efc5d0a10dc1e | 7.98 | 8 |
from __future__ import annotations
from abc import abstractmethod
from collections.abc import Awaitable, Callable
from contextlib import nullcontext
from typing import TYPE_CHECKING, Any, Protocol, runtime_checkable
from cq.middlewares.contextlib import AsyncContextManagerMiddleware
if TYPE_CHECKING: # pragma: no c... | 100nm/python-cq | cq/_core/routing/di.py | .py | bea1ef0d3bd73511 | 7.56 | 12 |
from typing import List
import attr
import hou
from ayon_houdini.api.lib import get_color_management_preferences
from ayon_core.pipeline.colorspace import (
get_display_view_colorspace_name,
get_ocio_config_colorspaces
)
@attr.s
class LayerMetadata(object):
"""Data class for Render Layer metadata."""
... | ynput/ayon-houdini | client/ayon_houdini/api/colorspace.py | .py | 34f5577a033bdd03 | 7.64 | 18 |
import os
import re
import logging
import platform
from ayon_core.settings import get_project_settings
from ayon_core.pipeline import get_current_project_name
from ayon_core.lib import StringTemplate
import hou
from .lib import get_current_context_template_data_with_entity_attrs
log = logging.getLogger("ayon_houdi... | ynput/ayon-houdini | client/ayon_houdini/api/shelves.py | .py | bf5bc8104388053c | 7.64 | 18 |
"""Houdini-specific USD Library functions."""
import contextlib
import logging
import json
import itertools
from typing import List
import hou
import ayon_api
from pxr import Usd, Sdf, Tf, Vt, UsdRender
log = logging.getLogger(__name__)
# Expression to take last part of the folder path as default prim, but if
# it ... | ynput/ayon-houdini | client/ayon_houdini/api/usd.py | .py | adc765b7face6271 | 7.64 | 18 |
from ayon_applications import PreLaunchHook, LaunchTypes
class SetDefaultDisplayView(PreLaunchHook):
"""Set default view and default display for houdini via OpenColorIO.
Houdini's defaultDisplay and defaultView are set by
setting 'OCIO_ACTIVE_DISPLAYS' and 'OCIO_ACTIVE_VIEWS'
environment variables re... | ynput/ayon-houdini | client/ayon_houdini/hooks/set_default_display_and_view.py | .py | b315be202a07814a | 7.64 | 18 |
from ayon_applications import PreLaunchHook, LaunchTypes
class SetPath(PreLaunchHook):
"""Set current dir to workdir.
Hook `GlobalHostDataHook` must be executed before this hook.
"""
app_groups = {"houdini"}
launch_types = {LaunchTypes.local}
def execute(self):
workdir = self.launch_... | ynput/ayon-houdini | client/ayon_houdini/hooks/set_paths.py | .py | 0a9f907f124d34fc | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Converter for legacy Houdini products."""
from ayon_core.pipeline.create.creator_plugins import ProductConvertorPlugin
from ayon_houdini.api.lib import imprint
class HoudiniLegacyConvertor(ProductConvertorPlugin):
"""Find and convert any legacy products in the scene.
This Converter... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/convert_legacy.py | .py | 01f73832c0498233 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating alembic camera products."""
from ayon_houdini.api import plugin
from ayon_core.pipeline import CreatorError
from ayon_core.lib import EnumDef
import hou
class CreateAlembicCamera(plugin.HoudiniCreator):
"""Single baked camera from Alembic ROP"""
identif... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_alembic_camera.py | .py | 3671b8e791319e8d | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating Arnold ASS files."""
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef
class CreateArnoldAss(plugin.HoudiniCreator):
"""Export Arnold .ass archive"""
identifier = "io.openpype.creators.houdini.ass"
label = "Arnold ASS"
product... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_arnold_ass.py | .py | 8985b1bd84a58d8d | 7.64 | 18 |
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef, BoolDef
class CreateArnoldRop(plugin.RenderLegacyProductTypeCreator):
"""Arnold ROP"""
identifier = "io.openpype.creators.houdini.arnold_rop"
label = "Arnold ROP"
product_base_type = "render"
product_type = product_base_type
... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_arnold_rop.py | .py | 2b19dccb4f11f4ca | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating pointcache bgeo files."""
import inspect
from ayon_houdini.api import plugin
from ayon_core.pipeline import CreatorError
import hou
from ayon_core.lib import EnumDef
class CreateBGEO(plugin.HoudiniCreator):
"""BGEO pointcache creator."""
identifier = "io.... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_bgeo.py | .py | 6aa4e111f53ec927 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating composite sequences."""
from ayon_houdini.api import plugin
from ayon_core.pipeline import CreatorError
from ayon_core.lib import EnumDef
import hou
class CreateCompositeSequence(plugin.HoudiniCreator):
"""Composite ROP to Image Sequence"""
identifier =... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_composite.py | .py | 40d0b1044bb7bdba | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating composite sequences."""
from ayon_houdini.api import plugin
from ayon_core.pipeline import CreatorError
from ayon_core.lib import EnumDef
import hou
class CreateCopernicusROP(plugin.HoudiniCreator):
"""Copernicus ROP to Image Sequence"""
identifier = "i... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_copernicus.py | .py | 53e1780a35d8eeda | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating publishable Houdini Digital Assets."""
import hou
import ayon_api
from ayon_core.pipeline import (
CreatorError,
get_current_project_name
)
from ayon_core.lib import (
get_ayon_username,
BoolDef
)
from ayon_houdini.api import plugin
from ayon_houd... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_hda.py | .py | 1af5c2555eeae131 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin to create Karma ROP."""
from ayon_houdini.api import plugin
from ayon_core.lib import BoolDef, EnumDef, NumberDef
class CreateKarmaROP(plugin.RenderLegacyProductTypeCreator):
"""Karma ROP"""
identifier = "io.openpype.creators.houdini.karma_rop"
label = "Karma ROP"... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_karma_rop.py | .py | d6c8b3b03c186f6c | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin to create Mantra ROP."""
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef, BoolDef
class CreateMantraROP(plugin.RenderLegacyProductTypeCreator):
"""Mantra ROP"""
identifier = "io.openpype.creators.houdini.mantra_rop"
label = "Mantra ROP"
p... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_mantra_rop.py | .py | b8cabfc1658d3a39 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating Model product type.
Note:
Currently, This creator plugin is the same as 'create_pointcache.py'
But renaming the product type to 'model'.
It's purpose to support
Maya (load/publish model from maya to/from houdini).
It's considered to support m... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_model.py | .py | c9cf5b899ad8141d | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating pointcache alembics."""
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef
import hou
class CreatePointCache(plugin.HoudiniCreator):
"""Alembic ROP to pointcache"""
identifier = "io.openpype.creators.houdini.pointcache"
label = "P... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_pointcache.py | .py | fb120238a1ba9330 | 7.64 | 18 |
import inspect
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef
import hou
class CreatePRTPointCloud(plugin.HoudiniCreator):
"""PRT pointcloud Creator
Create point cloud instances for publishing with the PRT representation.
It requires the PRT_ROPDriver to be installed, which can b... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_pointcloud_prt.py | .py | 3d318f99c1b9f190 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating Redshift proxies."""
from ayon_houdini.api import plugin
import hou
from ayon_core.lib import EnumDef
class CreateRedshiftProxy(plugin.HoudiniCreator):
"""Redshift Proxy"""
identifier = "io.openpype.creators.houdini.redshiftproxy"
label = "Redshift Pr... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_redshift_proxy.py | .py | fd1f53d151c10345 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin to create Redshift ROP."""
import hou # noqa
from ayon_core.pipeline import CreatorError
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef, BoolDef
class CreateRedshiftROP(plugin.RenderLegacyProductTypeCreator):
"""Redshift ROP"""
identifier = "... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_redshift_rop.py | .py | c9fa64d995fb5ad9 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating USDs."""
import inspect
from ayon_houdini.api import plugin
from ayon_houdini.api.usd import DEFAULT_PRIM_EXPRESSION
from ayon_core.lib import EnumDef
import hou
class CreateUSD(plugin.HoudiniCreator):
"""Universal Scene Description"""
identifier = "io.... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_usd.py | .py | 38b079e0df3609c3 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating USD renders."""
from ayon_houdini.api import plugin
from ayon_core.lib import BoolDef, EnumDef
import hou
def get_usd_rop_renderers():
"""Return all available renderers supported by USD Render ROP.
Note that the USD Render ROP does not include all Hydra ... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_usdrender.py | .py | 54c7eb6da9bbbac1 | 7.64 | 18 |
# -*- coding: utf-8 -*-
"""Creator plugin for creating VDB Caches."""
from ayon_houdini.api import plugin
from ayon_core.lib import EnumDef
import hou
class CreateVDBCache(plugin.HoudiniCreator):
"""OpenVDB from Geometry ROP"""
identifier = "io.openpype.creators.houdini.vdbcache"
name = "vbdcache"
la... | ynput/ayon-houdini | client/ayon_houdini/plugins/create/create_vbd_cache.py | .py | 6a005acc04200531 | 7.64 | 18 |
from ayon_core.pipeline import InventoryAction
import hou
class SelectInScene(InventoryAction):
"""Select nodes in the scene from selected containers in scene inventory"""
label = "Select in scene"
icon = "search"
color = "#888888"
order = 99
@staticmethod
def is_compatible(container) -... | ynput/ayon-houdini | client/ayon_houdini/plugins/inventory/select_containers.py | .py | dd207404d9e10aba | 7.64 | 18 |
import os
import hou
from ayon_houdini.api import (
pipeline,
plugin,
lib
)
class AbcLoader(plugin.HoudiniLoader):
"""Load Alembic"""
product_base_types = {"model", "animation", "pointcache", "gpuCache"}
product_types = product_base_types
label = "Load Alembic"
representations = {"*... | ynput/ayon-houdini | client/ayon_houdini/plugins/load/load_alembic.py | .py | 01d2f86355858324 | 7.64 | 18 |
import hou
from ayon_houdini.api import (
pipeline,
plugin,
lib,
)
class AssLoader(plugin.HoudiniLoader):
"""Load .ass with Arnold Procedural"""
product_base_types = {"ass"}
product_types = product_base_types
label = "Load Arnold Procedural"
representations = {"*"}
extensions = {... | ynput/ayon-houdini | client/ayon_houdini/plugins/load/load_ass.py | .py | b4c65911c57e756d | 7.64 | 18 |
from ayon_core.pipeline import load
from ayon_houdini.api.lib import find_active_network
from ayon_houdini.api import hda_utils
import hou
class LOPLoadAssetLoader(load.LoaderPlugin):
"""Load reference/payload into Solaris using AYON `lop_import` LOP"""
product_base_types = {"*"}
product_types = product... | ynput/ayon-houdini | client/ayon_houdini/plugins/load/load_asset_lop.py | .py | e5b2a0d5429afd96 | 7.64 | 18 |
# -*- coding: utf-8 -*-
import hou
from ayon_houdini.api import (
pipeline,
plugin,
lib
)
class BgeoLoader(plugin.HoudiniLoader):
"""Load bgeo files to Houdini."""
label = "Load bgeo"
product_base_types = {"*"}
product_types = product_base_types
representations = {"*"}
extensions... | ynput/ayon-houdini | client/ayon_houdini/plugins/load/load_bgeo.py | .py | eb6f8b28258cde17 | 7.64 | 18 |
from typing import Optional
from aiogram import Bot
class BotSideEffectHandler:
"""SideEffectHandler that works via Bot + chat_id (no aiogram Message needed).
Used by SchedulerService for scheduled task execution where there is
no incoming Telegram message to reply to.
"""
def __init__(self, bo... | ijwfly/chatgpt-tg | app/bot/bot_side_effects.py | .py | 3d7362ff26989728 | 7.62 | 16 |
from aiogram import types
CANCELLATION_PREFIX = 'cancel'
class CancellationToken:
"""
Class that represents a cancellation token
"""
def __init__(self):
self.is_canceled = False
def __call__(self):
return self.is_canceled
def cancel(self):
self.is_canceled = True
... | ijwfly/chatgpt-tg | app/bot/cancellation_manager.py | .py | 53affdcedae71a8b | 7.62 | 16 |
import asyncio
import logging
from datetime import datetime, timezone
from croniter import croniter
from aiogram import Bot
import settings
from app.bot.bot_side_effects import BotSideEffectHandler
from app.context.context_manager import build_context_manager
from app.functions.agent_tools import get_user_timezone
f... | ijwfly/chatgpt-tg | app/bot/scheduler_service.py | .py | 429928acc7c89ba3 | 7.62 | 16 |
import logging
from datetime import datetime
from enum import Enum
from typing import Optional
from aiogram.types import Message
from aiogram.utils.exceptions import BadRequest
from app.bot.utils import send_telegram_message, edit_telegram_message
logger = logging.getLogger(__name__)
class ServiceState(str, Enum)... | ijwfly/chatgpt-tg | app/bot/service_message.py | .py | 6403bf908dffff2d | 7.62 | 16 |
import contextvars
import logging
from dataclasses import dataclass
from typing import Optional, List
import pydantic
import pytz
from pydantic import Field
import settings
from app.functions.base import OpenAIFunction, OpenAIFunctionParams
from app.runtime.background_task_manager import BackgroundTaskManager
from ap... | ijwfly/chatgpt-tg | app/functions/agent_tools.py | .py | 6e57ff93bde1e7cd | 7.62 | 16 |
from typing import Optional
import pydantic
from abc import ABC, abstractmethod
from app.runtime.side_effects import SideEffectHandler
class OpenAIFunctionParams(pydantic.BaseModel):
pass
class OpenAIFunction(ABC):
PARAMS_SCHEMA = OpenAIFunctionParams
def __init__(self, user, db, context_manager, sid... | ijwfly/chatgpt-tg | app/functions/base.py | .py | a3d5a72a03dfe603 | 7.62 | 16 |
import openai
import anthropic
import settings
class BaseLLMClient:
def __init__(self, api_key, base_url=None, extra_completion_params=None):
self.api_key = api_key
self.base_url = base_url
self.extra_completion_params = extra_completion_params or {}
async def chat_completions_create(... | ijwfly/chatgpt-tg | app/openai_helpers/llm_client.py | .py | 05acda4305baff1c | 7.62 | 16 |
import asyncio
import logging
import time
import uuid
from dataclasses import dataclass, field
from typing import Optional, Callable, Coroutine, Dict, List
logger = logging.getLogger(__name__)
# Extra slack on top of the configured timeout: the sub-agent is expected to stop
# itself at its own deadline and return a p... | ijwfly/chatgpt-tg | app/runtime/background_task_manager.py | .py | 5c1f6c45c655f9ad | 7.62 | 16 |
from typing import Protocol, AsyncGenerator, Callable, Optional
from app.runtime.conversation_session import ConversationSession
from app.runtime.events import RuntimeEvent
from app.runtime.user_input import UserInput
class LLMRuntime(Protocol):
"""
Black box: receives user input, loads context,
calls LL... | ijwfly/chatgpt-tg | app/runtime/runtime.py | .py | 481f1e2124b53cb7 | 7.62 | 16 |
from dataclasses import dataclass, field
from typing import Optional, List
@dataclass
class ImageInput:
file_id: str
width: int
height: int
@dataclass
class TextInput:
"""A single text (and optionally image) message from the user."""
text: Optional[str] = None
tg_message_id: int = -1
ima... | ijwfly/chatgpt-tg | app/runtime/user_input.py | .py | 598b92fed1c56240 | 7.62 | 16 |
import requests
from PIL import Image
from io import BytesIO
class BackgroundRemoval:
"""
This API allows you to remove the background from an image. It is available at https://api.segmind.com/v1/bg-removal.
The API accepts a URL of the image to be processed and returns the image with the background remov... | segmind/segmind-py | segmind/BackgroundRemoval.py | .py | 1505c11857b13593 | 7.5 | 9 |
"""
import requests
api_key = "YOUR API-KEY"
url = "https://api.segmind.com/v1/sd1.5-deepspacediffusion"
# Request payload
data = {
"prompt": "jwst, nebula, spiral galaxy,mixed colors,outerspace, hyper quality, intricate detail, ultra realistic, maximum detail, foreground focus, instagram, 8k, volumetric light, ci... | segmind/segmind-py | segmind/DeepSpaceDiffusion.py | .py | 8008274480f26e34 | 7.5 | 9 |
import requests
from PIL import Image
from io import BytesIO
class ESRGAN:
"""
This API allows you to enhance and upscale images using the ESRGAN (Enhanced Super-Resolution Generative Adversarial Network) algorithm. It is available at https://api.segmind.com/v1/esrgan.
The API accepts a URL of the image t... | segmind/segmind-py | segmind/ESRGAN.py | .py | 2db1dfc7afcfb2ba | 7.5 | 9 |
import requests
from PIL import Image
from io import BytesIO
from .utils import toB64
class FaceSwap:
"""
This API allows you to swap faces in images and is available at https://api.segmind.com/v1/sd2.1-faceswapper.
The API accepts the following parameters:
imageUrl: The URL of the image to be pro... | segmind/segmind-py | segmind/FaceSwap.py | .py | 8489d03870e5e48e | 7.5 | 9 |
import requests
from PIL import Image
from io import BytesIO
from .utils import toB64
class SAM:
"""
This API allows you to generate Segmentation Masks using SAM (Segment Anything Model) and is available at https://api.segmind.com/v1/sam-img2mask.
The API accepts the following parameters:
imageUrl... | segmind/segmind-py | segmind/SAM.py | .py | ea0c9e7737b01115 | 7.5 | 9 |
import os
from pathlib import Path
import aiod_utils.rle as aiod_rle
import dask.array as da
import dask_image.ndmeasure
import numpy as np
import psutil
import skimage.measure
import tifffile
from aiod_utils.io import extract_idxs_from_fname, reduce_dtype
from aiod_utils.preprocess import (
get_downsample_factor,... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/combine_stacks.py | .py | d36d6b19f3629fc0 | 7.5 | 9 |
from collections import defaultdict
from pathlib import Path
import pandas as pd
from aiod_utils.io import load_image
from aiod_utils.stacks import (
MAX_SUBSTACK_SIZE,
Stack,
calc_num_stacks,
compute_max_substack_size,
generate_stack_indices,
)
if __name__ == "__main__":
# Get the command lin... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/create_splits.py | .py | d9545a649c161bce | 7.5 | 9 |
import argparse
import shutil
import subprocess
import time
from pathlib import Path
import requests
from tqdm.auto import tqdm
def get_model_checkpoint(
chkpt_fname: str,
chkpt_loc: str,
chkpt_type: str,
):
"""Download or copy a model artifact into the current working directory.
Existence check... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/download_model.py | .py | db24893dfc3045c5 | 7.5 | 9 |
"""
For this first version, where we will implement this new pipeline for preprocessing sets, we will just use the existing functions and run them over the whole image naively without Dask/chunk thoughts
"""
from pathlib import Path
import numpy as np
import pandas as pd
from aiod_utils.io import load_image_data, sav... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/preprocess_image.py | .py | 9bdeb35ca023f01c | 7.5 | 9 |
import contextlib
import platform
from pathlib import Path
import numpy as np
import skimage
import torch
import torch.multiprocessing as mp
import yaml
from empanada.data import VolumeDataset
from empanada.data.utils import resize_by_factor
from empanada.inference.engines import (
PanopticDeepLabRenderEngine,
... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/run_empanada.py | .py | a747eaf8484cff11 | 7.5 | 9 |
import argparse
import hashlib
import json
import os
from pathlib import Path
from urllib.parse import urlparse
from aiod_registry import load_manifests
from aiod_registry.utils import generate_default_config, is_accessible, resolve_version
def get_location_type(location: str) -> str:
"""Determine whether a loca... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/setup_model.py | .py | 03d821d765a98013 | 7.5 | 9 |
import argparse
import inspect
import warnings
from pathlib import Path
import aiod_utils.io as aiod_io
import aiod_utils.rle as aiod_rle
import numpy as np
from skimage.segmentation import relabel_sequential
DEFAULT_DIM_ORDER = "CZYX"
def save_masks(
save_dir,
save_name,
masks,
idxs: list[int, ...]... | FrancisCrickInstitute/Segment-Flow | modules/models/resources/usr/bin/utils.py | .py | 1aa57b7381545880 | 7.5 | 9 |
from __future__ import annotations
import contextlib
from collections.abc import Callable, Generator, Iterable
from typing import Any
import numpy as np
import numpy.typing as npt
from ndsl.performance.timer import NullTimer, Timer
from ndsl.types import Allocator
from ndsl.utils import (
device_synchronize,
... | NOAA-GFDL/NDSL | ndsl/buffer.py | .py | 9f77880548e341d5 | 7.54 | 11 |
import collections
import numpy as np
import xarray as xr
from ndsl import Quantity
from ndsl.checkpointer.base import ArrayLike, Checkpointer, SavepointName, VariableName
from ndsl.optional_imports import cupy as cp
def make_dims(
savepoint_dim: str, label: str, data_list: list[np.ndarray]
) -> tuple[list[str]... | NOAA-GFDL/NDSL | ndsl/checkpointer/snapshots.py | .py | d8db1db1b229c26e | 7.54 | 11 |
from __future__ import annotations
import collections
import contextlib
import dataclasses
from collections.abc import Mapping
import numpy as np
from ndsl.checkpointer.base import ArrayLike, Checkpointer, SavepointName, VariableName
from ndsl.quantity import Quantity
class InsufficientTrialsError(Exception):
... | NOAA-GFDL/NDSL | ndsl/checkpointer/thresholds.py | .py | 451ca597f30fd51b | 7.54 | 11 |
import collections
import contextlib
import os.path
from collections.abc import MutableMapping
import numpy as np
import xarray as xr
from ndsl.checkpointer.base import ArrayLike, Checkpointer, SavepointName
from ndsl.checkpointer.thresholds import SavepointThresholds, cast_to_ndarray
def _clip_pace_array_to_target... | NOAA-GFDL/NDSL | ndsl/checkpointer/validation.py | .py | 8d9a0287fcc4ec3f | 7.54 | 11 |
import functools
from collections.abc import Sequence
import ndsl.constants as constants
def shift_boundary_slice_tuple(
dims: Sequence[str],
origin: Sequence[int],
extent: Sequence[int],
boundary_type: int,
slice_tuple: tuple[slice | int, ...],
) -> tuple[slice | int, ...]:
slice_list = []
... | NOAA-GFDL/NDSL | ndsl/comm/_boundary_utils.py | .py | 58b73c15a433b69c | 7.54 | 11 |
from __future__ import annotations
import os
from typing import TYPE_CHECKING
from gt4py.cartesian import config as gt_config
from mpi4py import MPI
if TYPE_CHECKING:
from ndsl.dsl.stencil_config import CompilationConfig
def determine_rank_is_compiling(rank: int, size: int) -> bool:
"""Determines if a rank... | NOAA-GFDL/NDSL | ndsl/comm/decomposition.py | .py | ceeb40bdba9c6be9 | 7.54 | 11 |
from enum import Enum
from typing import Final
import gt4py.cartesian.backend as gt_backend
class BackendStrategy(Enum):
"""Strategy for the code execution"""
STENCIL = "st"
ORCHESTRATION = "orch"
class BackendTargetDevice(Enum):
"""Target device"""
CPU = "cpu"
GPU = "gpu"
class Backend... | NOAA-GFDL/NDSL | ndsl/config/backend.py | .py | 99e9b3967a7ce52e | 7.54 | 11 |
import dataclasses
import numbers
import os
import pathlib
from typing import Any
import pandas as pd
import xarray as xr
from ndsl import ndsl_log
from ndsl.quantity import Quantity
@dataclasses.dataclass
class DebuggerStartFrom:
"""The StartFrom configuration aims at delaying the debugger recording until a ce... | NOAA-GFDL/NDSL | ndsl/debug/debugger.py | .py | 2ff65648edf8854d | 7.54 | 11 |
from ndsl.comm.partitioner import Partitioner
from ndsl.dsl.caches.codepath import FV3CodePath
def identify_code_path(
rank: int,
partitioner: Partitioner,
*,
single_code_path: bool = False,
) -> FV3CodePath:
"""
Determine which code path your rank will hit.
If single_code_path is True, o... | NOAA-GFDL/NDSL | ndsl/dsl/caches/cache_location.py | .py | 8bfab9e214b93485 | 7.54 | 11 |
import os
from pathlib import Path
from dace.sdfg.sdfg import SDFG
from ndsl import ndsl_log
from ndsl.config import Backend
from ndsl.dsl.caches.cache_location import get_cache_fullpath
from ndsl.dsl.dace.dace_config import DaceConfig
class BuildInfo:
"""Drop build and memory info inside the `.dacecache`,
... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/cache.py | .py | 8b6c72e2a1f720e2 | 7.54 | 11 |
from typing import Any
import dace
from dace import library, nodes
from dace.transformation import transformation as xf
from ndsl import OptimizationConfig
@library.node
class _Labeler(nodes.LibraryNode):
implementations: dict[str, Any] = {}
default_implementation = "pure"
unique_name = dace.properties.... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/labeler.py | .py | 0802998f5ce5ab71 | 7.54 | 11 |
import numbers
import os
from pathlib import Path
from pprint import pformat
from typing import Any
from dace import SDFG, DeviceType, dtypes, nodes
from dace.codegen.compiled_sdfg import CompiledSDFG
from dace.dtypes import DeviceType as DaceDeviceType
from dace.dtypes import ScheduleType
from dace.dtypes import Stor... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/optimize.py | .py | 941cd1dd3cebca06 | 7.54 | 11 |
import copy
import dace
import sympy as sp
from dace import data as dt
from dace import symbolic
from dace.sdfg import graph as gr
from dace.sdfg import utils as sdutil
from dace.transformation.helpers import get_parent_map
from ndsl import ndsl_log
def _filter_all_maps(
sdfg: dace.SDFG,
whitelist: list[str... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/sdfg/debug_passes.py | .py | d2436ad327938d3f | 7.54 | 11 |
import dace.sdfg.analysis.schedule_tree.treenodes as tn
from ndsl.dsl.dace.builder.stree.common import AxisIterator
def is_axis_map(node: tn.MapScope, axis: AxisIterator) -> bool:
"""Returns true if node is a Map over the given axis."""
if len(node.node.map.params) != 1:
return False
param = nod... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/stree/common/control_flow.py | .py | 91f200e77de6b529 | 7.54 | 11 |
from enum import Enum
from dace.memlet import Memlet
from dace.sdfg.analysis.schedule_tree import treenodes as tn
from ndsl import ndsl_log
class AxisIterator(Enum):
_I = ("__i", 0)
_J = ("__j", 1)
_K = ("__k", 2)
def as_str(self) -> str:
return self.value[0]
def as_cartesian_index(sel... | NOAA-GFDL/NDSL | ndsl/dsl/dace/builder/stree/common/memlet.py | .py | 5adc8660bbb11aa5 | 7.54 | 11 |
"""
(character) limits for BDBA-api
limits are either found by trail and error or from the documentation
"""
app_name = 255
file_name = 241
def fits(
value: str,
/,
limit: int,
) -> bool:
return len(value) <= limit
def trim(
value: str,
/,
limit: int,
) -> str:
return value[:limit]... | open-component-model/odg-core | src/bdba/limits.py | .py | c89df4851d0b1a80 | 7.02 | 10 |
import collections.abc
import dataclasses
import traceback
import ocm
import odg.labels
@dataclasses.dataclass
class ScanRequest:
"""
a scan request of an artefact (referenced by component and artefact).
if a previous scan result was found, its "product-id" is stored as `target_product_id`
"""
... | open-component-model/odg-core | src/bdba_utils/model.py | .py | b1ecd8cd75d7cb3c | 7.52 | 10 |
import json
import logging
from pathlib import Path
from .theme_manager import ThemeConfig
logger = logging.getLogger("mongo_ops_manager")
class ConfigManager:
"""Manages application configuration persistence."""
def __init__(self):
self.config_dir = Path.home() / ".config" / "close-mongo-ops-manage... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/config_manager.py | .py | 4d19ab8756ac086d | 7.5 | 9 |
from textual.app import ComposeResult
from textual.containers import (
Horizontal,
)
from textual.widgets import Button, Input
from close_mongo_ops_manager.messages import FilterChanged
class FilterBar(Horizontal):
"""Container for filter inputs."""
BORDER_TITLE = "Filters"
BORDER_SUBTITLE = "Filte... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/filterbar.py | .py | 9c1a06c94efa478f | 7.5 | 9 |
from textual.app import ComposeResult
from textual.containers import (
Container,
Horizontal,
)
from textual.screen import ModalScreen
from textual.widgets import Button, Static
class KillConfirmation(ModalScreen[bool]):
id = "kill_confirmation_screen"
"""Modal screen for kill operation confirmation."... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/kill_confirmation_screen.py | .py | dcebbac425915165 | 7.5 | 9 |
import logging
from textual.binding import Binding
from textual.app import ComposeResult
from textual.containers import (
Container,
VerticalScroll,
)
from textual.screen import ModalScreen
from textual.widgets import Footer, Static
from textual.timer import Timer
logger = logging.getLogger("mongo_ops_manager... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/log_screen.py | .py | 7fa1d32e6fdbf1da | 7.5 | 9 |
from textual.binding import Binding
from textual.app import ComposeResult
from textual.containers import ScrollableContainer, VerticalScroll
from textual.screen import ModalScreen
from textual.widgets import TextArea
class OperationDetailsScreen(ModalScreen):
"""Screen for viewing detailed operation information."... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/operation_details_screen.py | .py | fbcb4d8f77d82d05 | 7.5 | 9 |
from textual.binding import Binding
from textual.widgets import DataTable
from textual.coordinate import Coordinate
from close_mongo_ops_manager.messages import SelectionChanged
from close_mongo_ops_manager.operation_details_screen import OperationDetailsScreen
class OperationsView(DataTable):
"""Table displayin... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/operations_view.py | .py | 454635e866ce6b26 | 7.5 | 9 |
from textual.widgets import Static
class StatusBar(Static):
"""Status bar widget showing current connection and refresh status."""
DEFAULT_CSS = """
StatusBar {
width: 100%;
height: 1;
background: $boost;
color: $text;
content-align: left middle;
padding: 0... | closeio/close-mongo-ops-manager | src/close_mongo_ops_manager/statusbar.py | .py | 54ca0652ebda8f1b | 7.5 | 9 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.