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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
async_unload_entry | (hass, config_entry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass, config_entry):
"""Unload a config entry."""
await hass.config_entries.async_forward_entry_unload(config_entry, "sensor")
hass.data[DOMAIN].pop(config_entry.entry_id)
return True | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
",",
"config_entry",
")",
":",
"await",
"hass",
".",
"config_entries",
".",
"async_forward_entry_unload",
"(",
"config_entry",
",",
"\"sensor\"",
")",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
".",
"pop",
"(",
... | [
81,
0
] | [
85,
15
] | python | en | ['en', 'es', 'en'] | True |
get_api | (hass, entry) | Return the api from glances_api. | Return the api from glances_api. | def get_api(hass, entry):
"""Return the api from glances_api."""
params = entry.copy()
params.pop(CONF_NAME)
verify_ssl = params.pop(CONF_VERIFY_SSL)
session = async_get_clientsession(hass, verify_ssl)
return Glances(hass.loop, session, **params) | [
"def",
"get_api",
"(",
"hass",
",",
"entry",
")",
":",
"params",
"=",
"entry",
".",
"copy",
"(",
")",
"params",
".",
"pop",
"(",
"CONF_NAME",
")",
"verify_ssl",
"=",
"params",
".",
"pop",
"(",
"CONF_VERIFY_SSL",
")",
"session",
"=",
"async_get_clientsess... | [
167,
0
] | [
173,
48
] | python | en | ['en', 'pt', 'en'] | True |
GlancesData.__init__ | (self, hass, config_entry) | Initialize the Glances data. | Initialize the Glances data. | def __init__(self, hass, config_entry):
"""Initialize the Glances data."""
self.hass = hass
self.config_entry = config_entry
self.api = None
self.unsub_timer = None
self.available = False | [
"def",
"__init__",
"(",
"self",
",",
"hass",
",",
"config_entry",
")",
":",
"self",
".",
"hass",
"=",
"hass",
"self",
".",
"config_entry",
"=",
"config_entry",
"self",
".",
"api",
"=",
"None",
"self",
".",
"unsub_timer",
"=",
"None",
"self",
".",
"avai... | [
91,
4
] | [
97,
30
] | python | en | ['en', 'en', 'en'] | True |
GlancesData.host | (self) | Return client host. | Return client host. | def host(self):
"""Return client host."""
return self.config_entry.data[CONF_HOST] | [
"def",
"host",
"(",
"self",
")",
":",
"return",
"self",
".",
"config_entry",
".",
"data",
"[",
"CONF_HOST",
"]"
] | [
100,
4
] | [
102,
48
] | python | en | ['en', 'no', 'en'] | True |
GlancesData.async_update | (self) | Get the latest data from the Glances REST API. | Get the latest data from the Glances REST API. | async def async_update(self):
"""Get the latest data from the Glances REST API."""
try:
await self.api.get_data()
self.available = True
except exceptions.GlancesApiError:
_LOGGER.error("Unable to fetch data from Glances")
self.available = False
... | [
"async",
"def",
"async_update",
"(",
"self",
")",
":",
"try",
":",
"await",
"self",
".",
"api",
".",
"get_data",
"(",
")",
"self",
".",
"available",
"=",
"True",
"except",
"exceptions",
".",
"GlancesApiError",
":",
"_LOGGER",
".",
"error",
"(",
"\"Unable... | [
104,
4
] | [
113,
54
] | python | en | ['en', 'en', 'en'] | True |
GlancesData.async_setup | (self) | Set up the Glances client. | Set up the Glances client. | async def async_setup(self):
"""Set up the Glances client."""
try:
self.api = get_api(self.hass, self.config_entry.data)
await self.api.get_data()
self.available = True
_LOGGER.debug("Successfully connected to Glances")
except exceptions.GlancesAp... | [
"async",
"def",
"async_setup",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"api",
"=",
"get_api",
"(",
"self",
".",
"hass",
",",
"self",
".",
"config_entry",
".",
"data",
")",
"await",
"self",
".",
"api",
".",
"get_data",
"(",
")",
"self",
".",... | [
115,
4
] | [
136,
19
] | python | en | ['en', 'fr', 'en'] | True |
GlancesData.add_options | (self) | Add options for Glances integration. | Add options for Glances integration. | def add_options(self):
"""Add options for Glances integration."""
if not self.config_entry.options:
options = {CONF_SCAN_INTERVAL: DEFAULT_SCAN_INTERVAL}
self.hass.config_entries.async_update_entry(
self.config_entry, options=options
) | [
"def",
"add_options",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"config_entry",
".",
"options",
":",
"options",
"=",
"{",
"CONF_SCAN_INTERVAL",
":",
"DEFAULT_SCAN_INTERVAL",
"}",
"self",
".",
"hass",
".",
"config_entries",
".",
"async_update_entry",
"("... | [
138,
4
] | [
144,
13
] | python | en | ['en', 'en', 'en'] | True |
GlancesData.set_scan_interval | (self, scan_interval) | Update scan interval. | Update scan interval. | def set_scan_interval(self, scan_interval):
"""Update scan interval."""
async def refresh(event_time):
"""Get the latest data from Glances api."""
await self.async_update()
if self.unsub_timer is not None:
self.unsub_timer()
self.unsub_timer = async_... | [
"def",
"set_scan_interval",
"(",
"self",
",",
"scan_interval",
")",
":",
"async",
"def",
"refresh",
"(",
"event_time",
")",
":",
"\"\"\"Get the latest data from Glances api.\"\"\"",
"await",
"self",
".",
"async_update",
"(",
")",
"if",
"self",
".",
"unsub_timer",
... | [
146,
4
] | [
157,
9
] | python | en | ['en', 'de', 'en'] | True |
GlancesData.async_options_updated | (hass, entry) | Triggered by config entry options updates. | Triggered by config entry options updates. | async def async_options_updated(hass, entry):
"""Triggered by config entry options updates."""
hass.data[DOMAIN][entry.entry_id].set_scan_interval(
entry.options[CONF_SCAN_INTERVAL]
) | [
"async",
"def",
"async_options_updated",
"(",
"hass",
",",
"entry",
")",
":",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"entry",
".",
"entry_id",
"]",
".",
"set_scan_interval",
"(",
"entry",
".",
"options",
"[",
"CONF_SCAN_INTERVAL",
"]",
")"
] | [
160,
4
] | [
164,
9
] | python | en | ['en', 'en', 'en'] | True |
_login_and_fetch_syno_info | (api, otp_code) | Login to the NAS and fetch basic data. | Login to the NAS and fetch basic data. | def _login_and_fetch_syno_info(api, otp_code):
"""Login to the NAS and fetch basic data."""
# These do i/o
api.login(otp_code)
api.utilisation.update()
api.storage.update()
api.network.update()
if (
not api.information.serial
or api.utilisation.cpu_user_load is None
... | [
"def",
"_login_and_fetch_syno_info",
"(",
"api",
",",
"otp_code",
")",
":",
"# These do i/o",
"api",
".",
"login",
"(",
"otp_code",
")",
"api",
".",
"utilisation",
".",
"update",
"(",
")",
"api",
".",
"storage",
".",
"update",
"(",
")",
"api",
".",
"netw... | [
280,
0
] | [
296,
33
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_get_options_flow | (config_entry) | Get the options flow for this handler. | Get the options flow for this handler. | def async_get_options_flow(config_entry):
"""Get the options flow for this handler."""
return SynologyDSMOptionsFlowHandler(config_entry) | [
"def",
"async_get_options_flow",
"(",
"config_entry",
")",
":",
"return",
"SynologyDSMOptionsFlowHandler",
"(",
"config_entry",
")"
] | [
84,
4
] | [
86,
58
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.__init__ | (self) | Initialize the synology_dsm config flow. | Initialize the synology_dsm config flow. | def __init__(self):
"""Initialize the synology_dsm config flow."""
self.saved_user_input = {}
self.discovered_conf = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"saved_user_input",
"=",
"{",
"}",
"self",
".",
"discovered_conf",
"=",
"{",
"}"
] | [
88,
4
] | [
91,
33
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler._show_setup_form | (self, user_input=None, errors=None) | Show the setup form to the user. | Show the setup form to the user. | async def _show_setup_form(self, user_input=None, errors=None):
"""Show the setup form to the user."""
if not user_input:
user_input = {}
if self.discovered_conf:
user_input.update(self.discovered_conf)
step_id = "link"
data_schema = _discovery_sc... | [
"async",
"def",
"_show_setup_form",
"(",
"self",
",",
"user_input",
"=",
"None",
",",
"errors",
"=",
"None",
")",
":",
"if",
"not",
"user_input",
":",
"user_input",
"=",
"{",
"}",
"if",
"self",
".",
"discovered_conf",
":",
"user_input",
".",
"update",
"(... | [
93,
4
] | [
111,
9
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_step_user | (self, user_input=None) | Handle a flow initiated by the user. | Handle a flow initiated by the user. | async def async_step_user(self, user_input=None):
"""Handle a flow initiated by the user."""
errors = {}
if user_input is None:
return await self._show_setup_form(user_input, None)
if self.discovered_conf:
user_input.update(self.discovered_conf)
host = ... | [
"async",
"def",
"async_step_user",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"errors",
"=",
"{",
"}",
"if",
"user_input",
"is",
"None",
":",
"return",
"await",
"self",
".",
"_show_setup_form",
"(",
"user_input",
",",
"None",
")",
"if",
"self... | [
113,
4
] | [
188,
68
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_step_ssdp | (self, discovery_info) | Handle a discovered synology_dsm. | Handle a discovered synology_dsm. | async def async_step_ssdp(self, discovery_info):
"""Handle a discovered synology_dsm."""
parsed_url = urlparse(discovery_info[ssdp.ATTR_SSDP_LOCATION])
friendly_name = (
discovery_info[ssdp.ATTR_UPNP_FRIENDLY_NAME].split("(", 1)[0].strip()
)
mac = discovery_info[ssdp... | [
"async",
"def",
"async_step_ssdp",
"(",
"self",
",",
"discovery_info",
")",
":",
"parsed_url",
"=",
"urlparse",
"(",
"discovery_info",
"[",
"ssdp",
".",
"ATTR_SSDP_LOCATION",
"]",
")",
"friendly_name",
"=",
"(",
"discovery_info",
"[",
"ssdp",
".",
"ATTR_UPNP_FRI... | [
190,
4
] | [
212,
43
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_step_import | (self, user_input=None) | Import a config entry. | Import a config entry. | async def async_step_import(self, user_input=None):
"""Import a config entry."""
return await self.async_step_user(user_input) | [
"async",
"def",
"async_step_import",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"return",
"await",
"self",
".",
"async_step_user",
"(",
"user_input",
")"
] | [
214,
4
] | [
216,
53
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_step_link | (self, user_input) | Link a config entry from discovery. | Link a config entry from discovery. | async def async_step_link(self, user_input):
"""Link a config entry from discovery."""
return await self.async_step_user(user_input) | [
"async",
"def",
"async_step_link",
"(",
"self",
",",
"user_input",
")",
":",
"return",
"await",
"self",
".",
"async_step_user",
"(",
"user_input",
")"
] | [
218,
4
] | [
220,
53
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler.async_step_2sa | (self, user_input, errors=None) | Enter 2SA code to anthenticate. | Enter 2SA code to anthenticate. | async def async_step_2sa(self, user_input, errors=None):
"""Enter 2SA code to anthenticate."""
if not self.saved_user_input:
self.saved_user_input = user_input
if not user_input.get(CONF_OTP_CODE):
return self.async_show_form(
step_id="2sa",
... | [
"async",
"def",
"async_step_2sa",
"(",
"self",
",",
"user_input",
",",
"errors",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"saved_user_input",
":",
"self",
".",
"saved_user_input",
"=",
"user_input",
"if",
"not",
"user_input",
".",
"get",
"(",
"CONF... | [
222,
4
] | [
237,
53
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMFlowHandler._mac_already_configured | (self, mac) | See if we already have configured a NAS with this MAC address. | See if we already have configured a NAS with this MAC address. | def _mac_already_configured(self, mac):
"""See if we already have configured a NAS with this MAC address."""
existing_macs = [
mac.replace("-", "")
for entry in self._async_current_entries()
for mac in entry.data.get(CONF_MAC, [])
]
return mac in exist... | [
"def",
"_mac_already_configured",
"(",
"self",
",",
"mac",
")",
":",
"existing_macs",
"=",
"[",
"mac",
".",
"replace",
"(",
"\"-\"",
",",
"\"\"",
")",
"for",
"entry",
"in",
"self",
".",
"_async_current_entries",
"(",
")",
"for",
"mac",
"in",
"entry",
"."... | [
239,
4
] | [
246,
35
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMOptionsFlowHandler.__init__ | (self, config_entry: config_entries.ConfigEntry) | Initialize options flow. | Initialize options flow. | def __init__(self, config_entry: config_entries.ConfigEntry):
"""Initialize options flow."""
self.config_entry = config_entry | [
"def",
"__init__",
"(",
"self",
",",
"config_entry",
":",
"config_entries",
".",
"ConfigEntry",
")",
":",
"self",
".",
"config_entry",
"=",
"config_entry"
] | [
252,
4
] | [
254,
40
] | python | en | ['en', 'en', 'en'] | True |
SynologyDSMOptionsFlowHandler.async_step_init | (self, user_input=None) | Handle options flow. | Handle options flow. | async def async_step_init(self, user_input=None):
"""Handle options flow."""
if user_input is not None:
return self.async_create_entry(title="", data=user_input)
data_schema = vol.Schema(
{
vol.Optional(
CONF_SCAN_INTERVAL,
... | [
"async",
"def",
"async_step_init",
"(",
"self",
",",
"user_input",
"=",
"None",
")",
":",
"if",
"user_input",
"is",
"not",
"None",
":",
"return",
"self",
".",
"async_create_entry",
"(",
"title",
"=",
"\"\"",
",",
"data",
"=",
"user_input",
")",
"data_schem... | [
256,
4
] | [
277,
76
] | python | en | ['en', 'nl', 'en'] | True |
_make_causal_mask | (input_ids_shape: tf.TensorShape, past_key_values_length: int = 0) |
Make causal mask used for bi-directional self-attention.
|
Make causal mask used for bi-directional self-attention.
| def _make_causal_mask(input_ids_shape: tf.TensorShape, past_key_values_length: int = 0):
"""
Make causal mask used for bi-directional self-attention.
"""
bsz, tgt_len = input_ids_shape
mask = tf.ones((tgt_len, tgt_len)) * LARGE_NEGATIVE
mask_cond = tf.range(shape_list(mask)[-1])
mask = tf.w... | [
"def",
"_make_causal_mask",
"(",
"input_ids_shape",
":",
"tf",
".",
"TensorShape",
",",
"past_key_values_length",
":",
"int",
"=",
"0",
")",
":",
"bsz",
",",
"tgt_len",
"=",
"input_ids_shape",
"mask",
"=",
"tf",
".",
"ones",
"(",
"(",
"tgt_len",
",",
"tgt_... | [
82,
0
] | [
95,
58
] | python | en | ['en', 'error', 'th'] | False |
_expand_mask | (mask: tf.Tensor, tgt_len: Optional[int] = None, past_key_values_length: int = 0) |
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
|
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
| def _expand_mask(mask: tf.Tensor, tgt_len: Optional[int] = None, past_key_values_length: int = 0):
"""
Expands attention_mask from `[bsz, seq_len]` to `[bsz, 1, tgt_seq_len, src_seq_len]`.
"""
src_len = shape_list(mask)[1]
tgt_len = tgt_len if tgt_len is not None else src_len
one_cst = tf.consta... | [
"def",
"_expand_mask",
"(",
"mask",
":",
"tf",
".",
"Tensor",
",",
"tgt_len",
":",
"Optional",
"[",
"int",
"]",
"=",
"None",
",",
"past_key_values_length",
":",
"int",
"=",
"0",
")",
":",
"src_len",
"=",
"shape_list",
"(",
"mask",
")",
"[",
"1",
"]",... | [
98,
0
] | [
108,
53
] | python | en | ['en', 'error', 'th'] | False |
TFBartLearnedPositionalEmbedding.call | (self, input_shape: tf.TensorShape, past_key_values_length: int = 0) | Input is expected to be of size [bsz x seqlen]. | Input is expected to be of size [bsz x seqlen]. | def call(self, input_shape: tf.TensorShape, past_key_values_length: int = 0):
"""Input is expected to be of size [bsz x seqlen]."""
bsz, seq_len = input_shape[:2]
positions = tf.range(past_key_values_length, seq_len + past_key_values_length, delta=1, name="range")
return super().call(po... | [
"def",
"call",
"(",
"self",
",",
"input_shape",
":",
"tf",
".",
"TensorShape",
",",
"past_key_values_length",
":",
"int",
"=",
"0",
")",
":",
"bsz",
",",
"seq_len",
"=",
"input_shape",
"[",
":",
"2",
"]",
"positions",
"=",
"tf",
".",
"range",
"(",
"p... | [
122,
4
] | [
127,
52
] | python | en | ['en', 'en', 'en'] | True |
TFBartAttention.call | (
self,
hidden_states: tf.Tensor,
key_value_states: Optional[tf.Tensor] = None,
past_key_value: Optional[Tuple[Tuple[tf.Tensor]]] = None,
attention_mask: Optional[tf.Tensor] = None,
layer_head_mask: Optional[tf.Tensor] = None,
training=False,
) | Input shape: Batch x Time x Channel | Input shape: Batch x Time x Channel | def call(
self,
hidden_states: tf.Tensor,
key_value_states: Optional[tf.Tensor] = None,
past_key_value: Optional[Tuple[Tuple[tf.Tensor]]] = None,
attention_mask: Optional[tf.Tensor] = None,
layer_head_mask: Optional[tf.Tensor] = None,
training=False,
) -> Tupl... | [
"def",
"call",
"(",
"self",
",",
"hidden_states",
":",
"tf",
".",
"Tensor",
",",
"key_value_states",
":",
"Optional",
"[",
"tf",
".",
"Tensor",
"]",
"=",
"None",
",",
"past_key_value",
":",
"Optional",
"[",
"Tuple",
"[",
"Tuple",
"[",
"tf",
".",
"Tenso... | [
160,
4
] | [
276,
56
] | python | en | ['en', 'pl', 'en'] | True |
TFBartEncoderLayer.call | (self, hidden_states: tf.Tensor, attention_mask: tf.Tensor, layer_head_mask: tf.Tensor, training=False) |
Args:
hidden_states (:obj:`tf.Tensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
attention_mask (:obj:`tf.Tensor`): attention mask of size
`(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
laye... |
Args:
hidden_states (:obj:`tf.Tensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
attention_mask (:obj:`tf.Tensor`): attention mask of size
`(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
laye... | def call(self, hidden_states: tf.Tensor, attention_mask: tf.Tensor, layer_head_mask: tf.Tensor, training=False):
"""
Args:
hidden_states (:obj:`tf.Tensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
attention_mask (:obj:`tf.Tensor`): attention mask of size
... | [
"def",
"call",
"(",
"self",
",",
"hidden_states",
":",
"tf",
".",
"Tensor",
",",
"attention_mask",
":",
"tf",
".",
"Tensor",
",",
"layer_head_mask",
":",
"tf",
".",
"Tensor",
",",
"training",
"=",
"False",
")",
":",
"residual",
"=",
"hidden_states",
"hid... | [
294,
4
] | [
329,
47
] | python | en | ['en', 'error', 'th'] | False |
TFBartDecoderLayer.call | (
self,
hidden_states,
attention_mask: Optional[tf.Tensor] = None,
encoder_hidden_states: Optional[tf.Tensor] = None,
encoder_attention_mask: Optional[tf.Tensor] = None,
layer_head_mask: Optional[tf.Tensor] = None,
encoder_layer_head_mask: Optional[tf.Tensor] = No... |
Args:
hidden_states (:obj:`tf.Tensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
attention_mask (:obj:`tf.Tensor`): attention mask of size
`(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
enco... |
Args:
hidden_states (:obj:`tf.Tensor`): input to the layer of shape `(seq_len, batch, embed_dim)`
attention_mask (:obj:`tf.Tensor`): attention mask of size
`(batch, 1, tgt_len, src_len)` where padding elements are indicated by very large negative values.
enco... | def call(
self,
hidden_states,
attention_mask: Optional[tf.Tensor] = None,
encoder_hidden_states: Optional[tf.Tensor] = None,
encoder_attention_mask: Optional[tf.Tensor] = None,
layer_head_mask: Optional[tf.Tensor] = None,
encoder_layer_head_mask: Optional[tf.Tens... | [
"def",
"call",
"(",
"self",
",",
"hidden_states",
",",
"attention_mask",
":",
"Optional",
"[",
"tf",
".",
"Tensor",
"]",
"=",
"None",
",",
"encoder_hidden_states",
":",
"Optional",
"[",
"tf",
".",
"Tensor",
"]",
"=",
"None",
",",
"encoder_attention_mask",
... | [
360,
4
] | [
435,
9
] | python | en | ['en', 'error', 'th'] | False |
test_entity_registry | (hass, requests_mock) | Tests that the devices are registered in the entity registry. | Tests that the devices are registered in the entity registry. | async def test_entity_registry(hass, requests_mock):
"""Tests that the devices are registered in the entity registry."""
await setup_platform(hass, LIGHT_DOMAIN)
entity_registry = await hass.helpers.entity_registry.async_get_registry()
entry = entity_registry.async_get("light.front_light")
assert e... | [
"async",
"def",
"test_entity_registry",
"(",
"hass",
",",
"requests_mock",
")",
":",
"await",
"setup_platform",
"(",
"hass",
",",
"LIGHT_DOMAIN",
")",
"entity_registry",
"=",
"await",
"hass",
".",
"helpers",
".",
"entity_registry",
".",
"async_get_registry",
"(",
... | [
8,
0
] | [
17,
36
] | python | en | ['en', 'en', 'en'] | True |
test_light_off_reports_correctly | (hass, requests_mock) | Tests that the initial state of a device that should be off is correct. | Tests that the initial state of a device that should be off is correct. | async def test_light_off_reports_correctly(hass, requests_mock):
"""Tests that the initial state of a device that should be off is correct."""
await setup_platform(hass, LIGHT_DOMAIN)
state = hass.states.get("light.front_light")
assert state.state == "off"
assert state.attributes.get("friendly_name... | [
"async",
"def",
"test_light_off_reports_correctly",
"(",
"hass",
",",
"requests_mock",
")",
":",
"await",
"setup_platform",
"(",
"hass",
",",
"LIGHT_DOMAIN",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"\"light.front_light\"",
")",
"assert",
"stat... | [
20,
0
] | [
26,
65
] | python | en | ['en', 'en', 'en'] | True |
test_light_on_reports_correctly | (hass, requests_mock) | Tests that the initial state of a device that should be on is correct. | Tests that the initial state of a device that should be on is correct. | async def test_light_on_reports_correctly(hass, requests_mock):
"""Tests that the initial state of a device that should be on is correct."""
await setup_platform(hass, LIGHT_DOMAIN)
state = hass.states.get("light.internal_light")
assert state.state == "on"
assert state.attributes.get("friendly_name... | [
"async",
"def",
"test_light_on_reports_correctly",
"(",
"hass",
",",
"requests_mock",
")",
":",
"await",
"setup_platform",
"(",
"hass",
",",
"LIGHT_DOMAIN",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"\"light.internal_light\"",
")",
"assert",
"st... | [
29,
0
] | [
35,
68
] | python | en | ['en', 'en', 'en'] | True |
test_light_can_be_turned_on | (hass, requests_mock) | Tests the light turns on correctly. | Tests the light turns on correctly. | async def test_light_can_be_turned_on(hass, requests_mock):
"""Tests the light turns on correctly."""
await setup_platform(hass, LIGHT_DOMAIN)
# Mocks the response for turning a light on
requests_mock.put(
"https://api.ring.com/clients_api/doorbots/765432/floodlight_light_on",
text=load... | [
"async",
"def",
"test_light_can_be_turned_on",
"(",
"hass",
",",
"requests_mock",
")",
":",
"await",
"setup_platform",
"(",
"hass",
",",
"LIGHT_DOMAIN",
")",
"# Mocks the response for turning a light on",
"requests_mock",
".",
"put",
"(",
"\"https://api.ring.com/clients_api... | [
38,
0
] | [
57,
30
] | python | en | ['en', 'en', 'en'] | True |
test_updates_work | (hass, requests_mock) | Tests the update service works correctly. | Tests the update service works correctly. | async def test_updates_work(hass, requests_mock):
"""Tests the update service works correctly."""
await setup_platform(hass, LIGHT_DOMAIN)
state = hass.states.get("light.front_light")
assert state.state == "off"
# Changes the return to indicate that the light is now on.
requests_mock.get(
... | [
"async",
"def",
"test_updates_work",
"(",
"hass",
",",
"requests_mock",
")",
":",
"await",
"setup_platform",
"(",
"hass",
",",
"LIGHT_DOMAIN",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"\"light.front_light\"",
")",
"assert",
"state",
".",
"s... | [
60,
0
] | [
76,
30
] | python | en | ['en', 'en', 'en'] | True |
async_setup | (hass: HomeAssistant, config: Config) | Set up configured Met. | Set up configured Met. | async def async_setup(hass: HomeAssistant, config: Config) -> bool:
"""Set up configured Met."""
hass.data.setdefault(DOMAIN, {})
return True | [
"async",
"def",
"async_setup",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"Config",
")",
"->",
"bool",
":",
"hass",
".",
"data",
".",
"setdefault",
"(",
"DOMAIN",
",",
"{",
"}",
")",
"return",
"True"
] | [
30,
0
] | [
33,
15
] | python | en | ['en', 'nl', 'en'] | True |
async_setup_entry | (hass, config_entry) | Set up Met as config entry. | Set up Met as config entry. | async def async_setup_entry(hass, config_entry):
"""Set up Met as config entry."""
coordinator = MetDataUpdateCoordinator(hass, config_entry)
await coordinator.async_refresh()
if not coordinator.last_update_success:
raise ConfigEntryNotReady
if config_entry.data.get(CONF_TRACK_HOME, False)... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
")",
":",
"coordinator",
"=",
"MetDataUpdateCoordinator",
"(",
"hass",
",",
"config_entry",
")",
"await",
"coordinator",
".",
"async_refresh",
"(",
")",
"if",
"not",
"coordinator",
".",
"last... | [
36,
0
] | [
53,
15
] | python | en | ['en', 'en', 'en'] | True |
async_unload_entry | (hass, config_entry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass, config_entry):
"""Unload a config entry."""
await hass.config_entries.async_forward_entry_unload(config_entry, "weather")
hass.data[DOMAIN][config_entry.entry_id].untrack_home()
hass.data[DOMAIN].pop(config_entry.entry_id)
return True | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
",",
"config_entry",
")",
":",
"await",
"hass",
".",
"config_entries",
".",
"async_forward_entry_unload",
"(",
"config_entry",
",",
"\"weather\"",
")",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"config_entry... | [
56,
0
] | [
62,
15
] | python | en | ['en', 'es', 'en'] | True |
MetDataUpdateCoordinator.__init__ | (self, hass, config_entry) | Initialize global Met data updater. | Initialize global Met data updater. | def __init__(self, hass, config_entry):
"""Initialize global Met data updater."""
self._unsub_track_home = None
self.weather = MetWeatherData(
hass, config_entry.data, hass.config.units.is_metric
)
self.weather.init_data()
update_interval = timedelta(minutes=... | [
"def",
"__init__",
"(",
"self",
",",
"hass",
",",
"config_entry",
")",
":",
"self",
".",
"_unsub_track_home",
"=",
"None",
"self",
".",
"weather",
"=",
"MetWeatherData",
"(",
"hass",
",",
"config_entry",
".",
"data",
",",
"hass",
".",
"config",
".",
"uni... | [
68,
4
] | [
78,
85
] | python | nl | ['fr', 'nl', 'nl'] | True |
MetDataUpdateCoordinator._async_update_data | (self) | Fetch data from Met. | Fetch data from Met. | async def _async_update_data(self):
"""Fetch data from Met."""
try:
return await self.weather.fetch_data()
except Exception as err:
raise UpdateFailed(f"Update failed: {err}") from err | [
"async",
"def",
"_async_update_data",
"(",
"self",
")",
":",
"try",
":",
"return",
"await",
"self",
".",
"weather",
".",
"fetch_data",
"(",
")",
"except",
"Exception",
"as",
"err",
":",
"raise",
"UpdateFailed",
"(",
"f\"Update failed: {err}\"",
")",
"from",
... | [
80,
4
] | [
85,
64
] | python | en | ['en', 'en', 'en'] | True |
MetDataUpdateCoordinator.track_home | (self) | Start tracking changes to HA home setting. | Start tracking changes to HA home setting. | def track_home(self):
"""Start tracking changes to HA home setting."""
if self._unsub_track_home:
return
async def _async_update_weather_data(_event=None):
"""Update weather data."""
self.weather.init_data()
await self.async_refresh()
sel... | [
"def",
"track_home",
"(",
"self",
")",
":",
"if",
"self",
".",
"_unsub_track_home",
":",
"return",
"async",
"def",
"_async_update_weather_data",
"(",
"_event",
"=",
"None",
")",
":",
"\"\"\"Update weather data.\"\"\"",
"self",
".",
"weather",
".",
"init_data",
"... | [
87,
4
] | [
99,
9
] | python | en | ['en', 'en', 'en'] | True |
MetDataUpdateCoordinator.untrack_home | (self) | Stop tracking changes to HA home setting. | Stop tracking changes to HA home setting. | def untrack_home(self):
"""Stop tracking changes to HA home setting."""
if self._unsub_track_home:
self._unsub_track_home()
self._unsub_track_home = None | [
"def",
"untrack_home",
"(",
"self",
")",
":",
"if",
"self",
".",
"_unsub_track_home",
":",
"self",
".",
"_unsub_track_home",
"(",
")",
"self",
".",
"_unsub_track_home",
"=",
"None"
] | [
101,
4
] | [
105,
41
] | python | en | ['en', 'en', 'en'] | True |
MetWeatherData.__init__ | (self, hass, config, is_metric) | Initialise the weather entity data. | Initialise the weather entity data. | def __init__(self, hass, config, is_metric):
"""Initialise the weather entity data."""
self.hass = hass
self._config = config
self._is_metric = is_metric
self._weather_data = None
self.current_weather_data = {}
self.daily_forecast = None
self.hourly_foreca... | [
"def",
"__init__",
"(",
"self",
",",
"hass",
",",
"config",
",",
"is_metric",
")",
":",
"self",
".",
"hass",
"=",
"hass",
"self",
".",
"_config",
"=",
"config",
"self",
".",
"_is_metric",
"=",
"is_metric",
"self",
".",
"_weather_data",
"=",
"None",
"se... | [
111,
4
] | [
119,
35
] | python | en | ['en', 'zu', 'en'] | True |
MetWeatherData.init_data | (self) | Weather data inialization - get the coordinates. | Weather data inialization - get the coordinates. | def init_data(self):
"""Weather data inialization - get the coordinates."""
if self._config.get(CONF_TRACK_HOME, False):
latitude = self.hass.config.latitude
longitude = self.hass.config.longitude
elevation = self.hass.config.elevation
else:
latitu... | [
"def",
"init_data",
"(",
"self",
")",
":",
"if",
"self",
".",
"_config",
".",
"get",
"(",
"CONF_TRACK_HOME",
",",
"False",
")",
":",
"latitude",
"=",
"self",
".",
"hass",
".",
"config",
".",
"latitude",
"longitude",
"=",
"self",
".",
"hass",
".",
"co... | [
121,
4
] | [
145,
9
] | python | en | ['en', 'en', 'en'] | True |
MetWeatherData.fetch_data | (self) | Fetch data from API - (current weather and forecast). | Fetch data from API - (current weather and forecast). | async def fetch_data(self):
"""Fetch data from API - (current weather and forecast)."""
await self._weather_data.fetching_data()
self.current_weather_data = self._weather_data.get_current_weather()
time_zone = dt_util.DEFAULT_TIME_ZONE
self.daily_forecast = self._weather_data.get... | [
"async",
"def",
"fetch_data",
"(",
"self",
")",
":",
"await",
"self",
".",
"_weather_data",
".",
"fetching_data",
"(",
")",
"self",
".",
"current_weather_data",
"=",
"self",
".",
"_weather_data",
".",
"get_current_weather",
"(",
")",
"time_zone",
"=",
"dt_util... | [
147,
4
] | [
154,
19
] | python | en | ['en', 'en', 'en'] | True |
get_kodi_connection | (
host, port, ws_port, username, password, ssl=False, timeout=5, session=None
) | Get Kodi connection. | Get Kodi connection. | def get_kodi_connection(
host, port, ws_port, username, password, ssl=False, timeout=5, session=None
):
"""Get Kodi connection."""
if ws_port is None:
return MockConnection()
else:
return MockWSConnection() | [
"def",
"get_kodi_connection",
"(",
"host",
",",
"port",
",",
"ws_port",
",",
"username",
",",
"password",
",",
"ssl",
"=",
"False",
",",
"timeout",
"=",
"5",
",",
"session",
"=",
"None",
")",
":",
"if",
"ws_port",
"is",
"None",
":",
"return",
"MockConn... | [
38,
0
] | [
45,
33
] | python | en | ['it', 'en', 'en'] | True |
MockConnection.__init__ | (self, connected=True) | Mock the Kodi connection. | Mock the Kodi connection. | def __init__(self, connected=True):
"""Mock the Kodi connection."""
self._connected = connected | [
"def",
"__init__",
"(",
"self",
",",
"connected",
"=",
"True",
")",
":",
"self",
".",
"_connected",
"=",
"connected"
] | [
51,
4
] | [
53,
35
] | python | en | ['en', 'xh', 'en'] | True |
MockConnection.connect | (self) | Mock connect. | Mock connect. | async def connect(self):
"""Mock connect."""
pass | [
"async",
"def",
"connect",
"(",
"self",
")",
":",
"pass"
] | [
55,
4
] | [
57,
12
] | python | en | ['en', 'en', 'en'] | False |
MockConnection.connected | (self) | Mock connected. | Mock connected. | def connected(self):
"""Mock connected."""
return self._connected | [
"def",
"connected",
"(",
"self",
")",
":",
"return",
"self",
".",
"_connected"
] | [
60,
4
] | [
62,
30
] | python | en | ['en', 'en', 'en'] | False |
MockConnection.can_subscribe | (self) | Mock can_subscribe. | Mock can_subscribe. | def can_subscribe(self):
"""Mock can_subscribe."""
return False | [
"def",
"can_subscribe",
"(",
"self",
")",
":",
"return",
"False"
] | [
65,
4
] | [
67,
20
] | python | en | ['en', 'en', 'en'] | False |
MockConnection.close | (self) | Mock close. | Mock close. | async def close(self):
"""Mock close."""
pass | [
"async",
"def",
"close",
"(",
"self",
")",
":",
"pass"
] | [
69,
4
] | [
71,
12
] | python | en | ['en', 'ca', 'en'] | False |
MockConnection.server | (self) | Mock server. | Mock server. | def server(self):
"""Mock server."""
return None | [
"def",
"server",
"(",
"self",
")",
":",
"return",
"None"
] | [
74,
4
] | [
76,
19
] | python | en | ['en', 'da', 'en'] | False |
MockWSConnection.__init__ | (self, connected=True) | Mock the websocket connection. | Mock the websocket connection. | def __init__(self, connected=True):
"""Mock the websocket connection."""
self._connected = connected | [
"def",
"__init__",
"(",
"self",
",",
"connected",
"=",
"True",
")",
":",
"self",
".",
"_connected",
"=",
"connected"
] | [
82,
4
] | [
84,
35
] | python | en | ['en', 'da', 'en'] | True |
MockWSConnection.connect | (self) | Mock connect. | Mock connect. | async def connect(self):
"""Mock connect."""
pass | [
"async",
"def",
"connect",
"(",
"self",
")",
":",
"pass"
] | [
86,
4
] | [
88,
12
] | python | en | ['en', 'en', 'en'] | False |
MockWSConnection.connected | (self) | Mock connected. | Mock connected. | def connected(self):
"""Mock connected."""
return self._connected | [
"def",
"connected",
"(",
"self",
")",
":",
"return",
"self",
".",
"_connected"
] | [
91,
4
] | [
93,
30
] | python | en | ['en', 'en', 'en'] | False |
MockWSConnection.can_subscribe | (self) | Mock can_subscribe. | Mock can_subscribe. | def can_subscribe(self):
"""Mock can_subscribe."""
return False | [
"def",
"can_subscribe",
"(",
"self",
")",
":",
"return",
"False"
] | [
96,
4
] | [
98,
20
] | python | en | ['en', 'en', 'en'] | False |
MockWSConnection.close | (self) | Mock close. | Mock close. | async def close(self):
"""Mock close."""
pass | [
"async",
"def",
"close",
"(",
"self",
")",
":",
"pass"
] | [
100,
4
] | [
102,
12
] | python | en | ['en', 'ca', 'en'] | False |
MockWSConnection.server | (self) | Mock server. | Mock server. | def server(self):
"""Mock server."""
return None | [
"def",
"server",
"(",
"self",
")",
":",
"return",
"None"
] | [
105,
4
] | [
107,
19
] | python | en | ['en', 'da', 'en'] | False |
G_BFS.update_search_space | (self, search_space) | Update the self.bounds and self.types by the search_space.json file.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
| Update the self.bounds and self.types by the search_space.json file. | def update_search_space(self, search_space):
"""Update the self.bounds and self.types by the search_space.json file.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
"""
if not isinstance(search_space, dict):
self.logger.info("The format of search space is not a... | [
"def",
"update_search_space",
"(",
"self",
",",
"search_space",
")",
":",
"if",
"not",
"isinstance",
"(",
"search_space",
",",
"dict",
")",
":",
"self",
".",
"logger",
".",
"info",
"(",
"\"The format of search space is not a dict.\"",
")",
"raise",
"RuntimeError",... | [
203,
4
] | [
216,
56
] | python | en | ['en', 'en', 'en'] | True |
G_BFS.generate_multiple_parameters | (self, parameter_id_list, **kwargs) | Returns multiple sets of trial (hyper-)parameters,
as iterable of serializable objects.
| Returns multiple sets of trial (hyper-)parameters,
as iterable of serializable objects.
| def generate_multiple_parameters(self, parameter_id_list, **kwargs):
"""Returns multiple sets of trial (hyper-)parameters,
as iterable of serializable objects.
"""
result = []
self.send_trial_callback = kwargs['st_callback']
for parameter_id in parameter_id_list:
... | [
"def",
"generate_multiple_parameters",
"(",
"self",
",",
"parameter_id_list",
",",
"*",
"*",
"kwargs",
")",
":",
"result",
"=",
"[",
"]",
"self",
".",
"send_trial_callback",
"=",
"kwargs",
"[",
"'st_callback'",
"]",
"for",
"parameter_id",
"in",
"parameter_id_lis... | [
218,
4
] | [
233,
21
] | python | en | ['en', 'af', 'en'] | True |
G_BFS.generate_parameters | (self, parameter_id, **kwargs) | Method which provides one set of hyper-parameters.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
| Method which provides one set of hyper-parameters. | def generate_parameters(self, parameter_id, **kwargs):
"""Method which provides one set of hyper-parameters.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
"""
if self.serve_list:
self.wait_dict[parameter_id] = self.serve_list.pop()
return self.wai... | [
"def",
"generate_parameters",
"(",
"self",
",",
"parameter_id",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"serve_list",
":",
"self",
".",
"wait_dict",
"[",
"parameter_id",
"]",
"=",
"self",
".",
"serve_list",
".",
"pop",
"(",
")",
"return",
... | [
235,
4
] | [
245,
65
] | python | en | ['en', 'en', 'en'] | True |
G_BFS.receive_trial_result | (self, parameter_id, parameters, value, **kwargs) | Method invoked when a trial reports its final result.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
| Method invoked when a trial reports its final result. | def receive_trial_result(self, parameter_id, parameters, value, **kwargs):
"""Method invoked when a trial reports its final result.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
"""
if isinstance(value, dict):
value = value['default']
self.population... | [
"def",
"receive_trial_result",
"(",
"self",
",",
"parameter_id",
",",
"parameters",
",",
"value",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"value",
"=",
"value",
"[",
"'default'",
"]",
"self",
".",
"po... | [
247,
4
] | [
268,
36
] | python | en | ['en', 'en', 'en'] | True |
G_BFS.trial_end | (self, parameter_id, success, **kwargs) | Method invoked when a trial is completed or terminated.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
| Method invoked when a trial is completed or terminated. | def trial_end(self, parameter_id, success, **kwargs):
"""Method invoked when a trial is completed or terminated.
Override of the abstract method in :class:`~nni.tuner.Tuner`.
"""
if not success:
self.population.append(self.wait_dict[parameter_id], 0.0)
del self.w... | [
"def",
"trial_end",
"(",
"self",
",",
"parameter_id",
",",
"success",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"success",
":",
"self",
".",
"population",
".",
"append",
"(",
"self",
".",
"wait_dict",
"[",
"parameter_id",
"]",
",",
"0.0",
")",
... | [
270,
4
] | [
277,
44
] | python | en | ['en', 'en', 'en'] | True |
test_wrong_config | (hass, config_to_try) | Test setup with wrong configuration. | Test setup with wrong configuration. | async def test_wrong_config(hass, config_to_try):
"""Test setup with wrong configuration."""
assert not await async_setup_component(
hass, "panel_iframe", {"panel_iframe": config_to_try}
) | [
"async",
"def",
"test_wrong_config",
"(",
"hass",
",",
"config_to_try",
")",
":",
"assert",
"not",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"panel_iframe\"",
",",
"{",
"\"panel_iframe\"",
":",
"config_to_try",
"}",
")"
] | [
14,
0
] | [
18,
5
] | python | en | ['en', 'en', 'en'] | True |
test_correct_config | (hass) | Test correct config. | Test correct config. | async def test_correct_config(hass):
"""Test correct config."""
assert await async_setup_component(
hass,
"panel_iframe",
{
"panel_iframe": {
"router": {
"icon": "mdi:network-wireless",
"title": "Router",
... | [
"async",
"def",
"test_correct_config",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"panel_iframe\"",
",",
"{",
"\"panel_iframe\"",
":",
"{",
"\"router\"",
":",
"{",
"\"icon\"",
":",
"\"mdi:network-wireless\"",
",",
"\"tit... | [
21,
0
] | [
86,
5
] | python | en | ['en', 'gl', 'en'] | True |
async_setup | (hass, config) | Set up the MQTT eventstream component. | Set up the MQTT eventstream component. | async def async_setup(hass, config):
"""Set up the MQTT eventstream component."""
mqtt = hass.components.mqtt
conf = config.get(DOMAIN, {})
pub_topic = conf.get(CONF_PUBLISH_TOPIC)
sub_topic = conf.get(CONF_SUBSCRIBE_TOPIC)
ignore_event = conf.get(CONF_IGNORE_EVENT)
@callback
def _event... | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"config",
")",
":",
"mqtt",
"=",
"hass",
".",
"components",
".",
"mqtt",
"conf",
"=",
"config",
".",
"get",
"(",
"DOMAIN",
",",
"{",
"}",
")",
"pub_topic",
"=",
"conf",
".",
"get",
"(",
"CONF_PUBLISH_T... | [
40,
0
] | [
105,
15
] | python | en | ['en', 'lb', 'en'] | True |
_async_reproduce_state | (
hass: HomeAssistantType,
state: State,
*,
context: Optional[Context] = None,
reproduce_options: Optional[Dict[str, Any]] = None,
) | Reproduce a single state. | Reproduce a single state. | async def _async_reproduce_state(
hass: HomeAssistantType,
state: State,
*,
context: Optional[Context] = None,
reproduce_options: Optional[Dict[str, Any]] = None,
) -> None:
"""Reproduce a single state."""
cur_state = hass.states.get(state.entity_id)
if cur_state is None:
_LOGGE... | [
"async",
"def",
"_async_reproduce_state",
"(",
"hass",
":",
"HomeAssistantType",
",",
"state",
":",
"State",
",",
"*",
",",
"context",
":",
"Optional",
"[",
"Context",
"]",
"=",
"None",
",",
"reproduce_options",
":",
"Optional",
"[",
"Dict",
"[",
"str",
",... | [
16,
0
] | [
51,
85
] | python | en | ['en', 'en', 'en'] | True |
async_reproduce_states | (
hass: HomeAssistantType,
states: Iterable[State],
*,
context: Optional[Context] = None,
reproduce_options: Optional[Dict[str, Any]] = None,
) | Reproduce Input number states. | Reproduce Input number states. | async def async_reproduce_states(
hass: HomeAssistantType,
states: Iterable[State],
*,
context: Optional[Context] = None,
reproduce_options: Optional[Dict[str, Any]] = None,
) -> None:
"""Reproduce Input number states."""
# Reproduce states in parallel.
await asyncio.gather(
*(
... | [
"async",
"def",
"async_reproduce_states",
"(",
"hass",
":",
"HomeAssistantType",
",",
"states",
":",
"Iterable",
"[",
"State",
"]",
",",
"*",
",",
"context",
":",
"Optional",
"[",
"Context",
"]",
"=",
"None",
",",
"reproduce_options",
":",
"Optional",
"[",
... | [
54,
0
] | [
70,
5
] | python | en | ['en', 'en', 'en'] | True |
valid_integration | (integration) | Test if it's a valid integration. | Test if it's a valid integration. | def valid_integration(integration):
"""Test if it's a valid integration."""
if not (COMPONENT_DIR / integration).exists():
raise argparse.ArgumentTypeError(
f"The integration {integration} does not exist."
)
return integration | [
"def",
"valid_integration",
"(",
"integration",
")",
":",
"if",
"not",
"(",
"COMPONENT_DIR",
"/",
"integration",
")",
".",
"exists",
"(",
")",
":",
"raise",
"argparse",
".",
"ArgumentTypeError",
"(",
"f\"The integration {integration} does not exist.\"",
")",
"return... | [
14,
0
] | [
21,
22
] | python | en | ['en', 'en', 'en'] | True |
get_arguments | () | Get parsed passed in arguments. | Get parsed passed in arguments. | def get_arguments() -> argparse.Namespace:
"""Get parsed passed in arguments."""
parser = argparse.ArgumentParser(description="Home Assistant Scaffolder")
parser.add_argument("template", type=str, choices=TEMPLATES)
parser.add_argument(
"--develop", action="store_true", help="Automatically fill ... | [
"def",
"get_arguments",
"(",
")",
"->",
"argparse",
".",
"Namespace",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
"description",
"=",
"\"Home Assistant Scaffolder\"",
")",
"parser",
".",
"add_argument",
"(",
"\"template\"",
",",
"type",
"=",
"str... | [
24,
0
] | [
37,
20
] | python | en | ['en', 'la', 'en'] | True |
main | () | Scaffold an integration. | Scaffold an integration. | def main():
"""Scaffold an integration."""
if not Path("requirements_all.txt").is_file():
print("Run from project root")
return 1
args = get_arguments()
info = gather_info.gather_info(args)
print()
# If we are calling scaffold on a non-existing integration,
# We're going t... | [
"def",
"main",
"(",
")",
":",
"if",
"not",
"Path",
"(",
"\"requirements_all.txt\"",
")",
".",
"is_file",
"(",
")",
":",
"print",
"(",
"\"Run from project root\"",
")",
"return",
"1",
"args",
"=",
"get_arguments",
"(",
")",
"info",
"=",
"gather_info",
".",
... | [
40,
0
] | [
106,
12
] | python | en | ['en', 'lb', 'en'] | True |
test_setup | (hass, legacy_patchable_time) | Test the general setup of the integration. | Test the general setup of the integration. | async def test_setup(hass, legacy_patchable_time):
"""Test the general setup of the integration."""
# Set up some mock feed entries for this test.
mock_entry_1 = _generate_mock_feed_entry(
"1234",
"Title 1",
15.5,
(38.0, -3.0),
locality="Locality 1",
attributi... | [
"async",
"def",
"test_setup",
"(",
"hass",
",",
"legacy_patchable_time",
")",
":",
"# Set up some mock feed entries for this test.",
"mock_entry_1",
"=",
"_generate_mock_feed_entry",
"(",
"\"1234\"",
",",
"\"Title 1\"",
",",
"15.5",
",",
"(",
"38.0",
",",
"-",
"3.0",
... | [
29,
0
] | [
114,
44
] | python | en | ['en', 'en', 'en'] | True |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the Verisure binary sensors. | Set up the Verisure binary sensors. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the Verisure binary sensors."""
sensors = []
hub.update_overview()
if int(hub.config.get(CONF_DOOR_WINDOW, 1)):
sensors.extend(
[
VerisureDoorWindowSensor(device_label)
for... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"sensors",
"=",
"[",
"]",
"hub",
".",
"update_overview",
"(",
")",
"if",
"int",
"(",
"hub",
".",
"config",
".",
"get",
"(",
"CONF_DO... | [
9,
0
] | [
25,
25
] | python | en | ['en', 'bs', 'en'] | True |
VerisureDoorWindowSensor.__init__ | (self, device_label) | Initialize the Verisure door window sensor. | Initialize the Verisure door window sensor. | def __init__(self, device_label):
"""Initialize the Verisure door window sensor."""
self._device_label = device_label | [
"def",
"__init__",
"(",
"self",
",",
"device_label",
")",
":",
"self",
".",
"_device_label",
"=",
"device_label"
] | [
31,
4
] | [
33,
41
] | python | en | ['en', 'nl', 'en'] | True |
VerisureDoorWindowSensor.name | (self) | Return the name of the binary sensor. | Return the name of the binary sensor. | def name(self):
"""Return the name of the binary sensor."""
return hub.get_first(
"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].area",
self._device_label,
) | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"hub",
".",
"get_first",
"(",
"\"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].area\"",
",",
"self",
".",
"_device_label",
",",
")"
] | [
36,
4
] | [
41,
9
] | python | en | ['en', 'mi', 'en'] | True |
VerisureDoorWindowSensor.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 (
hub.get_first(
"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].state",
self._device_label,
)
== "OPEN"
) | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"(",
"hub",
".",
"get_first",
"(",
"\"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')].state\"",
",",
"self",
".",
"_device_label",
",",
")",
"==",
"\"OPEN\"",
")"
] | [
44,
4
] | [
52,
9
] | python | en | ['en', 'en', 'en'] | True |
VerisureDoorWindowSensor.available | (self) | Return True if entity is available. | Return True if entity is available. | def available(self):
"""Return True if entity is available."""
return (
hub.get_first(
"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')]",
self._device_label,
)
is not None
) | [
"def",
"available",
"(",
"self",
")",
":",
"return",
"(",
"hub",
".",
"get_first",
"(",
"\"$.doorWindow.doorWindowDevice[?(@.deviceLabel=='%s')]\"",
",",
"self",
".",
"_device_label",
",",
")",
"is",
"not",
"None",
")"
] | [
55,
4
] | [
63,
9
] | python | en | ['en', 'en', 'en'] | True |
VerisureDoorWindowSensor.update | (self) | Update the state of the sensor. | Update the state of the sensor. | def update(self):
"""Update the state of the sensor."""
hub.update_overview() | [
"def",
"update",
"(",
"self",
")",
":",
"hub",
".",
"update_overview",
"(",
")"
] | [
66,
4
] | [
68,
29
] | python | en | ['en', 'en', 'en'] | True |
VerisureEthernetStatus.name | (self) | Return the name of the binary sensor. | Return the name of the binary sensor. | def name(self):
"""Return the name of the binary sensor."""
return "Verisure Ethernet status" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"\"Verisure Ethernet status\""
] | [
75,
4
] | [
77,
41
] | python | en | ['en', 'mi', 'en'] | True |
VerisureEthernetStatus.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 hub.get_first("$.ethernetConnectedNow") | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"hub",
".",
"get_first",
"(",
"\"$.ethernetConnectedNow\"",
")"
] | [
80,
4
] | [
82,
54
] | python | en | ['en', 'en', 'en'] | True |
VerisureEthernetStatus.available | (self) | Return True if entity is available. | Return True if entity is available. | def available(self):
"""Return True if entity is available."""
return hub.get_first("$.ethernetConnectedNow") is not None | [
"def",
"available",
"(",
"self",
")",
":",
"return",
"hub",
".",
"get_first",
"(",
"\"$.ethernetConnectedNow\"",
")",
"is",
"not",
"None"
] | [
85,
4
] | [
87,
66
] | python | en | ['en', 'en', 'en'] | True |
VerisureEthernetStatus.update | (self) | Update the state of the sensor. | Update the state of the sensor. | def update(self):
"""Update the state of the sensor."""
hub.update_overview() | [
"def",
"update",
"(",
"self",
")",
":",
"hub",
".",
"update_overview",
"(",
")"
] | [
90,
4
] | [
92,
29
] | python | en | ['en', 'en', 'en'] | True |
VerisureEthernetStatus.device_class | (self) | Return the class of this device, from component DEVICE_CLASSES. | Return the class of this device, from component DEVICE_CLASSES. | def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
return DEVICE_CLASS_CONNECTIVITY | [
"def",
"device_class",
"(",
"self",
")",
":",
"return",
"DEVICE_CLASS_CONNECTIVITY"
] | [
95,
4
] | [
97,
40
] | python | en | ['en', 'en', 'en'] | True |
setup_component | (hass, config_entry) | Set up the component for testing. | Set up the component for testing. | async def setup_component(hass, config_entry):
"""Set up the component for testing."""
config_entry.add_to_hass(hass)
assert await async_setup_component(hass, DOMAIN, {})
await hass.async_block_till_done() | [
"async",
"def",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
":",
"config_entry",
".",
"add_to_hass",
"(",
"hass",
")",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
"{",
"}",
")",
"await",
"hass",
".",
"async_bloc... | [
13,
0
] | [
17,
38
] | python | en | ['en', 'en', 'en'] | True |
test_sign_in | (hass, config_entry, controller) | Test the sign-in service. | Test the sign-in service. | async def test_sign_in(hass, config_entry, controller):
"""Test the sign-in service."""
await setup_component(hass, config_entry)
await hass.services.async_call(
DOMAIN,
SERVICE_SIGN_IN,
{ATTR_USERNAME: "test@test.com", ATTR_PASSWORD: "password"},
blocking=True,
)
c... | [
"async",
"def",
"test_sign_in",
"(",
"hass",
",",
"config_entry",
",",
"controller",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SIGN_IN",
",",
... | [
20,
0
] | [
31,
75
] | python | en | ['en', 'en', 'en'] | True |
test_sign_in_not_connected | (hass, config_entry, controller, caplog) | Test sign-in service logs error when not connected. | Test sign-in service logs error when not connected. | async def test_sign_in_not_connected(hass, config_entry, controller, caplog):
"""Test sign-in service logs error when not connected."""
await setup_component(hass, config_entry)
controller.connection_state = const.STATE_RECONNECTING
await hass.services.async_call(
DOMAIN,
SERVICE_SIGN_I... | [
"async",
"def",
"test_sign_in_not_connected",
"(",
"hass",
",",
"config_entry",
",",
"controller",
",",
"caplog",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"controller",
".",
"connection_state",
"=",
"const",
".",
"STATE_RECONNEC... | [
34,
0
] | [
47,
75
] | python | en | ['en', 'en', 'en'] | True |
test_sign_in_failed | (hass, config_entry, controller, caplog) | Test sign-in service logs error when not connected. | Test sign-in service logs error when not connected. | async def test_sign_in_failed(hass, config_entry, controller, caplog):
"""Test sign-in service logs error when not connected."""
await setup_component(hass, config_entry)
controller.sign_in.side_effect = CommandFailedError("", "Invalid credentials", 6)
await hass.services.async_call(
DOMAIN,
... | [
"async",
"def",
"test_sign_in_failed",
"(",
"hass",
",",
"config_entry",
",",
"controller",
",",
"caplog",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"controller",
".",
"sign_in",
".",
"side_effect",
"=",
"CommandFailedError",
"... | [
50,
0
] | [
63,
67
] | python | en | ['en', 'en', 'en'] | True |
test_sign_in_unknown_error | (hass, config_entry, controller, caplog) | Test sign-in service logs error for failure. | Test sign-in service logs error for failure. | async def test_sign_in_unknown_error(hass, config_entry, controller, caplog):
"""Test sign-in service logs error for failure."""
await setup_component(hass, config_entry)
controller.sign_in.side_effect = HeosError()
await hass.services.async_call(
DOMAIN,
SERVICE_SIGN_IN,
{ATTR_... | [
"async",
"def",
"test_sign_in_unknown_error",
"(",
"hass",
",",
"config_entry",
",",
"controller",
",",
"caplog",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"controller",
".",
"sign_in",
".",
"side_effect",
"=",
"HeosError",
"("... | [
66,
0
] | [
79,
45
] | python | en | ['en', 'en', 'en'] | True |
test_sign_out | (hass, config_entry, controller) | Test the sign-out service. | Test the sign-out service. | async def test_sign_out(hass, config_entry, controller):
"""Test the sign-out service."""
await setup_component(hass, config_entry)
await hass.services.async_call(DOMAIN, SERVICE_SIGN_OUT, {}, blocking=True)
assert controller.sign_out.call_count == 1 | [
"async",
"def",
"test_sign_out",
"(",
"hass",
",",
"config_entry",
",",
"controller",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"await",
"hass",
".",
"services",
".",
"async_call",
"(",
"DOMAIN",
",",
"SERVICE_SIGN_OUT",
",",... | [
82,
0
] | [
88,
46
] | python | en | ['en', 'en', 'en'] | True |
test_sign_out_not_connected | (hass, config_entry, controller, caplog) | Test the sign-out service. | Test the sign-out service. | async def test_sign_out_not_connected(hass, config_entry, controller, caplog):
"""Test the sign-out service."""
await setup_component(hass, config_entry)
controller.connection_state = const.STATE_RECONNECTING
await hass.services.async_call(DOMAIN, SERVICE_SIGN_OUT, {}, blocking=True)
assert contro... | [
"async",
"def",
"test_sign_out_not_connected",
"(",
"hass",
",",
"config_entry",
",",
"controller",
",",
"caplog",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"controller",
".",
"connection_state",
"=",
"const",
".",
"STATE_RECONNE... | [
91,
0
] | [
99,
76
] | python | en | ['en', 'en', 'en'] | True |
test_sign_out_unknown_error | (hass, config_entry, controller, caplog) | Test the sign-out service. | Test the sign-out service. | async def test_sign_out_unknown_error(hass, config_entry, controller, caplog):
"""Test the sign-out service."""
await setup_component(hass, config_entry)
controller.sign_out.side_effect = HeosError()
await hass.services.async_call(DOMAIN, SERVICE_SIGN_OUT, {}, blocking=True)
assert controller.sign... | [
"async",
"def",
"test_sign_out_unknown_error",
"(",
"hass",
",",
"config_entry",
",",
"controller",
",",
"caplog",
")",
":",
"await",
"setup_component",
"(",
"hass",
",",
"config_entry",
")",
"controller",
".",
"sign_out",
".",
"side_effect",
"=",
"HeosError",
"... | [
102,
0
] | [
110,
46
] | python | en | ['en', 'en', 'en'] | True |
printc | (the_color, *args) | Color print helper. | Color print helper. | def printc(the_color, *args):
"""Color print helper."""
msg = " ".join(args)
if not escape_codes:
print(msg)
return
try:
print(escape_codes[the_color] + msg + escape_codes["reset"])
except KeyError:
print(msg)
raise ValueError(f"Invalid color {the_color}") | [
"def",
"printc",
"(",
"the_color",
",",
"*",
"args",
")",
":",
"msg",
"=",
"\" \"",
".",
"join",
"(",
"args",
")",
"if",
"not",
"escape_codes",
":",
"print",
"(",
"msg",
")",
"return",
"try",
":",
"print",
"(",
"escape_codes",
"[",
"the_color",
"]",
... | [
26,
0
] | [
36,
54
] | python | en | ['en', 'ca', 'en'] | True |
validate_requirements_ok | () | Validate requirements, returns True of ok. | Validate requirements, returns True of ok. | def validate_requirements_ok():
"""Validate requirements, returns True of ok."""
from gen_requirements_all import main as req_main
return req_main(True) == 0 | [
"def",
"validate_requirements_ok",
"(",
")",
":",
"from",
"gen_requirements_all",
"import",
"main",
"as",
"req_main",
"return",
"req_main",
"(",
"True",
")",
"==",
"0"
] | [
39,
0
] | [
43,
30
] | python | en | ['en', 'nl', 'en'] | True |
read_stream | (stream, display) | Read from stream line by line until EOF, display, and capture lines. | Read from stream line by line until EOF, display, and capture lines. | async def read_stream(stream, display):
"""Read from stream line by line until EOF, display, and capture lines."""
output = []
while True:
line = await stream.readline()
if not line:
break
output.append(line)
display(line.decode()) # assume it doesn't block
r... | [
"async",
"def",
"read_stream",
"(",
"stream",
",",
"display",
")",
":",
"output",
"=",
"[",
"]",
"while",
"True",
":",
"line",
"=",
"await",
"stream",
".",
"readline",
"(",
")",
"if",
"not",
"line",
":",
"break",
"output",
".",
"append",
"(",
"line",... | [
46,
0
] | [
55,
27
] | python | en | ['en', 'en', 'en'] | True |
async_exec | (*args, display=False) | Execute, return code & log. | Execute, return code & log. | async def async_exec(*args, display=False):
"""Execute, return code & log."""
argsp = []
for arg in args:
if os.path.isfile(arg):
argsp.append(f"\\\n {shlex.quote(arg)}")
else:
argsp.append(shlex.quote(arg))
printc("cyan", *argsp)
try:
kwargs = {
... | [
"async",
"def",
"async_exec",
"(",
"*",
"args",
",",
"display",
"=",
"False",
")",
":",
"argsp",
"=",
"[",
"]",
"for",
"arg",
"in",
"args",
":",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"arg",
")",
":",
"argsp",
".",
"append",
"(",
"f\"\\\\\\... | [
58,
0
] | [
91,
28
] | python | en | ['en', 'id', 'en'] | True |
pylint | (files) | Exec pylint. | Exec pylint. | async def pylint(files):
"""Exec pylint."""
_, log = await async_exec("pylint", "-f", "parseable", "--persistent=n", *files)
res = []
for line in log.splitlines():
line = line.split(":")
if len(line) < 3:
continue
_fn = line[0].replace("\\", "/")
res.append(Er... | [
"async",
"def",
"pylint",
"(",
"files",
")",
":",
"_",
",",
"log",
"=",
"await",
"async_exec",
"(",
"\"pylint\"",
",",
"\"-f\"",
",",
"\"parseable\"",
",",
"\"--persistent=n\"",
",",
"*",
"files",
")",
"res",
"=",
"[",
"]",
"for",
"line",
"in",
"log",
... | [
104,
0
] | [
114,
14
] | python | fr | ['fr', 'hu', 'sw'] | False |
flake8 | (files) | Exec flake8. | Exec flake8. | async def flake8(files):
"""Exec flake8."""
_, log = await async_exec("pre-commit", "run", "flake8", "--files", *files)
res = []
for line in log.splitlines():
line = line.split(":")
if len(line) < 4:
continue
_fn = line[0].replace("\\", "/")
res.append(Error(_... | [
"async",
"def",
"flake8",
"(",
"files",
")",
":",
"_",
",",
"log",
"=",
"await",
"async_exec",
"(",
"\"pre-commit\"",
",",
"\"run\"",
",",
"\"flake8\"",
",",
"\"--files\"",
",",
"*",
"files",
")",
"res",
"=",
"[",
"]",
"for",
"line",
"in",
"log",
"."... | [
117,
0
] | [
127,
14
] | python | el-Latn | ['fr', 'el-Latn', 'ru'] | False |
lint | (files) | Perform lint. | Perform lint. | async def lint(files):
"""Perform lint."""
files = [file for file in files if os.path.isfile(file)]
fres, pres = await asyncio.gather(flake8(files), pylint(files))
res = fres + pres
res.sort(key=lambda item: item.file)
if res:
print("Pylint & Flake8 errors:")
else:
printc(PA... | [
"async",
"def",
"lint",
"(",
"files",
")",
":",
"files",
"=",
"[",
"file",
"for",
"file",
"in",
"files",
"if",
"os",
".",
"path",
".",
"isfile",
"(",
"file",
")",
"]",
"fres",
",",
"pres",
"=",
"await",
"asyncio",
".",
"gather",
"(",
"flake8",
"(... | [
130,
0
] | [
153,
18
] | python | en | ['en', 'ca', 'en'] | False |
main | () | Run the main loop. | Run the main loop. | async def main():
"""Run the main loop."""
# Ensure we are in the homeassistant root
os.chdir(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
files = await git()
if not files:
print(
"No changed files found. Please ensure you have added your "
"changes ... | [
"async",
"def",
"main",
"(",
")",
":",
"# Ensure we are in the homeassistant root",
"os",
".",
"chdir",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"os",
".",
"path",
".",
"realpath",
"(",
"__file__",
")",
")",
... | [
156,
0
] | [
230,
37
] | python | en | ['en', 'ms', 'en'] | True |
TestFFmpegNoiseSetup.setup_method | (self) | Set up things to be run when tests are started. | Set up things to be run when tests are started. | def setup_method(self):
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
self.config = {
"binary_sensor": {"platform": "ffmpeg_noise", "input": "testinputvideo"}
} | [
"def",
"setup_method",
"(",
"self",
")",
":",
"self",
".",
"hass",
"=",
"get_test_home_assistant",
"(",
")",
"self",
".",
"config",
"=",
"{",
"\"binary_sensor\"",
":",
"{",
"\"platform\"",
":",
"\"ffmpeg_noise\"",
",",
"\"input\"",
":",
"\"testinputvideo\"",
"... | [
11,
4
] | [
17,
9
] | python | en | ['en', 'en', 'en'] | True |
TestFFmpegNoiseSetup.teardown_method | (self) | Stop everything that was started. | Stop everything that was started. | def teardown_method(self):
"""Stop everything that was started."""
self.hass.stop() | [
"def",
"teardown_method",
"(",
"self",
")",
":",
"self",
".",
"hass",
".",
"stop",
"(",
")"
] | [
19,
4
] | [
21,
24
] | python | en | ['en', 'en', 'en'] | True |
TestFFmpegNoiseSetup.test_setup_component | (self) | Set up ffmpeg component. | Set up ffmpeg component. | def test_setup_component(self):
"""Set up ffmpeg component."""
with assert_setup_component(1, "binary_sensor"):
setup_component(self.hass, "binary_sensor", self.config)
self.hass.block_till_done()
assert self.hass.data["ffmpeg"].binary == "ffmpeg"
assert self.hass.st... | [
"def",
"test_setup_component",
"(",
"self",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"binary_sensor\"",
")",
":",
"setup_component",
"(",
"self",
".",
"hass",
",",
"\"binary_sensor\"",
",",
"self",
".",
"config",
")",
"self",
".",
"hass",
... | [
23,
4
] | [
30,
77
] | python | en | ['en', 'da', 'en'] | True |
TestFFmpegNoiseSetup.test_setup_component_start | (self, mock_start) | Set up ffmpeg component. | Set up ffmpeg component. | def test_setup_component_start(self, mock_start):
"""Set up ffmpeg component."""
with assert_setup_component(1, "binary_sensor"):
setup_component(self.hass, "binary_sensor", self.config)
self.hass.block_till_done()
assert self.hass.data["ffmpeg"].binary == "ffmpeg"
a... | [
"def",
"test_setup_component_start",
"(",
"self",
",",
"mock_start",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"binary_sensor\"",
")",
":",
"setup_component",
"(",
"self",
".",
"hass",
",",
"\"binary_sensor\"",
",",
"self",
".",
"config",
")",... | [
33,
4
] | [
46,
44
] | python | en | ['en', 'da', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.