sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:homeassistant/components/linkplay/select.py | """Support for LinkPlay select."""
from __future__ import annotations
from collections.abc import Awaitable, Callable, Coroutine
from dataclasses import dataclass
import logging
from typing import Any
from linkplay.bridge import LinkPlayBridge, LinkPlayPlayer
from linkplay.consts import AudioOutputHwMode
from linkpl... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/linkplay/select.py",
"license": "Apache License 2.0",
"lines": 88,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/medcom_ble/coordinator.py | """The Medcom BLE integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from bleak import BleakError
from medcom_ble import MedcomBleDevice, MedcomBleDeviceData
from homeassistant.components import bluetooth
from homeassistant.config_entries import ConfigEntry
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/medcom_ble/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/met_eireann/coordinator.py | """The met_eireann component."""
from __future__ import annotations
from collections.abc import Mapping
from datetime import timedelta
import logging
from typing import Any, Self
import meteireann
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ELEVATION, CONF_LATITUDE, CON... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/met_eireann/coordinator.py",
"license": "Apache License 2.0",
"lines": 60,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/meteoclimatic/coordinator.py | """Support for Meteoclimatic weather data."""
import logging
from typing import Any
from meteoclimatic import MeteoclimaticClient
from meteoclimatic.exceptions import MeteoclimaticError
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/meteoclimatic/coordinator.py",
"license": "Apache License 2.0",
"lines": 33,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/miele/services.py | """Services for Miele integration."""
from datetime import timedelta
import logging
from typing import cast
from aiohttp import ClientResponseError
import voluptuous as vol
from homeassistant.const import ATTR_DEVICE_ID, ATTR_TEMPERATURE
from homeassistant.core import (
HomeAssistant,
ServiceCall,
Servic... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/miele/services.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/mqtt/repairs.py | """Repairs for MQTT."""
from __future__ import annotations
from typing import TYPE_CHECKING
import voluptuous as vol
from homeassistant import data_entry_flow
from homeassistant.components.repairs import RepairsFlow
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/mqtt/repairs.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/nasweb/sensor.py | """Platform for NASweb sensors."""
from __future__ import annotations
import logging
import time
from webio_api import Input as NASwebInput, TempSensor
from webio_api.const import (
STATE_INPUT_ACTIVE,
STATE_INPUT_NORMAL,
STATE_INPUT_PROBLEM,
STATE_INPUT_TAMPER,
STATE_INPUT_UNDEFINED,
)
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nasweb/sensor.py",
"license": "Apache License 2.0",
"lines": 162,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/ollama/ai_task.py | """AI Task integration for Ollama."""
from __future__ import annotations
from json import JSONDecodeError
import logging
from homeassistant.components import ai_task, conversation
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import Ho... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/ollama/ai_task.py",
"license": "Apache License 2.0",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/onkyo/util.py | """Utils for Onkyo."""
from .const import InputSource, ListeningMode
def get_meaning(param: InputSource | ListeningMode) -> str:
"""Get param meaning."""
return " ··· ".join(param.meanings)
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/onkyo/util.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/open_router/ai_task.py | """AI Task integration for OpenRouter."""
from __future__ import annotations
from json import JSONDecodeError
import logging
from homeassistant.components import ai_task, conversation
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/open_router/ai_task.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/open_router/config_flow.py | """Config flow for OpenRouter integration."""
from __future__ import annotations
import logging
from typing import Any
from python_open_router import (
Model,
OpenRouterClient,
OpenRouterError,
SupportedParameter,
)
import voluptuous as vol
from homeassistant.config_entries import (
SOURCE_USER,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/open_router/config_flow.py",
"license": "Apache License 2.0",
"lines": 249,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/open_router/const.py | """Constants for the OpenRouter integration."""
import logging
from homeassistant.const import CONF_LLM_HASS_API, CONF_PROMPT
from homeassistant.helpers import llm
DOMAIN = "open_router"
LOGGER = logging.getLogger(__package__)
CONF_RECOMMENDED = "recommended"
RECOMMENDED_CONVERSATION_OPTIONS = {
CONF_RECOMMEND... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/open_router/const.py",
"license": "Apache License 2.0",
"lines": 12,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/open_router/conversation.py | """Conversation support for OpenRouter."""
from typing import Literal
from homeassistant.components import conversation
from homeassistant.config_entries import ConfigSubentry
from homeassistant.const import CONF_LLM_HASS_API, CONF_PROMPT, MATCH_ALL
from homeassistant.core import HomeAssistant
from homeassistant.help... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/open_router/conversation.py",
"license": "Apache License 2.0",
"lines": 55,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/open_router/entity.py | """Base entity for Open Router."""
from __future__ import annotations
import base64
from collections.abc import AsyncGenerator, Callable
import json
from mimetypes import guess_file_type
from pathlib import Path
from typing import TYPE_CHECKING, Any, Literal
import openai
from openai.types.chat import (
ChatComp... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/open_router/entity.py",
"license": "Apache License 2.0",
"lines": 258,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/openai_conversation/ai_task.py | """AI Task integration for OpenAI."""
from __future__ import annotations
import base64
from json import JSONDecodeError
import logging
from typing import TYPE_CHECKING
from openai.types.responses.response_output_item import ImageGenerationCall
from homeassistant.components import ai_task, conversation
from homeassi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openai_conversation/ai_task.py",
"license": "Apache License 2.0",
"lines": 129,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/openai_conversation/entity.py | """Base entity for OpenAI."""
from __future__ import annotations
import base64
from collections.abc import AsyncGenerator, Callable, Iterable
import json
from mimetypes import guess_file_type
from pathlib import Path
import re
from typing import TYPE_CHECKING, Any, Literal, cast
import openai
from openai._streaming ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openai_conversation/entity.py",
"license": "Apache License 2.0",
"lines": 661,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/playstation_network/binary_sensor.py | """Binary Sensor platform for PlayStation Network integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from enum import StrEnum
from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from h... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/playstation_network/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 56,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/playstation_network/entity.py | """Base entity for PlayStation Network Integration."""
from typing import TYPE_CHECKING
from homeassistant.config_entries import ConfigSubentry
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/playstation_network/entity.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/playstation_network/image.py | """Image platform for PlayStation Network."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from enum import StrEnum
from typing import TYPE_CHECKING
from homeassistant.components.image import ImageEntity, ImageEntityDescription
from homeassistant.config_en... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/playstation_network/image.py",
"license": "Apache License 2.0",
"lines": 124,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/playstation_network/notify.py | """Notify platform for PlayStation Network."""
from __future__ import annotations
from enum import StrEnum
from typing import TYPE_CHECKING
from psnawp_api.core.psnawp_exceptions import (
PSNAWPClientError,
PSNAWPForbiddenError,
PSNAWPNotFoundError,
PSNAWPServerError,
)
from psnawp_api.models.group.g... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/playstation_network/notify.py",
"license": "Apache License 2.0",
"lines": 167,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/smartthings/vacuum.py | """SmartThings vacuum platform."""
from __future__ import annotations
import logging
from typing import Any
from pysmartthings import Attribute, Command, SmartThings
from pysmartthings.capability import Capability
from homeassistant.components.vacuum import (
StateVacuumEntity,
VacuumActivity,
VacuumEnt... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/smartthings/vacuum.py",
"license": "Apache License 2.0",
"lines": 114,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/smhi/sensor.py | """Sensor platform for SMHI integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/smhi/sensor.py",
"license": "Apache License 2.0",
"lines": 285,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/stookwijzer/services.py | """Define services for the Stookwijzer integration."""
from typing import Required, TypedDict, cast
import voluptuous as vol
from homeassistant.const import ATTR_CONFIG_ENTRY_ID
from homeassistant.core import (
HomeAssistant,
ServiceCall,
ServiceResponse,
SupportsResponse,
callback,
)
from homeas... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/stookwijzer/services.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/switchbot_cloud/fan.py | """Support for the Switchbot Battery Circulator fan."""
import asyncio
import logging
from typing import Any
from switchbot_api import (
AirPurifierCommands,
BatteryCirculatorFanCommands,
BatteryCirculatorFanMode,
CommonCommands,
SwitchBotAPI,
)
from homeassistant.components.fan import FanEntity,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/switchbot_cloud/fan.py",
"license": "Apache License 2.0",
"lines": 172,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/switchbot_cloud/light.py | """Support for the Switchbot Light."""
import asyncio
from typing import Any
from switchbot_api import (
CeilingLightCommands,
CommonCommands,
Device,
Remote,
RGBWLightCommands,
RGBWWLightCommands,
SwitchBotAPI,
)
from homeassistant.components.light import ColorMode, LightEntity
from home... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/switchbot_cloud/light.py",
"license": "Apache License 2.0",
"lines": 181,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/uptime_kuma/config_flow.py | """Config flow for the Uptime Kuma integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from pythonkuma import (
UptimeKuma,
UptimeKumaAuthenticationException,
UptimeKumaException,
UptimeKumaParseException,
)
import voluptuous as... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/config_flow.py",
"license": "Apache License 2.0",
"lines": 205,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/uptime_kuma/const.py | """Constants for the Uptime Kuma integration."""
from pythonkuma import MonitorType
DOMAIN = "uptime_kuma"
HAS_CERT = {
MonitorType.HTTP,
MonitorType.KEYWORD,
MonitorType.JSON_QUERY,
}
HAS_URL = HAS_CERT | {MonitorType.REAL_BROWSER}
HAS_PORT = {
MonitorType.PORT,
MonitorType.STEAM,
MonitorTyp... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/const.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/uptime_kuma/coordinator.py | """Coordinator for the Uptime Kuma integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from pythonkuma import (
UpdateException,
UptimeKuma,
UptimeKumaAuthenticationException,
UptimeKumaException,
UptimeKumaMonitor,
UptimeKumaParseException,
Up... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/coordinator.py",
"license": "Apache License 2.0",
"lines": 150,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/uptime_kuma/diagnostics.py | """Diagnostics platform for Uptime Kuma."""
from __future__ import annotations
from dataclasses import asdict
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.core import HomeAssistant
from .coordinator import UptimeKumaConfigEntry
TO_REDACT = {"monitor_u... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/diagnostics.py",
"license": "Apache License 2.0",
"lines": 15,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/uptime_kuma/sensor.py | """Sensor platform for the Uptime Kuma integration."""
from __future__ import annotations
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from enum import StrEnum
from typing import Any
from pythonkuma import MonitorType, UptimeKumaMonitor
from pythonkuma.models import MonitorStatus
f... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/sensor.py",
"license": "Apache License 2.0",
"lines": 260,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/uptime_kuma/update.py | """Update platform for the Uptime Kuma integration."""
from __future__ import annotations
from enum import StrEnum
from yarl import URL
from homeassistant.components.update import (
UpdateEntity,
UpdateEntityDescription,
UpdateEntityFeature,
)
from homeassistant.const import CONF_URL, EntityCategory
fro... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptime_kuma/update.py",
"license": "Apache License 2.0",
"lines": 98,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/velux/binary_sensor.py | """Support for rain sensors built into some Velux windows."""
from __future__ import annotations
from datetime import timedelta
from pyvlx.exception import PyVLXException
from pyvlx.opening_device import OpeningDevice, Window
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
Bina... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/velux/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/api.py | """API for Volvo bound to Home Assistant OAuth."""
import logging
from typing import cast
from aiohttp import ClientSession
from volvocarsapi.auth import AccessTokenManager
from homeassistant.helpers.config_entry_oauth2_flow import OAuth2Session
from homeassistant.helpers.redact import async_redact_data
_LOGGER = l... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/api.py",
"license": "Apache License 2.0",
"lines": 40,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/application_credentials.py | """Application credentials platform for the Volvo integration."""
from __future__ import annotations
from volvocarsapi.auth import AUTHORIZE_URL, TOKEN_URL
from volvocarsapi.scopes import ALL_SCOPES
from homeassistant.components.application_credentials import ClientCredential
from homeassistant.core import HomeAssis... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/application_credentials.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/config_flow.py | """Config flow for Volvo."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
import voluptuous as vol
from volvocarsapi.api import VolvoCarsApi
from volvocarsapi.models import VolvoApiException, VolvoCarsVehicle
from volvocarsapi.scopes import ALL_SCOPES
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/config_flow.py",
"license": "Apache License 2.0",
"lines": 205,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/volvo/const.py | """Constants for the Volvo integration."""
from homeassistant.const import Platform
DOMAIN = "volvo"
PLATFORMS: list[Platform] = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.DEVICE_TRACKER,
Platform.LOCK,
Platform.SENSOR,
]
API_NONE_VALUE = "UNSPECIFIED"
CONF_VIN = "vin"
DATA_BATTERY_CAPAC... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/const.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/coordinator.py | """Volvo coordinators."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from datetime import timedelta
import logging
from typing import Any, cast
from volvocarsapi.api import VolvoCarsApi
from volvoc... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/coordinator.py",
"license": "Apache License 2.0",
"lines": 291,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/volvo/entity.py | """Volvo entity classes."""
from abc import abstractmethod
from dataclasses import dataclass
from volvocarsapi.models import VolvoCarsApiBaseModel
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.core import callback
from homeassistant.helpers.device_registry import DeviceInfo
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/entity.py",
"license": "Apache License 2.0",
"lines": 78,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/sensor.py | """Volvo sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import logging
from typing import cast
from volvocarsapi.models import (
VolvoCarsApiBaseModel,
VolvoCarsLocation,
VolvoCarsValue,
VolvoCarsValueField,
VolvoCarsValueStat... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/sensor.py",
"license": "Apache License 2.0",
"lines": 397,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/wiz/fan.py | """WiZ integration fan platform."""
from __future__ import annotations
import math
from typing import Any, ClassVar
from pywizlight.bulblibrary import BulbType, Features
from homeassistant.components.fan import (
DIRECTION_FORWARD,
DIRECTION_REVERSE,
FanEntity,
FanEntityFeature,
)
from homeassistant... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/wiz/fan.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/zone/condition.py | """Offer zone automation rules."""
from __future__ import annotations
from typing import Any, Unpack, cast
import voluptuous as vol
from homeassistant.const import (
ATTR_GPS_ACCURACY,
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_ENTITY_ID,
CONF_OPTIONS,
CONF_ZONE,
STATE_UNAVAILABLE,
STATE_UN... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/zone/condition.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/zwave_js/models.py | """Provide models for the Z-Wave integration."""
from __future__ import annotations
from collections.abc import Iterable
from dataclasses import asdict, dataclass, field
from enum import StrEnum
from typing import TYPE_CHECKING, Any
from awesomeversion import AwesomeVersion
from zwave_js_server.const import LogLevel... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/zwave_js/models.py",
"license": "Apache License 2.0",
"lines": 201,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/helpers/target.py | """Helpers for dealing with entity targets."""
from __future__ import annotations
import abc
from collections.abc import Callable
import dataclasses
import logging
from logging import Logger
from typing import Any, TypeGuard
from homeassistant.const import (
ATTR_AREA_ID,
ATTR_DEVICE_ID,
ATTR_ENTITY_ID,
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/helpers/target.py",
"license": "Apache License 2.0",
"lines": 323,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/util/resource.py | """Resource management utilities for Home Assistant."""
from __future__ import annotations
import logging
import os
import resource
from typing import Final
_LOGGER = logging.getLogger(__name__)
# Default soft file descriptor limit to set
DEFAULT_SOFT_FILE_LIMIT: Final = 2048
def set_open_file_descriptor_limit() ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/util/resource.py",
"license": "Apache License 2.0",
"lines": 52,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:pylint/plugins/hass_async_load_fixtures.py | """Plugin for logger invocations."""
from __future__ import annotations
from astroid import nodes
from pylint.checkers import BaseChecker
from pylint.lint import PyLinter
FUNCTION_NAMES = (
"load_fixture",
"load_json_array_fixture",
"load_json_object_fixture",
)
class HassLoadFixturesChecker(BaseChecke... | {
"repo_id": "home-assistant/core",
"file_path": "pylint/plugins/hass_async_load_fixtures.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:script/hassfest/conditions.py | """Validate conditions."""
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
fr... | {
"repo_id": "home-assistant/core",
"file_path": "script/hassfest/conditions.py",
"license": "Apache License 2.0",
"lines": 194,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:tests/components/airos/test_config_flow.py | """Test the Ubiquiti airOS config flow."""
from typing import Any
from unittest.mock import AsyncMock, patch
from airos.exceptions import (
AirOSConnectionAuthenticationError,
AirOSConnectionSetupError,
AirOSDeviceConnectionError,
AirOSEndpointError,
AirOSKeyDataMissingError,
AirOSListenerErro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airos/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 734,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/airos/test_diagnostics.py | """Diagnostic tests for airOS."""
from unittest.mock import AsyncMock, MagicMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.airos.coordinator import AirOS8Data
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
fro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airos/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/airos/test_sensor.py | """Test the Ubiquiti airOS sensors."""
from datetime import timedelta
from unittest.mock import AsyncMock
from airos.exceptions import AirOSDataMissingError, AirOSDeviceConnectionError
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.comp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airos/test_sensor.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/airthings/test_sensor.py | """Test the Airthings sensors."""
from airthings import Airthings
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import setup_integration
from tests.common import MockConfigEntry, snapshot_platform
async de... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airthings/test_sensor.py",
"license": "Apache License 2.0",
"lines": 17,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/alexa_devices/test_services.py | """Tests for Alexa Devices services."""
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.alexa_devices.const import DOMAIN
from homeassistant.components.alexa_devices.services import (
ATTR_INFO_SKILL,
ATTR_SOUND,
ATTR_TEXT_COM... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/alexa_devices/test_services.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/amberelectric/test_helpers.py | """Test formatters."""
from amberelectric.models.price_descriptor import PriceDescriptor
from homeassistant.components.amberelectric.helpers import normalize_descriptor
def test_normalize_descriptor() -> None:
"""Test normalizing descriptors works correctly."""
assert normalize_descriptor(None) is None
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/amberelectric/test_helpers.py",
"license": "Apache License 2.0",
"lines": 13,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/amberelectric/test_services.py | """Test the Amber Service object."""
import re
import pytest
import voluptuous as vol
from homeassistant.components.amberelectric.const import DOMAIN
from homeassistant.components.amberelectric.services import ATTR_CHANNEL_TYPE
from homeassistant.const import ATTR_CONFIG_ENTRY_ID
from homeassistant.core import HomeA... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/amberelectric/test_services.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/blue_current/test_switch.py | """The tests for Bluecurrent switches."""
from homeassistant.components.blue_current import CHARGEPOINT_SETTINGS, PLUG_AND_CHARGE
from homeassistant.components.blue_current.const import (
ACTIVITY,
CHARGEPOINT_STATUS,
PUBLIC_CHARGING,
UNAVAILABLE,
)
from homeassistant.const import STATE_OFF, STATE_ON, ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/blue_current/test_switch.py",
"license": "Apache License 2.0",
"lines": 113,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/bring/test_services.py | """Test actions of Bring! integration."""
from unittest.mock import AsyncMock
from bring_api import (
ActivityType,
BringActivityResponse,
BringNotificationType,
BringRequestException,
ReactionType,
)
import pytest
from homeassistant.components.bring.const import DOMAIN
from homeassistant.compone... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/bring/test_services.py",
"license": "Apache License 2.0",
"lines": 156,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/datadog/common.py | """Common helpers for the datetime entity component tests."""
from unittest import mock
MOCK_DATA = {
"host": "localhost",
"port": 8125,
}
MOCK_OPTIONS = {
"prefix": "hass",
"rate": 1,
}
MOCK_CONFIG = {**MOCK_DATA, **MOCK_OPTIONS}
CONNECTION_TEST_METRIC = "connection_test"
def create_mock_state(e... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/datadog/common.py",
"license": "Apache License 2.0",
"lines": 20,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/datadog/test_config_flow.py | """Tests for the Datadog config flow."""
from unittest.mock import MagicMock, patch
from homeassistant.components.datadog.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
from .common import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/datadog/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 146,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/downloader/test_services.py | """Test downloader services."""
import asyncio
from contextlib import AbstractContextManager, nullcontext as does_not_raise
import pytest
from requests_mock import Mocker
import voluptuous as vol
from homeassistant.components.downloader.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/downloader/test_services.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/esphome/test_dynamic_encryption.py | """Tests for ESPHome dynamic encryption key generation."""
from __future__ import annotations
import base64
from homeassistant.components.esphome.encryption_key_storage import (
ESPHomeEncryptionKeyStorage,
async_get_encryption_key_storage,
)
from homeassistant.core import HomeAssistant
async def test_dyna... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/esphome/test_dynamic_encryption.py",
"license": "Apache License 2.0",
"lines": 74,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/google_assistant_sdk/test_application_credentials.py | """Test the Google Assistant SDK application_credentials."""
import pytest
from homeassistant import setup
from homeassistant.components.google_assistant_sdk.application_credentials import (
async_get_description_placeholders,
)
from homeassistant.core import HomeAssistant
@pytest.mark.parametrize(
("additi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/google_assistant_sdk/test_application_credentials.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/google_generative_ai_conversation/test_ai_task.py | """Test AI Task platform of Google Generative AI Conversation integration."""
from pathlib import Path
from unittest.mock import AsyncMock, Mock, patch
from google.genai.types import File, FileState, GenerateContentResponse
import pytest
import voluptuous as vol
from homeassistant.components import ai_task, media_so... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/google_generative_ai_conversation/test_ai_task.py",
"license": "Apache License 2.0",
"lines": 268,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/google_generative_ai_conversation/test_stt.py | """Tests for the Google Generative AI Conversation STT entity."""
from __future__ import annotations
from collections.abc import AsyncIterable, Generator
from unittest.mock import AsyncMock, Mock, patch
from google.genai import types
import pytest
from homeassistant.components import stt
from homeassistant.componen... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/google_generative_ai_conversation/test_stt.py",
"license": "Apache License 2.0",
"lines": 253,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homee/test_init.py | """Test Homee initialization."""
from unittest.mock import MagicMock
from pyHomee import HomeeAuthFailedException, HomeeConnectionFailedException
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.homee.const import DOMAIN
from homeassistant.config_entries import ConfigEntrySt... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homee/test_init.py",
"license": "Apache License 2.0",
"lines": 171,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homematicip_cloud/test_valve.py | """Test HomematicIP Cloud valve entities."""
from homeassistant.components.valve import (
DOMAIN as VALVE_DOMAIN,
SERVICE_OPEN_VALVE,
ValveState,
)
from homeassistant.core import HomeAssistant
from .helper import HomeFactory, async_manipulate_test_data, get_and_check_entity_basics
async def test_waterin... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homematicip_cloud/test_valve.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/huawei_lte/test_diagnostics.py | """Test huawei_lte diagnostics."""
from unittest.mock import MagicMock, patch
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.components.huawei_lte.const import DOMAIN
from homeassistant.const import CONF_URL
from homeassistant.core import HomeAssistant
from . impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huawei_lte/test_diagnostics.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/husqvarna_automower_ble/test_sensor.py | """Test the Husqvarna Automower Bluetooth setup."""
from unittest.mock import 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 tests.common import Mock... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/husqvarna_automower_ble/test_sensor.py",
"license": "Apache License 2.0",
"lines": 23,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/huum/test_binary_sensor.py | """Tests for the Huum climate entity."""
from unittest.mock import AsyncMock
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_with_selected_platforms
from ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huum/test_binary_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/huum/test_climate.py | """Tests for the Huum climate entity."""
from unittest.mock import AsyncMock
from huum.const import SaunaStatus
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.climate import (
ATTR_HVAC_MODE,
DOMAIN as CLIMATE_DOMAIN,
SERVICE_SET_HVAC_MODE,
SERVICE_SET_TEMPERATURE,
H... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huum/test_climate.py",
"license": "Apache License 2.0",
"lines": 93,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/huum/test_init.py | """Tests for the Huum __init__."""
from unittest.mock import AsyncMock
from homeassistant.components.huum.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from . import setup_with_selected_platforms
fr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huum/test_init.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/huum/test_light.py | """Tests for the Huum light entity."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.light import DOMAIN as LIGHT_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_OFF,
STATE_ON,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huum/test_light.py",
"license": "Apache License 2.0",
"lines": 60,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/immich/test_services.py | """Test the Immich services."""
from unittest.mock import Mock, patch
from aioimmich.exceptions import ImmichError, ImmichNotFoundError
import pytest
from homeassistant.components.immich.const import DOMAIN
from homeassistant.components.immich.services import SERVICE_UPLOAD_FILE
from homeassistant.components.media_s... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/immich/test_services.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/ituran/test_binary_sensor.py | """Test the Ituran binary sensor platform."""
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
from pyituran.exceptions import IturanApiError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.ituran.const import UPDATE_INTERVAL
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ituran/test_binary_sensor.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/kostal_plenticore/test_switch.py | """Test the Kostal Plenticore Solar Inverter switch platform."""
from datetime import timedelta
from unittest.mock import Mock
from pykoplenti import SettingsData
import pytest
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
SERVICE_TURN_O... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/kostal_plenticore/test_switch.py",
"license": "Apache License 2.0",
"lines": 166,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/media_source/test_const.py | """Test constants for the media source component."""
import pytest
from homeassistant.components.media_source.const import URI_SCHEME_REGEX
@pytest.mark.parametrize(
("uri", "expected_domain", "expected_identifier"),
[
("media-source://", None, None),
("media-source://local_media", "local_me... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/media_source/test_const.py",
"license": "Apache License 2.0",
"lines": 74,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/miele/test_services.py | """Tests the services provided by the miele integration."""
from datetime import timedelta
from unittest.mock import MagicMock, Mock
from aiohttp import ClientResponseError
import pytest
from syrupy.assertion import SnapshotAssertion
from voluptuous import MultipleInvalid
from homeassistant.components.miele.const im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/miele/test_services.py",
"license": "Apache License 2.0",
"lines": 189,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/mqtt/test_repairs.py | """Test repairs for MQTT."""
from collections.abc import Coroutine
from copy import deepcopy
from typing import Any
from unittest.mock import patch
import pytest
from homeassistant.components import mqtt
from homeassistant.config_entries import ConfigSubentry, ConfigSubentryData
from homeassistant.const import SERVI... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/mqtt/test_repairs.py",
"license": "Apache License 2.0",
"lines": 152,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ollama/test_ai_task.py | """Test AI Task platform of Ollama integration."""
from pathlib import Path
from unittest.mock import patch
import ollama
import pytest
import voluptuous as vol
from homeassistant.components import ai_task, media_source
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantEr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ollama/test_ai_task.py",
"license": "Apache License 2.0",
"lines": 317,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/onkyo/test_media_player.py | """Test Onkyo media player platform."""
import asyncio
from collections.abc import AsyncGenerator
from unittest.mock import AsyncMock, patch
from aioonkyo import Code, Instruction, Kind, Zone, command, query, status
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.media_play... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/onkyo/test_media_player.py",
"license": "Apache License 2.0",
"lines": 277,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/open_router/test_ai_task.py | """Test AI Task structured data generation."""
from pathlib import Path
from unittest.mock import AsyncMock, patch
from openai.types import CompletionUsage
from openai.types.chat import ChatCompletion, ChatCompletionMessage
from openai.types.chat.chat_completion import Choice
import pytest
from syrupy.assertion impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/open_router/test_ai_task.py",
"license": "Apache License 2.0",
"lines": 277,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/open_router/test_config_flow.py | """Test the OpenRouter config flow."""
from unittest.mock import AsyncMock
import pytest
from python_open_router import OpenRouterError
from homeassistant.components.open_router.const import CONF_PROMPT, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY, CONF_LL... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/open_router/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 335,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/open_router/test_conversation.py | """Tests for the OpenRouter integration."""
import datetime
from unittest.mock import AsyncMock, patch
from freezegun import freeze_time
from openai.types import CompletionUsage
from openai.types.chat import (
ChatCompletion,
ChatCompletionMessage,
ChatCompletionMessageFunctionToolCall,
)
from openai.type... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/open_router/test_conversation.py",
"license": "Apache License 2.0",
"lines": 188,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openai_conversation/test_ai_task.py | """Test AI Task platform of OpenAI Conversation integration."""
from pathlib import Path
from unittest.mock import AsyncMock, patch
import httpx
from openai import PermissionDeniedError
import pytest
import voluptuous as vol
from homeassistant.components import ai_task, media_source
from homeassistant.components.ope... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openai_conversation/test_ai_task.py",
"license": "Apache License 2.0",
"lines": 274,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openai_conversation/test_entity.py | """Tests for the OpenAI Conversation entity."""
import voluptuous as vol
from homeassistant.components.openai_conversation.entity import (
_format_structured_output,
)
from homeassistant.helpers import selector
async def test_format_structured_output() -> None:
"""Test the format_structured_output function.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openai_conversation/test_entity.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/opower/test_coordinator.py | """Tests for the Opower coordinator."""
from datetime import datetime
from unittest.mock import AsyncMock
from opower import CostRead
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.opower.const import DOMAIN
from homeassistant.components.opower.coordinator import OpowerCoo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/opower/test_coordinator.py",
"license": "Apache License 2.0",
"lines": 218,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/opower/test_init.py | """Tests for the Opower integration."""
from unittest.mock import AsyncMock
from opower.exceptions import ApiException, CannotConnect, InvalidAuth
import pytest
from homeassistant.components.opower.const import DOMAIN
from homeassistant.components.recorder import Recorder
from homeassistant.config_entries import Con... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/opower/test_init.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/opower/test_sensor.py | """Tests for the Opower sensor platform."""
from datetime import datetime
from unittest.mock import AsyncMock, patch
from opower import CostRead
import pytest
from homeassistant.components.recorder import Recorder
from homeassistant.const import ATTR_UNIT_OF_MEASUREMENT, UnitOfEnergy, UnitOfVolume
from homeassistant... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/opower/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/pi_hole/test_repairs.py | """Test pi_hole component."""
from datetime import timedelta
from unittest.mock import AsyncMock
from hole.exceptions import HoleConnectionError, HoleError
import pytest
import homeassistant
from homeassistant.components import pi_hole
from homeassistant.components.pi_hole.const import VERSION_6_RESPONSE_TO_5_ERROR
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/pi_hole/test_repairs.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/pi_hole/test_sensor.py | """Test pi_hole component."""
import copy
from datetime import timedelta
from unittest.mock import AsyncMock
import pytest
from homeassistant.components import pi_hole
from homeassistant.components.pi_hole.const import CONF_STATISTICS_ONLY
from homeassistant.core import HomeAssistant
from homeassistant.util import d... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/pi_hole/test_sensor.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_binary_sensor.py | """Test the Playstation Network binary 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 impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_binary_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/playstation_network/test_image.py | """Test the PlayStation Network image platform."""
from collections.abc import Generator
from datetime import timedelta
from http import HTTPStatus
from unittest.mock import MagicMock, patch
from freezegun.api import FrozenDateTimeFactory
import pytest
import respx
from homeassistant.config_entries import ConfigEntr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_image.py",
"license": "Apache License 2.0",
"lines": 77,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_init.py | """Tests for PlayStation Network."""
from datetime import timedelta
from unittest.mock import MagicMock
from freezegun.api import FrozenDateTimeFactory
from psnawp_api.core import (
PSNAWPAuthenticationError,
PSNAWPClientError,
PSNAWPForbiddenError,
PSNAWPNotFoundError,
PSNAWPServerError,
)
import... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_init.py",
"license": "Apache License 2.0",
"lines": 269,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/playstation_network/test_notify.py | """Tests for the PlayStation Network notify platform."""
from collections.abc import AsyncGenerator
from unittest.mock import MagicMock, patch
from psnawp_api.core.psnawp_exceptions import (
PSNAWPClientError,
PSNAWPForbiddenError,
PSNAWPNotFoundError,
PSNAWPServerError,
)
import pytest
from syrupy.as... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/playstation_network/test_notify.py",
"license": "Apache License 2.0",
"lines": 134,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/smartthings/test_vacuum.py | """Test for the SmartThings vacuum platform."""
from unittest.mock import AsyncMock
from pysmartthings import Attribute, Capability, Command
from pysmartthings.models import HealthStatus
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.smartthings import MAIN
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/smartthings/test_vacuum.py",
"license": "Apache License 2.0",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/smhi/test_sensor.py | """Test for the smhi weather entity."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_registry import EntityRegistry
from tests.common import MockConfigEntry, snapshot_platform
@py... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/smhi/test_sensor.py",
"license": "Apache License 2.0",
"lines": 20,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/snapcast/test_media_player.py | """Test the snapcast media player implementation."""
from unittest.mock import AsyncMock, PropertyMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.media_player import (
ATTR_GROUP_MEMBERS,
DOMAIN as MEDIA_PLAYER_DOMAIN,
SERVICE_JOIN,
SERVICE_UNJOI... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/snapcast/test_media_player.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/stookwijzer/test_services.py | """Tests for the Stookwijzer services."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.stookwijzer.const import DOMAIN, SERVICE_GET_FORECAST
from homeassistant.const import ATTR_CONFIG_ENTRY_ID
from homeassistant.core import HomeAssistant
from homeassistant.exceptions imp... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/stookwijzer/test_services.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/switchbot_cloud/test_fan.py | """Test for the Switchbot Battery Circulator Fan."""
from unittest.mock import patch
import pytest
import switchbot_api
from switchbot_api import Device, SwitchBotAPI
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.fan import (
ATTR_PERCENTAGE,
ATTR_PRESET_MODE,
DOMAIN as FAN... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_fan.py",
"license": "Apache License 2.0",
"lines": 226,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot_cloud/test_light.py | """Test for the Switchbot Light Entity."""
from unittest.mock import patch
import pytest
from switchbot_api import CeilingLightCommands, CommonCommands, Device, SwitchBotAPI
from homeassistant.components.light import (
ATTR_COLOR_MODE,
DOMAIN as LIGHT_DOMAIN,
ColorMode,
)
from homeassistant.config_entrie... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_light.py",
"license": "Apache License 2.0",
"lines": 508,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot_cloud/test_vacuum.py | """Test for the switchbot_cloud vacuum."""
from unittest.mock import patch
from switchbot_api import (
Device,
VacuumCleanerV2Commands,
VacuumCleanerV3Commands,
VacuumCleanMode,
VacuumCommands,
)
from homeassistant.components.switchbot_cloud import SwitchBotAPI
from homeassistant.components.switc... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_vacuum.py",
"license": "Apache License 2.0",
"lines": 465,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/template/test_helpers.py | """The tests for template helpers."""
import pytest
from homeassistant.components.template.alarm_control_panel import (
LEGACY_FIELDS as ALARM_CONTROL_PANEL_LEGACY_FIELDS,
)
from homeassistant.components.template.binary_sensor import (
LEGACY_FIELDS as BINARY_SENSOR_LEGACY_FIELDS,
)
from homeassistant.compone... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/template/test_helpers.py",
"license": "Apache License 2.0",
"lines": 908,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.