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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
GradientAccumulator.gradients | (self) | The accumulated gradients on the current replica. | The accumulated gradients on the current replica. | def gradients(self):
"""The accumulated gradients on the current replica."""
if not self._gradients:
raise ValueError("The accumulator should be called first to initialize the gradients")
return list(gradient.value() if gradient is not None else gradient for gradient in self._gradien... | [
"def",
"gradients",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_gradients",
":",
"raise",
"ValueError",
"(",
"\"The accumulator should be called first to initialize the gradients\"",
")",
"return",
"list",
"(",
"gradient",
".",
"value",
"(",
")",
"if",
"gra... | [
311,
4
] | [
315,
107
] | python | en | ['en', 'en', 'en'] | True |
GradientAccumulator.__call__ | (self, gradients) | Accumulates :obj:`gradients` on the current replica. | Accumulates :obj:`gradients` on the current replica. | def __call__(self, gradients):
"""Accumulates :obj:`gradients` on the current replica."""
if not self._gradients:
_ = self.step # Create the step variable.
self._gradients.extend(
[
tf.Variable(
tf.zeros_like(gradient),... | [
"def",
"__call__",
"(",
"self",
",",
"gradients",
")",
":",
"if",
"not",
"self",
".",
"_gradients",
":",
"_",
"=",
"self",
".",
"step",
"# Create the step variable.",
"self",
".",
"_gradients",
".",
"extend",
"(",
"[",
"tf",
".",
"Variable",
"(",
"tf",
... | [
317,
4
] | [
341,
39
] | python | en | ['en', 'en', 'en'] | True |
GradientAccumulator.reset | (self) | Resets the accumulated gradients on the current replica. | Resets the accumulated gradients on the current replica. | def reset(self):
"""Resets the accumulated gradients on the current replica."""
if not self._gradients:
return
self._accum_steps.assign(0)
for gradient in self._gradients:
if gradient is not None:
gradient.assign(tf.zeros_like(gradient)) | [
"def",
"reset",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_gradients",
":",
"return",
"self",
".",
"_accum_steps",
".",
"assign",
"(",
"0",
")",
"for",
"gradient",
"in",
"self",
".",
"_gradients",
":",
"if",
"gradient",
"is",
"not",
"None",
"... | [
343,
4
] | [
350,
56
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up AdvantageAir climate platform. | Set up AdvantageAir climate platform. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up AdvantageAir climate platform."""
instance = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
entities = []
for ac_key, ac_device in instance["coordinator"].data["aircons"].items():
entities.append(AdvantageAi... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"instance",
"=",
"hass",
".",
"data",
"[",
"ADVANTAGE_AIR_DOMAIN",
"]",
"[",
"config_entry",
".",
"entry_id",
"]",
"entities",
"=",
"[",
"]",
"for",
"... | [
56,
0
] | [
68,
32
] | python | en | ['en', 'lv', 'en'] | True |
AdvantageAirClimateEntity.temperature_unit | (self) | Return the temperature unit. | Return the temperature unit. | def temperature_unit(self):
"""Return the temperature unit."""
return TEMP_CELSIUS | [
"def",
"temperature_unit",
"(",
"self",
")",
":",
"return",
"TEMP_CELSIUS"
] | [
75,
4
] | [
77,
27
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirClimateEntity.target_temperature_step | (self) | Return the supported temperature step. | Return the supported temperature step. | def target_temperature_step(self):
"""Return the supported temperature step."""
return PRECISION_WHOLE | [
"def",
"target_temperature_step",
"(",
"self",
")",
":",
"return",
"PRECISION_WHOLE"
] | [
80,
4
] | [
82,
30
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirClimateEntity.max_temp | (self) | Return the maximum supported temperature. | Return the maximum supported temperature. | def max_temp(self):
"""Return the maximum supported temperature."""
return 32 | [
"def",
"max_temp",
"(",
"self",
")",
":",
"return",
"32"
] | [
85,
4
] | [
87,
17
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirClimateEntity.min_temp | (self) | Return the minimum supported temperature. | Return the minimum supported temperature. | def min_temp(self):
"""Return the minimum supported temperature."""
return 16 | [
"def",
"min_temp",
"(",
"self",
")",
":",
"return",
"16"
] | [
90,
4
] | [
92,
17
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirAC.name | (self) | Return the name. | Return the name. | def name(self):
"""Return the name."""
return self._ac["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ac",
"[",
"\"name\"",
"]"
] | [
99,
4
] | [
101,
31
] | python | en | ['en', 'ig', 'en'] | True |
AdvantageAirAC.unique_id | (self) | Return a unique id. | Return a unique id. | def unique_id(self):
"""Return a unique id."""
return f'{self.coordinator.data["system"]["rid"]}-{self.ac_key}' | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"f'{self.coordinator.data[\"system\"][\"rid\"]}-{self.ac_key}'"
] | [
104,
4
] | [
106,
72
] | python | ca | ['fr', 'ca', 'en'] | False |
AdvantageAirAC.target_temperature | (self) | Return the current target temperature. | Return the current target temperature. | def target_temperature(self):
"""Return the current target temperature."""
return self._ac["setTemp"] | [
"def",
"target_temperature",
"(",
"self",
")",
":",
"return",
"self",
".",
"_ac",
"[",
"\"setTemp\"",
"]"
] | [
109,
4
] | [
111,
34
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirAC.hvac_mode | (self) | Return the current HVAC modes. | Return the current HVAC modes. | def hvac_mode(self):
"""Return the current HVAC modes."""
if self._ac["state"] == ADVANTAGE_AIR_STATE_ON:
return ADVANTAGE_AIR_HVAC_MODES.get(self._ac["mode"])
return HVAC_MODE_OFF | [
"def",
"hvac_mode",
"(",
"self",
")",
":",
"if",
"self",
".",
"_ac",
"[",
"\"state\"",
"]",
"==",
"ADVANTAGE_AIR_STATE_ON",
":",
"return",
"ADVANTAGE_AIR_HVAC_MODES",
".",
"get",
"(",
"self",
".",
"_ac",
"[",
"\"mode\"",
"]",
")",
"return",
"HVAC_MODE_OFF"
] | [
114,
4
] | [
118,
28
] | python | en | ['en', 'is', 'en'] | True |
AdvantageAirAC.hvac_modes | (self) | Return the supported HVAC modes. | Return the supported HVAC modes. | def hvac_modes(self):
"""Return the supported HVAC modes."""
return AC_HVAC_MODES | [
"def",
"hvac_modes",
"(",
"self",
")",
":",
"return",
"AC_HVAC_MODES"
] | [
121,
4
] | [
123,
28
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirAC.fan_mode | (self) | Return the current fan modes. | Return the current fan modes. | def fan_mode(self):
"""Return the current fan modes."""
return ADVANTAGE_AIR_FAN_MODES.get(self._ac["fan"]) | [
"def",
"fan_mode",
"(",
"self",
")",
":",
"return",
"ADVANTAGE_AIR_FAN_MODES",
".",
"get",
"(",
"self",
".",
"_ac",
"[",
"\"fan\"",
"]",
")"
] | [
126,
4
] | [
128,
59
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirAC.fan_modes | (self) | Return the supported fan modes. | Return the supported fan modes. | def fan_modes(self):
"""Return the supported fan modes."""
return [FAN_AUTO, FAN_LOW, FAN_MEDIUM, FAN_HIGH] | [
"def",
"fan_modes",
"(",
"self",
")",
":",
"return",
"[",
"FAN_AUTO",
",",
"FAN_LOW",
",",
"FAN_MEDIUM",
",",
"FAN_HIGH",
"]"
] | [
131,
4
] | [
133,
56
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirAC.supported_features | (self) | Return the supported features. | Return the supported features. | def supported_features(self):
"""Return the supported features."""
return SUPPORT_TARGET_TEMPERATURE | SUPPORT_FAN_MODE | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_TARGET_TEMPERATURE",
"|",
"SUPPORT_FAN_MODE"
] | [
136,
4
] | [
138,
60
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirAC.async_set_hvac_mode | (self, hvac_mode) | Set the HVAC Mode and State. | Set the HVAC Mode and State. | async def async_set_hvac_mode(self, hvac_mode):
"""Set the HVAC Mode and State."""
if hvac_mode == HVAC_MODE_OFF:
await self.async_change(
{self.ac_key: {"info": {"state": ADVANTAGE_AIR_STATE_OFF}}}
)
else:
await self.async_change(
... | [
"async",
"def",
"async_set_hvac_mode",
"(",
"self",
",",
"hvac_mode",
")",
":",
"if",
"hvac_mode",
"==",
"HVAC_MODE_OFF",
":",
"await",
"self",
".",
"async_change",
"(",
"{",
"self",
".",
"ac_key",
":",
"{",
"\"info\"",
":",
"{",
"\"state\"",
":",
"ADVANTA... | [
140,
4
] | [
156,
13
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirAC.async_set_fan_mode | (self, fan_mode) | Set the Fan Mode. | Set the Fan Mode. | async def async_set_fan_mode(self, fan_mode):
"""Set the Fan Mode."""
await self.async_change(
{self.ac_key: {"info": {"fan": HASS_FAN_MODES.get(fan_mode)}}}
) | [
"async",
"def",
"async_set_fan_mode",
"(",
"self",
",",
"fan_mode",
")",
":",
"await",
"self",
".",
"async_change",
"(",
"{",
"self",
".",
"ac_key",
":",
"{",
"\"info\"",
":",
"{",
"\"fan\"",
":",
"HASS_FAN_MODES",
".",
"get",
"(",
"fan_mode",
")",
"}",
... | [
158,
4
] | [
162,
9
] | python | en | ['en', 'fy', 'en'] | True |
AdvantageAirAC.async_set_temperature | (self, **kwargs) | Set the Temperature. | Set the Temperature. | async def async_set_temperature(self, **kwargs):
"""Set the Temperature."""
temp = kwargs.get(ATTR_TEMPERATURE)
await self.async_change({self.ac_key: {"info": {"setTemp": temp}}}) | [
"async",
"def",
"async_set_temperature",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"temp",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_TEMPERATURE",
")",
"await",
"self",
".",
"async_change",
"(",
"{",
"self",
".",
"ac_key",
":",
"{",
"\"info\"",
":",
... | [
164,
4
] | [
167,
75
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirZone.name | (self) | Return the name. | Return the name. | def name(self):
"""Return the name."""
return self._zone["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_zone",
"[",
"\"name\"",
"]"
] | [
174,
4
] | [
176,
33
] | python | en | ['en', 'ig', 'en'] | True |
AdvantageAirZone.unique_id | (self) | Return a unique id. | Return a unique id. | def unique_id(self):
"""Return a unique id."""
return f'{self.coordinator.data["system"]["rid"]}-{self.ac_key}-{self.zone_key}' | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"f'{self.coordinator.data[\"system\"][\"rid\"]}-{self.ac_key}-{self.zone_key}'"
] | [
179,
4
] | [
181,
88
] | python | ca | ['fr', 'ca', 'en'] | False |
AdvantageAirZone.current_temperature | (self) | Return the current temperature. | Return the current temperature. | def current_temperature(self):
"""Return the current temperature."""
return self._zone["measuredTemp"] | [
"def",
"current_temperature",
"(",
"self",
")",
":",
"return",
"self",
".",
"_zone",
"[",
"\"measuredTemp\"",
"]"
] | [
184,
4
] | [
186,
41
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirZone.target_temperature | (self) | Return the target temperature. | Return the target temperature. | def target_temperature(self):
"""Return the target temperature."""
return self._zone["setTemp"] | [
"def",
"target_temperature",
"(",
"self",
")",
":",
"return",
"self",
".",
"_zone",
"[",
"\"setTemp\"",
"]"
] | [
189,
4
] | [
191,
36
] | python | en | ['en', 'la', 'en'] | True |
AdvantageAirZone.hvac_mode | (self) | Return the current HVAC modes. | Return the current HVAC modes. | def hvac_mode(self):
"""Return the current HVAC modes."""
if self._zone["state"] == ADVANTAGE_AIR_STATE_OPEN:
return HVAC_MODE_FAN_ONLY
return HVAC_MODE_OFF | [
"def",
"hvac_mode",
"(",
"self",
")",
":",
"if",
"self",
".",
"_zone",
"[",
"\"state\"",
"]",
"==",
"ADVANTAGE_AIR_STATE_OPEN",
":",
"return",
"HVAC_MODE_FAN_ONLY",
"return",
"HVAC_MODE_OFF"
] | [
194,
4
] | [
198,
28
] | python | en | ['en', 'is', 'en'] | True |
AdvantageAirZone.hvac_modes | (self) | Return supported HVAC modes. | Return supported HVAC modes. | def hvac_modes(self):
"""Return supported HVAC modes."""
return ZONE_HVAC_MODES | [
"def",
"hvac_modes",
"(",
"self",
")",
":",
"return",
"ZONE_HVAC_MODES"
] | [
201,
4
] | [
203,
30
] | python | en | ['en', 'da', 'en'] | True |
AdvantageAirZone.supported_features | (self) | Return the supported features. | Return the supported features. | def supported_features(self):
"""Return the supported features."""
return SUPPORT_TARGET_TEMPERATURE | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_TARGET_TEMPERATURE"
] | [
206,
4
] | [
208,
41
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirZone.async_set_hvac_mode | (self, hvac_mode) | Set the HVAC Mode and State. | Set the HVAC Mode and State. | async def async_set_hvac_mode(self, hvac_mode):
"""Set the HVAC Mode and State."""
if hvac_mode == HVAC_MODE_OFF:
await self.async_change(
{
self.ac_key: {
"zones": {self.zone_key: {"state": ADVANTAGE_AIR_STATE_CLOSE}}
... | [
"async",
"def",
"async_set_hvac_mode",
"(",
"self",
",",
"hvac_mode",
")",
":",
"if",
"hvac_mode",
"==",
"HVAC_MODE_OFF",
":",
"await",
"self",
".",
"async_change",
"(",
"{",
"self",
".",
"ac_key",
":",
"{",
"\"zones\"",
":",
"{",
"self",
".",
"zone_key",
... | [
210,
4
] | [
227,
13
] | python | en | ['en', 'en', 'en'] | True |
AdvantageAirZone.async_set_temperature | (self, **kwargs) | Set the Temperature. | Set the Temperature. | async def async_set_temperature(self, **kwargs):
"""Set the Temperature."""
temp = kwargs.get(ATTR_TEMPERATURE)
await self.async_change(
{self.ac_key: {"zones": {self.zone_key: {"setTemp": temp}}}}
) | [
"async",
"def",
"async_set_temperature",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"temp",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_TEMPERATURE",
")",
"await",
"self",
".",
"async_change",
"(",
"{",
"self",
".",
"ac_key",
":",
"{",
"\"zones\"",
":",
... | [
229,
4
] | [
234,
9
] | python | en | ['en', 'la', 'en'] | True |
device_reg | (hass) | Return an empty, loaded, registry. | Return an empty, loaded, registry. | def device_reg(hass):
"""Return an empty, loaded, registry."""
return mock_device_registry(hass) | [
"def",
"device_reg",
"(",
"hass",
")",
":",
"return",
"mock_device_registry",
"(",
"hass",
")"
] | [
24,
0
] | [
26,
37
] | python | en | ['en', 'fy', 'en'] | True |
entity_reg | (hass) | Return an empty, loaded, registry. | Return an empty, loaded, registry. | def entity_reg(hass):
"""Return an empty, loaded, registry."""
return mock_registry(hass) | [
"def",
"entity_reg",
"(",
"hass",
")",
":",
"return",
"mock_registry",
"(",
"hass",
")"
] | [
30,
0
] | [
32,
30
] | python | en | ['en', 'fy', '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\"",
")"
] | [
36,
0
] | [
38,
57
] | python | en | ['en', 'en', 'en'] | True |
test_get_triggers | (hass, device_reg, entity_reg) | Test we get the expected triggers from a light. | Test we get the expected triggers from a light. | async def test_get_triggers(hass, device_reg, entity_reg):
"""Test we get the expected triggers from a light."""
config_entry = MockConfigEntry(domain="test", data={})
config_entry.add_to_hass(hass)
device_entry = device_reg.async_get_or_create(
config_entry_id=config_entry.entry_id,
con... | [
"async",
"def",
"test_get_triggers",
"(",
"hass",
",",
"device_reg",
",",
"entity_reg",
")",
":",
"config_entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"\"test\"",
",",
"data",
"=",
"{",
"}",
")",
"config_entry",
".",
"add_to_hass",
"(",
"hass",
")",
... | [
41,
0
] | [
67,
40
] | python | en | ['en', 'en', 'en'] | True |
test_get_trigger_capabilities | (hass, device_reg, entity_reg) | Test we get the expected capabilities from a light trigger. | Test we get the expected capabilities from a light trigger. | async def test_get_trigger_capabilities(hass, device_reg, entity_reg):
"""Test we get the expected capabilities from a light trigger."""
config_entry = MockConfigEntry(domain="test", data={})
config_entry.add_to_hass(hass)
device_entry = device_reg.async_get_or_create(
config_entry_id=config_ent... | [
"async",
"def",
"test_get_trigger_capabilities",
"(",
"hass",
",",
"device_reg",
",",
"entity_reg",
")",
":",
"config_entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"\"test\"",
",",
"data",
"=",
"{",
"}",
")",
"config_entry",
".",
"add_to_hass",
"(",
"has... | [
70,
0
] | [
89,
52
] | python | en | ['en', 'en', 'en'] | True |
test_if_fires_on_state_change | (hass, calls) | Test for turn_on and turn_off triggers firing. | Test for turn_on and turn_off triggers firing. | async def test_if_fires_on_state_change(hass, calls):
"""Test for turn_on and turn_off triggers firing."""
platform = getattr(hass.components, f"test.{DOMAIN}")
platform.init()
await hass.async_block_till_done()
assert await async_setup_component(hass, DOMAIN, {DOMAIN: {CONF_PLATFORM: "test"}})
... | [
"async",
"def",
"test_if_fires_on_state_change",
"(",
"hass",
",",
"calls",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"f\"test.{DOMAIN}\"",
")",
"platform",
".",
"init",
"(",
")",
"await",
"hass",
".",
"async_block_till_done",
... | [
92,
0
] | [
176,
5
] | python | en | ['en', 'en', 'en'] | True |
test_if_fires_on_state_change_with_for | (hass, calls) | Test for triggers firing with delay. | Test for triggers firing with delay. | async def test_if_fires_on_state_change_with_for(hass, calls):
"""Test for triggers firing with delay."""
platform = getattr(hass.components, f"test.{DOMAIN}")
platform.init()
await hass.async_block_till_done()
assert await async_setup_component(hass, DOMAIN, {DOMAIN: {CONF_PLATFORM: "test"}})
... | [
"async",
"def",
"test_if_fires_on_state_change_with_for",
"(",
"hass",
",",
"calls",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"f\"test.{DOMAIN}\"",
")",
"platform",
".",
"init",
"(",
")",
"await",
"hass",
".",
"async_block_till_... | [
179,
0
] | [
237,
5
] | python | en | ['en', 'en', 'en'] | True |
create_engine_test | (*args, **kwargs) | Test version of create_engine that initializes with old schema.
This simulates an existing db with the old schema.
| Test version of create_engine that initializes with old schema. | def create_engine_test(*args, **kwargs):
"""Test version of create_engine that initializes with old schema.
This simulates an existing db with the old schema.
"""
engine = create_engine(*args, **kwargs)
models_original.Base.metadata.create_all(engine)
return engine | [
"def",
"create_engine_test",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"engine",
"=",
"create_engine",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
"models_original",
".",
"Base",
".",
"metadata",
".",
"create_all",
"(",
"engine",
")",
"r... | [
13,
0
] | [
20,
17
] | python | en | ['en', 'en', 'en'] | True |
test_schema_update_calls | (hass) | Test that schema migrations occur in correct order. | Test that schema migrations occur in correct order. | async def test_schema_update_calls(hass):
"""Test that schema migrations occur in correct order."""
with patch(
"homeassistant.components.recorder.create_engine", new=create_engine_test
), patch(
"homeassistant.components.recorder.migration._apply_update",
wraps=migration._apply_upda... | [
"async",
"def",
"test_schema_update_calls",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"homeassistant.components.recorder.create_engine\"",
",",
"new",
"=",
"create_engine_test",
")",
",",
"patch",
"(",
"\"homeassistant.components.recorder.migration._apply_update\"",
",",... | [
23,
0
] | [
41,
5
] | python | en | ['en', 'en', 'en'] | True |
test_schema_migrate | (hass) | Test the full schema migration logic.
We're just testing that the logic can execute successfully here without
throwing exceptions. Maintaining a set of assertions based on schema
inspection could quickly become quite cumbersome.
| Test the full schema migration logic. | async def test_schema_migrate(hass):
"""Test the full schema migration logic.
We're just testing that the logic can execute successfully here without
throwing exceptions. Maintaining a set of assertions based on schema
inspection could quickly become quite cumbersome.
"""
with patch("sqlalchemy... | [
"async",
"def",
"test_schema_migrate",
"(",
"hass",
")",
":",
"with",
"patch",
"(",
"\"sqlalchemy.create_engine\"",
",",
"new",
"=",
"create_engine_test",
")",
",",
"patch",
"(",
"\"homeassistant.components.recorder.Recorder._setup_run\"",
")",
"as",
"setup_run",
":",
... | [
44,
0
] | [
58,
31
] | python | en | ['en', 'de', 'en'] | True |
test_invalid_update | () | Test that an invalid new version raises an exception. | Test that an invalid new version raises an exception. | def test_invalid_update():
"""Test that an invalid new version raises an exception."""
with pytest.raises(ValueError):
migration._apply_update(None, -1, 0) | [
"def",
"test_invalid_update",
"(",
")",
":",
"with",
"pytest",
".",
"raises",
"(",
"ValueError",
")",
":",
"migration",
".",
"_apply_update",
"(",
"None",
",",
"-",
"1",
",",
"0",
")"
] | [
61,
0
] | [
64,
44
] | python | en | ['en', 'en', 'en'] | True |
test_forgiving_add_column | () | Test that add column will continue if column exists. | Test that add column will continue if column exists. | def test_forgiving_add_column():
"""Test that add column will continue if column exists."""
engine = create_engine("sqlite://", poolclass=StaticPool)
engine.execute("CREATE TABLE hello (id int)")
migration._add_columns(engine, "hello", ["context_id CHARACTER(36)"])
migration._add_columns(engine, "he... | [
"def",
"test_forgiving_add_column",
"(",
")",
":",
"engine",
"=",
"create_engine",
"(",
"\"sqlite://\"",
",",
"poolclass",
"=",
"StaticPool",
")",
"engine",
".",
"execute",
"(",
"\"CREATE TABLE hello (id int)\"",
")",
"migration",
".",
"_add_columns",
"(",
"engine",... | [
67,
0
] | [
72,
73
] | python | en | ['en', 'en', 'en'] | True |
test_forgiving_add_index | () | Test that add index will continue if index exists. | Test that add index will continue if index exists. | def test_forgiving_add_index():
"""Test that add index will continue if index exists."""
engine = create_engine("sqlite://", poolclass=StaticPool)
models.Base.metadata.create_all(engine)
migration._create_index(engine, "states", "ix_states_context_id") | [
"def",
"test_forgiving_add_index",
"(",
")",
":",
"engine",
"=",
"create_engine",
"(",
"\"sqlite://\"",
",",
"poolclass",
"=",
"StaticPool",
")",
"models",
".",
"Base",
".",
"metadata",
".",
"create_all",
"(",
"engine",
")",
"migration",
".",
"_create_index",
... | [
75,
0
] | [
79,
69
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (
hass: HomeAssistantType,
entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) | Set up the ISY994 sensor platform. | Set up the ISY994 sensor platform. | async def async_setup_entry(
hass: HomeAssistantType,
entry: ConfigEntry,
async_add_entities: Callable[[list], None],
) -> bool:
"""Set up the ISY994 sensor platform."""
hass_isy_data = hass.data[ISY994_DOMAIN][entry.entry_id]
devices = []
for node in hass_isy_data[ISY994_NODES][SENSOR]:
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistantType",
",",
"entry",
":",
"ConfigEntry",
",",
"async_add_entities",
":",
"Callable",
"[",
"[",
"list",
"]",
",",
"None",
"]",
",",
")",
"->",
"bool",
":",
"hass_isy_data",
"=",
"hass",
".... | [
25,
0
] | [
42,
31
] | python | en | ['en', 'ru', 'en'] | True |
ISYSensorEntity.raw_unit_of_measurement | (self) | Get the raw unit of measurement for the ISY994 sensor device. | Get the raw unit of measurement for the ISY994 sensor device. | def raw_unit_of_measurement(self) -> Union[dict, str]:
"""Get the raw unit of measurement for the ISY994 sensor device."""
uom = self._node.uom
# Backwards compatibility for ISYv4 Firmware:
if isinstance(uom, list):
return UOM_FRIENDLY_NAME.get(uom[0], uom[0])
# Spe... | [
"def",
"raw_unit_of_measurement",
"(",
"self",
")",
"->",
"Union",
"[",
"dict",
",",
"str",
"]",
":",
"uom",
"=",
"self",
".",
"_node",
".",
"uom",
"# Backwards compatibility for ISYv4 Firmware:",
"if",
"isinstance",
"(",
"uom",
",",
"list",
")",
":",
"retur... | [
49,
4
] | [
65,
41
] | python | en | ['en', 'en', 'en'] | True |
ISYSensorEntity.state | (self) | Get the state of the ISY994 sensor device. | Get the state of the ISY994 sensor device. | def state(self) -> str:
"""Get the state of the ISY994 sensor device."""
value = self._node.status
if value == ISY_VALUE_UNKNOWN:
return None
# Get the translated ISY Unit of Measurement
uom = self.raw_unit_of_measurement
# Check if this is a known index pai... | [
"def",
"state",
"(",
"self",
")",
"->",
"str",
":",
"value",
"=",
"self",
".",
"_node",
".",
"status",
"if",
"value",
"==",
"ISY_VALUE_UNKNOWN",
":",
"return",
"None",
"# Get the translated ISY Unit of Measurement",
"uom",
"=",
"self",
".",
"raw_unit_of_measurem... | [
68,
4
] | [
91,
20
] | python | en | ['en', 'en', 'en'] | True |
ISYSensorEntity.unit_of_measurement | (self) | Get the Home Assistant unit of measurement for the device. | Get the Home Assistant unit of measurement for the device. | def unit_of_measurement(self) -> str:
"""Get the Home Assistant unit of measurement for the device."""
raw_units = self.raw_unit_of_measurement
# Check if this is a known index pair UOM
if isinstance(raw_units, dict) or raw_units in [UOM_ON_OFF, UOM_INDEX]:
return None
... | [
"def",
"unit_of_measurement",
"(",
"self",
")",
"->",
"str",
":",
"raw_units",
"=",
"self",
".",
"raw_unit_of_measurement",
"# Check if this is a known index pair UOM",
"if",
"isinstance",
"(",
"raw_units",
",",
"dict",
")",
"or",
"raw_units",
"in",
"[",
"UOM_ON_OFF... | [
94,
4
] | [
102,
24
] | python | en | ['en', 'en', 'en'] | True |
ISYSensorVariableEntity.__init__ | (self, vname: str, vobj: object) | Initialize the ISY994 binary sensor program. | Initialize the ISY994 binary sensor program. | def __init__(self, vname: str, vobj: object) -> None:
"""Initialize the ISY994 binary sensor program."""
super().__init__(vobj)
self._name = vname | [
"def",
"__init__",
"(",
"self",
",",
"vname",
":",
"str",
",",
"vobj",
":",
"object",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"vobj",
")",
"self",
".",
"_name",
"=",
"vname"
] | [
108,
4
] | [
111,
26
] | python | en | ['en', 'pl', 'en'] | True |
ISYSensorVariableEntity.state | (self) | Return the state of the variable. | Return the state of the variable. | def state(self):
"""Return the state of the variable."""
return convert_isy_value_to_hass(self._node.status, "", self._node.prec) | [
"def",
"state",
"(",
"self",
")",
":",
"return",
"convert_isy_value_to_hass",
"(",
"self",
".",
"_node",
".",
"status",
",",
"\"\"",
",",
"self",
".",
"_node",
".",
"prec",
")"
] | [
114,
4
] | [
116,
80
] | python | en | ['en', 'en', 'en'] | True |
ISYSensorVariableEntity.device_state_attributes | (self) | Get the state attributes for the device. | Get the state attributes for the device. | def device_state_attributes(self) -> Dict:
"""Get the state attributes for the device."""
return {
"init_value": convert_isy_value_to_hass(
self._node.init, "", self._node.prec
)
} | [
"def",
"device_state_attributes",
"(",
"self",
")",
"->",
"Dict",
":",
"return",
"{",
"\"init_value\"",
":",
"convert_isy_value_to_hass",
"(",
"self",
".",
"_node",
".",
"init",
",",
"\"\"",
",",
"self",
".",
"_node",
".",
"prec",
")",
"}"
] | [
119,
4
] | [
125,
9
] | python | en | ['en', 'en', 'en'] | True |
ISYSensorVariableEntity.icon | (self) | Return the icon. | Return the icon. | def icon(self):
"""Return the icon."""
return "mdi:counter" | [
"def",
"icon",
"(",
"self",
")",
":",
"return",
"\"mdi:counter\""
] | [
128,
4
] | [
130,
28
] | python | en | ['en', 'sr', 'en'] | True |
allocate_buffers | (engine) |
Allocates all buffers required for an engine, i.e. host/device inputs/outputs.
Parameters
----------
engine : tensorrt.ICudaEngine
An ICudaEngine for executing inference on a built network
Returns
-------
list
All input HostDeviceMem of an engine
list
All outpu... |
Allocates all buffers required for an engine, i.e. host/device inputs/outputs. | def allocate_buffers(engine):
"""
Allocates all buffers required for an engine, i.e. host/device inputs/outputs.
Parameters
----------
engine : tensorrt.ICudaEngine
An ICudaEngine for executing inference on a built network
Returns
-------
list
All input HostDeviceMem of... | [
"def",
"allocate_buffers",
"(",
"engine",
")",
":",
"inputs",
"=",
"[",
"]",
"outputs",
"=",
"[",
"]",
"bindings",
"=",
"[",
"]",
"stream",
"=",
"cuda",
".",
"Stream",
"(",
")",
"for",
"binding",
"in",
"engine",
":",
"size",
"=",
"trt",
".",
"volum... | [
34,
0
] | [
71,
44
] | python | en | ['en', 'error', 'th'] | False |
HostDeviceMem.__init__ | (self, host_mem, device_mem) |
This function builds an engine from an onnx model with calibration process.
Parameters
----------
host_mem : host memory
Memory buffers of host
device_mem : device memory
Memory buffers of device
|
This function builds an engine from an onnx model with calibration process. | def __init__(self, host_mem, device_mem):
"""
This function builds an engine from an onnx model with calibration process.
Parameters
----------
host_mem : host memory
Memory buffers of host
device_mem : device memory
Memory buffers of device
... | [
"def",
"__init__",
"(",
"self",
",",
"host_mem",
",",
"device_mem",
")",
":",
"self",
".",
"host",
"=",
"host_mem",
"self",
".",
"device",
"=",
"device_mem"
] | [
14,
4
] | [
26,
32
] | python | en | ['en', 'error', 'th'] | False |
mock_client | (hass, hass_client, registrations=None) | Create a test client for HTML5 views. | Create a test client for HTML5 views. | async def mock_client(hass, hass_client, registrations=None):
"""Create a test client for HTML5 views."""
if registrations is None:
registrations = {}
with patch(
"homeassistant.components.html5.notify._load_config", return_value=registrations
):
await async_setup_component(hass... | [
"async",
"def",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
"=",
"None",
")",
":",
"if",
"registrations",
"is",
"None",
":",
"registrations",
"=",
"{",
"}",
"with",
"patch",
"(",
"\"homeassistant.components.html5.notify._load_config\"",
"... | [
65,
0
] | [
76,
30
] | python | en | ['en', 'en', 'en'] | True |
test_create_vapid_withoutvapid | () | Test creating empty vapid. | Test creating empty vapid. | def test_create_vapid_withoutvapid():
"""Test creating empty vapid."""
resp = html5.create_vapid_headers(
vapid_email=None, vapid_private_key=None, subscription_info=None
)
assert resp is None | [
"def",
"test_create_vapid_withoutvapid",
"(",
")",
":",
"resp",
"=",
"html5",
".",
"create_vapid_headers",
"(",
"vapid_email",
"=",
"None",
",",
"vapid_private_key",
"=",
"None",
",",
"subscription_info",
"=",
"None",
")",
"assert",
"resp",
"is",
"None"
] | [
282,
0
] | [
287,
23
] | python | en | ['en', 'sr', 'en'] | True |
test_registering_new_device_view | (hass, hass_client) | Test that the HTML view works. | Test that the HTML view works. | async def test_registering_new_device_view(hass, hass_client):
"""Test that the HTML view works."""
client = await mock_client(hass, hass_client)
with patch("homeassistant.components.html5.notify.save_json") as mock_save:
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTION_1))
... | [
"async",
"def",
"test_registering_new_device_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
")",
"with",
"patch",
"(",
"\"homeassistant.components.html5.notify.save_json\"",
")",
"as",
"mock_sa... | [
290,
0
] | [
299,
78
] | python | en | ['en', 'en', 'en'] | True |
test_registering_new_device_view_with_name | (hass, hass_client) | Test that the HTML view works with name attribute. | Test that the HTML view works with name attribute. | async def test_registering_new_device_view_with_name(hass, hass_client):
"""Test that the HTML view works with name attribute."""
client = await mock_client(hass, hass_client)
SUB_WITH_NAME = SUBSCRIPTION_1.copy()
SUB_WITH_NAME["name"] = "test device"
with patch("homeassistant.components.html5.not... | [
"async",
"def",
"test_registering_new_device_view_with_name",
"(",
"hass",
",",
"hass_client",
")",
":",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
")",
"SUB_WITH_NAME",
"=",
"SUBSCRIPTION_1",
".",
"copy",
"(",
")",
"SUB_WITH_NAME",
"[... | [
302,
0
] | [
314,
75
] | python | en | ['en', 'en', 'en'] | True |
test_registering_new_device_expiration_view | (hass, hass_client) | Test that the HTML view works. | Test that the HTML view works. | async def test_registering_new_device_expiration_view(hass, hass_client):
"""Test that the HTML view works."""
client = await mock_client(hass, hass_client)
with patch("homeassistant.components.html5.notify.save_json") as mock_save:
resp = await client.post(REGISTER_URL, data=json.dumps(SUBSCRIPTIO... | [
"async",
"def",
"test_registering_new_device_expiration_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
")",
"with",
"patch",
"(",
"\"homeassistant.components.html5.notify.save_json\"",
")",
"as",... | [
317,
0
] | [
325,
78
] | python | en | ['en', 'en', 'en'] | True |
test_registering_new_device_fails_view | (hass, hass_client) | Test subs. are not altered when registering a new device fails. | Test subs. are not altered when registering a new device fails. | async def test_registering_new_device_fails_view(hass, hass_client):
"""Test subs. are not altered when registering a new device fails."""
registrations = {}
client = await mock_client(hass, hass_client, registrations)
with patch(
"homeassistant.components.html5.notify.save_json",
side_... | [
"async",
"def",
"test_registering_new_device_fails_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"with",
"patch",
"(",
"\"homea... | [
328,
0
] | [
340,
30
] | python | en | ['en', 'en', 'en'] | True |
test_registering_existing_device_view | (hass, hass_client) | Test subscription is updated when registering existing device. | Test subscription is updated when registering existing device. | async def test_registering_existing_device_view(hass, hass_client):
"""Test subscription is updated when registering existing device."""
registrations = {}
client = await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.save_json") as mock_save:
aw... | [
"async",
"def",
"test_registering_existing_device_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"with",
"patch",
"(",
"\"homeas... | [
343,
0
] | [
354,
62
] | python | en | ['en', 'en', 'en'] | True |
test_registering_existing_device_view_with_name | (hass, hass_client) | Test subscription is updated when reg'ing existing device with name. | Test subscription is updated when reg'ing existing device with name. | async def test_registering_existing_device_view_with_name(hass, hass_client):
"""Test subscription is updated when reg'ing existing device with name."""
registrations = {}
client = await mock_client(hass, hass_client, registrations)
SUB_WITH_NAME = SUBSCRIPTION_1.copy()
SUB_WITH_NAME["name"] = "tes... | [
"async",
"def",
"test_registering_existing_device_view_with_name",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"SUB_WITH_NAME",
"=",
"... | [
357,
0
] | [
371,
59
] | python | en | ['en', 'en', 'en'] | True |
test_registering_existing_device_fails_view | (hass, hass_client) | Test sub. is not updated when registering existing device fails. | Test sub. is not updated when registering existing device fails. | async def test_registering_existing_device_fails_view(hass, hass_client):
"""Test sub. is not updated when registering existing device fails."""
registrations = {}
client = await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.save_json") as mock_save:
... | [
"async",
"def",
"test_registering_existing_device_fails_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"with",
"patch",
"(",
"\"... | [
374,
0
] | [
385,
62
] | python | en | ['en', 'en', 'en'] | True |
test_registering_new_device_validation | (hass, hass_client) | Test various errors when registering a new device. | Test various errors when registering a new device. | async def test_registering_new_device_validation(hass, hass_client):
"""Test various errors when registering a new device."""
client = await mock_client(hass, hass_client)
resp = await client.post(
REGISTER_URL,
data=json.dumps({"browser": "invalid browser", "subscription": "sub info"}),
... | [
"async",
"def",
"test_registering_new_device_validation",
"(",
"hass",
",",
"hass_client",
")",
":",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
")",
"resp",
"=",
"await",
"client",
".",
"post",
"(",
"REGISTER_URL",
",",
"data",
"="... | [
388,
0
] | [
406,
29
] | python | en | ['en', 'en', 'en'] | True |
test_unregistering_device_view | (hass, hass_client) | Test that the HTML unregister view works. | Test that the HTML unregister view works. | async def test_unregistering_device_view(hass, hass_client):
"""Test that the HTML unregister view works."""
registrations = {"some device": SUBSCRIPTION_1, "other device": SUBSCRIPTION_2}
client = await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.sav... | [
"async",
"def",
"test_unregistering_device_view",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"\"some device\"",
":",
"SUBSCRIPTION_1",
",",
"\"other device\"",
":",
"SUBSCRIPTION_2",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",... | [
409,
0
] | [
422,
60
] | python | en | ['en', 'en', 'en'] | True |
test_unregister_device_view_handle_unknown_subscription | (hass, hass_client) | Test that the HTML unregister view handles unknown subscriptions. | Test that the HTML unregister view handles unknown subscriptions. | async def test_unregister_device_view_handle_unknown_subscription(hass, hass_client):
"""Test that the HTML unregister view handles unknown subscriptions."""
registrations = {}
client = await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.save_json") as ... | [
"async",
"def",
"test_unregister_device_view_handle_unknown_subscription",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"with",
"patch",
... | [
425,
0
] | [
438,
41
] | python | en | ['en', 'en', 'en'] | True |
test_unregistering_device_view_handles_save_error | (hass, hass_client) | Test that the HTML unregister view handles save errors. | Test that the HTML unregister view handles save errors. | async def test_unregistering_device_view_handles_save_error(hass, hass_client):
"""Test that the HTML unregister view handles save errors."""
registrations = {"some device": SUBSCRIPTION_1, "other device": SUBSCRIPTION_2}
client = await mock_client(hass, hass_client, registrations)
with patch(
... | [
"async",
"def",
"test_unregistering_device_view_handles_save_error",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"\"some device\"",
":",
"SUBSCRIPTION_1",
",",
"\"other device\"",
":",
"SUBSCRIPTION_2",
"}",
"client",
"=",
"await",
"mock_client... | [
441,
0
] | [
459,
5
] | python | en | ['en', 'en', 'en'] | True |
test_callback_view_no_jwt | (hass, hass_client) | Test that the notification callback view works without JWT. | Test that the notification callback view works without JWT. | async def test_callback_view_no_jwt(hass, hass_client):
"""Test that the notification callback view works without JWT."""
client = await mock_client(hass, hass_client)
resp = await client.post(
PUBLISH_URL,
data=json.dumps(
{"type": "push", "tag": "3bc28d69-0921-41f1-ac6a-7a627ba... | [
"async",
"def",
"test_callback_view_no_jwt",
"(",
"hass",
",",
"hass_client",
")",
":",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
")",
"resp",
"=",
"await",
"client",
".",
"post",
"(",
"PUBLISH_URL",
",",
"data",
"=",
"json",
... | [
462,
0
] | [
472,
29
] | python | en | ['en', 'en', 'en'] | True |
test_callback_view_with_jwt | (hass, hass_client) | Test that the notification callback view works with JWT. | Test that the notification callback view works with JWT. | async def test_callback_view_with_jwt(hass, hass_client):
"""Test that the notification callback view works with JWT."""
registrations = {"device": SUBSCRIPTION_1}
client = await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.WebPusher") as mock_wp:
... | [
"async",
"def",
"test_callback_view_with_jwt",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"\"device\"",
":",
"SUBSCRIPTION_1",
"}",
"client",
"=",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"wit... | [
475,
0
] | [
509,
52
] | python | en | ['en', 'en', 'en'] | True |
test_send_fcm_without_targets | (hass, hass_client) | Test that the notification is send with FCM without targets. | Test that the notification is send with FCM without targets. | async def test_send_fcm_without_targets(hass, hass_client):
"""Test that the notification is send with FCM without targets."""
registrations = {"device": SUBSCRIPTION_5}
await mock_client(hass, hass_client, registrations)
with patch("homeassistant.components.html5.notify.WebPusher") as mock_wp:
... | [
"async",
"def",
"test_send_fcm_without_targets",
"(",
"hass",
",",
"hass_client",
")",
":",
"registrations",
"=",
"{",
"\"device\"",
":",
"SUBSCRIPTION_5",
"}",
"await",
"mock_client",
"(",
"hass",
",",
"hass_client",
",",
"registrations",
")",
"with",
"patch",
... | [
512,
0
] | [
529,
69
] | python | en | ['en', 'en', 'en'] | True |
TestHtml5Notify.test_get_service_with_no_json | (self) | Test empty json file. | Test empty json file. | def test_get_service_with_no_json(self):
"""Test empty json file."""
hass = MagicMock()
m = mock_open()
with patch("homeassistant.util.json.open", m, create=True):
service = html5.get_service(hass, {})
assert service is not None | [
"def",
"test_get_service_with_no_json",
"(",
"self",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"m",
"=",
"mock_open",
"(",
")",
"with",
"patch",
"(",
"\"homeassistant.util.json.open\"",
",",
"m",
",",
"create",
"=",
"True",
")",
":",
"service",
"=",
"h... | [
82,
4
] | [
90,
34
] | python | en | ['en', 'cs', 'en'] | True |
TestHtml5Notify.test_dismissing_message | (self, mock_wp) | Test dismissing message. | Test dismissing message. | def test_dismissing_message(self, mock_wp):
"""Test dismissing message."""
hass = MagicMock()
data = {"device": SUBSCRIPTION_1}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
service = html5.get_service(hass, {"... | [
"def",
"test_dismissing_message",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"device\"",
":",
"SUBSCRIPTION_1",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",... | [
93,
4
] | [
118,
39
] | python | da | ['de', 'da', 'en'] | False |
TestHtml5Notify.test_sending_message | (self, mock_wp) | Test sending message. | Test sending message. | def test_sending_message(self, mock_wp):
"""Test sending message."""
hass = MagicMock()
data = {"device": SUBSCRIPTION_1}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
service = html5.get_service(hass, {"gcm_se... | [
"def",
"test_sending_message",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"device\"",
":",
"SUBSCRIPTION_1",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
... | [
121,
4
] | [
148,
44
] | python | en | ['en', 'lb', 'en'] | True |
TestHtml5Notify.test_gcm_key_include | (self, mock_wp) | Test if the gcm_key is only included for GCM endpoints. | Test if the gcm_key is only included for GCM endpoints. | def test_gcm_key_include(self, mock_wp):
"""Test if the gcm_key is only included for GCM endpoints."""
hass = MagicMock()
data = {"chrome": SUBSCRIPTION_1, "firefox": SUBSCRIPTION_2}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=... | [
"def",
"test_gcm_key_include",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"chrome\"",
":",
"SUBSCRIPTION_1",
",",
"\"firefox\"",
":",
"SUBSCRIPTION_2",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"... | [
151,
4
] | [
179,
58
] | python | en | ['en', 'en', 'en'] | True |
TestHtml5Notify.test_fcm_key_include | (self, mock_wp) | Test if the FCM header is included. | Test if the FCM header is included. | def test_fcm_key_include(self, mock_wp):
"""Test if the FCM header is included."""
hass = MagicMock()
data = {"chrome": SUBSCRIPTION_5}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
service = html5.get_service(... | [
"def",
"test_fcm_key_include",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"chrome\"",
":",
"SUBSCRIPTION_5",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
... | [
182,
4
] | [
204,
79
] | python | en | ['en', 'en', 'en'] | True |
TestHtml5Notify.test_fcm_send_with_unknown_priority | (self, mock_wp) | Test if the gcm_key is only included for GCM endpoints. | Test if the gcm_key is only included for GCM endpoints. | def test_fcm_send_with_unknown_priority(self, mock_wp):
"""Test if the gcm_key is only included for GCM endpoints."""
hass = MagicMock()
data = {"chrome": SUBSCRIPTION_5}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
... | [
"def",
"test_fcm_send_with_unknown_priority",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"chrome\"",
":",
"SUBSCRIPTION_5",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"d... | [
207,
4
] | [
229,
74
] | python | en | ['en', 'en', 'en'] | True |
TestHtml5Notify.test_fcm_no_targets | (self, mock_wp) | Test if the gcm_key is only included for GCM endpoints. | Test if the gcm_key is only included for GCM endpoints. | def test_fcm_no_targets(self, mock_wp):
"""Test if the gcm_key is only included for GCM endpoints."""
hass = MagicMock()
data = {"chrome": SUBSCRIPTION_5}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
service =... | [
"def",
"test_fcm_no_targets",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"chrome\"",
":",
"SUBSCRIPTION_5",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
"... | [
232,
4
] | [
254,
74
] | python | en | ['en', 'en', 'en'] | True |
TestHtml5Notify.test_fcm_additional_data | (self, mock_wp) | Test if the gcm_key is only included for GCM endpoints. | Test if the gcm_key is only included for GCM endpoints. | def test_fcm_additional_data(self, mock_wp):
"""Test if the gcm_key is only included for GCM endpoints."""
hass = MagicMock()
data = {"chrome": SUBSCRIPTION_5}
m = mock_open(read_data=json.dumps(data))
with patch("homeassistant.util.json.open", m, create=True):
serv... | [
"def",
"test_fcm_additional_data",
"(",
"self",
",",
"mock_wp",
")",
":",
"hass",
"=",
"MagicMock",
"(",
")",
"data",
"=",
"{",
"\"chrome\"",
":",
"SUBSCRIPTION_5",
"}",
"m",
"=",
"mock_open",
"(",
"read_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")"... | [
257,
4
] | [
279,
74
] | python | en | ['en', 'en', 'en'] | True |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up Sure PetCare Flaps sensors. | Set up Sure PetCare Flaps sensors. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up Sure PetCare Flaps sensors."""
if discovery_info is None:
return
entities = []
spc = hass.data[DATA_SURE_PETCARE][SPC]
for entity in spc.ids:
sure_type = entity[CONF_TYPE]
if ... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"if",
"discovery_info",
"is",
"None",
":",
"return",
"entities",
"=",
"[",
"]",
"spc",
"=",
"hass",
".",
"data",
"[... | [
29,
0
] | [
51,
38
] | python | en | ['en', 'su', 'en'] | True |
SurePetcareSensor.__init__ | (self, _id: int, sure_type: SureProductID, spc: SurePetcareAPI) | Initialize a Sure Petcare sensor. | Initialize a Sure Petcare sensor. | def __init__(self, _id: int, sure_type: SureProductID, spc: SurePetcareAPI):
"""Initialize a Sure Petcare sensor."""
self._id = _id
self._sure_type = sure_type
self._spc = spc
self._spc_data: Dict[str, Any] = self._spc.states[self._sure_type].get(self._id)
self._state: ... | [
"def",
"__init__",
"(",
"self",
",",
"_id",
":",
"int",
",",
"sure_type",
":",
"SureProductID",
",",
"spc",
":",
"SurePetcareAPI",
")",
":",
"self",
".",
"_id",
"=",
"_id",
"self",
".",
"_sure_type",
"=",
"sure_type",
"self",
".",
"_spc",
"=",
"spc",
... | [
57,
4
] | [
72,
51
] | python | ro | ['ro', 'ro', 'it'] | True |
SurePetcareSensor.name | (self) | Return the name of the device if any. | Return the name of the device if any. | def name(self) -> str:
"""Return the name of the device if any."""
return self._name | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_name"
] | [
75,
4
] | [
77,
25
] | python | en | ['en', 'en', 'en'] | True |
SurePetcareSensor.unique_id | (self) | Return an unique ID. | Return an unique ID. | def unique_id(self) -> str:
"""Return an unique ID."""
return f"{self._spc_data['household_id']}-{self._id}" | [
"def",
"unique_id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f\"{self._spc_data['household_id']}-{self._id}\""
] | [
80,
4
] | [
82,
61
] | python | fr | ['fr', 'fr', 'en'] | True |
SurePetcareSensor.available | (self) | Return true if entity is available. | Return true if entity is available. | def available(self) -> bool:
"""Return true if entity is available."""
return bool(self._state) | [
"def",
"available",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"bool",
"(",
"self",
".",
"_state",
")"
] | [
85,
4
] | [
87,
32
] | python | en | ['en', 'en', 'en'] | True |
SurePetcareSensor.should_poll | (self) | Return true. | Return true. | def should_poll(self) -> bool:
"""Return true."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"False"
] | [
90,
4
] | [
92,
20
] | python | en | ['en', 'mt', 'en'] | False |
SurePetcareSensor.async_update | (self) | Get the latest data and update the state. | Get the latest data and update the state. | async def async_update(self) -> None:
"""Get the latest data and update the state."""
self._spc_data = self._spc.states[self._sure_type].get(self._id)
self._state = self._spc_data.get("status")
_LOGGER.debug("%s -> self._state: %s", self._name, self._state) | [
"async",
"def",
"async_update",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_spc_data",
"=",
"self",
".",
"_spc",
".",
"states",
"[",
"self",
".",
"_sure_type",
"]",
".",
"get",
"(",
"self",
".",
"_id",
")",
"self",
".",
"_state",
"=",
"self... | [
94,
4
] | [
98,
71
] | python | en | ['en', 'en', 'en'] | True |
SurePetcareSensor.async_added_to_hass | (self) | Register callbacks. | Register callbacks. | async def async_added_to_hass(self) -> None:
"""Register callbacks."""
@callback
def update() -> None:
"""Update the state."""
self.async_schedule_update_ha_state(True)
self._async_unsub_dispatcher_connect = async_dispatcher_connect(
self.hass, TOPIC... | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
"->",
"None",
":",
"@",
"callback",
"def",
"update",
"(",
")",
"->",
"None",
":",
"\"\"\"Update the state.\"\"\"",
"self",
".",
"async_schedule_update_ha_state",
"(",
"True",
")",
"self",
".",
"_async_unsu... | [
100,
4
] | [
110,
9
] | python | en | ['en', 'no', 'en'] | False |
SurePetcareSensor.async_will_remove_from_hass | (self) | Disconnect dispatcher listener when removed. | Disconnect dispatcher listener when removed. | async def async_will_remove_from_hass(self) -> None:
"""Disconnect dispatcher listener when removed."""
if self._async_unsub_dispatcher_connect:
self._async_unsub_dispatcher_connect() | [
"async",
"def",
"async_will_remove_from_hass",
"(",
"self",
")",
"->",
"None",
":",
"if",
"self",
".",
"_async_unsub_dispatcher_connect",
":",
"self",
".",
"_async_unsub_dispatcher_connect",
"(",
")"
] | [
112,
4
] | [
115,
50
] | python | en | ['en', 'en', 'en'] | True |
Flap.state | (self) | Return battery level in percent. | Return battery level in percent. | def state(self) -> Optional[int]:
"""Return battery level in percent."""
return SureLockStateID(self._state["locking"]["mode"]).name.capitalize() | [
"def",
"state",
"(",
"self",
")",
"->",
"Optional",
"[",
"int",
"]",
":",
"return",
"SureLockStateID",
"(",
"self",
".",
"_state",
"[",
"\"locking\"",
"]",
"[",
"\"mode\"",
"]",
")",
".",
"name",
".",
"capitalize",
"(",
")"
] | [
122,
4
] | [
124,
80
] | python | en | ['id', 'no', 'en'] | False |
Flap.device_state_attributes | (self) | Return the state attributes of the device. | Return the state attributes of the device. | def device_state_attributes(self) -> Optional[Dict[str, Any]]:
"""Return the state attributes of the device."""
attributes = None
if self._state:
attributes = {"learn_mode": bool(self._state["learn_mode"])}
return attributes | [
"def",
"device_state_attributes",
"(",
"self",
")",
"->",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"attributes",
"=",
"None",
"if",
"self",
".",
"_state",
":",
"attributes",
"=",
"{",
"\"learn_mode\"",
":",
"bool",
"(",
"self",
"... | [
127,
4
] | [
133,
25
] | python | en | ['en', 'en', 'en'] | True |
SureBattery.name | (self) | Return the name of the device if any. | Return the name of the device if any. | def name(self) -> str:
"""Return the name of the device if any."""
return f"{self._name} Battery Level" | [
"def",
"name",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f\"{self._name} Battery Level\""
] | [
140,
4
] | [
142,
44
] | python | en | ['en', 'en', 'en'] | True |
SureBattery.state | (self) | Return battery level in percent. | Return battery level in percent. | def state(self) -> Optional[int]:
"""Return battery level in percent."""
battery_percent: Optional[int]
try:
per_battery_voltage = self._state["battery"] / 4
voltage_diff = per_battery_voltage - SURE_BATT_VOLTAGE_LOW
battery_percent = min(int(voltage_diff / SU... | [
"def",
"state",
"(",
"self",
")",
"->",
"Optional",
"[",
"int",
"]",
":",
"battery_percent",
":",
"Optional",
"[",
"int",
"]",
"try",
":",
"per_battery_voltage",
"=",
"self",
".",
"_state",
"[",
"\"battery\"",
"]",
"/",
"4",
"voltage_diff",
"=",
"per_bat... | [
145,
4
] | [
155,
30
] | python | en | ['id', 'no', 'en'] | False |
SureBattery.unique_id | (self) | Return an unique ID. | Return an unique ID. | def unique_id(self) -> str:
"""Return an unique ID."""
return f"{self._spc_data['household_id']}-{self._id}-battery" | [
"def",
"unique_id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f\"{self._spc_data['household_id']}-{self._id}-battery\""
] | [
158,
4
] | [
160,
69
] | python | fr | ['fr', 'fr', 'en'] | True |
SureBattery.device_class | (self) | Return the device class. | Return the device class. | def device_class(self) -> str:
"""Return the device class."""
return DEVICE_CLASS_BATTERY | [
"def",
"device_class",
"(",
"self",
")",
"->",
"str",
":",
"return",
"DEVICE_CLASS_BATTERY"
] | [
163,
4
] | [
165,
35
] | python | en | ['en', 'en', 'en'] | True |
SureBattery.device_state_attributes | (self) | Return state attributes. | Return state attributes. | def device_state_attributes(self) -> Optional[Dict[str, Any]]:
"""Return state attributes."""
attributes = None
if self._state:
voltage_per_battery = float(self._state["battery"]) / 4
attributes = {
ATTR_VOLTAGE: f"{float(self._state['battery']):.2f}",
... | [
"def",
"device_state_attributes",
"(",
"self",
")",
"->",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
":",
"attributes",
"=",
"None",
"if",
"self",
".",
"_state",
":",
"voltage_per_battery",
"=",
"float",
"(",
"self",
".",
"_state",
"[",
... | [
168,
4
] | [
178,
25
] | python | en | ['en', 'co', 'en'] | True |
SureBattery.unit_of_measurement | (self) | Return the unit of measurement. | Return the unit of measurement. | def unit_of_measurement(self) -> str:
"""Return the unit of measurement."""
return PERCENTAGE | [
"def",
"unit_of_measurement",
"(",
"self",
")",
"->",
"str",
":",
"return",
"PERCENTAGE"
] | [
181,
4
] | [
183,
25
] | python | en | ['en', 'la', 'en'] | True |
listen | (
hass: core.HomeAssistant, service: Union[str, Collection[str]], callback: Callable
) | Set up listener for discovery of specific service.
Service can be a string or a list/tuple.
| Set up listener for discovery of specific service. | def listen(
hass: core.HomeAssistant, service: Union[str, Collection[str]], callback: Callable
) -> None:
"""Set up listener for discovery of specific service.
Service can be a string or a list/tuple.
"""
run_callback_threadsafe(hass.loop, async_listen, hass, service, callback).result() | [
"def",
"listen",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"service",
":",
"Union",
"[",
"str",
",",
"Collection",
"[",
"str",
"]",
"]",
",",
"callback",
":",
"Callable",
")",
"->",
"None",
":",
"run_callback_threadsafe",
"(",
"hass",
".",
"... | [
20,
0
] | [
27,
86
] | python | en | ['en', 'en', 'en'] | True |
async_listen | (
hass: core.HomeAssistant, service: Union[str, Collection[str]], callback: Callable
) | Set up listener for discovery of specific service.
Service can be a string or a list/tuple.
| Set up listener for discovery of specific service. | def async_listen(
hass: core.HomeAssistant, service: Union[str, Collection[str]], callback: Callable
) -> None:
"""Set up listener for discovery of specific service.
Service can be a string or a list/tuple.
"""
if isinstance(service, str):
service = (service,)
else:
service = tu... | [
"def",
"async_listen",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"service",
":",
"Union",
"[",
"str",
",",
"Collection",
"[",
"str",
"]",
"]",
",",
"callback",
":",
"Callable",
")",
"->",
"None",
":",
"if",
"isinstance",
"(",
"service",
",",... | [
32,
0
] | [
54,
78
] | python | en | ['en', 'en', 'en'] | True |
discover | (
hass: core.HomeAssistant,
service: str,
discovered: DiscoveryInfoType,
component: str,
hass_config: ConfigType,
) | Fire discovery event. Can ensure a component is loaded. | Fire discovery event. Can ensure a component is loaded. | def discover(
hass: core.HomeAssistant,
service: str,
discovered: DiscoveryInfoType,
component: str,
hass_config: ConfigType,
) -> None:
"""Fire discovery event. Can ensure a component is loaded."""
hass.add_job(
async_discover( # type: ignore
hass, service, discovered, ... | [
"def",
"discover",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"service",
":",
"str",
",",
"discovered",
":",
"DiscoveryInfoType",
",",
"component",
":",
"str",
",",
"hass_config",
":",
"ConfigType",
",",
")",
"->",
"None",
":",
"hass",
".",
"ad... | [
58,
0
] | [
70,
5
] | python | en | ['en', 'en', 'en'] | True |
async_discover | (
hass: core.HomeAssistant,
service: str,
discovered: Optional[DiscoveryInfoType],
component: Optional[str],
hass_config: ConfigType,
) | Fire discovery event. Can ensure a component is loaded. | Fire discovery event. Can ensure a component is loaded. | async def async_discover(
hass: core.HomeAssistant,
service: str,
discovered: Optional[DiscoveryInfoType],
component: Optional[str],
hass_config: ConfigType,
) -> None:
"""Fire discovery event. Can ensure a component is loaded."""
if component is not None and component not in hass.config.com... | [
"async",
"def",
"async_discover",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"service",
":",
"str",
",",
"discovered",
":",
"Optional",
"[",
"DiscoveryInfoType",
"]",
",",
"component",
":",
"Optional",
"[",
"str",
"]",
",",
"hass_config",
":",
"C... | [
74,
0
] | [
90,
56
] | python | en | ['en', 'en', 'en'] | True |
listen_platform | (
hass: core.HomeAssistant, component: str, callback: Callable
) | Register a platform loader listener. | Register a platform loader listener. | def listen_platform(
hass: core.HomeAssistant, component: str, callback: Callable
) -> None:
"""Register a platform loader listener."""
run_callback_threadsafe(
hass.loop, async_listen_platform, hass, component, callback
).result() | [
"def",
"listen_platform",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"component",
":",
"str",
",",
"callback",
":",
"Callable",
")",
"->",
"None",
":",
"run_callback_threadsafe",
"(",
"hass",
".",
"loop",
",",
"async_listen_platform",
",",
"hass",
... | [
94,
0
] | [
100,
14
] | python | da | ['fr', 'da', 'en'] | False |
async_listen_platform | (
hass: core.HomeAssistant,
component: str,
callback: Callable[[str, Optional[Dict[str, Any]]], Any],
) | Register a platform loader listener.
This method must be run in the event loop.
| Register a platform loader listener. | def async_listen_platform(
hass: core.HomeAssistant,
component: str,
callback: Callable[[str, Optional[Dict[str, Any]]], Any],
) -> None:
"""Register a platform loader listener.
This method must be run in the event loop.
"""
service = EVENT_LOAD_PLATFORM.format(component)
job = core.Has... | [
"def",
"async_listen_platform",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"component",
":",
"str",
",",
"callback",
":",
"Callable",
"[",
"[",
"str",
",",
"Optional",
"[",
"Dict",
"[",
"str",
",",
"Any",
"]",
"]",
"]",
",",
"Any",
"]",
","... | [
104,
0
] | [
129,
81
] | python | da | ['fr', 'da', 'en'] | False |
load_platform | (
hass: core.HomeAssistant,
component: str,
platform: str,
discovered: DiscoveryInfoType,
hass_config: ConfigType,
) | Load a component and platform dynamically.
Target components will be loaded and an EVENT_PLATFORM_DISCOVERED will be
fired to load the platform. The event will contain:
{ ATTR_SERVICE = EVENT_LOAD_PLATFORM + '.' + <<component>>
ATTR_PLATFORM = <<platform>>
ATTR_DISCOVERED = <<discov... | Load a component and platform dynamically. | def load_platform(
hass: core.HomeAssistant,
component: str,
platform: str,
discovered: DiscoveryInfoType,
hass_config: ConfigType,
) -> None:
"""Load a component and platform dynamically.
Target components will be loaded and an EVENT_PLATFORM_DISCOVERED will be
fired to load the platfo... | [
"def",
"load_platform",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"component",
":",
"str",
",",
"platform",
":",
"str",
",",
"discovered",
":",
"DiscoveryInfoType",
",",
"hass_config",
":",
"ConfigType",
",",
")",
"->",
"None",
":",
"hass",
".",... | [
133,
0
] | [
154,
5
] | python | en | ['en', 'en', 'en'] | True |
async_load_platform | (
hass: core.HomeAssistant,
component: str,
platform: str,
discovered: DiscoveryInfoType,
hass_config: ConfigType,
) | Load a component and platform dynamically.
Target components will be loaded and an EVENT_PLATFORM_DISCOVERED will be
fired to load the platform. The event will contain:
{ ATTR_SERVICE = EVENT_LOAD_PLATFORM + '.' + <<component>>
ATTR_PLATFORM = <<platform>>
ATTR_DISCOVERED = <<discov... | Load a component and platform dynamically. | async def async_load_platform(
hass: core.HomeAssistant,
component: str,
platform: str,
discovered: DiscoveryInfoType,
hass_config: ConfigType,
) -> None:
"""Load a component and platform dynamically.
Target components will be loaded and an EVENT_PLATFORM_DISCOVERED will be
fired to loa... | [
"async",
"def",
"async_load_platform",
"(",
"hass",
":",
"core",
".",
"HomeAssistant",
",",
"component",
":",
"str",
",",
"platform",
":",
"str",
",",
"discovered",
":",
"DiscoveryInfoType",
",",
"hass_config",
":",
"ConfigType",
",",
")",
"->",
"None",
":",... | [
158,
0
] | [
199,
56
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.