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_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up an InComfort/InTouch climate device. | Set up an InComfort/InTouch climate device. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up an InComfort/InTouch climate device."""
if discovery_info is None:
return
client = hass.data[DOMAIN]["client"]
heaters = hass.data[DOMAIN]["heaters"]
async_add_entities(
[InComfortClima... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"if",
"discovery_info",
"is",
"None",
":",
"return",
"client",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"... | [
15,
0
] | [
25,
5
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.__init__ | (self, client, heater, room) | Initialize the climate device. | Initialize the climate device. | def __init__(self, client, heater, room) -> None:
"""Initialize the climate device."""
super().__init__()
self._unique_id = f"{heater.serial_no}_{room.room_no}"
self.entity_id = f"{CLIMATE_DOMAIN}.{DOMAIN}_{room.room_no}"
self._name = f"Thermostat {room.room_no}"
self._... | [
"def",
"__init__",
"(",
"self",
",",
"client",
",",
"heater",
",",
"room",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
")",
"self",
".",
"_unique_id",
"=",
"f\"{heater.serial_no}_{room.room_no}\"",
"self",
".",
"entity_id",
"=",
"f\"{C... | [
31,
4
] | [
40,
25
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.extra_state_attributes | (self) | Return the device state attributes. | Return the device state attributes. | def extra_state_attributes(self) -> dict[str, Any]:
"""Return the device state attributes."""
return {"status": self._room.status} | [
"def",
"extra_state_attributes",
"(",
"self",
")",
"->",
"dict",
"[",
"str",
",",
"Any",
"]",
":",
"return",
"{",
"\"status\"",
":",
"self",
".",
"_room",
".",
"status",
"}"
] | [
43,
4
] | [
45,
44
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.temperature_unit | (self) | Return the unit of measurement. | Return the unit of measurement. | def temperature_unit(self) -> str:
"""Return the unit of measurement."""
return TEMP_CELSIUS | [
"def",
"temperature_unit",
"(",
"self",
")",
"->",
"str",
":",
"return",
"TEMP_CELSIUS"
] | [
48,
4
] | [
50,
27
] | python | en | ['en', 'la', 'en'] | True |
InComfortClimate.hvac_mode | (self) | Return hvac operation ie. heat, cool mode. | Return hvac operation ie. heat, cool mode. | def hvac_mode(self) -> str:
"""Return hvac operation ie. heat, cool mode."""
return HVAC_MODE_HEAT | [
"def",
"hvac_mode",
"(",
"self",
")",
"->",
"str",
":",
"return",
"HVAC_MODE_HEAT"
] | [
53,
4
] | [
55,
29
] | python | bg | ['en', 'bg', 'bg'] | True |
InComfortClimate.hvac_modes | (self) | Return the list of available hvac operation modes. | Return the list of available hvac operation modes. | def hvac_modes(self) -> list[str]:
"""Return the list of available hvac operation modes."""
return [HVAC_MODE_HEAT] | [
"def",
"hvac_modes",
"(",
"self",
")",
"->",
"list",
"[",
"str",
"]",
":",
"return",
"[",
"HVAC_MODE_HEAT",
"]"
] | [
58,
4
] | [
60,
31
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.current_temperature | (self) | Return the current temperature. | Return the current temperature. | def current_temperature(self) -> float | None:
"""Return the current temperature."""
return self._room.room_temp | [
"def",
"current_temperature",
"(",
"self",
")",
"->",
"float",
"|",
"None",
":",
"return",
"self",
".",
"_room",
".",
"room_temp"
] | [
63,
4
] | [
65,
35
] | python | en | ['en', 'la', 'en'] | True |
InComfortClimate.target_temperature | (self) | Return the temperature we try to reach. | Return the temperature we try to reach. | def target_temperature(self) -> float | None:
"""Return the temperature we try to reach."""
return self._room.setpoint | [
"def",
"target_temperature",
"(",
"self",
")",
"->",
"float",
"|",
"None",
":",
"return",
"self",
".",
"_room",
".",
"setpoint"
] | [
68,
4
] | [
70,
34
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.supported_features | (self) | Return the list of supported features. | Return the list of supported features. | def supported_features(self) -> int:
"""Return the list of supported features."""
return SUPPORT_TARGET_TEMPERATURE | [
"def",
"supported_features",
"(",
"self",
")",
"->",
"int",
":",
"return",
"SUPPORT_TARGET_TEMPERATURE"
] | [
73,
4
] | [
75,
41
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.min_temp | (self) | Return max valid temperature that can be set. | Return max valid temperature that can be set. | def min_temp(self) -> float:
"""Return max valid temperature that can be set."""
return 5.0 | [
"def",
"min_temp",
"(",
"self",
")",
"->",
"float",
":",
"return",
"5.0"
] | [
78,
4
] | [
80,
18
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.max_temp | (self) | Return max valid temperature that can be set. | Return max valid temperature that can be set. | def max_temp(self) -> float:
"""Return max valid temperature that can be set."""
return 30.0 | [
"def",
"max_temp",
"(",
"self",
")",
"->",
"float",
":",
"return",
"30.0"
] | [
83,
4
] | [
85,
19
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.async_set_temperature | (self, **kwargs) | Set a new target temperature for this zone. | Set a new target temperature for this zone. | async def async_set_temperature(self, **kwargs) -> None:
"""Set a new target temperature for this zone."""
temperature = kwargs.get(ATTR_TEMPERATURE)
await self._room.set_override(temperature) | [
"async",
"def",
"async_set_temperature",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"None",
":",
"temperature",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_TEMPERATURE",
")",
"await",
"self",
".",
"_room",
".",
"set_override",
"(",
"temperature",
")"
] | [
87,
4
] | [
90,
50
] | python | en | ['en', 'en', 'en'] | True |
InComfortClimate.async_set_hvac_mode | (self, hvac_mode: str) | Set new target hvac mode. | Set new target hvac mode. | async def async_set_hvac_mode(self, hvac_mode: str) -> None:
"""Set new target hvac mode.""" | [
"async",
"def",
"async_set_hvac_mode",
"(",
"self",
",",
"hvac_mode",
":",
"str",
")",
"->",
"None",
":"
] | [
92,
4
] | [
93,
39
] | python | da | ['da', 'su', 'en'] | False |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up the Philips TV platform. | Set up the Philips TV platform. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Philips TV platform."""
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": config_entries.SOURCE_IMPORT},
data=config,
)
... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"hass",
".",
"async_create_task",
"(",
"hass",
".",
"config_entries",
".",
"flow",
".",
"async_init",
"(",
"DOMAIN",
",... | [
93,
0
] | [
101,
5
] | python | en | ['en', 'da', 'en'] | True |
async_setup_entry | (
hass: HomeAssistant,
config_entry: config_entries.ConfigEntry,
async_add_entities,
) | Set up the configuration entry. | Set up the configuration entry. | async def async_setup_entry(
hass: HomeAssistant,
config_entry: config_entries.ConfigEntry,
async_add_entities,
):
"""Set up the configuration entry."""
coordinator = hass.data[DOMAIN][config_entry.entry_id]
async_add_entities(
[
PhilipsTVMediaPlayer(
coordina... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"config_entry",
":",
"config_entries",
".",
"ConfigEntry",
",",
"async_add_entities",
",",
")",
":",
"coordinator",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"config_entry",
... | [
104,
0
] | [
119,
5
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.__init__ | (
self,
coordinator: PhilipsTVDataUpdateCoordinator,
system: dict[str, Any],
unique_id: str,
) | Initialize the Philips TV. | Initialize the Philips TV. | def __init__(
self,
coordinator: PhilipsTVDataUpdateCoordinator,
system: dict[str, Any],
unique_id: str,
) -> None:
"""Initialize the Philips TV."""
self._tv = coordinator.api
self._coordinator = coordinator
self._sources = {}
self._channels = ... | [
"def",
"__init__",
"(",
"self",
",",
"coordinator",
":",
"PhilipsTVDataUpdateCoordinator",
",",
"system",
":",
"dict",
"[",
"str",
",",
"Any",
"]",
",",
"unique_id",
":",
"str",
",",
")",
"->",
"None",
":",
"self",
".",
"_tv",
"=",
"coordinator",
".",
... | [
127,
4
] | [
148,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer._async_update_soon | (self) | Reschedule update task. | Reschedule update task. | async def _async_update_soon(self):
"""Reschedule update task."""
self.async_write_ha_state()
await self.coordinator.async_request_refresh() | [
"async",
"def",
"_async_update_soon",
"(",
"self",
")",
":",
"self",
".",
"async_write_ha_state",
"(",
")",
"await",
"self",
".",
"coordinator",
".",
"async_request_refresh",
"(",
")"
] | [
150,
4
] | [
153,
54
] | python | de | ['de', 'nl', 'en'] | False |
PhilipsTVMediaPlayer.name | (self) | Return the device name. | Return the device name. | def name(self):
"""Return the device name."""
return self._system["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_system",
"[",
"\"name\"",
"]"
] | [
156,
4
] | [
158,
35
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.supported_features | (self) | Flag media player features that are supported. | Flag media player features that are supported. | def supported_features(self):
"""Flag media player features that are supported."""
supports = self._supports
if self._coordinator.turn_on or (
self._tv.on and self._tv.powerstate is not None
):
supports |= SUPPORT_TURN_ON
return supports | [
"def",
"supported_features",
"(",
"self",
")",
":",
"supports",
"=",
"self",
".",
"_supports",
"if",
"self",
".",
"_coordinator",
".",
"turn_on",
"or",
"(",
"self",
".",
"_tv",
".",
"on",
"and",
"self",
".",
"_tv",
".",
"powerstate",
"is",
"not",
"None... | [
161,
4
] | [
168,
23
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.state | (self) | Get the device state. An exception means OFF state. | Get the device state. An exception means OFF state. | def state(self):
"""Get the device state. An exception means OFF state."""
if self._tv.on and (self._tv.powerstate == "On" or self._tv.powerstate is None):
return STATE_ON
return STATE_OFF | [
"def",
"state",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tv",
".",
"on",
"and",
"(",
"self",
".",
"_tv",
".",
"powerstate",
"==",
"\"On\"",
"or",
"self",
".",
"_tv",
".",
"powerstate",
"is",
"None",
")",
":",
"return",
"STATE_ON",
"return",
"STA... | [
171,
4
] | [
175,
24
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.source | (self) | Return the current input source. | Return the current input source. | def source(self):
"""Return the current input source."""
return self._sources.get(self._tv.source_id) | [
"def",
"source",
"(",
"self",
")",
":",
"return",
"self",
".",
"_sources",
".",
"get",
"(",
"self",
".",
"_tv",
".",
"source_id",
")"
] | [
178,
4
] | [
180,
52
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.source_list | (self) | List of available input sources. | List of available input sources. | def source_list(self):
"""List of available input sources."""
return list(self._sources.values()) | [
"def",
"source_list",
"(",
"self",
")",
":",
"return",
"list",
"(",
"self",
".",
"_sources",
".",
"values",
"(",
")",
")"
] | [
183,
4
] | [
185,
43
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_select_source | (self, source) | Set the input source. | Set the input source. | async def async_select_source(self, source):
"""Set the input source."""
source_id = _inverted(self._sources).get(source)
if source_id:
await self._tv.setSource(source_id)
await self._async_update_soon() | [
"async",
"def",
"async_select_source",
"(",
"self",
",",
"source",
")",
":",
"source_id",
"=",
"_inverted",
"(",
"self",
".",
"_sources",
")",
".",
"get",
"(",
"source",
")",
"if",
"source_id",
":",
"await",
"self",
".",
"_tv",
".",
"setSource",
"(",
"... | [
187,
4
] | [
192,
39
] | python | en | ['en', 'su', 'en'] | True |
PhilipsTVMediaPlayer.volume_level | (self) | Volume level of the media player (0..1). | Volume level of the media player (0..1). | def volume_level(self):
"""Volume level of the media player (0..1)."""
return self._tv.volume | [
"def",
"volume_level",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tv",
".",
"volume"
] | [
195,
4
] | [
197,
30
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.is_volume_muted | (self) | Boolean if volume is currently muted. | Boolean if volume is currently muted. | def is_volume_muted(self):
"""Boolean if volume is currently muted."""
return self._tv.muted | [
"def",
"is_volume_muted",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tv",
".",
"muted"
] | [
200,
4
] | [
202,
29
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_turn_on | (self) | Turn on the device. | Turn on the device. | async def async_turn_on(self):
"""Turn on the device."""
if self._tv.on and self._tv.powerstate:
await self._tv.setPowerState("On")
self._state = STATE_ON
else:
await self._coordinator.turn_on.async_run(self.hass, self._context)
await self._async_updat... | [
"async",
"def",
"async_turn_on",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tv",
".",
"on",
"and",
"self",
".",
"_tv",
".",
"powerstate",
":",
"await",
"self",
".",
"_tv",
".",
"setPowerState",
"(",
"\"On\"",
")",
"self",
".",
"_state",
"=",
"STATE_... | [
204,
4
] | [
211,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_turn_off | (self) | Turn off the device. | Turn off the device. | async def async_turn_off(self):
"""Turn off the device."""
await self._tv.sendKey("Standby")
self._state = STATE_OFF
await self._async_update_soon() | [
"async",
"def",
"async_turn_off",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Standby\"",
")",
"self",
".",
"_state",
"=",
"STATE_OFF",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
213,
4
] | [
217,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_volume_up | (self) | Send volume up command. | Send volume up command. | async def async_volume_up(self):
"""Send volume up command."""
await self._tv.sendKey("VolumeUp")
await self._async_update_soon() | [
"async",
"def",
"async_volume_up",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"VolumeUp\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
219,
4
] | [
222,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_volume_down | (self) | Send volume down command. | Send volume down command. | async def async_volume_down(self):
"""Send volume down command."""
await self._tv.sendKey("VolumeDown")
await self._async_update_soon() | [
"async",
"def",
"async_volume_down",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"VolumeDown\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
224,
4
] | [
227,
39
] | python | en | ['en', 'it', 'en'] | True |
PhilipsTVMediaPlayer.async_mute_volume | (self, mute) | Send mute command. | Send mute command. | async def async_mute_volume(self, mute):
"""Send mute command."""
if self._tv.muted != mute:
await self._tv.sendKey("Mute")
await self._async_update_soon()
else:
_LOGGER.debug("Ignoring request when already in expected state") | [
"async",
"def",
"async_mute_volume",
"(",
"self",
",",
"mute",
")",
":",
"if",
"self",
".",
"_tv",
".",
"muted",
"!=",
"mute",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Mute\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")",... | [
229,
4
] | [
235,
76
] | python | en | ['en', 'co', 'en'] | True |
PhilipsTVMediaPlayer.async_set_volume_level | (self, volume) | Set volume level, range 0..1. | Set volume level, range 0..1. | async def async_set_volume_level(self, volume):
"""Set volume level, range 0..1."""
await self._tv.setVolume(volume, self._tv.muted)
await self._async_update_soon() | [
"async",
"def",
"async_set_volume_level",
"(",
"self",
",",
"volume",
")",
":",
"await",
"self",
".",
"_tv",
".",
"setVolume",
"(",
"volume",
",",
"self",
".",
"_tv",
".",
"muted",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
237,
4
] | [
240,
39
] | python | en | ['fr', 'zu', 'en'] | False |
PhilipsTVMediaPlayer.async_media_previous_track | (self) | Send rewind command. | Send rewind command. | async def async_media_previous_track(self):
"""Send rewind command."""
await self._tv.sendKey("Previous")
await self._async_update_soon() | [
"async",
"def",
"async_media_previous_track",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Previous\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
242,
4
] | [
245,
39
] | python | en | ['en', 'co', 'en'] | True |
PhilipsTVMediaPlayer.async_media_next_track | (self) | Send fast forward command. | Send fast forward command. | async def async_media_next_track(self):
"""Send fast forward command."""
await self._tv.sendKey("Next")
await self._async_update_soon() | [
"async",
"def",
"async_media_next_track",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Next\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
247,
4
] | [
250,
39
] | python | en | ['en', 'cy', 'en'] | True |
PhilipsTVMediaPlayer.async_media_play_pause | (self) | Send pause command to media player. | Send pause command to media player. | async def async_media_play_pause(self):
"""Send pause command to media player."""
if self._tv.quirk_playpause_spacebar:
await self._tv.sendUnicode(" ")
else:
await self._tv.sendKey("PlayPause")
await self._async_update_soon() | [
"async",
"def",
"async_media_play_pause",
"(",
"self",
")",
":",
"if",
"self",
".",
"_tv",
".",
"quirk_playpause_spacebar",
":",
"await",
"self",
".",
"_tv",
".",
"sendUnicode",
"(",
"\" \"",
")",
"else",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
... | [
252,
4
] | [
258,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_media_play | (self) | Send pause command to media player. | Send pause command to media player. | async def async_media_play(self):
"""Send pause command to media player."""
await self._tv.sendKey("Play")
await self._async_update_soon() | [
"async",
"def",
"async_media_play",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Play\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
260,
4
] | [
263,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_media_pause | (self) | Send play command to media player. | Send play command to media player. | async def async_media_pause(self):
"""Send play command to media player."""
await self._tv.sendKey("Pause")
await self._async_update_soon() | [
"async",
"def",
"async_media_pause",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Pause\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
265,
4
] | [
268,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_media_stop | (self) | Send play command to media player. | Send play command to media player. | async def async_media_stop(self):
"""Send play command to media player."""
await self._tv.sendKey("Stop")
await self._async_update_soon() | [
"async",
"def",
"async_media_stop",
"(",
"self",
")",
":",
"await",
"self",
".",
"_tv",
".",
"sendKey",
"(",
"\"Stop\"",
")",
"await",
"self",
".",
"_async_update_soon",
"(",
")"
] | [
270,
4
] | [
273,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.media_channel | (self) | Get current channel if it's a channel. | Get current channel if it's a channel. | def media_channel(self):
"""Get current channel if it's a channel."""
return self._media_channel | [
"def",
"media_channel",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_channel"
] | [
276,
4
] | [
278,
34
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.media_title | (self) | Title of current playing media. | Title of current playing media. | def media_title(self):
"""Title of current playing media."""
return self._media_title | [
"def",
"media_title",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_title"
] | [
281,
4
] | [
283,
32
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.media_content_type | (self) | Return content type of playing media. | Return content type of playing media. | def media_content_type(self):
"""Return content type of playing media."""
return self._media_content_type | [
"def",
"media_content_type",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_content_type"
] | [
286,
4
] | [
288,
39
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.media_content_id | (self) | Content type of current playing media. | Content type of current playing media. | def media_content_id(self):
"""Content type of current playing media."""
return self._media_content_id | [
"def",
"media_content_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_media_content_id"
] | [
291,
4
] | [
293,
37
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.media_image_url | (self) | Image url of current playing media. | Image url of current playing media. | def media_image_url(self):
"""Image url of current playing media."""
if self._media_content_id and self._media_content_type in (
MEDIA_TYPE_APP,
MEDIA_TYPE_CHANNEL,
):
return self.get_browse_image_url(
self._media_content_type, self._media_cont... | [
"def",
"media_image_url",
"(",
"self",
")",
":",
"if",
"self",
".",
"_media_content_id",
"and",
"self",
".",
"_media_content_type",
"in",
"(",
"MEDIA_TYPE_APP",
",",
"MEDIA_TYPE_CHANNEL",
",",
")",
":",
"return",
"self",
".",
"get_browse_image_url",
"(",
"self",... | [
296,
4
] | [
305,
19
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.app_id | (self) | ID of the current running app. | ID of the current running app. | def app_id(self):
"""ID of the current running app."""
return self._tv.application_id | [
"def",
"app_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_tv",
".",
"application_id"
] | [
308,
4
] | [
310,
38
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.app_name | (self) | Name of the current running app. | Name of the current running app. | def app_name(self):
"""Name of the current running app."""
app = self._tv.applications.get(self._tv.application_id)
if app:
return app.get("label") | [
"def",
"app_name",
"(",
"self",
")",
":",
"app",
"=",
"self",
".",
"_tv",
".",
"applications",
".",
"get",
"(",
"self",
".",
"_tv",
".",
"application_id",
")",
"if",
"app",
":",
"return",
"app",
".",
"get",
"(",
"\"label\"",
")"
] | [
313,
4
] | [
317,
35
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.unique_id | (self) | Return unique identifier if known. | Return unique identifier if known. | def unique_id(self):
"""Return unique identifier if known."""
return self._unique_id | [
"def",
"unique_id",
"(",
"self",
")",
":",
"return",
"self",
".",
"_unique_id"
] | [
320,
4
] | [
322,
30
] | python | de | ['fr', 'de', 'en'] | False |
PhilipsTVMediaPlayer.device_info | (self) | Return a device description for device registry. | Return a device description for device registry. | def device_info(self):
"""Return a device description for device registry."""
return {
"name": self._system["name"],
"identifiers": {
(DOMAIN, self._unique_id),
},
"model": self._system.get("model"),
"manufacturer": "Philips",
... | [
"def",
"device_info",
"(",
"self",
")",
":",
"return",
"{",
"\"name\"",
":",
"self",
".",
"_system",
"[",
"\"name\"",
"]",
",",
"\"identifiers\"",
":",
"{",
"(",
"DOMAIN",
",",
"self",
".",
"_unique_id",
")",
",",
"}",
",",
"\"model\"",
":",
"self",
... | [
325,
4
] | [
335,
9
] | python | en | ['ro', 'fr', 'en'] | False |
PhilipsTVMediaPlayer.async_play_media | (self, media_type, media_id, **kwargs) | Play a piece of media. | Play a piece of media. | async def async_play_media(self, media_type, media_id, **kwargs):
"""Play a piece of media."""
_LOGGER.debug("Call play media type <%s>, Id <%s>", media_type, media_id)
if media_type == MEDIA_TYPE_CHANNEL:
list_id, _, channel_id = media_id.partition("/")
if channel_id:
... | [
"async",
"def",
"async_play_media",
"(",
"self",
",",
"media_type",
",",
"media_id",
",",
"*",
"*",
"kwargs",
")",
":",
"_LOGGER",
".",
"debug",
"(",
"\"Call play media type <%s>, Id <%s>\"",
",",
"media_type",
",",
"media_id",
")",
"if",
"media_type",
"==",
"... | [
337,
4
] | [
356,
68
] | python | en | ['en', 'en', 'en'] | True |
PhilipsTVMediaPlayer.async_browse_media_channels | (self, expanded) | Return channel media objects. | Return channel media objects. | async def async_browse_media_channels(self, expanded):
"""Return channel media objects."""
if expanded:
children = [
BrowseMedia(
title=channel.get("name", f"Channel: {channel_id}"),
media_class=MEDIA_CLASS_CHANNEL,
... | [
"async",
"def",
"async_browse_media_channels",
"(",
"self",
",",
"expanded",
")",
":",
"if",
"expanded",
":",
"children",
"=",
"[",
"BrowseMedia",
"(",
"title",
"=",
"channel",
".",
"get",
"(",
"\"name\"",
",",
"f\"Channel: {channel_id}\"",
")",
",",
"media_cl... | [
358,
4
] | [
384,
9
] | python | en | ['it', 'fy', 'en'] | False |
PhilipsTVMediaPlayer.async_browse_media_favorites | (self, list_id, expanded) | Return channel media objects. | Return channel media objects. | async def async_browse_media_favorites(self, list_id, expanded):
"""Return channel media objects."""
if expanded:
favorites = await self._tv.getFavoriteList(list_id)
if favorites:
def get_name(channel):
channel_data = self._tv.channels.get(str... | [
"async",
"def",
"async_browse_media_favorites",
"(",
"self",
",",
"list_id",
",",
"expanded",
")",
":",
"if",
"expanded",
":",
"favorites",
"=",
"await",
"self",
".",
"_tv",
".",
"getFavoriteList",
"(",
"list_id",
")",
"if",
"favorites",
":",
"def",
"get_nam... | [
386,
4
] | [
424,
9
] | python | en | ['it', 'fy', 'en'] | False |
PhilipsTVMediaPlayer.async_browse_media_applications | (self, expanded) | Return application media objects. | Return application media objects. | async def async_browse_media_applications(self, expanded):
"""Return application media objects."""
if expanded:
children = [
BrowseMedia(
title=application["label"],
media_class=MEDIA_CLASS_APP,
media_content_id=appl... | [
"async",
"def",
"async_browse_media_applications",
"(",
"self",
",",
"expanded",
")",
":",
"if",
"expanded",
":",
"children",
"=",
"[",
"BrowseMedia",
"(",
"title",
"=",
"application",
"[",
"\"label\"",
"]",
",",
"media_class",
"=",
"MEDIA_CLASS_APP",
",",
"me... | [
426,
4
] | [
455,
9
] | python | en | ['en', 'fy', 'en'] | True |
PhilipsTVMediaPlayer.async_browse_media_favorite_lists | (self, expanded) | Return favorite media objects. | Return favorite media objects. | async def async_browse_media_favorite_lists(self, expanded):
"""Return favorite media objects."""
if self._tv.favorite_lists and expanded:
children = [
await self.async_browse_media_favorites(list_id, False)
for list_id in self._tv.favorite_lists
]... | [
"async",
"def",
"async_browse_media_favorite_lists",
"(",
"self",
",",
"expanded",
")",
":",
"if",
"self",
".",
"_tv",
".",
"favorite_lists",
"and",
"expanded",
":",
"children",
"=",
"[",
"await",
"self",
".",
"async_browse_media_favorites",
"(",
"list_id",
",",... | [
457,
4
] | [
476,
9
] | python | en | ['en', 'fy', 'en'] | True |
PhilipsTVMediaPlayer.async_browse_media_root | (self) | Return root media objects. | Return root media objects. | async def async_browse_media_root(self):
"""Return root media objects."""
return BrowseMedia(
title="Library",
media_class=MEDIA_CLASS_DIRECTORY,
media_content_id="",
media_content_type="",
can_play=False,
can_expand=True,
... | [
"async",
"def",
"async_browse_media_root",
"(",
"self",
")",
":",
"return",
"BrowseMedia",
"(",
"title",
"=",
"\"Library\"",
",",
"media_class",
"=",
"MEDIA_CLASS_DIRECTORY",
",",
"media_content_id",
"=",
"\"\"",
",",
"media_content_type",
"=",
"\"\"",
",",
"can_p... | [
478,
4
] | [
493,
9
] | python | en | ['en', 'mt', 'en'] | True |
PhilipsTVMediaPlayer.async_browse_media | (self, media_content_type=None, media_content_id=None) | Implement the websocket media browsing helper. | Implement the websocket media browsing helper. | async def async_browse_media(self, media_content_type=None, media_content_id=None):
"""Implement the websocket media browsing helper."""
if not self._tv.on:
raise BrowseError("Can't browse when tv is turned off")
if media_content_id in (None, ""):
return await self.async... | [
"async",
"def",
"async_browse_media",
"(",
"self",
",",
"media_content_type",
"=",
"None",
",",
"media_content_id",
"=",
"None",
")",
":",
"if",
"not",
"self",
".",
"_tv",
".",
"on",
":",
"raise",
"BrowseError",
"(",
"\"Can't browse when tv is turned off\"",
")"... | [
495,
4
] | [
512,
88
] | python | en | ['en', 'af', 'en'] | True |
PhilipsTVMediaPlayer.async_get_browse_image | (
self, media_content_type, media_content_id, media_image_id=None
) | Serve album art. Returns (content, content_type). | Serve album art. Returns (content, content_type). | async def async_get_browse_image(
self, media_content_type, media_content_id, media_image_id=None
):
"""Serve album art. Returns (content, content_type)."""
try:
if media_content_type == MEDIA_TYPE_APP and media_content_id:
return await self._tv.getApplicationIcon... | [
"async",
"def",
"async_get_browse_image",
"(",
"self",
",",
"media_content_type",
",",
"media_content_id",
",",
"media_image_id",
"=",
"None",
")",
":",
"try",
":",
"if",
"media_content_type",
"==",
"MEDIA_TYPE_APP",
"and",
"media_content_id",
":",
"return",
"await"... | [
514,
4
] | [
525,
25
] | python | de | ['de', 'la', 'en'] | False |
PhilipsTVMediaPlayer.async_get_media_image | (self) | Serve album art. Returns (content, content_type). | Serve album art. Returns (content, content_type). | async def async_get_media_image(self):
"""Serve album art. Returns (content, content_type)."""
return await self.async_get_browse_image(
self.media_content_type, self.media_content_id, None
) | [
"async",
"def",
"async_get_media_image",
"(",
"self",
")",
":",
"return",
"await",
"self",
".",
"async_get_browse_image",
"(",
"self",
".",
"media_content_type",
",",
"self",
".",
"media_content_id",
",",
"None",
")"
] | [
527,
4
] | [
531,
9
] | python | de | ['de', 'la', 'en'] | False |
PhilipsTVMediaPlayer._handle_coordinator_update | (self) | Handle updated data from the coordinator. | Handle updated data from the coordinator. | def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._update_from_coordinator()
super()._handle_coordinator_update() | [
"def",
"_handle_coordinator_update",
"(",
"self",
")",
"->",
"None",
":",
"self",
".",
"_update_from_coordinator",
"(",
")",
"super",
"(",
")",
".",
"_handle_coordinator_update",
"(",
")"
] | [
570,
4
] | [
573,
44
] | python | en | ['en', 'en', 'en'] | True |
color_rgb_to_int | (red: int, green: int, blue: int) | Return a RGB color as an integer. | Return a RGB color as an integer. | def color_rgb_to_int(red: int, green: int, blue: int) -> int:
"""Return a RGB color as an integer."""
return red * 256 * 256 + green * 256 + blue | [
"def",
"color_rgb_to_int",
"(",
"red",
":",
"int",
",",
"green",
":",
"int",
",",
"blue",
":",
"int",
")",
"->",
"int",
":",
"return",
"red",
"*",
"256",
"*",
"256",
"+",
"green",
"*",
"256",
"+",
"blue"
] | [
36,
0
] | [
38,
47
] | python | en | ['en', 'ga', 'en'] | True |
color_int_to_rgb | (value: int) | Return an RGB tuple from an integer. | Return an RGB tuple from an integer. | def color_int_to_rgb(value: int) -> tuple[int, int, int]:
"""Return an RGB tuple from an integer."""
return (value >> 16, (value >> 8) & 0xFF, value & 0xFF) | [
"def",
"color_int_to_rgb",
"(",
"value",
":",
"int",
")",
"->",
"tuple",
"[",
"int",
",",
"int",
",",
"int",
"]",
":",
"return",
"(",
"value",
">>",
"16",
",",
"(",
"value",
">>",
"8",
")",
"&",
"0xFF",
",",
"value",
"&",
"0xFF",
")"
] | [
41,
0
] | [
43,
59
] | python | en | ['en', 'mt', 'en'] | True |
async_setup_platform | (hass, config, async_add_entities, discovery_info=None) | Set up the EverLights lights from configuration.yaml. | Set up the EverLights lights from configuration.yaml. | async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the EverLights lights from configuration.yaml."""
lights = []
for ipaddr in config[CONF_HOSTS]:
api = pyeverlights.EverLights(ipaddr, async_get_clientsession(hass))
try:
status = aw... | [
"async",
"def",
"async_setup_platform",
"(",
"hass",
",",
"config",
",",
"async_add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"lights",
"=",
"[",
"]",
"for",
"ipaddr",
"in",
"config",
"[",
"CONF_HOSTS",
"]",
":",
"api",
"=",
"pyeverlights",
... | [
46,
0
] | [
65,
30
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.__init__ | (self, api, channel, status, effects) | Initialize the light. | Initialize the light. | def __init__(self, api, channel, status, effects):
"""Initialize the light."""
self._api = api
self._channel = channel
self._status = status
self._effects = effects
self._mac = status["mac"]
self._error_reported = False
self._hs_color = [255, 255]
... | [
"def",
"__init__",
"(",
"self",
",",
"api",
",",
"channel",
",",
"status",
",",
"effects",
")",
":",
"self",
".",
"_api",
"=",
"api",
"self",
".",
"_channel",
"=",
"channel",
"self",
".",
"_status",
"=",
"status",
"self",
".",
"_effects",
"=",
"effec... | [
71,
4
] | [
82,
30
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.unique_id | (self) | Return a unique ID. | Return a unique ID. | def unique_id(self) -> str:
"""Return a unique ID."""
return f"{self._mac}-{self._channel}" | [
"def",
"unique_id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"f\"{self._mac}-{self._channel}\""
] | [
85,
4
] | [
87,
45
] | python | ca | ['fr', 'ca', 'en'] | False |
EverLightsLight.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 self._available | [
"def",
"available",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_available"
] | [
90,
4
] | [
92,
30
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.name | (self) | Return the name of the device. | Return the name of the device. | def name(self):
"""Return the name of the device."""
return f"EverLights {self._mac} Zone {self._channel}" | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"f\"EverLights {self._mac} Zone {self._channel}\""
] | [
95,
4
] | [
97,
61
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.is_on | (self) | Return true if device is on. | Return true if device is on. | def is_on(self):
"""Return true if device is on."""
return self._status[f"ch{self._channel}Active"] == 1 | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"self",
".",
"_status",
"[",
"f\"ch{self._channel}Active\"",
"]",
"==",
"1"
] | [
100,
4
] | [
102,
60
] | python | en | ['en', 'fy', 'en'] | True |
EverLightsLight.brightness | (self) | Return the brightness of this light between 0..255. | Return the brightness of this light between 0..255. | def brightness(self):
"""Return the brightness of this light between 0..255."""
return self._brightness | [
"def",
"brightness",
"(",
"self",
")",
":",
"return",
"self",
".",
"_brightness"
] | [
105,
4
] | [
107,
31
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.hs_color | (self) | Return the color property. | Return the color property. | def hs_color(self):
"""Return the color property."""
return self._hs_color | [
"def",
"hs_color",
"(",
"self",
")",
":",
"return",
"self",
".",
"_hs_color"
] | [
110,
4
] | [
112,
29
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.effect | (self) | Return the effect property. | Return the effect property. | def effect(self):
"""Return the effect property."""
return self._effect | [
"def",
"effect",
"(",
"self",
")",
":",
"return",
"self",
".",
"_effect"
] | [
115,
4
] | [
117,
27
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.supported_features | (self) | Flag supported features. | Flag supported features. | def supported_features(self):
"""Flag supported features."""
return SUPPORT_EVERLIGHTS | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_EVERLIGHTS"
] | [
120,
4
] | [
122,
33
] | python | en | ['da', 'en', 'en'] | True |
EverLightsLight.effect_list | (self) | Return the list of supported effects. | Return the list of supported effects. | def effect_list(self):
"""Return the list of supported effects."""
return self._effects | [
"def",
"effect_list",
"(",
"self",
")",
":",
"return",
"self",
".",
"_effects"
] | [
125,
4
] | [
127,
28
] | python | en | ['en', 'en', 'en'] | True |
EverLightsLight.async_turn_on | (self, **kwargs) | Turn the light on. | Turn the light on. | async def async_turn_on(self, **kwargs):
"""Turn the light on."""
hs_color = kwargs.get(ATTR_HS_COLOR, self._hs_color)
brightness = kwargs.get(ATTR_BRIGHTNESS, self._brightness)
effect = kwargs.get(ATTR_EFFECT)
if effect is not None:
colors = await self._api.set_patt... | [
"async",
"def",
"async_turn_on",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"hs_color",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_HS_COLOR",
",",
"self",
".",
"_hs_color",
")",
"brightness",
"=",
"kwargs",
".",
"get",
"(",
"ATTR_BRIGHTNESS",
",",
"self"... | [
129,
4
] | [
151,
29
] | python | en | ['en', 'et', 'en'] | True |
EverLightsLight.async_turn_off | (self, **kwargs) | Turn the light off. | Turn the light off. | async def async_turn_off(self, **kwargs):
"""Turn the light off."""
await self._api.clear_pattern(self._channel) | [
"async",
"def",
"async_turn_off",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"_api",
".",
"clear_pattern",
"(",
"self",
".",
"_channel",
")"
] | [
153,
4
] | [
155,
52
] | python | en | ['en', 'zh', 'en'] | True |
EverLightsLight.async_update | (self) | Synchronize state with control box. | Synchronize state with control box. | async def async_update(self):
"""Synchronize state with control box."""
try:
self._status = await self._api.get_status()
except pyeverlights.ConnectionError:
if self._available:
_LOGGER.warning("EverLights control box connection lost")
self._av... | [
"async",
"def",
"async_update",
"(",
"self",
")",
":",
"try",
":",
"self",
".",
"_status",
"=",
"await",
"self",
".",
"_api",
".",
"get_status",
"(",
")",
"except",
"pyeverlights",
".",
"ConnectionError",
":",
"if",
"self",
".",
"_available",
":",
"_LOGG... | [
157,
4
] | [
168,
34
] | python | en | ['en', 'en', 'en'] | True |
get_cps_from_files | (paths) | Return a tuple of the cps and the paths that we actually read. | Return a tuple of the cps and the paths that we actually read. | def get_cps_from_files(paths):
"""Return a tuple of the cps and the paths that we actually read."""
cps = set()
new_paths = set()
for f in paths:
ext = path.splitext(f)[1]
if ext not in [".otf", ".ttf"]:
continue
cps |= coverage.character_set(f)
new_paths.add(... | [
"def",
"get_cps_from_files",
"(",
"paths",
")",
":",
"cps",
"=",
"set",
"(",
")",
"new_paths",
"=",
"set",
"(",
")",
"for",
"f",
"in",
"paths",
":",
"ext",
"=",
"path",
".",
"splitext",
"(",
"f",
")",
"[",
"1",
"]",
"if",
"ext",
"not",
"in",
"[... | [
35,
0
] | [
45,
33
] | python | en | ['en', 'en', 'en'] | True |
_create_metadata | (**kwargs) | Create a MetaData object from the args. 'date' defaults to today's
date. | Create a MetaData object from the args. 'date' defaults to today's
date. | def _create_metadata(**kwargs):
"""Create a MetaData object from the args. 'date' defaults to today's
date."""
date = str(kwargs.pop("date", datetime.date.today()))
program = str(kwargs.pop("program", "generate_coverage_data"))
arglist = [(k, v) for k, v in sorted(kwargs.items()) if v is not None]
... | [
"def",
"_create_metadata",
"(",
"*",
"*",
"kwargs",
")",
":",
"date",
"=",
"str",
"(",
"kwargs",
".",
"pop",
"(",
"\"date\"",
",",
"datetime",
".",
"date",
".",
"today",
"(",
")",
")",
")",
"program",
"=",
"str",
"(",
"kwargs",
".",
"pop",
"(",
"... | [
56,
0
] | [
62,
43
] | python | en | ['en', 'en', 'en'] | True |
_create_cmapdata | (name, cmap) | Create a CmapData object from the name and cmap. | Create a CmapData object from the name and cmap. | def _create_cmapdata(name, cmap):
"""Create a CmapData object from the name and cmap."""
return CmapData(name, tool_utils.write_int_ranges(cmap)) | [
"def",
"_create_cmapdata",
"(",
"name",
",",
"cmap",
")",
":",
"return",
"CmapData",
"(",
"name",
",",
"tool_utils",
".",
"write_int_ranges",
"(",
"cmap",
")",
")"
] | [
65,
0
] | [
67,
60
] | python | en | ['en', 'en', 'en'] | True |
create | (name, cps, paths=None, cmap_data=None) | Generate the coverage data object. | Generate the coverage data object. | def create(name, cps, paths=None, cmap_data=None):
"""Generate the coverage data object."""
metadata = _create_metadata(paths=paths, cmap_data=cmap_data)
cmapdata = _create_cmapdata(name, cps)
return CoverageData(metadata, cmapdata) | [
"def",
"create",
"(",
"name",
",",
"cps",
",",
"paths",
"=",
"None",
",",
"cmap_data",
"=",
"None",
")",
":",
"metadata",
"=",
"_create_metadata",
"(",
"paths",
"=",
"paths",
",",
"cmap_data",
"=",
"cmap_data",
")",
"cmapdata",
"=",
"_create_cmapdata",
"... | [
70,
0
] | [
74,
43
] | python | en | ['en', 'en', 'en'] | True |
_common_path_prefix | (items) | Assuming items is an array of paths using path.sep as a path separator,
return a common path prefix of the items. | Assuming items is an array of paths using path.sep as a path separator,
return a common path prefix of the items. | def _common_path_prefix(items):
"""Assuming items is an array of paths using path.sep as a path separator,
return a common path prefix of the items."""
prefix = None
if len(items) <= 1:
return ""
for item in items:
if prefix is None:
last = item.rfind(path.sep)
... | [
"def",
"_common_path_prefix",
"(",
"items",
")",
":",
"prefix",
"=",
"None",
"if",
"len",
"(",
"items",
")",
"<=",
"1",
":",
"return",
"\"\"",
"for",
"item",
"in",
"items",
":",
"if",
"prefix",
"is",
"None",
":",
"last",
"=",
"item",
".",
"rfind",
... | [
77,
0
] | [
102,
17
] | python | en | ['en', 'en', 'en'] | True |
_build_meta_elem | (metadata) | Convert metadata to ET node. | Convert metadata to ET node. | def _build_meta_elem(metadata):
"""Convert metadata to ET node."""
meta = ET.Element("meta", date=metadata.date, program=metadata.program)
if metadata.args:
args = ET.Element("args")
for k, v in metadata.args:
if isinstance(v, list):
arg = ET.Element(k, isList="tr... | [
"def",
"_build_meta_elem",
"(",
"metadata",
")",
":",
"meta",
"=",
"ET",
".",
"Element",
"(",
"\"meta\"",
",",
"date",
"=",
"metadata",
".",
"date",
",",
"program",
"=",
"metadata",
".",
"program",
")",
"if",
"metadata",
".",
"args",
":",
"args",
"=",
... | [
105,
0
] | [
127,
15
] | python | en | ['en', 'lb', 'it'] | False |
_build_cmap_elem | (cmapdata) | Convert data to ET node. | Convert data to ET node. | def _build_cmap_elem(cmapdata):
"""Convert data to ET node."""
data = ET.Element("data")
name = ET.Element("name")
name.text = cmapdata.name
data.append(name)
ranges = ET.Element("ranges")
ranges.text = cmapdata.ranges
data.append(ranges)
return data | [
"def",
"_build_cmap_elem",
"(",
"cmapdata",
")",
":",
"data",
"=",
"ET",
".",
"Element",
"(",
"\"data\"",
")",
"name",
"=",
"ET",
".",
"Element",
"(",
"\"name\"",
")",
"name",
".",
"text",
"=",
"cmapdata",
".",
"name",
"data",
".",
"append",
"(",
"na... | [
130,
0
] | [
139,
15
] | python | en | ['en', 'lb', 'it'] | False |
_prettify | (root, indent="") | Pretty-print the root element if it has no text and children
by adding to the root text and each child's tail. | Pretty-print the root element if it has no text and children
by adding to the root text and each child's tail. | def _prettify(root, indent=""):
"""Pretty-print the root element if it has no text and children
by adding to the root text and each child's tail."""
if not root.text and len(root):
indent += " "
sfx = "\n" + indent
root.text = sfx
for elem in root:
elem.tail = s... | [
"def",
"_prettify",
"(",
"root",
",",
"indent",
"=",
"\"\"",
")",
":",
"if",
"not",
"root",
".",
"text",
"and",
"len",
"(",
"root",
")",
":",
"indent",
"+=",
"\" \"",
"sfx",
"=",
"\"\\n\"",
"+",
"indent",
"root",
".",
"text",
"=",
"sfx",
"for",
... | [
142,
0
] | [
152,
28
] | python | en | ['en', 'en', 'en'] | True |
write | (coveragedata, out_file=None) | Write coverage data to xml. | Write coverage data to xml. | def write(coveragedata, out_file=None):
"""Write coverage data to xml."""
tree = _build_tree(coveragedata)
if out_file:
tree.write(out_file, encoding="utf-8", xml_declaration=True)
else:
print(ET.tostring(tree.getroot(), encoding="utf-8")) | [
"def",
"write",
"(",
"coveragedata",
",",
"out_file",
"=",
"None",
")",
":",
"tree",
"=",
"_build_tree",
"(",
"coveragedata",
")",
"if",
"out_file",
":",
"tree",
".",
"write",
"(",
"out_file",
",",
"encoding",
"=",
"\"utf-8\"",
",",
"xml_declaration",
"=",... | [
163,
0
] | [
169,
60
] | python | en | ['en', 'el-Latn', 'en'] | True |
User.__init__ | (self, id: int=None, username: str=None, first_name: str=None, last_name: str=None, email: str=None, password: str=None, phone: str=None, user_status: int=None) | User - a model defined in Swagger
:param id: The id of this User. # noqa: E501
:type id: int
:param username: The username of this User. # noqa: E501
:type username: str
:param first_name: The first_name of this User. # noqa: E501
:type first_name: str
:param ... | User - a model defined in Swagger | def __init__(self, id: int=None, username: str=None, first_name: str=None, last_name: str=None, email: str=None, password: str=None, phone: str=None, user_status: int=None): # noqa: E501
"""User - a model defined in Swagger
:param id: The id of this User. # noqa: E501
:type id: int
:p... | [
"def",
"__init__",
"(",
"self",
",",
"id",
":",
"int",
"=",
"None",
",",
"username",
":",
"str",
"=",
"None",
",",
"first_name",
":",
"str",
"=",
"None",
",",
"last_name",
":",
"str",
"=",
"None",
",",
"email",
":",
"str",
"=",
"None",
",",
"pass... | [
17,
4
] | [
66,
39
] | python | en | ['en', 'en', 'en'] | True |
User.from_dict | (cls, dikt) | Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The User of this User. # noqa: E501
:rtype: User
| Returns the dict as a model | def from_dict(cls, dikt) -> 'User':
"""Returns the dict as a model
:param dikt: A dict.
:type: dict
:return: The User of this User. # noqa: E501
:rtype: User
"""
return util.deserialize_model(dikt, cls) | [
"def",
"from_dict",
"(",
"cls",
",",
"dikt",
")",
"->",
"'User'",
":",
"return",
"util",
".",
"deserialize_model",
"(",
"dikt",
",",
"cls",
")"
] | [
69,
4
] | [
77,
48
] | python | en | ['en', 'en', 'en'] | True |
User.id | (self) | Gets the id of this User.
:return: The id of this User.
:rtype: int
| Gets the id of this User. | def id(self) -> int:
"""Gets the id of this User.
:return: The id of this User.
:rtype: int
"""
return self._id | [
"def",
"id",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_id"
] | [
80,
4
] | [
87,
23
] | python | en | ['en', 'en', 'en'] | True |
User.id | (self, id: int) | Sets the id of this User.
:param id: The id of this User.
:type id: int
| Sets the id of this User. | def id(self, id: int):
"""Sets the id of this User.
:param id: The id of this User.
:type id: int
"""
self._id = id | [
"def",
"id",
"(",
"self",
",",
"id",
":",
"int",
")",
":",
"self",
".",
"_id",
"=",
"id"
] | [
90,
4
] | [
98,
21
] | python | en | ['en', 'en', 'en'] | True |
User.username | (self) | Gets the username of this User.
:return: The username of this User.
:rtype: str
| Gets the username of this User. | def username(self) -> str:
"""Gets the username of this User.
:return: The username of this User.
:rtype: str
"""
return self._username | [
"def",
"username",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_username"
] | [
101,
4
] | [
108,
29
] | python | en | ['en', 'en', 'en'] | True |
User.username | (self, username: str) | Sets the username of this User.
:param username: The username of this User.
:type username: str
| Sets the username of this User. | def username(self, username: str):
"""Sets the username of this User.
:param username: The username of this User.
:type username: str
"""
self._username = username | [
"def",
"username",
"(",
"self",
",",
"username",
":",
"str",
")",
":",
"self",
".",
"_username",
"=",
"username"
] | [
111,
4
] | [
119,
33
] | python | en | ['en', 'en', 'en'] | True |
User.first_name | (self) | Gets the first_name of this User.
:return: The first_name of this User.
:rtype: str
| Gets the first_name of this User. | def first_name(self) -> str:
"""Gets the first_name of this User.
:return: The first_name of this User.
:rtype: str
"""
return self._first_name | [
"def",
"first_name",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_first_name"
] | [
122,
4
] | [
129,
31
] | python | en | ['en', 'en', 'en'] | True |
User.first_name | (self, first_name: str) | Sets the first_name of this User.
:param first_name: The first_name of this User.
:type first_name: str
| Sets the first_name of this User. | def first_name(self, first_name: str):
"""Sets the first_name of this User.
:param first_name: The first_name of this User.
:type first_name: str
"""
self._first_name = first_name | [
"def",
"first_name",
"(",
"self",
",",
"first_name",
":",
"str",
")",
":",
"self",
".",
"_first_name",
"=",
"first_name"
] | [
132,
4
] | [
140,
37
] | python | en | ['en', 'en', 'en'] | True |
User.last_name | (self) | Gets the last_name of this User.
:return: The last_name of this User.
:rtype: str
| Gets the last_name of this User. | def last_name(self) -> str:
"""Gets the last_name of this User.
:return: The last_name of this User.
:rtype: str
"""
return self._last_name | [
"def",
"last_name",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_last_name"
] | [
143,
4
] | [
150,
30
] | python | en | ['en', 'en', 'en'] | True |
User.last_name | (self, last_name: str) | Sets the last_name of this User.
:param last_name: The last_name of this User.
:type last_name: str
| Sets the last_name of this User. | def last_name(self, last_name: str):
"""Sets the last_name of this User.
:param last_name: The last_name of this User.
:type last_name: str
"""
self._last_name = last_name | [
"def",
"last_name",
"(",
"self",
",",
"last_name",
":",
"str",
")",
":",
"self",
".",
"_last_name",
"=",
"last_name"
] | [
153,
4
] | [
161,
35
] | python | en | ['en', 'en', 'en'] | True |
User.email | (self) | Gets the email of this User.
:return: The email of this User.
:rtype: str
| Gets the email of this User. | def email(self) -> str:
"""Gets the email of this User.
:return: The email of this User.
:rtype: str
"""
return self._email | [
"def",
"email",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_email"
] | [
164,
4
] | [
171,
26
] | python | en | ['en', 'en', 'en'] | True |
User.email | (self, email: str) | Sets the email of this User.
:param email: The email of this User.
:type email: str
| Sets the email of this User. | def email(self, email: str):
"""Sets the email of this User.
:param email: The email of this User.
:type email: str
"""
self._email = email | [
"def",
"email",
"(",
"self",
",",
"email",
":",
"str",
")",
":",
"self",
".",
"_email",
"=",
"email"
] | [
174,
4
] | [
182,
27
] | python | en | ['en', 'en', 'en'] | True |
User.password | (self) | Gets the password of this User.
:return: The password of this User.
:rtype: str
| Gets the password of this User. | def password(self) -> str:
"""Gets the password of this User.
:return: The password of this User.
:rtype: str
"""
return self._password | [
"def",
"password",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_password"
] | [
185,
4
] | [
192,
29
] | python | en | ['en', 'en', 'en'] | True |
User.password | (self, password: str) | Sets the password of this User.
:param password: The password of this User.
:type password: str
| Sets the password of this User. | def password(self, password: str):
"""Sets the password of this User.
:param password: The password of this User.
:type password: str
"""
self._password = password | [
"def",
"password",
"(",
"self",
",",
"password",
":",
"str",
")",
":",
"self",
".",
"_password",
"=",
"password"
] | [
195,
4
] | [
203,
33
] | python | en | ['en', 'en', 'en'] | True |
User.phone | (self) | Gets the phone of this User.
:return: The phone of this User.
:rtype: str
| Gets the phone of this User. | def phone(self) -> str:
"""Gets the phone of this User.
:return: The phone of this User.
:rtype: str
"""
return self._phone | [
"def",
"phone",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_phone"
] | [
206,
4
] | [
213,
26
] | python | en | ['en', 'en', 'en'] | True |
User.phone | (self, phone: str) | Sets the phone of this User.
:param phone: The phone of this User.
:type phone: str
| Sets the phone of this User. | def phone(self, phone: str):
"""Sets the phone of this User.
:param phone: The phone of this User.
:type phone: str
"""
self._phone = phone | [
"def",
"phone",
"(",
"self",
",",
"phone",
":",
"str",
")",
":",
"self",
".",
"_phone",
"=",
"phone"
] | [
216,
4
] | [
224,
27
] | python | en | ['en', 'en', 'en'] | True |
User.user_status | (self) | Gets the user_status of this User.
User Status # noqa: E501
:return: The user_status of this User.
:rtype: int
| Gets the user_status of this User. | def user_status(self) -> int:
"""Gets the user_status of this User.
User Status # noqa: E501
:return: The user_status of this User.
:rtype: int
"""
return self._user_status | [
"def",
"user_status",
"(",
"self",
")",
"->",
"int",
":",
"return",
"self",
".",
"_user_status"
] | [
227,
4
] | [
235,
32
] | python | en | ['en', 'en', 'en'] | True |
User.user_status | (self, user_status: int) | Sets the user_status of this User.
User Status # noqa: E501
:param user_status: The user_status of this User.
:type user_status: int
| Sets the user_status of this User. | def user_status(self, user_status: int):
"""Sets the user_status of this User.
User Status # noqa: E501
:param user_status: The user_status of this User.
:type user_status: int
"""
self._user_status = user_status | [
"def",
"user_status",
"(",
"self",
",",
"user_status",
":",
"int",
")",
":",
"self",
".",
"_user_status",
"=",
"user_status"
] | [
238,
4
] | [
247,
39
] | python | en | ['en', 'en', 'en'] | True |
async_alarm_disarm | (hass, code=None, entity_id=ENTITY_MATCH_ALL) | Send the alarm the command for disarm. | Send the alarm the command for disarm. | async def async_alarm_disarm(hass, code=None, entity_id=ENTITY_MATCH_ALL):
"""Send the alarm the command for disarm."""
data = {}
if code:
data[ATTR_CODE] = code
if entity_id:
data[ATTR_ENTITY_ID] = entity_id
await hass.services.async_call(DOMAIN, SERVICE_ALARM_DISARM, data, blockin... | [
"async",
"def",
"async_alarm_disarm",
"(",
"hass",
",",
"code",
"=",
"None",
",",
"entity_id",
"=",
"ENTITY_MATCH_ALL",
")",
":",
"data",
"=",
"{",
"}",
"if",
"code",
":",
"data",
"[",
"ATTR_CODE",
"]",
"=",
"code",
"if",
"entity_id",
":",
"data",
"[",... | [
20,
0
] | [
28,
85
] | 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.