Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
test_configure_two_steps | (manager) | Test that we reuse instances. | Test that we reuse instances. | async def test_configure_two_steps(manager):
"""Test that we reuse instances."""
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 1
async def async_step_first(self, user_input=None):
if user_input is not None:
self.init_da... | [
"async",
"def",
"test_configure_two_steps",
"(",
"manager",
")",
":",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSION",
"=",
"1",
"async",
"def",
"async_step_first... | [
71,
0
] | [
103,
57
] | python | en | ['en', 'fr', 'en'] | True |
test_show_form | (manager) | Test that we can show a form. | Test that we can show a form. | async def test_show_form(manager):
"""Test that we can show a form."""
schema = vol.Schema({vol.Required("username"): str, vol.Required("password"): str})
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
async def async_step_init(self, user_input=None):
... | [
"async",
"def",
"test_show_form",
"(",
"manager",
")",
":",
"schema",
"=",
"vol",
".",
"Schema",
"(",
"{",
"vol",
".",
"Required",
"(",
"\"username\"",
")",
":",
"str",
",",
"vol",
".",
"Required",
"(",
"\"password\"",
")",
":",
"str",
"}",
")",
"@",... | [
106,
0
] | [
122,
62
] | python | en | ['en', 'en', 'en'] | True |
test_abort_removes_instance | (manager) | Test that abort removes the flow from progress. | Test that abort removes the flow from progress. | async def test_abort_removes_instance(manager):
"""Test that abort removes the flow from progress."""
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
is_new = True
async def async_step_init(self, user_input=None):
old = self.is_new
sel... | [
"async",
"def",
"test_abort_removes_instance",
"(",
"manager",
")",
":",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"is_new",
"=",
"True",
"async",
"def",
"async_step_... | [
125,
0
] | [
144,
49
] | python | en | ['en', 'en', 'en'] | True |
test_create_saves_data | (manager) | Test creating a config entry. | Test creating a config entry. | async def test_create_saves_data(manager):
"""Test creating a config entry."""
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 5
async def async_step_init(self, user_input=None):
return self.async_create_entry(title="Test Title", data="T... | [
"async",
"def",
"test_create_saves_data",
"(",
"manager",
")",
":",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSION",
"=",
"5",
"async",
"def",
"async_step_init",
... | [
147,
0
] | [
166,
34
] | python | en | ['en', 'en', 'en'] | True |
test_discovery_init_flow | (manager) | Test a flow initialized by discovery. | Test a flow initialized by discovery. | async def test_discovery_init_flow(manager):
"""Test a flow initialized by discovery."""
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 5
async def async_step_init(self, info):
return self.async_create_entry(title=info["id"], data=info)... | [
"async",
"def",
"test_discovery_init_flow",
"(",
"manager",
")",
":",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSION",
"=",
"5",
"async",
"def",
"async_step_init"... | [
169,
0
] | [
190,
41
] | python | en | ['en', 'en', 'en'] | True |
test_finish_callback_change_result_type | (hass) | Test finish callback can change result type. | Test finish callback can change result type. | async def test_finish_callback_change_result_type(hass):
"""Test finish callback can change result type."""
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 1
async def async_step_init(self, input):
"""Return init form with one input field 'count'."""
if input is ... | [
"async",
"def",
"test_finish_callback_change_result_type",
"(",
"hass",
")",
":",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSION",
"=",
"1",
"async",
"def",
"async_step_init",
"(",
"self",
",",
"input",
")",
":",
"\"\"\"Retur... | [
193,
0
] | [
236,
32
] | python | en | ['en', 'en', 'en'] | True |
test_external_step | (hass, manager) | Test external step logic. | Test external step logic. | async def test_external_step(hass, manager):
"""Test external step logic."""
manager.hass = hass
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 5
data = None
async def async_step_init(self, user_input=None):
if not user_inpu... | [
"async",
"def",
"test_external_step",
"(",
"hass",
",",
"manager",
")",
":",
"manager",
".",
"hass",
"=",
"hass",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSI... | [
239,
0
] | [
284,
37
] | python | en | ['en', 'lb', 'en'] | True |
test_show_progress | (hass, manager) | Test show progress logic. | Test show progress logic. | async def test_show_progress(hass, manager):
"""Test show progress logic."""
manager.hass = hass
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
VERSION = 5
data = None
task_one_done = False
async def async_step_init(self, user_input=None)... | [
"async",
"def",
"test_show_progress",
"(",
"hass",
",",
"manager",
")",
":",
"manager",
".",
"hass",
"=",
"hass",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"VERSI... | [
287,
0
] | [
354,
37
] | python | en | ['en', 'pl', 'en'] | True |
test_abort_flow_exception | (manager) | Test that the AbortFlow exception works. | Test that the AbortFlow exception works. | async def test_abort_flow_exception(manager):
"""Test that the AbortFlow exception works."""
@manager.mock_reg_handler("test")
class TestFlow(data_entry_flow.FlowHandler):
async def async_step_init(self, user_input=None):
raise data_entry_flow.AbortFlow("mock-reason", {"placeholder": "y... | [
"async",
"def",
"test_abort_flow_exception",
"(",
"manager",
")",
":",
"@",
"manager",
".",
"mock_reg_handler",
"(",
"\"test\"",
")",
"class",
"TestFlow",
"(",
"data_entry_flow",
".",
"FlowHandler",
")",
":",
"async",
"def",
"async_step_init",
"(",
"self",
",",
... | [
357,
0
] | [
368,
68
] | python | en | ['en', 'en', 'en'] | True |
test_simpleconnect_fan_setup | (hass) | Test that a SIMPLEconnect fan can be correctly setup in HA. | Test that a SIMPLEconnect fan can be correctly setup in HA. | async def test_simpleconnect_fan_setup(hass):
"""Test that a SIMPLEconnect fan can be correctly setup in HA."""
accessories = await setup_accessories_from_file(hass, "simpleconnect_fan.json")
config_entry, pairing = await setup_test_accessories(hass, accessories)
entity_registry = await hass.helpers.en... | [
"async",
"def",
"test_simpleconnect_fan_setup",
"(",
"hass",
")",
":",
"accessories",
"=",
"await",
"setup_accessories_from_file",
"(",
"hass",
",",
"\"simpleconnect_fan.json\"",
")",
"config_entry",
",",
"pairing",
"=",
"await",
"setup_test_accessories",
"(",
"hass",
... | [
15,
0
] | [
49,
39
] | python | en | ['en', 'en', 'en'] | True |
setup_fritzbox | (hass: HomeAssistantType, config: dict) | Set up mock AVM Fritz!Box. | Set up mock AVM Fritz!Box. | async def setup_fritzbox(hass: HomeAssistantType, config: dict):
"""Set up mock AVM Fritz!Box."""
assert await async_setup_component(hass, FB_DOMAIN, config)
await hass.async_block_till_done() | [
"async",
"def",
"setup_fritzbox",
"(",
"hass",
":",
"HomeAssistantType",
",",
"config",
":",
"dict",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"FB_DOMAIN",
",",
"config",
")",
"await",
"hass",
".",
"async_block_till_done",
"(",
")... | [
26,
0
] | [
29,
38
] | python | en | ['en', 'zu', 'en'] | True |
test_setup | (hass: HomeAssistantType, fritz: Mock) | Test setup of platform. | Test setup of platform. | async def test_setup(hass: HomeAssistantType, fritz: Mock):
"""Test setup of platform."""
device = FritzDeviceBinarySensorMock()
fritz().get_devices.return_value = [device]
await setup_fritzbox(hass, MOCK_CONFIG)
state = hass.states.get(ENTITY_ID)
assert state
assert state.state == STATE_O... | [
"async",
"def",
"test_setup",
"(",
"hass",
":",
"HomeAssistantType",
",",
"fritz",
":",
"Mock",
")",
":",
"device",
"=",
"FritzDeviceBinarySensorMock",
"(",
")",
"fritz",
"(",
")",
".",
"get_devices",
".",
"return_value",
"=",
"[",
"device",
"]",
"await",
... | [
32,
0
] | [
43,
58
] | python | en | ['en', 'da', 'en'] | True |
test_is_off | (hass: HomeAssistantType, fritz: Mock) | Test state of platform. | Test state of platform. | async def test_is_off(hass: HomeAssistantType, fritz: Mock):
"""Test state of platform."""
device = FritzDeviceBinarySensorMock()
device.present = False
fritz().get_devices.return_value = [device]
await setup_fritzbox(hass, MOCK_CONFIG)
state = hass.states.get(ENTITY_ID)
assert state
a... | [
"async",
"def",
"test_is_off",
"(",
"hass",
":",
"HomeAssistantType",
",",
"fritz",
":",
"Mock",
")",
":",
"device",
"=",
"FritzDeviceBinarySensorMock",
"(",
")",
"device",
".",
"present",
"=",
"False",
"fritz",
"(",
")",
".",
"get_devices",
".",
"return_val... | [
46,
0
] | [
56,
35
] | python | en | ['en', 'da', 'en'] | True |
test_update | (hass: HomeAssistantType, fritz: Mock) | Test update with error. | Test update with error. | async def test_update(hass: HomeAssistantType, fritz: Mock):
"""Test update with error."""
device = FritzDeviceBinarySensorMock()
fritz().get_devices.return_value = [device]
await setup_fritzbox(hass, MOCK_CONFIG)
assert device.update.call_count == 1
assert fritz().login.call_count == 1
n... | [
"async",
"def",
"test_update",
"(",
"hass",
":",
"HomeAssistantType",
",",
"fritz",
":",
"Mock",
")",
":",
"device",
"=",
"FritzDeviceBinarySensorMock",
"(",
")",
"fritz",
"(",
")",
".",
"get_devices",
".",
"return_value",
"=",
"[",
"device",
"]",
"await",
... | [
59,
0
] | [
74,
40
] | python | en | ['en', 'de', 'en'] | True |
test_update_error | (hass: HomeAssistantType, fritz: Mock) | Test update with error. | Test update with error. | async def test_update_error(hass: HomeAssistantType, fritz: Mock):
"""Test update with error."""
device = FritzDeviceBinarySensorMock()
device.update.side_effect = [mock.DEFAULT, HTTPError("Boom")]
fritz().get_devices.return_value = [device]
await setup_fritzbox(hass, MOCK_CONFIG)
assert devic... | [
"async",
"def",
"test_update_error",
"(",
"hass",
":",
"HomeAssistantType",
",",
"fritz",
":",
"Mock",
")",
":",
"device",
"=",
"FritzDeviceBinarySensorMock",
"(",
")",
"device",
".",
"update",
".",
"side_effect",
"=",
"[",
"mock",
".",
"DEFAULT",
",",
"HTTP... | [
77,
0
] | [
93,
40
] | python | en | ['en', 'de', 'en'] | True |
test_lock | (
hass: HomeAssistant, vera_component_factory: ComponentFactory
) | Test function. | Test function. | async def test_lock(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test function."""
vera_device = MagicMock(spec=pv.VeraLock) # type: pv.VeraLock
vera_device.device_id = 1
vera_device.vera_device_id = vera_device.device_id
vera_device.name = "dev1"
vera_device... | [
"async",
"def",
"test_lock",
"(",
"hass",
":",
"HomeAssistant",
",",
"vera_component_factory",
":",
"ComponentFactory",
")",
"->",
"None",
":",
"vera_device",
"=",
"MagicMock",
"(",
"spec",
"=",
"pv",
".",
"VeraLock",
")",
"# type: pv.VeraLock",
"vera_device",
"... | [
11,
0
] | [
53,
61
] | python | en | ['en', 'en', 'en'] | False |
GenerateManifest | (context) | Generates a Container Manifest given a Template context.
Args:
context: Template context, which must contain dockerImage and port
properties, and an optional dockerEnv property.
Returns:
A Container Manifest as a YAML string.
| Generates a Container Manifest given a Template context. | def GenerateManifest(context):
"""Generates a Container Manifest given a Template context.
Args:
context: Template context, which must contain dockerImage and port
properties, and an optional dockerEnv property.
Returns:
A Container Manifest as a YAML string.
"""
env_list = []
if 'dockerEn... | [
"def",
"GenerateManifest",
"(",
"context",
")",
":",
"env_list",
"=",
"[",
"]",
"if",
"'dockerEnv'",
"in",
"context",
".",
"properties",
":",
"for",
"key",
",",
"value",
"in",
"six",
".",
"iteritems",
"(",
"context",
".",
"properties",
"[",
"'dockerEnv'",
... | [
20,
0
] | [
56,
54
] | python | en | ['en', 'en', 'en'] | True |
calls | (hass) | Track calls to a mock service. | Track calls to a mock service. | def calls(hass):
"""Track calls to a mock service."""
return async_mock_service(hass, "test", "automation") | [
"def",
"calls",
"(",
"hass",
")",
":",
"return",
"async_mock_service",
"(",
"hass",
",",
"\"test\"",
",",
"\"automation\"",
")"
] | [
12,
0
] | [
14,
57
] | python | en | ['en', 'en', 'en'] | True |
setup_comp | (hass, mqtt_mock) | Initialize components. | Initialize components. | def setup_comp(hass, mqtt_mock):
"""Initialize components."""
mock_component(hass, "group") | [
"def",
"setup_comp",
"(",
"hass",
",",
"mqtt_mock",
")",
":",
"mock_component",
"(",
"hass",
",",
"\"group\"",
")"
] | [
18,
0
] | [
20,
33
] | python | en | ['de', 'en', 'en'] | False |
test_if_fires_on_topic_match | (hass, calls) | Test if message is fired on topic match. | Test if message is fired on topic match. | async def test_if_fires_on_topic_match(hass, calls):
"""Test if message is fired on topic match."""
assert await async_setup_component(
hass,
automation.DOMAIN,
{
automation.DOMAIN: {
"trigger": {"platform": "mqtt", "topic": "test-topic"},
"act... | [
"async",
"def",
"test_if_fires_on_topic_match",
"(",
"hass",
",",
"calls",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"automation",
".",
"DOMAIN",
",",
"{",
"automation",
".",
"DOMAIN",
":",
"{",
"\"trigger\"",
":",
"{",
"\"platfor... | [
23,
0
] | [
56,
26
] | python | en | ['en', 'en', 'en'] | True |
test_if_fires_on_topic_and_payload_match | (hass, calls) | Test if message is fired on topic and payload match. | Test if message is fired on topic and payload match. | async def test_if_fires_on_topic_and_payload_match(hass, calls):
"""Test if message is fired on topic and payload match."""
assert await async_setup_component(
hass,
automation.DOMAIN,
{
automation.DOMAIN: {
"trigger": {
"platform": "mqtt",... | [
"async",
"def",
"test_if_fires_on_topic_and_payload_match",
"(",
"hass",
",",
"calls",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"automation",
".",
"DOMAIN",
",",
"{",
"automation",
".",
"DOMAIN",
":",
"{",
"\"trigger\"",
":",
"{",
... | [
59,
0
] | [
78,
26
] | python | en | ['en', 'en', 'en'] | True |
test_if_not_fires_on_topic_but_no_payload_match | (hass, calls) | Test if message is not fired on topic but no payload. | Test if message is not fired on topic but no payload. | async def test_if_not_fires_on_topic_but_no_payload_match(hass, calls):
"""Test if message is not fired on topic but no payload."""
assert await async_setup_component(
hass,
automation.DOMAIN,
{
automation.DOMAIN: {
"trigger": {
"platform":... | [
"async",
"def",
"test_if_not_fires_on_topic_but_no_payload_match",
"(",
"hass",
",",
"calls",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"automation",
".",
"DOMAIN",
",",
"{",
"automation",
".",
"DOMAIN",
":",
"{",
"\"trigger\"",
":",
... | [
81,
0
] | [
100,
26
] | python | en | ['en', 'en', 'en'] | True |
test_encoding_default | (hass, calls, mqtt_mock) | Test default encoding. | Test default encoding. | async def test_encoding_default(hass, calls, mqtt_mock):
"""Test default encoding."""
assert await async_setup_component(
hass,
automation.DOMAIN,
{
automation.DOMAIN: {
"trigger": {"platform": "mqtt", "topic": "test-topic"},
"action": {"servic... | [
"async",
"def",
"test_encoding_default",
"(",
"hass",
",",
"calls",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"automation",
".",
"DOMAIN",
",",
"{",
"automation",
".",
"DOMAIN",
":",
"{",
"\"trigger\"",
":",
"{... | [
103,
0
] | [
116,
84
] | python | da | ['fr', 'da', 'en'] | False |
test_encoding_custom | (hass, calls, mqtt_mock) | Test default encoding. | Test default encoding. | async def test_encoding_custom(hass, calls, mqtt_mock):
"""Test default encoding."""
assert await async_setup_component(
hass,
automation.DOMAIN,
{
automation.DOMAIN: {
"trigger": {"platform": "mqtt", "topic": "test-topic", "encoding": ""},
"ac... | [
"async",
"def",
"test_encoding_custom",
"(",
"hass",
",",
"calls",
",",
"mqtt_mock",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"automation",
".",
"DOMAIN",
",",
"{",
"automation",
".",
"DOMAIN",
":",
"{",
"\"trigger\"",
":",
"{"... | [
119,
0
] | [
132,
81
] | python | da | ['fr', 'da', 'en'] | False |
async_setup | (hass, hass_config) | Set up the Plaato component. | Set up the Plaato component. | async def async_setup(hass, hass_config):
"""Set up the Plaato component."""
return True | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"hass_config",
")",
":",
"return",
"True"
] | [
62,
0
] | [
64,
15
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, entry) | Configure based on config entry. | Configure based on config entry. | async def async_setup_entry(hass, entry):
"""Configure based on config entry."""
if DOMAIN not in hass.data:
hass.data[DOMAIN] = {}
webhook_id = entry.data[CONF_WEBHOOK_ID]
hass.components.webhook.async_register(DOMAIN, "Plaato", webhook_id, handle_webhook)
hass.async_create_task(hass.conf... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"entry",
")",
":",
"if",
"DOMAIN",
"not",
"in",
"hass",
".",
"data",
":",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"=",
"{",
"}",
"webhook_id",
"=",
"entry",
".",
"data",
"[",
"CONF_WEBHOOK_ID",
... | [
67,
0
] | [
77,
15
] | python | en | ['en', 'en', 'en'] | True |
async_unload_entry | (hass, entry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass, entry):
"""Unload a config entry."""
hass.components.webhook.async_unregister(entry.data[CONF_WEBHOOK_ID])
hass.data[SENSOR_DATA_KEY]()
await hass.config_entries.async_forward_entry_unload(entry, SENSOR)
return True | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
",",
"entry",
")",
":",
"hass",
".",
"components",
".",
"webhook",
".",
"async_unregister",
"(",
"entry",
".",
"data",
"[",
"CONF_WEBHOOK_ID",
"]",
")",
"hass",
".",
"data",
"[",
"SENSOR_DATA_KEY",
"]",
"(... | [
80,
0
] | [
86,
15
] | python | en | ['en', 'es', 'en'] | True |
handle_webhook | (hass, webhook_id, request) | Handle incoming webhook from Plaato. | Handle incoming webhook from Plaato. | async def handle_webhook(hass, webhook_id, request):
"""Handle incoming webhook from Plaato."""
try:
data = WEBHOOK_SCHEMA(await request.json())
except vol.MultipleInvalid as error:
_LOGGER.warning("An error occurred when parsing webhook data <%s>", error)
return
device_id = _de... | [
"async",
"def",
"handle_webhook",
"(",
"hass",
",",
"webhook_id",
",",
"request",
")",
":",
"try",
":",
"data",
"=",
"WEBHOOK_SCHEMA",
"(",
"await",
"request",
".",
"json",
"(",
")",
")",
"except",
"vol",
".",
"MultipleInvalid",
"as",
"error",
":",
"_LOG... | [
89,
0
] | [
124,
78
] | python | en | ['en', 'xh', 'en'] | True |
_device_id | (data) | Return name of device sensor. | Return name of device sensor. | def _device_id(data):
"""Return name of device sensor."""
return f"{data.get(ATTR_DEVICE_NAME)}_{data.get(ATTR_DEVICE_ID)}" | [
"def",
"_device_id",
"(",
"data",
")",
":",
"return",
"f\"{data.get(ATTR_DEVICE_NAME)}_{data.get(ATTR_DEVICE_ID)}\""
] | [
127,
0
] | [
129,
69
] | python | en | ['en', 'sl', 'en'] | True |
get_pairs | (word) |
Return set of symbol pairs in a word.
Word is represented as tuple of symbols (symbols being variable-length strings).
|
Return set of symbol pairs in a word. | def get_pairs(word):
"""
Return set of symbol pairs in a word.
Word is represented as tuple of symbols (symbols being variable-length strings).
"""
pairs = set()
prev_char = word[0]
for char in word[1:]:
pairs.add((prev_char, char))
prev_char = char
pairs = set(pairs)
... | [
"def",
"get_pairs",
"(",
"word",
")",
":",
"pairs",
"=",
"set",
"(",
")",
"prev_char",
"=",
"word",
"[",
"0",
"]",
"for",
"char",
"in",
"word",
"[",
"1",
":",
"]",
":",
"pairs",
".",
"add",
"(",
"(",
"prev_char",
",",
"char",
")",
")",
"prev_ch... | [
96,
0
] | [
109,
16
] | python | en | ['en', 'error', 'th'] | False |
BlenderbotTokenizer.build_inputs_with_special_tokens | (self, token_ids_0: List[int], token_ids_1: List[int] = None) |
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Blenderbot sequence has the following format:
- single sequence: `` X </s>``
Args:
token_ids_0 (:obj:`List[int]`):
List ... |
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Blenderbot sequence has the following format: | def build_inputs_with_special_tokens(self, token_ids_0: List[int], token_ids_1: List[int] = None):
"""
Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. A Blenderbot sequence has the following format:
-... | [
"def",
"build_inputs_with_special_tokens",
"(",
"self",
",",
"token_ids_0",
":",
"List",
"[",
"int",
"]",
",",
"token_ids_1",
":",
"List",
"[",
"int",
"]",
"=",
"None",
")",
":",
"return",
"token_ids_0",
"+",
"[",
"self",
".",
"eos_token_id",
"]"
] | [
60,
4
] | [
76,
48
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner.validate_config | (self, model, config_list) |
Parameters
----------
model : torch.nn.Module
Model to be pruned
config_list : list
List on pruning configs
|
Parameters
----------
model : torch.nn.Module
Model to be pruned
config_list : list
List on pruning configs
| def validate_config(self, model, config_list):
"""
Parameters
----------
model : torch.nn.Module
Model to be pruned
config_list : list
List on pruning configs
"""
if self._base_algo == 'level':
schema = CompressorSchema([{
... | [
"def",
"validate_config",
"(",
"self",
",",
"model",
",",
"config_list",
")",
":",
"if",
"self",
".",
"_base_algo",
"==",
"'level'",
":",
"schema",
"=",
"CompressorSchema",
"(",
"[",
"{",
"'sparsity'",
":",
"And",
"(",
"float",
",",
"lambda",
"n",
":",
... | [
106,
4
] | [
129,
36
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner._sparsities_2_config_list | (self, sparsities) |
convert sparsities vector into config_list for LevelPruner or L1FilterPruner
Parameters
----------
sparsities : list
list of sparsities
Returns
-------
list of dict
config_list for LevelPruner or L1FilterPruner
|
convert sparsities vector into config_list for LevelPruner or L1FilterPruner | def _sparsities_2_config_list(self, sparsities):
'''
convert sparsities vector into config_list for LevelPruner or L1FilterPruner
Parameters
----------
sparsities : list
list of sparsities
Returns
-------
list of dict
config_list ... | [
"def",
"_sparsities_2_config_list",
"(",
"self",
",",
"sparsities",
")",
":",
"config_list",
"=",
"[",
"]",
"sparsities",
"=",
"sorted",
"(",
"sparsities",
")",
"self",
".",
"modules_wrapper",
"=",
"sorted",
"(",
"self",
".",
"modules_wrapper",
",",
"key",
"... | [
131,
4
] | [
163,
26
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner._rescale_sparsities | (self, sparsities, target_sparsity) |
Rescale the sparsities list to satisfy the target overall sparsity
Parameters
----------
sparsities : list
target_sparsity : float
the target overall sparsity
Returns
-------
list
the rescaled sparsities
|
Rescale the sparsities list to satisfy the target overall sparsity | def _rescale_sparsities(self, sparsities, target_sparsity):
'''
Rescale the sparsities list to satisfy the target overall sparsity
Parameters
----------
sparsities : list
target_sparsity : float
the target overall sparsity
Returns
-------
... | [
"def",
"_rescale_sparsities",
"(",
"self",
",",
"sparsities",
",",
"target_sparsity",
")",
":",
"num_weights",
"=",
"[",
"]",
"for",
"wrapper",
"in",
"self",
".",
"get_modules_wrapper",
"(",
")",
":",
"num_weights",
".",
"append",
"(",
"wrapper",
".",
"modul... | [
165,
4
] | [
202,
25
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner._init_sparsities | (self) |
Generate a sorted sparsities vector
|
Generate a sorted sparsities vector
| def _init_sparsities(self):
'''
Generate a sorted sparsities vector
'''
# repeatedly generate a distribution until satisfies the overall sparsity requirement
_logger.info('Gererating sparsities...')
while True:
sparsities = sorted(np.random.uniform(
... | [
"def",
"_init_sparsities",
"(",
"self",
")",
":",
"# repeatedly generate a distribution until satisfies the overall sparsity requirement",
"_logger",
".",
"info",
"(",
"'Gererating sparsities...'",
")",
"while",
"True",
":",
"sparsities",
"=",
"sorted",
"(",
"np",
".",
"r... | [
204,
4
] | [
220,
21
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner._generate_perturbations | (self) |
Generate perturbation to the current sparsities distribution.
Returns:
--------
list
perturbated sparsities
|
Generate perturbation to the current sparsities distribution. | def _generate_perturbations(self):
'''
Generate perturbation to the current sparsities distribution.
Returns:
--------
list
perturbated sparsities
'''
_logger.info("Gererating perturbations to the current sparsities...")
# decrease magnitude ... | [
"def",
"_generate_perturbations",
"(",
"self",
")",
":",
"_logger",
".",
"info",
"(",
"\"Gererating perturbations to the current sparsities...\"",
")",
"# decrease magnitude with current temperature",
"magnitude",
"=",
"self",
".",
"_current_temperature",
"/",
"self",
".",
... | [
222,
4
] | [
248,
33
] | python | en | ['en', 'error', 'th'] | False |
SimulatedAnnealingPruner.compress | (self, return_config_list=False) |
Compress the model with Simulated Annealing.
Returns
-------
torch.nn.Module
model with specified modules compressed.
|
Compress the model with Simulated Annealing. | def compress(self, return_config_list=False):
"""
Compress the model with Simulated Annealing.
Returns
-------
torch.nn.Module
model with specified modules compressed.
"""
_logger.info('Starting Simulated Annealing Compression...')
# initiaze... | [
"def",
"compress",
"(",
"self",
",",
"return_config_list",
"=",
"False",
")",
":",
"_logger",
".",
"info",
"(",
"'Starting Simulated Annealing Compression...'",
")",
"# initiaze a randomized action",
"pruning_iteration",
"=",
"0",
"self",
".",
"_init_sparsities",
"(",
... | [
253,
4
] | [
356,
31
] | python | en | ['en', 'error', 'th'] | False |
async_setup_frontend_storage | (hass) | Set up frontend storage. | Set up frontend storage. | async def async_setup_frontend_storage(hass):
"""Set up frontend storage."""
hass.data[DATA_STORAGE] = ({}, {})
hass.components.websocket_api.async_register_command(websocket_set_user_data)
hass.components.websocket_api.async_register_command(websocket_get_user_data) | [
"async",
"def",
"async_setup_frontend_storage",
"(",
"hass",
")",
":",
"hass",
".",
"data",
"[",
"DATA_STORAGE",
"]",
"=",
"(",
"{",
"}",
",",
"{",
"}",
")",
"hass",
".",
"components",
".",
"websocket_api",
".",
"async_register_command",
"(",
"websocket_set_... | [
13,
0
] | [
17,
81
] | python | en | ['en', 'de', 'en'] | True |
with_store | (orig_func) | Decorate function to provide data. | Decorate function to provide data. | def with_store(orig_func):
"""Decorate function to provide data."""
@wraps(orig_func)
async def with_store_func(hass, connection, msg):
"""Provide user specific data and store to function."""
stores, data = hass.data[DATA_STORAGE]
user_id = connection.user.id
store = stores.... | [
"def",
"with_store",
"(",
"orig_func",
")",
":",
"@",
"wraps",
"(",
"orig_func",
")",
"async",
"def",
"with_store_func",
"(",
"hass",
",",
"connection",
",",
"msg",
")",
":",
"\"\"\"Provide user specific data and store to function.\"\"\"",
"stores",
",",
"data",
"... | [
20,
0
] | [
40,
26
] | python | en | ['en', 'en', 'en'] | True |
websocket_set_user_data | (hass, connection, msg, store, data) | Handle set global data command.
Async friendly.
| Handle set global data command. | async def websocket_set_user_data(hass, connection, msg, store, data):
"""Handle set global data command.
Async friendly.
"""
data[msg["key"]] = msg["value"]
await store.async_save(data)
connection.send_message(websocket_api.result_message(msg["id"])) | [
"async",
"def",
"websocket_set_user_data",
"(",
"hass",
",",
"connection",
",",
"msg",
",",
"store",
",",
"data",
")",
":",
"data",
"[",
"msg",
"[",
"\"key\"",
"]",
"]",
"=",
"msg",
"[",
"\"value\"",
"]",
"await",
"store",
".",
"async_save",
"(",
"data... | [
52,
0
] | [
59,
68
] | python | en | ['fr', 'xh', 'en'] | False |
websocket_get_user_data | (hass, connection, msg, store, data) | Handle get global data command.
Async friendly.
| Handle get global data command. | async def websocket_get_user_data(hass, connection, msg, store, data):
"""Handle get global data command.
Async friendly.
"""
connection.send_message(
websocket_api.result_message(
msg["id"], {"value": data.get(msg["key"]) if "key" in msg else data}
)
) | [
"async",
"def",
"websocket_get_user_data",
"(",
"hass",
",",
"connection",
",",
"msg",
",",
"store",
",",
"data",
")",
":",
"connection",
".",
"send_message",
"(",
"websocket_api",
".",
"result_message",
"(",
"msg",
"[",
"\"id\"",
"]",
",",
"{",
"\"value\"",... | [
67,
0
] | [
76,
5
] | python | en | ['nl', 'en', 'en'] | True |
ConfigFlow.__init__ | (self) | Initialize the Panasonic Viera config flow. | Initialize the Panasonic Viera config flow. | def __init__(self):
"""Initialize the Panasonic Viera config flow."""
self._data = {
CONF_HOST: None,
CONF_NAME: None,
CONF_PORT: None,
CONF_ON_ACTION: None,
ATTR_DEVICE_INFO: None,
}
self._remote = None | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_data",
"=",
"{",
"CONF_HOST",
":",
"None",
",",
"CONF_NAME",
":",
"None",
",",
"CONF_PORT",
":",
"None",
",",
"CONF_ON_ACTION",
":",
"None",
",",
"ATTR_DEVICE_INFO",
":",
"None",
",",
"}",
"self"... | [
33,
4
] | [
43,
27
] | python | en | ['en', 'en', 'en'] | True |
ConfigFlow.async_step_user | (self, user_input=None) | Handle the initial step. | Handle the initial step. | async def async_step_user(self, user_input=None):
"""Handle the initial step."""
errors = {}
if user_input is not None:
await self.async_load_data(user_input)
try:
self._remote = await self.hass.async_add_executor_job(
partial(RemoteCo... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"errors",
"=",
"{",
"}",
"if",
"user_input",
"is",
"not",
"None",
":",
"await",
"self",
".",
"async_load_data",
"(",
"user_input",
")",
"try",
":",
"self",
".",
"... | [
45,
4
] | [
102,
9
] | python | en | ['en', 'en', 'en'] | True |
ConfigFlow.async_step_pairing | (self, user_input=None) | Handle the pairing step. | Handle the pairing step. | async def async_step_pairing(self, user_input=None):
"""Handle the pairing step."""
errors = {}
if user_input is not None:
pin = user_input[CONF_PIN]
try:
await self.hass.async_add_executor_job(
partial(self._remote.authorize_pin_code,... | [
"async",
"def",
"async_step_pairing",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"errors",
"=",
"{",
"}",
"if",
"user_input",
"is",
"not",
"None",
":",
"pin",
"=",
"user_input",
"[",
"CONF_PIN",
"]",
"try",
":",
"await",
"self",
".",
"hass"... | [
104,
4
] | [
152,
9
] | python | en | ['en', 'en', 'en'] | True |
ConfigFlow.async_step_import | (self, import_config) | Import a config entry from configuration.yaml. | Import a config entry from configuration.yaml. | async def async_step_import(self, import_config):
"""Import a config entry from configuration.yaml."""
return await self.async_step_user(user_input=import_config) | [
"async",
"def",
"async_step_import",
"(",
"self",
",",
"import_config",
")",
":",
"return",
"await",
"self",
".",
"async_step_user",
"(",
"user_input",
"=",
"import_config",
")"
] | [
154,
4
] | [
156,
67
] | python | en | ['en', 'en', 'en'] | True |
ConfigFlow.async_load_data | (self, config) | Load the data. | Load the data. | async def async_load_data(self, config):
"""Load the data."""
self._data = config
self._data[CONF_PORT] = (
self._data[CONF_PORT] if CONF_PORT in self._data else DEFAULT_PORT
)
self._data[CONF_ON_ACTION] = (
self._data[CONF_ON_ACTION] if CONF_ON_ACTION in... | [
"async",
"def",
"async_load_data",
"(",
"self",
",",
"config",
")",
":",
"self",
".",
"_data",
"=",
"config",
"self",
".",
"_data",
"[",
"CONF_PORT",
"]",
"=",
"(",
"self",
".",
"_data",
"[",
"CONF_PORT",
"]",
"if",
"CONF_PORT",
"in",
"self",
".",
"_... | [
158,
4
] | [
170,
45
] | python | en | ['en', 'en', 'en'] | True |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Old way of setting up the platform.
Can only be called when a user accidentally mentions the platform in their
config. But even in that case it would have been ignored.
| Old way of setting up the platform. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Old way of setting up the platform.
Can only be called when a user accidentally mentions the platform in their
config. But even in that case it would have been ignored.
""" | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":"
] | [
8,
0
] | [
13,
7
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, entry, async_add_entities) | Set up Daikin climate based on config_entry. | Set up Daikin climate based on config_entry. | async def async_setup_entry(hass, entry, async_add_entities):
"""Set up Daikin climate based on config_entry."""
daikin_api = hass.data[DAIKIN_DOMAIN][entry.entry_id]
zones = daikin_api.device.zones
if zones:
async_add_entities(
[
DaikinZoneSwitch(daikin_api, zone_id)... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"entry",
",",
"async_add_entities",
")",
":",
"daikin_api",
"=",
"hass",
".",
"data",
"[",
"DAIKIN_DOMAIN",
"]",
"[",
"entry",
".",
"entry_id",
"]",
"zones",
"=",
"daikin_api",
".",
"device",
".",
"zon... | [
16,
0
] | [
27,
9
] | python | en | ['en', 'en', 'en'] | True |
DaikinZoneSwitch.__init__ | (self, daikin_api, zone_id) | Initialize the zone. | Initialize the zone. | def __init__(self, daikin_api, zone_id):
"""Initialize the zone."""
self._api = daikin_api
self._zone_id = zone_id | [
"def",
"__init__",
"(",
"self",
",",
"daikin_api",
",",
"zone_id",
")",
":",
"self",
".",
"_api",
"=",
"daikin_api",
"self",
".",
"_zone_id",
"=",
"zone_id"
] | [
33,
4
] | [
36,
31
] | python | en | ['en', 'en', 'en'] | True |
DaikinZoneSwitch.unique_id | (self) | Return a unique ID. | Return a unique ID. | def unique_id(self):
"""Return a unique ID."""
return f"{self._api.device.mac}-zone{self._zone_id}" | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"f\"{self._api.device.mac}-zone{self._zone_id}\""
] | [
39,
4
] | [
41,
60
] | python | ca | ['fr', 'ca', 'en'] | False |
DaikinZoneSwitch.icon | (self) | Icon to use in the frontend, if any. | Icon to use in the frontend, if any. | def icon(self):
"""Icon to use in the frontend, if any."""
return ZONE_ICON | [
"def",
"icon",
"(",
"self",
")",
":",
"return",
"ZONE_ICON"
] | [
44,
4
] | [
46,
24
] | python | en | ['en', 'en', 'en'] | True |
DaikinZoneSwitch.name | (self) | Return the name of the sensor. | Return the name of the sensor. | def name(self):
"""Return the name of the sensor."""
return f"{self._api.name} {self._api.device.zones[self._zone_id][0]}" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"f\"{self._api.name} {self._api.device.zones[self._zone_id][0]}\""
] | [
49,
4
] | [
51,
77
] | python | en | ['en', 'mi', 'en'] | True |
DaikinZoneSwitch.is_on | (self) | Return the state of the sensor. | Return the state of the sensor. | def is_on(self):
"""Return the state of the sensor."""
return self._api.device.zones[self._zone_id][1] == "1" | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"self",
".",
"_api",
".",
"device",
".",
"zones",
"[",
"self",
".",
"_zone_id",
"]",
"[",
"1",
"]",
"==",
"\"1\""
] | [
54,
4
] | [
56,
62
] | python | en | ['en', 'en', 'en'] | True |
DaikinZoneSwitch.device_info | (self) | Return a device description for device registry. | Return a device description for device registry. | def device_info(self):
"""Return a device description for device registry."""
return self._api.device_info | [
"def",
"device_info",
"(",
"self",
")",
":",
"return",
"self",
".",
"_api",
".",
"device_info"
] | [
59,
4
] | [
61,
36
] | python | en | ['ro', 'fr', 'en'] | False |
DaikinZoneSwitch.async_update | (self) | Retrieve latest state. | Retrieve latest state. | async def async_update(self):
"""Retrieve latest state."""
await self._api.async_update() | [
"async",
"def",
"async_update",
"(",
"self",
")",
":",
"await",
"self",
".",
"_api",
".",
"async_update",
"(",
")"
] | [
63,
4
] | [
65,
38
] | python | en | ['es', 'sk', 'en'] | False |
DaikinZoneSwitch.async_turn_on | (self, **kwargs) | Turn the zone on. | Turn the zone on. | async def async_turn_on(self, **kwargs):
"""Turn the zone on."""
await self._api.device.set_zone(self._zone_id, "1") | [
"async",
"def",
"async_turn_on",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"_api",
".",
"device",
".",
"set_zone",
"(",
"self",
".",
"_zone_id",
",",
"\"1\"",
")"
] | [
67,
4
] | [
69,
59
] | python | en | ['en', 'en', 'en'] | True |
DaikinZoneSwitch.async_turn_off | (self, **kwargs) | Turn the zone off. | Turn the zone off. | async def async_turn_off(self, **kwargs):
"""Turn the zone off."""
await self._api.device.set_zone(self._zone_id, "0") | [
"async",
"def",
"async_turn_off",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"_api",
".",
"device",
".",
"set_zone",
"(",
"self",
".",
"_zone_id",
",",
"\"0\"",
")"
] | [
71,
4
] | [
73,
59
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up lights for device. | Set up lights for device. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up lights for device."""
wrapper = hass.data[DOMAIN][DATA_CONFIG_ENTRY][config_entry.entry_id][COAP]
blocks = []
for block in wrapper.device.blocks:
if block.type == "light":
blocks.append(block)
eli... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"wrapper",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"DATA_CONFIG_ENTRY",
"]",
"[",
"config_entry",
".",
"entry_id",
"]",
"[",
"COAP",
"]",
... | [
24,
0
] | [
46,
71
] | python | en | ['en', 'da', 'en'] | True |
ShellyLight.__init__ | (self, wrapper: ShellyDeviceWrapper, block: Block) | Initialize light. | Initialize light. | def __init__(self, wrapper: ShellyDeviceWrapper, block: Block) -> None:
"""Initialize light."""
super().__init__(wrapper, block)
self.control_result = None
self._supported_features = 0
if hasattr(block, "brightness"):
self._supported_features |= SUPPORT_BRIGHTNESS
... | [
"def",
"__init__",
"(",
"self",
",",
"wrapper",
":",
"ShellyDeviceWrapper",
",",
"block",
":",
"Block",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"wrapper",
",",
"block",
")",
"self",
".",
"control_result",
"=",
"None",
"self",
"... | [
52,
4
] | [
60,
58
] | python | en | ['en', 'en', 'en'] | False |
ShellyLight.supported_features | (self) | Supported features. | Supported features. | def supported_features(self) -> int:
"""Supported features."""
return self._supported_features | [
"def",
"supported_features",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_supported_features"
] | [
63,
4
] | [
65,
39
] | python | en | ['en', 'en', 'en'] | False |
ShellyLight.is_on | (self) | If light is on. | If light is on. | def is_on(self) -> bool:
"""If light is on."""
if self.control_result:
return self.control_result["ison"]
return self.block.output | [
"def",
"is_on",
"(",
"self",
")",
"->",
"bool",
":",
"if",
"self",
".",
"control_result",
":",
"return",
"self",
".",
"control_result",
"[",
"\"ison\"",
"]",
"return",
"self",
".",
"block",
".",
"output"
] | [
68,
4
] | [
73,
32
] | python | en | ['en', 'en', 'en'] | True |
ShellyLight.brightness | (self) | Brightness of light. | Brightness of light. | def brightness(self) -> Optional[int]:
"""Brightness of light."""
if self.control_result:
brightness = self.control_result["brightness"]
else:
brightness = self.block.brightness
return int(brightness / 100 * 255) | [
"def",
"brightness",
"(",
"self",
")",
"->",
"Optional",
"[",
"int",
"]",
":",
"if",
"self",
".",
"control_result",
":",
"brightness",
"=",
"self",
".",
"control_result",
"[",
"\"brightness\"",
"]",
"else",
":",
"brightness",
"=",
"self",
".",
"block",
"... | [
76,
4
] | [
82,
42
] | python | en | ['en', 'ky', 'en'] | True |
ShellyLight.color_temp | (self) | Return the CT color value in mireds. | Return the CT color value in mireds. | def color_temp(self) -> Optional[float]:
"""Return the CT color value in mireds."""
if self.control_result:
color_temp = self.control_result["temp"]
else:
color_temp = self.block.colorTemp
# If you set DUO to max mireds in Shelly app, 2700K,
# It reports ... | [
"def",
"color_temp",
"(",
"self",
")",
"->",
"Optional",
"[",
"float",
"]",
":",
"if",
"self",
".",
"control_result",
":",
"color_temp",
"=",
"self",
".",
"control_result",
"[",
"\"temp\"",
"]",
"else",
":",
"color_temp",
"=",
"self",
".",
"block",
".",
... | [
85,
4
] | [
97,
65
] | python | en | ['en', 'en', 'en'] | True |
ShellyLight.min_mireds | (self) | Return the coldest color_temp that this light supports. | Return the coldest color_temp that this light supports. | def min_mireds(self) -> float:
"""Return the coldest color_temp that this light supports."""
return color_temperature_kelvin_to_mired(6500) | [
"def",
"min_mireds",
"(",
"self",
")",
"->",
"float",
":",
"return",
"color_temperature_kelvin_to_mired",
"(",
"6500",
")"
] | [
100,
4
] | [
102,
54
] | python | en | ['en', 'en', 'en'] | True |
ShellyLight.max_mireds | (self) | Return the warmest color_temp that this light supports. | Return the warmest color_temp that this light supports. | def max_mireds(self) -> float:
"""Return the warmest color_temp that this light supports."""
return color_temperature_kelvin_to_mired(2700) | [
"def",
"max_mireds",
"(",
"self",
")",
"->",
"float",
":",
"return",
"color_temperature_kelvin_to_mired",
"(",
"2700",
")"
] | [
105,
4
] | [
107,
54
] | python | en | ['en', 'en', 'en'] | True |
ShellyLight.async_turn_on | (self, **kwargs) | Turn on light. | Turn on light. | async def async_turn_on(self, **kwargs) -> None:
"""Turn on light."""
params = {"turn": "on"}
if ATTR_BRIGHTNESS in kwargs:
tmp_brightness = kwargs[ATTR_BRIGHTNESS]
params["brightness"] = int(tmp_brightness / 255 * 100)
if ATTR_COLOR_TEMP in kwargs:
co... | [
"async",
"def",
"async_turn_on",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"params",
"=",
"{",
"\"turn\"",
":",
"\"on\"",
"}",
"if",
"ATTR_BRIGHTNESS",
"in",
"kwargs",
":",
"tmp_brightness",
"=",
"kwargs",
"[",
"ATTR_BRIGHTNESS",
"]",
... | [
109,
4
] | [
123,
35
] | python | en | ['en', 'et', 'en'] | True |
ShellyLight.async_turn_off | (self, **kwargs) | Turn off light. | Turn off light. | async def async_turn_off(self, **kwargs) -> None:
"""Turn off light."""
self.control_result = await self.block.set_state(turn="off")
self.async_write_ha_state() | [
"async",
"def",
"async_turn_off",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"self",
".",
"control_result",
"=",
"await",
"self",
".",
"block",
".",
"set_state",
"(",
"turn",
"=",
"\"off\"",
")",
"self",
".",
"async_write_ha_state",
"(... | [
125,
4
] | [
128,
35
] | python | en | ['en', 'zh', 'en'] | True |
ShellyLight._update_callback | (self) | When device updates, clear control result that overrides state. | When device updates, clear control result that overrides state. | def _update_callback(self):
"""When device updates, clear control result that overrides state."""
self.control_result = None
super()._update_callback() | [
"def",
"_update_callback",
"(",
"self",
")",
":",
"self",
".",
"control_result",
"=",
"None",
"super",
"(",
")",
".",
"_update_callback",
"(",
")"
] | [
131,
4
] | [
134,
34
] | python | en | ['en', 'en', 'en'] | True |
async_setup | (hass, config) | Mock a successful setup. | Mock a successful setup. | async def async_setup(hass, config):
"""Mock a successful setup."""
return True | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"config",
")",
":",
"return",
"True"
] | [
4,
0
] | [
6,
15
] | python | en | ['en', 'ro', 'en'] | True |
async_get_integration_with_requirements | (
hass: HomeAssistant, domain: str, done: Optional[Set[str]] = None
) | Get an integration with all requirements installed, including the dependencies.
This can raise IntegrationNotFound if manifest or integration
is invalid, RequirementNotFound if there was some type of
failure to install requirements.
| Get an integration with all requirements installed, including the dependencies. | async def async_get_integration_with_requirements(
hass: HomeAssistant, domain: str, done: Optional[Set[str]] = None
) -> Integration:
"""Get an integration with all requirements installed, including the dependencies.
This can raise IntegrationNotFound if manifest or integration
is invalid, Requirement... | [
"async",
"def",
"async_get_integration_with_requirements",
"(",
"hass",
":",
"HomeAssistant",
",",
"domain",
":",
"str",
",",
"done",
":",
"Optional",
"[",
"Set",
"[",
"str",
"]",
"]",
"=",
"None",
")",
"->",
"Integration",
":",
"if",
"done",
"is",
"None",... | [
32,
0
] | [
101,
22
] | python | en | ['en', 'en', 'en'] | True |
async_process_requirements | (
hass: HomeAssistant, name: str, requirements: List[str]
) | Install the requirements for a component or platform.
This method is a coroutine. It will raise RequirementsNotFound
if an requirement can't be satisfied.
| Install the requirements for a component or platform. | async def async_process_requirements(
hass: HomeAssistant, name: str, requirements: List[str]
) -> None:
"""Install the requirements for a component or platform.
This method is a coroutine. It will raise RequirementsNotFound
if an requirement can't be satisfied.
"""
pip_lock = hass.data.get(DAT... | [
"async",
"def",
"async_process_requirements",
"(",
"hass",
":",
"HomeAssistant",
",",
"name",
":",
"str",
",",
"requirements",
":",
"List",
"[",
"str",
"]",
")",
"->",
"None",
":",
"pip_lock",
"=",
"hass",
".",
"data",
".",
"get",
"(",
"DATA_PIP_LOCK",
"... | [
104,
0
] | [
130,
55
] | python | en | ['en', 'en', 'en'] | True |
pip_kwargs | (config_dir: Optional[str]) | Return keyword arguments for PIP install. | Return keyword arguments for PIP install. | def pip_kwargs(config_dir: Optional[str]) -> Dict[str, Any]:
"""Return keyword arguments for PIP install."""
is_docker = pkg_util.is_docker_env()
kwargs = {
"constraints": os.path.join(os.path.dirname(__file__), CONSTRAINT_FILE),
"no_cache_dir": is_docker,
}
if "WHEELS_LINKS" in os.e... | [
"def",
"pip_kwargs",
"(",
"config_dir",
":",
"Optional",
"[",
"str",
"]",
")",
"->",
"Dict",
"[",
"str",
",",
"Any",
"]",
":",
"is_docker",
"=",
"pkg_util",
".",
"is_docker_env",
"(",
")",
"kwargs",
"=",
"{",
"\"constraints\"",
":",
"os",
".",
"path",
... | [
133,
0
] | [
144,
17
] | python | en | ['en', 'no', 'en'] | True |
RequirementsNotFound.__init__ | (self, domain: str, requirements: List) | Initialize a component not found error. | Initialize a component not found error. | def __init__(self, domain: str, requirements: List) -> None:
"""Initialize a component not found error."""
super().__init__(f"Requirements for {domain} not found: {requirements}.")
self.domain = domain
self.requirements = requirements | [
"def",
"__init__",
"(",
"self",
",",
"domain",
":",
"str",
",",
"requirements",
":",
"List",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"f\"Requirements for {domain} not found: {requirements}.\"",
")",
"self",
".",
"domain",
"=",
"domain"... | [
25,
4
] | [
29,
40
] | python | en | ['en', 'en', 'en'] | True |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up the ELIQ Online sensor. | Set up the ELIQ Online sensor. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the ELIQ Online sensor."""
access_token = config.get(CONF_ACCESS_TOKEN)
name = config.get(CONF_NAME, DEFAULT_NAME)
channel_id = config.get(CONF_CHANNEL_ID)
session = async_get_clientsession(hass)
ap... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"access_token",
"=",
"config",
".",
"get",
"(",
"CONF_ACCESS_TOKEN",
")",
"name",
"=",
"config",
".",
"get",
"(",
"CO... | [
35,
0
] | [
51,
65
] | python | en | ['en', 'ca', 'en'] | True |
EliqSensor.__init__ | (self, api, channel_id, name) | Initialize the sensor. | Initialize the sensor. | def __init__(self, api, channel_id, name):
"""Initialize the sensor."""
self._name = name
self._state = None
self._api = api
self._channel_id = channel_id | [
"def",
"__init__",
"(",
"self",
",",
"api",
",",
"channel_id",
",",
"name",
")",
":",
"self",
".",
"_name",
"=",
"name",
"self",
".",
"_state",
"=",
"None",
"self",
".",
"_api",
"=",
"api",
"self",
".",
"_channel_id",
"=",
"channel_id"
] | [
57,
4
] | [
62,
37
] | python | en | ['en', 'en', 'en'] | True |
EliqSensor.name | (self) | Return the name of the sensor. | Return the name of the sensor. | def name(self):
"""Return the name of the sensor."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | [
65,
4
] | [
67,
25
] | python | en | ['en', 'mi', 'en'] | True |
EliqSensor.icon | (self) | Return icon. | Return icon. | def icon(self):
"""Return icon."""
return ICON | [
"def",
"icon",
"(",
"self",
")",
":",
"return",
"ICON"
] | [
70,
4
] | [
72,
19
] | python | en | ['en', 'la', 'en'] | False |
EliqSensor.unit_of_measurement | (self) | Return the unit of measurement of this entity, if any. | Return the unit of measurement of this entity, if any. | def unit_of_measurement(self):
"""Return the unit of measurement of this entity, if any."""
return UNIT_OF_MEASUREMENT | [
"def",
"unit_of_measurement",
"(",
"self",
")",
":",
"return",
"UNIT_OF_MEASUREMENT"
] | [
75,
4
] | [
77,
34
] | python | en | ['en', 'en', 'en'] | True |
EliqSensor.state | (self) | Return the state of the device. | Return the state of the device. | def state(self):
"""Return the state of the device."""
return self._state | [
"def",
"state",
"(",
"self",
")",
":",
"return",
"self",
".",
"_state"
] | [
80,
4
] | [
82,
26
] | python | en | ['en', 'en', 'en'] | True |
EliqSensor.async_update | (self) | Get the latest data. | Get the latest data. | async def async_update(self):
"""Get the latest data."""
try:
response = await self._api.get_data_now(channelid=self._channel_id)
self._state = int(response["power"])
_LOGGER.debug("Updated power from server %d W", self._state)
except KeyError:
_LO... | [
"async",
"def",
"async_update",
"(",
"self",
")",
":",
"try",
":",
"response",
"=",
"await",
"self",
".",
"_api",
".",
"get_data_now",
"(",
"channelid",
"=",
"self",
".",
"_channel_id",
")",
"self",
".",
"_state",
"=",
"int",
"(",
"response",
"[",
"\"p... | [
84,
4
] | [
93,
82
] | python | en | ['en', 'en', 'en'] | True |
test_one_cover | (hass, rfxtrx) | Test with 1 cover. | Test with 1 cover. | async def test_one_cover(hass, rfxtrx):
"""Test with 1 cover."""
entry_data = create_rfx_test_cfg(
devices={"0b1400cd0213c7f20d010f51": {"signal_repetitions": 1}}
)
mock_entry = MockConfigEntry(domain="rfxtrx", unique_id=DOMAIN, data=entry_data)
mock_entry.add_to_hass(hass)
await hass.... | [
"async",
"def",
"test_one_cover",
"(",
"hass",
",",
"rfxtrx",
")",
":",
"entry_data",
"=",
"create_rfx_test_cfg",
"(",
"devices",
"=",
"{",
"\"0b1400cd0213c7f20d010f51\"",
":",
"{",
"\"signal_repetitions\"",
":",
"1",
"}",
"}",
")",
"mock_entry",
"=",
"MockConfi... | [
12,
0
] | [
52,
5
] | python | en | ['en', 'en', 'en'] | True |
test_state_restore | (hass, rfxtrx, state) | State restoration. | State restoration. | async def test_state_restore(hass, rfxtrx, state):
"""State restoration."""
entity_id = "cover.lightwaverf_siemens_0213c7_242"
mock_restore_cache(hass, [State(entity_id, state)])
entry_data = create_rfx_test_cfg(
devices={"0b1400cd0213c7f20d010f51": {"signal_repetitions": 1}}
)
mock_e... | [
"async",
"def",
"test_state_restore",
"(",
"hass",
",",
"rfxtrx",
",",
"state",
")",
":",
"entity_id",
"=",
"\"cover.lightwaverf_siemens_0213c7_242\"",
"mock_restore_cache",
"(",
"hass",
",",
"[",
"State",
"(",
"entity_id",
",",
"state",
")",
"]",
")",
"entry_da... | [
56,
0
] | [
73,
52
] | python | en | ['en', 'hr', 'en'] | False |
test_several_covers | (hass, rfxtrx) | Test with 3 covers. | Test with 3 covers. | async def test_several_covers(hass, rfxtrx):
"""Test with 3 covers."""
entry_data = create_rfx_test_cfg(
devices={
"0b1400cd0213c7f20d010f51": {"signal_repetitions": 1},
"0A1400ADF394AB010D0060": {"signal_repetitions": 1},
"09190000009ba8010100": {"signal_repetitions"... | [
"async",
"def",
"test_several_covers",
"(",
"hass",
",",
"rfxtrx",
")",
":",
"entry_data",
"=",
"create_rfx_test_cfg",
"(",
"devices",
"=",
"{",
"\"0b1400cd0213c7f20d010f51\"",
":",
"{",
"\"signal_repetitions\"",
":",
"1",
"}",
",",
"\"0A1400ADF394AB010D0060\"",
":"... | [
76,
0
] | [
105,
73
] | python | en | ['en', 'en', 'en'] | True |
test_discover_covers | (hass, rfxtrx_automatic) | Test with discovery of covers. | Test with discovery of covers. | async def test_discover_covers(hass, rfxtrx_automatic):
"""Test with discovery of covers."""
rfxtrx = rfxtrx_automatic
await rfxtrx.signal("0a140002f38cae010f0070")
state = hass.states.get("cover.lightwaverf_siemens_f38cae_1")
assert state
assert state.state == "open"
await rfxtrx.signal("... | [
"async",
"def",
"test_discover_covers",
"(",
"hass",
",",
"rfxtrx_automatic",
")",
":",
"rfxtrx",
"=",
"rfxtrx_automatic",
"await",
"rfxtrx",
".",
"signal",
"(",
"\"0a140002f38cae010f0070\"",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"\"cover.li... | [
108,
0
] | [
120,
32
] | python | en | ['en', 'en', 'en'] | True |
test_duplicate_cover | (hass, rfxtrx) | Test with 2 duplicate covers. | Test with 2 duplicate covers. | async def test_duplicate_cover(hass, rfxtrx):
"""Test with 2 duplicate covers."""
entry_data = create_rfx_test_cfg(
devices={
"0b1400cd0213c7f20d010f51": {"signal_repetitions": 1},
"0b1400cd0213c7f20d010f50": {"signal_repetitions": 1},
}
)
mock_entry = MockConfigE... | [
"async",
"def",
"test_duplicate_cover",
"(",
"hass",
",",
"rfxtrx",
")",
":",
"entry_data",
"=",
"create_rfx_test_cfg",
"(",
"devices",
"=",
"{",
"\"0b1400cd0213c7f20d010f51\"",
":",
"{",
"\"signal_repetitions\"",
":",
"1",
"}",
",",
"\"0b1400cd0213c7f20d010f50\"",
... | [
123,
0
] | [
141,
85
] | python | en | ['en', 'en', 'en'] | True |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the heatmiser thermostat. | Set up the heatmiser thermostat. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the heatmiser thermostat."""
heatmiser_v3_thermostat = heatmiser.HeatmiserThermostat
host = config[CONF_HOST]
port = config[CONF_PORT]
thermostats = config[CONF_THERMOSTATS]
uh1_hub = connection.HeatmiserUH1(host,... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"heatmiser_v3_thermostat",
"=",
"heatmiser",
".",
"HeatmiserThermostat",
"host",
"=",
"config",
"[",
"CONF_HOST",
"]",
"port",
"=",
"config",
... | [
45,
0
] | [
63,
5
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.__init__ | (self, therm, device, uh1) | Initialize the thermostat. | Initialize the thermostat. | def __init__(self, therm, device, uh1):
"""Initialize the thermostat."""
self.therm = therm(device[CONF_ID], "prt", uh1)
self.uh1 = uh1
self._name = device[CONF_NAME]
self._current_temperature = None
self._target_temperature = None
self._id = device
self.d... | [
"def",
"__init__",
"(",
"self",
",",
"therm",
",",
"device",
",",
"uh1",
")",
":",
"self",
".",
"therm",
"=",
"therm",
"(",
"device",
"[",
"CONF_ID",
"]",
",",
"\"prt\"",
",",
"uh1",
")",
"self",
".",
"uh1",
"=",
"uh1",
"self",
".",
"_name",
"=",... | [
69,
4
] | [
79,
37
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.supported_features | (self) | Return the list of supported features. | Return the list of supported features. | def supported_features(self):
"""Return the list of supported features."""
return SUPPORT_TARGET_TEMPERATURE | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_TARGET_TEMPERATURE"
] | [
82,
4
] | [
84,
41
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.name | (self) | Return the name of the thermostat, if any. | Return the name of the thermostat, if any. | def name(self):
"""Return the name of the thermostat, if any."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | [
87,
4
] | [
89,
25
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.temperature_unit | (self) | Return the unit of measurement which this thermostat uses. | Return the unit of measurement which this thermostat uses. | def temperature_unit(self):
"""Return the unit of measurement which this thermostat uses."""
return self._temperature_unit | [
"def",
"temperature_unit",
"(",
"self",
")",
":",
"return",
"self",
".",
"_temperature_unit"
] | [
92,
4
] | [
94,
37
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.hvac_mode | (self) | Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
| Return hvac operation ie. heat, cool mode. | def hvac_mode(self) -> str:
"""Return hvac operation ie. heat, cool mode.
Need to be one of HVAC_MODE_*.
"""
return self._hvac_mode | [
"def",
"hvac_mode",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_hvac_mode"
] | [
97,
4
] | [
102,
30
] | python | bg | ['en', 'bg', 'bg'] | True |
HeatmiserV3Thermostat.hvac_modes | (self) | Return the list of available hvac operation modes.
Need to be a subset of HVAC_MODES.
| Return the list of available hvac operation modes. | def hvac_modes(self) -> List[str]:
"""Return the list of available hvac operation modes.
Need to be a subset of HVAC_MODES.
"""
return [HVAC_MODE_HEAT, HVAC_MODE_OFF] | [
"def",
"hvac_modes",
"(",
"self",
")",
"->",
"List",
"[",
"str",
"]",
":",
"return",
"[",
"HVAC_MODE_HEAT",
",",
"HVAC_MODE_OFF",
"]"
] | [
105,
4
] | [
110,
46
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.current_temperature | (self) | Return the current temperature. | Return the current temperature. | def current_temperature(self):
"""Return the current temperature."""
return self._current_temperature | [
"def",
"current_temperature",
"(",
"self",
")",
":",
"return",
"self",
".",
"_current_temperature"
] | [
113,
4
] | [
115,
40
] | python | en | ['en', 'la', 'en'] | True |
HeatmiserV3Thermostat.target_temperature | (self) | Return the temperature we try to reach. | Return the temperature we try to reach. | def target_temperature(self):
"""Return the temperature we try to reach."""
return self._target_temperature | [
"def",
"target_temperature",
"(",
"self",
")",
":",
"return",
"self",
".",
"_target_temperature"
] | [
118,
4
] | [
120,
39
] | python | en | ['en', 'en', 'en'] | True |
HeatmiserV3Thermostat.set_temperature | (self, **kwargs) | Set new target temperature. | Set new target temperature. | def set_temperature(self, **kwargs):
"""Set new target temperature."""
temperature = kwargs.get(ATTR_TEMPERATURE)
self._target_temperature = int(temperature)
self.therm.set_target_temp(self._target_temperature) | [
"def",
"set_temperature",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"temperature",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_TEMPERATURE",
")",
"self",
".",
"_target_temperature",
"=",
"int",
"(",
"temperature",
")",
"self",
".",
"therm",
".",
"set_targe... | [
122,
4
] | [
126,
60
] | python | en | ['en', 'ca', 'en'] | True |
HeatmiserV3Thermostat.update | (self) | Get the latest data. | Get the latest data. | def update(self):
"""Get the latest data."""
self.uh1.reopen()
if not self.uh1.status:
_LOGGER.error("Failed to update device %s", self._name)
return
self.dcb = self.therm.read_dcb()
self._temperature_unit = (
TEMP_CELSIUS
if (self.... | [
"def",
"update",
"(",
"self",
")",
":",
"self",
".",
"uh1",
".",
"reopen",
"(",
")",
"if",
"not",
"self",
".",
"uh1",
".",
"status",
":",
"_LOGGER",
".",
"error",
"(",
"\"Failed to update device %s\"",
",",
"self",
".",
"_name",
")",
"return",
"self",
... | [
128,
4
] | [
146,
9
] | python | en | ['en', 'en', 'en'] | True |
test_init | (
hass: HomeAssistant, vera_component_factory: ComponentFactory
) | Test function. | Test function. | async def test_init(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test function."""
vera_device1 = MagicMock(spec=pv.VeraBinarySensor) # type: pv.VeraBinarySensor
vera_device1.device_id = 1
vera_device1.vera_device_id = vera_device1.device_id
vera_device1.name = "... | [
"async",
"def",
"test_init",
"(",
"hass",
":",
"HomeAssistant",
",",
"vera_component_factory",
":",
"ComponentFactory",
")",
"->",
"None",
":",
"vera_device1",
"=",
"MagicMock",
"(",
"spec",
"=",
"pv",
".",
"VeraBinarySensor",
")",
"# type: pv.VeraBinarySensor",
"... | [
20,
0
] | [
44,
52
] | python | en | ['en', 'en', 'en'] | False |
test_init_from_file | (
hass: HomeAssistant, vera_component_factory: ComponentFactory
) | Test function. | Test function. | async def test_init_from_file(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test function."""
vera_device1 = MagicMock(spec=pv.VeraBinarySensor) # type: pv.VeraBinarySensor
vera_device1.device_id = 1
vera_device1.vera_device_id = vera_device1.device_id
vera_device... | [
"async",
"def",
"test_init_from_file",
"(",
"hass",
":",
"HomeAssistant",
",",
"vera_component_factory",
":",
"ComponentFactory",
")",
"->",
"None",
":",
"vera_device1",
"=",
"MagicMock",
"(",
"spec",
"=",
"pv",
".",
"VeraBinarySensor",
")",
"# type: pv.VeraBinarySe... | [
47,
0
] | [
71,
52
] | python | en | ['en', 'en', 'en'] | False |
test_multiple_controllers_with_legacy_one | (
hass: HomeAssistant, vera_component_factory: ComponentFactory
) | Test multiple controllers with one legacy controller. | Test multiple controllers with one legacy controller. | async def test_multiple_controllers_with_legacy_one(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test multiple controllers with one legacy controller."""
vera_device1 = MagicMock(spec=pv.VeraBinarySensor) # type: pv.VeraBinarySensor
vera_device1.device_id = 1
vera_de... | [
"async",
"def",
"test_multiple_controllers_with_legacy_one",
"(",
"hass",
":",
"HomeAssistant",
",",
"vera_component_factory",
":",
"ComponentFactory",
")",
"->",
"None",
":",
"vera_device1",
"=",
"MagicMock",
"(",
"spec",
"=",
"pv",
".",
"VeraBinarySensor",
")",
"#... | [
74,
0
] | [
126,
53
] | python | en | ['en', 'en', 'en'] | True |
test_unload | (
hass: HomeAssistant, vera_component_factory: ComponentFactory
) | Test function. | Test function. | async def test_unload(
hass: HomeAssistant, vera_component_factory: ComponentFactory
) -> None:
"""Test function."""
vera_device1 = MagicMock(spec=pv.VeraBinarySensor) # type: pv.VeraBinarySensor
vera_device1.device_id = 1
vera_device1.vera_device_id = vera_device1.device_id
vera_device1.name =... | [
"async",
"def",
"test_unload",
"(",
"hass",
":",
"HomeAssistant",
",",
"vera_component_factory",
":",
"ComponentFactory",
")",
"->",
"None",
":",
"vera_device1",
"=",
"MagicMock",
"(",
"spec",
"=",
"pv",
".",
"VeraBinarySensor",
")",
"# type: pv.VeraBinarySensor",
... | [
129,
0
] | [
148,
59
] | python | en | ['en', 'en', 'en'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.