sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:homeassistant/components/tilt_pi/entity.py | """Base entity for Tilt Pi integration."""
from tiltpi import TiltHydrometerData
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .coordinator import TiltPiDataUpdateCoordinator
class TiltEntity(Coordina... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/tilt_pi/entity.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/tilt_pi/sensor.py | """Support for Tilt Hydrometer sensors."""
from collections.abc import Callable
from dataclasses import dataclass
from typing import Final
from tiltpi import TiltHydrometerData
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/tilt_pi/sensor.py",
"license": "Apache License 2.0",
"lines": 74,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vegehub/config_flow.py | """Config flow for the VegeHub integration."""
import logging
from typing import Any
from vegehub import VegeHub
import voluptuous as vol
from homeassistant.components.webhook import (
async_generate_id as webhook_generate_id,
async_generate_url as webhook_generate_url,
)
from homeassistant.config_entries im... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/config_flow.py",
"license": "Apache License 2.0",
"lines": 136,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/vegehub/const.py | """Constants for the Vegetronix VegeHub integration."""
from homeassistant.const import Platform
DOMAIN = "vegehub"
NAME = "VegeHub"
PLATFORMS = [Platform.SENSOR, Platform.SWITCH]
MANUFACTURER = "vegetronix"
MODEL = "VegeHub"
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/const.py",
"license": "Apache License 2.0",
"lines": 7,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vegehub/coordinator.py | """Coordinator for the Vegetronix VegeHub."""
from __future__ import annotations
import logging
from typing import Any
from vegehub import VegeHub, update_data_to_ha_dict
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator i... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/coordinator.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vegehub/entity.py | """Base entity for VegeHub."""
from homeassistant.const import CONF_HOST, CONF_MAC
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import MANUFACTURER, MODEL
from .coordinator import VegeHubCoordina... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/entity.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vegehub/sensor.py | """Sensor configuration for VegeHub integration."""
from itertools import count
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
)
from homeassistant.const import UnitOfElectricPotential
from homeassistant.core import HomeAssistant
from homeassistant.... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/sensor.py",
"license": "Apache License 2.0",
"lines": 80,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/zoneminder/services.py | """Support for ZoneMinder."""
import logging
import voluptuous as vol
from homeassistant.const import ATTR_ID, ATTR_NAME
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.helpers import config_validation as cv
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
SER... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/zoneminder/services.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:script/hassfest/triggers.py | """Validate triggers."""
from __future__ import annotations
import contextlib
import json
import pathlib
import re
from typing import Any
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant.const import CONF_SELECTOR
from homeassistant.exceptions import HomeAssistantError
from... | {
"repo_id": "home-assistant/core",
"file_path": "script/hassfest/triggers.py",
"license": "Apache License 2.0",
"lines": 270,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:tests/components/adax/test_sensor.py | """Test Adax sensor entity."""
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
from tests.common im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/adax/test_sensor.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ai_task/test_entity.py | """Tests for the AI Task entity model."""
import pytest
import voluptuous as vol
from homeassistant.components.ai_task import async_generate_data
from homeassistant.const import STATE_UNKNOWN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import selector
from .conftest import TEST_ENTITY_ID,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ai_task/test_entity.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ai_task/test_http.py | """Test the HTTP API for AI Task integration."""
from homeassistant.core import HomeAssistant
from tests.typing import WebSocketGenerator
async def test_ws_preferences(
hass: HomeAssistant,
hass_ws_client: WebSocketGenerator,
init_components: None,
) -> None:
"""Test preferences via the WebSocket AP... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ai_task/test_http.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ai_task/test_init.py | """Test initialization of the AI Task component."""
from pathlib import Path
from typing import Any
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
import pytest
import voluptuous as vol
from homeassistant.components import media_source
from homeassistant.components.ai_task import AIT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ai_task/test_init.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ai_task/test_task.py | """Test tasks for the AI Task integration."""
from datetime import timedelta
from pathlib import Path
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components import media_source
from homeassistant.components.ai_task import (
AITaskEntityFeature,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ai_task/test_task.py",
"license": "Apache License 2.0",
"lines": 301,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/alexa_devices/test_sensor.py | """Tests for the Alexa Devices sensor platform."""
from typing import Any
from unittest.mock import AsyncMock, patch
from aioamazondevices.api import AmazonDeviceSensor
from aioamazondevices.exceptions import (
CannotAuthenticate,
CannotConnect,
CannotRetrieveData,
)
from freezegun.api import FrozenDateTi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/alexa_devices/test_sensor.py",
"license": "Apache License 2.0",
"lines": 144,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/alexa_devices/test_utils.py | """Tests for Alexa Devices utils."""
from unittest.mock import AsyncMock
from aioamazondevices.const.devices import SPEAKER_GROUP_FAMILY, SPEAKER_GROUP_MODEL
from aioamazondevices.exceptions import CannotConnect, CannotRetrieveData
import pytest
from homeassistant.components.alexa_devices.const import DOMAIN
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/alexa_devices/test_utils.py",
"license": "Apache License 2.0",
"lines": 140,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/altruist/test_config_flow.py | """Test the Altruist config flow."""
from ipaddress import ip_address
from unittest.mock import AsyncMock
from homeassistant.components.altruist.const import CONF_HOST, DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.core import HomeAssistant
from homeassistant.data_ent... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/altruist/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 138,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/altruist/test_init.py | """Test the Altruist integration."""
from unittest.mock import AsyncMock
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_setup_entry_client_creation_failure(
hass: HomeAssistant,
mock_config_entry... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/altruist/test_init.py",
"license": "Apache License 2.0",
"lines": 38,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/altruist/test_sensor.py | """Tests for the Altruist integration sensor platform."""
from datetime import timedelta
from unittest.mock import AsyncMock, patch
from altruistclient import AltruistError
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import STA... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/altruist/test_sensor.py",
"license": "Apache License 2.0",
"lines": 43,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/android_ip_webcam/test_camera.py | """Test the Android IP Webcam camera."""
from typing import Any
import pytest
from homeassistant.components.android_ip_webcam.const import DOMAIN
from homeassistant.components.camera import async_get_stream_source
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
@pytest.mark.u... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/android_ip_webcam/test_camera.py",
"license": "Apache License 2.0",
"lines": 44,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/google_generative_ai_conversation/test_tts.py | """Tests for the Google Generative AI Conversation TTS entity."""
from __future__ import annotations
from collections.abc import Generator
from http import HTTPStatus
from pathlib import Path
from typing import Any
from unittest.mock import AsyncMock, MagicMock, Mock, patch
from google.genai import types
from google... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/google_generative_ai_conversation/test_tts.py",
"license": "Apache License 2.0",
"lines": 246,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homee/test_diagnostics.py | """Test homee diagnostics."""
from unittest.mock import MagicMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.homee.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from . import build_mock_node, setup_integrati... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homee/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 78,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homee/test_siren.py | """Test homee sirens."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.siren import (
DOMAIN as SIREN_DOMAIN,
SERVICE_TOGGLE,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY_ID, Pl... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homee/test_siren.py",
"license": "Apache License 2.0",
"lines": 69,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homewizard/test_select.py | """Test the Select entity for HomeWizard."""
from unittest.mock import MagicMock
from homewizard_energy import UnsupportedError
from homewizard_energy.errors import RequestError, UnauthorizedError
from homewizard_energy.models import Batteries
import pytest
from syrupy.assertion import SnapshotAssertion
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homewizard/test_select.py",
"license": "Apache License 2.0",
"lines": 261,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/immich/test_update.py | """Test the Immich update platform."""
from unittest.mock import Mock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
from tests.common... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/immich/test_update.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lametric/test_update.py | """Tests for the LaMetric update platform."""
from unittest.mock import MagicMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tests.common import MockCo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lametric/test_update.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/meater/test_diagnostics.py | """Test Meater diagnostics."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagnostics_for_config_entry
from test... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/meater/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/meater/test_init.py | """Tests for the Meater integration."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.meater.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import STATE_UNAVAILABLE
from homeassistant.core impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/meater/test_init.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/meater/test_sensor.py | """Tests for the Meater sensors."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
f... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/meater/test_sensor.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/music_assistant/test_button.py | """Test Music Assistant button entities."""
from unittest.mock import MagicMock, call
from music_assistant_models.enums import EventType
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
from homeassistant.const import ATTR... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/music_assistant/test_button.py",
"license": "Apache License 2.0",
"lines": 75,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ntfy/test_sensor.py | """Tests for the ntfy sensor platform."""
from collections.abc import Generator
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ntfy/test_sensor.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openuv/test_binary_sensor.py | """Test OpenUV binary sensors."""
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.homeassistant import (
DOMAIN as HOMEASSISTANT_DOMAIN,
SERVICE_UPDATE_ENTITY,
)
from homeassistant.confi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openuv/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 125,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openuv/test_sensor.py | """Test OpenUV sensors."""
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tests.common import MockConfigEntry, snapshot_platform
async ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openuv/test_sensor.py",
"license": "Apache License 2.0",
"lines": 19,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/paperless_ngx/test_update.py | """Tests for Paperless-ngx update platform."""
from unittest.mock import AsyncMock, MagicMock
from freezegun.api import FrozenDateTimeFactory
from pypaperless.exceptions import PaperlessConnectionError
from pypaperless.models import RemoteVersion
import pytest
from homeassistant.components.paperless_ngx.update impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/paperless_ngx/test_update.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_config_flow.py | """Test the Playstation Network config flow."""
from unittest.mock import MagicMock
import pytest
from homeassistant.components.playstation_network.config_flow import (
PSNAWPAuthenticationError,
PSNAWPError,
PSNAWPInvalidTokenError,
PSNAWPNotFoundError,
)
from homeassistant.components.playstation_ne... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 426,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_diagnostics.py | """Tests for PlayStation Network diagnostics."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_media_player.py | """Test the Playstation Network media player platform."""
from collections.abc import AsyncGenerator
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_media_player.py",
"license": "Apache License 2.0",
"lines": 177,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_sensor.py | """Test the Playstation Network sensor platform."""
from collections.abc import Generator
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import Platform
from homeassistant.core import Home... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_sensor.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/pushbullet/test_sensor.py | """Test pushbullet sensor platform."""
from unittest.mock import Mock
import pytest
from homeassistant.components.pushbullet.const import DOMAIN
from homeassistant.components.pushbullet.sensor import (
SENSOR_TYPES,
PushBulletNotificationSensor,
)
from homeassistant.const import MAX_LENGTH_STATE_STATE
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/pushbullet/test_sensor.py",
"license": "Apache License 2.0",
"lines": 130,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/qbus/test_cover.py | """Test Qbus cover entities."""
from unittest.mock import AsyncMock
from qbusmqttapi.state import QbusMqttShutterState
from homeassistant.components.cover import (
ATTR_CURRENT_POSITION,
ATTR_CURRENT_TILT_POSITION,
ATTR_POSITION,
ATTR_TILT_POSITION,
DOMAIN as COVER_DOMAIN,
CoverEntityFeature,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/qbus/test_cover.py",
"license": "Apache License 2.0",
"lines": 241,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/rest/test_data.py | """Test REST data module logging improvements."""
from datetime import timedelta
import logging
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.rest import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.setup import a... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/rest/test_data.py",
"license": "Apache License 2.0",
"lines": 485,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/russound_rio/test_number.py | """Tests for the Russound RIO number platform."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from homeassistant.const import ATTR_ENTITY_ID,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/russound_rio/test_number.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/russound_rio/test_switch.py | """Tests for the Russound RIO switch platform."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN, SERVICE_TURN_ON
from homeassistant.const import ATTR_ENTITY_ID, SERVICE_TURN_OFF, Platform
fro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/russound_rio/test_switch.py",
"license": "Apache License 2.0",
"lines": 52,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/smarla/test_number.py | """Test number platform for Swing2Sleep Smarla integration."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from homeassistant.const import AT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/smarla/test_number.py",
"license": "Apache License 2.0",
"lines": 85,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sonos/test_diagnostics.py | """Tests for the diagnostics data provided by the Sonos integration."""
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import paths
from homeassistant.components.sonos.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceRegistry
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sonos/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 50,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sun/test_binary_sensor.py | """The tests for the Sun binary_sensor platform."""
from datetime import datetime, timedelta
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components import sun
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sun/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 34,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/telegram_bot/test_config_flow.py | """Config flow tests for the Telegram Bot integration."""
from unittest.mock import AsyncMock, patch
from telegram import AcceptedGiftTypes, ChatFullInfo, User
from telegram.constants import AccentColor
from telegram.error import BadRequest, InvalidToken, NetworkError
from homeassistant.components.telegram_bot.confi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/telegram_bot/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 496,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/telegram_bot/test_webhooks.py | """Tests for webhooks."""
from ipaddress import IPv4Network
from unittest.mock import patch
from telegram.error import TimedOut
from homeassistant.components.telegram_bot.const import DOMAIN
from homeassistant.components.telegram_bot.webhooks import TELEGRAM_WEBHOOK_URL
from homeassistant.config_entries import Confi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/telegram_bot/test_webhooks.py",
"license": "Apache License 2.0",
"lines": 104,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/tilt_pi/test_config_flow.py | """Test the Tilt config flow."""
from unittest.mock import AsyncMock
from homeassistant.components.tilt_pi.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_HOST, CONF_PORT, CONF_URL
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/tilt_pi/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/tilt_pi/test_sensor.py | """Test the Tilt Hydrometer sensors."""
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
from syrupy.assertion import SnapshotAssertion
from tiltpi import TiltColor, TiltPiConnectionError
from homeassistant.const import STATE_UNAVAILABLE, Platform
from homeassistant.core imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/tilt_pi/test_sensor.py",
"license": "Apache License 2.0",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vegehub/test_config_flow.py | """Tests for VegeHub config flow."""
from collections.abc import Generator
from ipaddress import ip_address
from typing import Any
from unittest.mock import MagicMock, patch
import pytest
from homeassistant import config_entries
from homeassistant.components.vegehub.const import DOMAIN
from homeassistant.config_entr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vegehub/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 285,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vegehub/test_sensor.py | """Unit tests for the VegeHub integration's sensor.py."""
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import init_integration
from .... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vegehub/test_sensor.py",
"license": "Apache License 2.0",
"lines": 49,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xiaomi_miio/test_fan.py | """The tests for the xiaomi_miio fan component."""
from collections.abc import Generator
from unittest.mock import MagicMock, Mock, patch
from miio.integrations.fan.dmaker.fan import FanStatusP5
from miio.integrations.fan.dmaker.fan_miot import FanStatusMiot
import pytest
from syrupy.assertion import SnapshotAssertio... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xiaomi_miio/test_fan.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot_cloud/test_binary_sensor.py | """Test for the switchbot_cloud binary sensors."""
from unittest.mock import patch
import pytest
from switchbot_api import Device
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switchbot_cloud.const import DOMAIN
from homeassistant.const import Platform
from homeassistant.core import Ho... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 69,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:homeassistant/components/alexa_devices/binary_sensor.py | """Support for binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Final
from aioamazondevices.const.metadata import SENSOR_STATE_OFF
from aioamazondevices.structures import AmazonDevice
from homeassistant.components.binary_... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 142,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/config_flow.py | """Config flow for Alexa Devices integration."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from aioamazondevices.api import AmazonEchoApi
from aioamazondevices.exceptions import (
CannotAuthenticate,
CannotConnect,
CannotRetrieveData,
)
import voluptuou... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/config_flow.py",
"license": "Apache License 2.0",
"lines": 153,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/alexa_devices/const.py | """Alexa Devices constants."""
import logging
_LOGGER = logging.getLogger(__package__)
DOMAIN = "alexa_devices"
CONF_LOGIN_DATA = "login_data"
CONF_SITE = "site"
DEFAULT_DOMAIN = "com"
COUNTRY_DOMAINS = {
"ar": DEFAULT_DOMAIN,
"at": DEFAULT_DOMAIN,
"au": "com.au",
"be": "com.be",
"br": DEFAULT_D... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/const.py",
"license": "Apache License 2.0",
"lines": 46,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/coordinator.py | """Support for Alexa Devices."""
from datetime import timedelta
from aioamazondevices.api import AmazonEchoApi
from aioamazondevices.exceptions import (
CannotAuthenticate,
CannotConnect,
CannotRetrieveData,
)
from aioamazondevices.structures import AmazonDevice
from aiohttp import ClientSession
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/coordinator.py",
"license": "Apache License 2.0",
"lines": 95,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/diagnostics.py | """Diagnostics support for Alexa Devices integration."""
from __future__ import annotations
from dataclasses import asdict
from typing import Any
from aioamazondevices.structures import AmazonDevice
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_NAME, CONF_PA... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/diagnostics.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/entity.py | """Defines a base Alexa Devices entity."""
from aioamazondevices.const.devices import SPEAKER_GROUP_MODEL
from aioamazondevices.structures import AmazonDevice
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coord... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/entity.py",
"license": "Apache License 2.0",
"lines": 48,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/notify.py | """Support for notification entity."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any, Final
from aioamazondevices.api import AmazonEchoApi
from aioamazondevices.const.devices import SPEAKER_GROUP_FAMILY
from aioamazondevice... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/notify.py",
"license": "Apache License 2.0",
"lines": 69,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/alexa_devices/switch.py | """Support for switches."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Final
from aioamazondevices.structures import AmazonDevice
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
Switc... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/alexa_devices/switch.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/backup/event.py | """Event platform for Home Assistant Backup integration."""
from __future__ import annotations
from typing import Final
from homeassistant.components.event import EventEntity
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/backup/event.py",
"license": "Apache License 2.0",
"lines": 46,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/blue_current/button.py | """Support for Blue Current buttons."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Any
from bluecurrent_api.client import Client
from homeassistant.components.button import (
ButtonDeviceClass,
ButtonEntity,
But... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/blue_current/button.py",
"license": "Apache License 2.0",
"lines": 71,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/bluesound/button.py | """Button entities for Bluesound."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING
from pyblu import Player
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.con... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/bluesound/button.py",
"license": "Apache License 2.0",
"lines": 103,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/bosch_alarm/binary_sensor.py | """Support for Bosch Alarm Panel binary sensors."""
from __future__ import annotations
from dataclasses import dataclass
from bosch_alarm_mode2 import Panel
from bosch_alarm_mode2.const import ALARM_PANEL_FAULTS
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/bosch_alarm/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 186,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/bosch_alarm/services.py | """Services for the bosch_alarm integration."""
from __future__ import annotations
import asyncio
import datetime as dt
from typing import Any
import voluptuous as vol
from homeassistant.const import ATTR_CONFIG_ENTRY_ID
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptio... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/bosch_alarm/services.py",
"license": "Apache License 2.0",
"lines": 51,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/bosch_alarm/switch.py | """Support for Bosch Alarm Panel outputs and doors as switches."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Any
from bosch_alarm_mode2 import Panel
from bosch_alarm_mode2.panel import Door
from homeassistant.components.sw... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/bosch_alarm/switch.py",
"license": "Apache License 2.0",
"lines": 119,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/downloader/services.py | """Support for functionality to download files."""
from __future__ import annotations
from http import HTTPStatus
import os
import re
import threading
import requests
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import ServiceValidationEr... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/downloader/services.py",
"license": "Apache License 2.0",
"lines": 141,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/eheimdigital/diagnostics.py | """Diagnostics for the EHEIM Digital integration."""
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.core import HomeAssistant
from .coordinator import EheimDigitalConfigEntry
TO_REDACT = {"emailAddr", "usrName"}
async def async_get_config_entry_diagnos... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/eheimdigital/diagnostics.py",
"license": "Apache License 2.0",
"lines": 13,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/eheimdigital/select.py | """EHEIM Digital select entities."""
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any, Literal, override
from eheimdigital.classic_vario import EheimDigitalClassicVario
from eheimdigital.device import EheimDigitalDevice
from eheimdigital.filter import EheimDigit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/eheimdigital/select.py",
"license": "Apache License 2.0",
"lines": 221,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/guardian/services.py | """Support for Guardian services."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import TYPE_CHECKING, Any
from aioguardian.errors import GuardianError
import voluptuous as vol
from homeassistant.const import (
ATTR_DEVICE_ID,
CONF_DEVICE_ID,
CONF_FILEN... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/guardian/services.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/homee/alarm_control_panel.py | """The Homee alarm control panel platform."""
from dataclasses import dataclass
from pyHomee.const import AttributeChangedBy, AttributeType
from pyHomee.model import HomeeAttribute, HomeeNode
from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntity,
AlarmControlPanelEntityDescriptio... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homee/alarm_control_panel.py",
"license": "Apache License 2.0",
"lines": 120,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/homee/event.py | """The homee event platform."""
from pyHomee.const import AttributeType, NodeProfile
from pyHomee.model import HomeeAttribute, HomeeNode
from homeassistant.components.event import (
EventDeviceClass,
EventEntity,
EventEntityDescription,
)
from homeassistant.core import HomeAssistant, callback
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homee/event.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/homee/fan.py | """The Homee fan platform."""
import math
from typing import Any, cast
from pyHomee.const import AttributeType, NodeProfile
from pyHomee.model import HomeeAttribute, HomeeNode
from homeassistant.components.fan import FanEntity, FanEntityFeature
from homeassistant.core import HomeAssistant
from homeassistant.exceptio... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homee/fan.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/huisbaasje/coordinator.py | """The EnergyFlip integration."""
import asyncio
from datetime import timedelta
import logging
from typing import Any
from energyflip import EnergyFlip, EnergyFlipException
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/huisbaasje/coordinator.py",
"license": "Apache License 2.0",
"lines": 108,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/icloud/services.py | """The iCloud component."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.helpers import config_validation as cv
from homeassistant.util import slugify
from .account import IcloudAccount, IcloudConfigEntry
from .con... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/icloud/services.py",
"license": "Apache License 2.0",
"lines": 109,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/immich/config_flow.py | """Config flow for the Immich integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from aioimmich import Immich
from aioimmich.const import CONNECT_ERRORS
from aioimmich.exceptions import ImmichUnauthorizedError
from aioimmich.users.models impor... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/config_flow.py",
"license": "Apache License 2.0",
"lines": 206,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/immich/const.py | """Constants for the Immich integration."""
DOMAIN = "immich"
DEFAULT_PORT = 2283
DEFAULT_USE_SSL = False
DEFAULT_VERIFY_SSL = False
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/const.py",
"license": "Apache License 2.0",
"lines": 5,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/immich/coordinator.py | """Coordinator for the Immich integration."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
import logging
from aioimmich import Immich
from aioimmich.const import CONNECT_ERRORS
from aioimmich.exceptions import ImmichUnauthorizedError
from aioimmich.server.model... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/coordinator.py",
"license": "Apache License 2.0",
"lines": 79,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/immich/diagnostics.py | """Diagnostics support for immich."""
from __future__ import annotations
from dataclasses import asdict
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_API_KEY, CONF_HOST
from homeassistant.core import HomeAssistant
from .coordinator imp... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/diagnostics.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/immich/entity.py | """Base entity for the Immich integration."""
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import ImmichDataUpdateCoordinator
class ImmichEntity(CoordinatorEntity[Immic... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/entity.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/immich/media_source.py | """Immich as a media source."""
from __future__ import annotations
from logging import getLogger
from aiohttp.web import HTTPNotFound, Request, Response, StreamResponse
from aioimmich.assets.models import ImmichAsset
from aioimmich.exceptions import ImmichError
from homeassistant.components.http import HomeAssistan... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/media_source.py",
"license": "Apache License 2.0",
"lines": 313,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/immich/sensor.py | """Sensor platform for the Immich integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.co... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/immich/sensor.py",
"license": "Apache License 2.0",
"lines": 138,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/iqvia/coordinator.py | """Support for IQVIA."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from datetime import timedelta
from typing import Any
from pyiqvia.errors import IQVIAError
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/iqvia/coordinator.py",
"license": "Apache License 2.0",
"lines": 37,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/jewish_calendar/diagnostics.py | """Diagnostics support for Jewish Calendar integration."""
from dataclasses import asdict
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssistant
from .const import CONF_ALTITU... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/jewish_calendar/diagnostics.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/miele/vacuum.py | """Platform for Miele vacuum integration."""
from __future__ import annotations
from dataclasses import dataclass
from enum import IntEnum
import logging
from typing import Any, Final
from aiohttp import ClientResponseError
from pymiele import MieleEnum
from homeassistant.components.vacuum import (
StateVacuumE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/miele/vacuum.py",
"license": "Apache License 2.0",
"lines": 172,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/paperless_ngx/config_flow.py | """Config flow for the Paperless-ngx integration."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from pypaperless import Paperless
from pypaperless.exceptions import (
InitializationError,
PaperlessConnectionError,
PaperlessForbiddenError,
PaperlessIn... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/paperless_ngx/config_flow.py",
"license": "Apache License 2.0",
"lines": 127,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/paperless_ngx/coordinator.py | """Paperless-ngx Status coordinator."""
from __future__ import annotations
from abc import abstractmethod
from dataclasses import dataclass
from datetime import timedelta
from pypaperless import Paperless
from pypaperless.exceptions import (
PaperlessConnectionError,
PaperlessForbiddenError,
PaperlessIna... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/paperless_ngx/coordinator.py",
"license": "Apache License 2.0",
"lines": 111,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/paperless_ngx/diagnostics.py | """Diagnostics support for Paperless-ngx."""
from __future__ import annotations
from dataclasses import asdict
from typing import Any
from homeassistant.core import HomeAssistant
from . import PaperlessConfigEntry
async def async_get_config_entry_diagnostics(
hass: HomeAssistant,
entry: PaperlessConfigEnt... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/paperless_ngx/diagnostics.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/paperless_ngx/entity.py | """Paperless-ngx base entity."""
from __future__ import annotations
from homeassistant.components.sensor import EntityDescription
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/paperless_ngx/entity.py",
"license": "Apache License 2.0",
"lines": 28,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/paperless_ngx/sensor.py | """Sensor platform for Paperless-ngx."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from pypaperless.models import Statistic, Status
from pypaperless.models.common import StatusType
from homeassistant.components.sensor import (
SensorDeviceClass,
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/paperless_ngx/sensor.py",
"license": "Apache License 2.0",
"lines": 271,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/probe_plus/config_flow.py | """Config flow for probe_plus integration."""
from __future__ import annotations
import dataclasses
import logging
from typing import Any
import voluptuous as vol
from homeassistant.components.bluetooth import (
BluetoothServiceInfo,
async_discovered_service_info,
)
from homeassistant.config_entries import ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/probe_plus/config_flow.py",
"license": "Apache License 2.0",
"lines": 101,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/probe_plus/coordinator.py | """Coordinator for the probe_plus integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from pyprobeplus import ProbePlusDevice
from pyprobeplus.exceptions import ProbePlusDeviceNotFound, ProbePlusError
from homeassistant.components import bluetooth
from homeassistant.conf... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/probe_plus/coordinator.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/probe_plus/entity.py | """Probe Plus base entity type."""
from dataclasses import dataclass
from pyprobeplus import ProbePlusDevice
from homeassistant.const import CONF_MODEL
from homeassistant.helpers.device_registry import (
CONNECTION_BLUETOOTH,
DeviceInfo,
format_mac,
)
from homeassistant.helpers.entity import EntityDescri... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/probe_plus/entity.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/probe_plus/sensor.py | """Support for Probe Plus BLE sensors."""
from collections.abc import Callable
from dataclasses import dataclass
from homeassistant.components.sensor import (
RestoreSensor,
SensorDeviceClass,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import (
PERCENTAGE,
SIGNAL_STR... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/probe_plus/sensor.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/ps4/services.py | """Support for PlayStation 4 consoles."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.const import ATTR_COMMAND, ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.helpers import config_validation as cv
from .const import COMMANDS... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/ps4/services.py",
"license": "Apache License 2.0",
"lines": 27,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/qbus/scene.py | """Support for Qbus scene."""
from typing import Any
from qbusmqttapi.discovery import QbusMqttOutput
from qbusmqttapi.state import QbusMqttState, StateAction, StateType
from homeassistant.components.scene import BaseScene
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/qbus/scene.py",
"license": "Apache License 2.0",
"lines": 42,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/rehlko/binary_sensor.py | """Binary sensor platform for Rehlko integration."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.const import Entit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/rehlko/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/smarla/config_flow.py | """Config flow for Swing2Sleep Smarla integration."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from pysmarlaapi import Connection
from pysmarlaapi.connection.exceptions import (
AuthenticationException,
ConnectionException,
)
import voluptuous as vol
from... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/smarla/config_flow.py",
"license": "Apache License 2.0",
"lines": 90,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.