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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
MockSwitchLinc.operating_flags | (self) | Return no operating flags to force properties to be checked. | Return no operating flags to force properties to be checked. | def operating_flags(self):
"""Return no operating flags to force properties to be checked."""
return {} | [
"def",
"operating_flags",
"(",
"self",
")",
":",
"return",
"{",
"}"
] | [
18,
4
] | [
20,
17
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.__init__ | (self, connected=True) | Init the MockDevices class. | Init the MockDevices class. | def __init__(self, connected=True):
"""Init the MockDevices class."""
self._devices = {}
self.modem = None
self._connected = connected
self.async_save = AsyncMock()
self.add_x10_device = MagicMock()
self.set_id = MagicMock() | [
"def",
"__init__",
"(",
"self",
",",
"connected",
"=",
"True",
")",
":",
"self",
".",
"_devices",
"=",
"{",
"}",
"self",
".",
"modem",
"=",
"None",
"self",
".",
"_connected",
"=",
"connected",
"self",
".",
"async_save",
"=",
"AsyncMock",
"(",
")",
"s... | [
26,
4
] | [
33,
33
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.__getitem__ | (self, address) | Return a a device from the device address. | Return a a device from the device address. | def __getitem__(self, address):
"""Return a a device from the device address."""
return self._devices.get(Address(address)) | [
"def",
"__getitem__",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"_devices",
".",
"get",
"(",
"Address",
"(",
"address",
")",
")"
] | [
35,
4
] | [
37,
50
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.__iter__ | (self) | Return an iterator of device addresses. | Return an iterator of device addresses. | def __iter__(self):
"""Return an iterator of device addresses."""
yield from self._devices | [
"def",
"__iter__",
"(",
"self",
")",
":",
"yield",
"from",
"self",
".",
"_devices"
] | [
39,
4
] | [
41,
32
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.__len__ | (self) | Return the number of devices. | Return the number of devices. | def __len__(self):
"""Return the number of devices."""
return len(self._devices) | [
"def",
"__len__",
"(",
"self",
")",
":",
"return",
"len",
"(",
"self",
".",
"_devices",
")"
] | [
43,
4
] | [
45,
33
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.get | (self, address) | Return a device from an address or None if not found. | Return a device from an address or None if not found. | def get(self, address):
"""Return a device from an address or None if not found."""
return self._devices.get(Address(address)) | [
"def",
"get",
"(",
"self",
",",
"address",
")",
":",
"return",
"self",
".",
"_devices",
".",
"get",
"(",
"Address",
"(",
"address",
")",
")"
] | [
47,
4
] | [
49,
50
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.async_load | (self, *args, **kwargs) | Load the mock devices. | Load the mock devices. | async def async_load(self, *args, **kwargs):
"""Load the mock devices."""
if self._connected:
addr0 = Address("AA.AA.AA")
addr1 = Address("11.11.11")
addr2 = Address("22.22.22")
addr3 = Address("33.33.33")
self._devices[addr0] = Hub(addr0, 0x03... | [
"async",
"def",
"async_load",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"self",
".",
"_connected",
":",
"addr0",
"=",
"Address",
"(",
"\"AA.AA.AA\"",
")",
"addr1",
"=",
"Address",
"(",
"\"11.11.11\"",
")",
"addr2",
"=",
... | [
51,
4
] | [
105,
45
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.fill_aldb | (self, address, records) | Fill the All-Link Database for a device. | Fill the All-Link Database for a device. | def fill_aldb(self, address, records):
"""Fill the All-Link Database for a device."""
device = self._devices[Address(address)]
aldb_records = dict_to_aldb_record(records)
device.aldb.load_saved_records(ALDBStatus.LOADED, aldb_records) | [
"def",
"fill_aldb",
"(",
"self",
",",
"address",
",",
"records",
")",
":",
"device",
"=",
"self",
".",
"_devices",
"[",
"Address",
"(",
"address",
")",
"]",
"aldb_records",
"=",
"dict_to_aldb_record",
"(",
"records",
")",
"device",
".",
"aldb",
".",
"loa... | [
107,
4
] | [
112,
71
] | python | en | ['en', 'en', 'en'] | True |
MockDevices.fill_properties | (self, address, props_dict) | Fill the operating flags and extended properties of a device. | Fill the operating flags and extended properties of a device. | def fill_properties(self, address, props_dict):
"""Fill the operating flags and extended properties of a device."""
device = self._devices[Address(address)]
operating_flags = props_dict.get("operating_flags", {})
properties = props_dict.get("properties", {})
for flag in operatin... | [
"def",
"fill_properties",
"(",
"self",
",",
"address",
",",
"props_dict",
")",
":",
"device",
"=",
"self",
".",
"_devices",
"[",
"Address",
"(",
"address",
")",
"]",
"operating_flags",
"=",
"props_dict",
".",
"get",
"(",
"\"operating_flags\"",
",",
"{",
"}... | [
114,
4
] | [
127,
51
] | python | en | ['en', 'en', 'en'] | True |
TestArray2String.test_basic | (self) | Basic test of array2string. | Basic test of array2string. | def test_basic(self):
"""Basic test of array2string."""
a = np.arange(3)
assert_(np.array2string(a) == '[0 1 2]')
assert_(np.array2string(a, max_line_width=4, legacy='1.13') == '[0 1\n 2]')
assert_(np.array2string(a, max_line_width=4) == '[0\n 1\n 2]') | [
"def",
"test_basic",
"(",
"self",
")",
":",
"a",
"=",
"np",
".",
"arange",
"(",
"3",
")",
"assert_",
"(",
"np",
".",
"array2string",
"(",
"a",
")",
"==",
"'[0 1 2]'",
")",
"assert_",
"(",
"np",
".",
"array2string",
"(",
"a",
",",
"max_line_width",
... | [
210,
4
] | [
215,
70
] | python | en | ['en', 'no', 'en'] | True |
TestArray2String.test_format_function | (self) | Test custom format function for each element in array. | Test custom format function for each element in array. | def test_format_function(self):
"""Test custom format function for each element in array."""
def _format_function(x):
if np.abs(x) < 1:
return '.'
elif np.abs(x) < 2:
return 'o'
else:
return 'O'
x = np.arange(3)... | [
"def",
"test_format_function",
"(",
"self",
")",
":",
"def",
"_format_function",
"(",
"x",
")",
":",
"if",
"np",
".",
"abs",
"(",
"x",
")",
"<",
"1",
":",
"return",
"'.'",
"elif",
"np",
".",
"abs",
"(",
"x",
")",
"<",
"2",
":",
"return",
"'o'",
... | [
226,
4
] | [
258,
34
] | python | en | ['en', 'en', 'en'] | True |
send_verify_email | (to_email, verify_url) |
功能:发验证邮件
:param to_email: 收件人 —— 用于保存更新的邮箱
:param verify_url: 验证邮件中的 链接
:return: 1成功,0失败
|
功能:发验证邮件
:param to_email: 收件人 —— 用于保存更新的邮箱
:param verify_url: 验证邮件中的 链接
:return: 1成功,0失败
| def send_verify_email(to_email, verify_url):
"""
功能:发验证邮件
:param to_email: 收件人 —— 用于保存更新的邮箱
:param verify_url: 验证邮件中的 链接
:return: 1成功,0失败
"""
html_message = '<p>尊敬的用户您好!</p>' \
'<p>感谢您使用美多商城。</p>' \
'<p>您的邮箱为:%s 。请点击此链接激活您的邮箱:</p>' \
... | [
"def",
"send_verify_email",
"(",
"to_email",
",",
"verify_url",
")",
":",
"html_message",
"=",
"'<p>尊敬的用户您好!</p>' \\",
"'<p>感谢您使用美多商城。</p>' \\",
"'<p>您的邮箱为:%s 。请点击此链接激活您的邮箱:</p>' \\",
"'<p><a href=\"%s\">%s<a></p>'",
"%",
"(",
"to_email",
",",
"verify_url",
",",
"verify_url",... | [
7,
0
] | [
27,
17
] | python | en | ['en', 'error', 'th'] | False |
calls_fixture | (hass) | Track calls to a mock service. | Track calls to a mock service. | def calls_fixture(hass):
"""Track calls to a mock service."""
return async_mock_service(hass, "test", "automation") | [
"def",
"calls_fixture",
"(",
"hass",
")",
":",
"return",
"async_mock_service",
"(",
"hass",
",",
"\"test\"",
",",
"\"automation\"",
")"
] | [
31,
0
] | [
33,
57
] | python | en | ['en', 'en', 'en'] | True |
test_template_state_text | (hass, calls, caplog) | Test the state text of a template. | Test the state text of a template. | async def test_template_state_text(hass, calls, caplog):
"""Test the state text of a template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",... | [
"async",
"def",
"test_template_state_text",
"(",
"hass",
",",
"calls",
",",
"caplog",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
","... | [
36,
0
] | [
117,
68
] | python | en | ['en', 'en', 'en'] | True |
test_template_state_text_combined | (hass, calls, caplog) | Test the state text of a template which combines position and value templates. | Test the state text of a template which combines position and value templates. | async def test_template_state_text_combined(hass, calls, caplog):
"""Test the state text of a template which combines position and value templates."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"... | [
"async",
"def",
"test_template_state_text_combined",
"(",
"hass",
",",
"calls",
",",
"caplog",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\... | [
120,
0
] | [
205,
67
] | python | en | ['en', 'en', 'en'] | True |
test_template_state_boolean | (hass, calls) | Test the value_template attribute. | Test the value_template attribute. | async def test_template_state_boolean(hass, calls):
"""Test the value_template attribute."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_state_boolean",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"co... | [
208,
0
] | [
239,
36
] | python | en | ['en', 'en', 'en'] | True |
test_template_position | (hass, calls) | Test the position_template attribute. | Test the position_template attribute. | async def test_template_position(hass, calls):
"""Test the position_template attribute."""
hass.states.async_set("cover.test", STATE_OPEN)
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": ... | [
"async",
"def",
"test_template_position",
"(",
"hass",
",",
"calls",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"cover.test\"",
",",
"STATE_OPEN",
")",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
... | [
242,
0
] | [
295,
38
] | python | en | ['en', 'en', 'en'] | True |
test_template_tilt | (hass, calls) | Test the tilt_template attribute. | Test the tilt_template attribute. | async def test_template_tilt(hass, calls):
"""Test the tilt_template attribute."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_tilt",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
298,
0
] | [
330,
64
] | python | en | ['en', 'en', 'en'] | True |
test_template_out_of_bounds | (hass, calls) | Test template out-of-bounds condition. | Test template out-of-bounds condition. | async def test_template_out_of_bounds(hass, calls):
"""Test template out-of-bounds condition."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_template_out_of_bounds",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"co... | [
333,
0
] | [
366,
59
] | python | en | ['en', 'en', 'en'] | True |
test_template_open_or_position | (hass, caplog) | Test that at least one of open_cover or set_position is used. | Test that at least one of open_cover or set_position is used. | async def test_template_open_or_position(hass, caplog):
"""Test that at least one of open_cover or set_position is used."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {"test_template_... | [
"async",
"def",
"test_template_open_or_position",
"(",
"hass",
",",
"caplog",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
",",
"\"covers\... | [
369,
0
] | [
384,
63
] | python | en | ['en', 'en', 'en'] | True |
test_template_open_and_close | (hass, calls) | Test that if open_cover is specified, close_cover is too. | Test that if open_cover is specified, close_cover is too. | async def test_template_open_and_close(hass, calls):
"""Test that if open_cover is specified, close_cover is too."""
with assert_setup_component(0, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"pla... | [
"async",
"def",
"test_template_open_and_close",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
387,
0
] | [
413,
40
] | python | en | ['en', 'en', 'en'] | True |
test_template_non_numeric | (hass, calls) | Test that tilt_template values are numeric. | Test that tilt_template values are numeric. | async def test_template_non_numeric(hass, calls):
"""Test that tilt_template values are numeric."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template... | [
"async",
"def",
"test_template_non_numeric",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cove... | [
416,
0
] | [
453,
59
] | python | en | ['en', 'en', 'en'] | True |
test_open_action | (hass, calls) | Test the open_cover command. | Test the open_cover command. | async def test_open_action(hass, calls):
"""Test the open_cover command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"... | [
"async",
"def",
"test_open_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
"... | [
456,
0
] | [
491,
26
] | python | en | ['en', 'en', 'en'] | True |
test_close_stop_action | (hass, calls) | Test the close-cover and stop_cover commands. | Test the close-cover and stop_cover commands. | async def test_close_stop_action(hass, calls):
"""Test the close-cover and stop_cover commands."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template"... | [
"async",
"def",
"test_close_stop_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
494,
0
] | [
535,
26
] | python | en | ['en', 'en', 'en'] | True |
test_set_position | (hass, calls) | Test the set_position command. | Test the set_position command. | async def test_set_position(hass, calls):
"""Test the set_position command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"input_number",
{"input_number": {"test": {"min": "0", "max": "100", "initial": "42"}}},
)
... | [
"async",
"def",
"test_set_position",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"input_number\"",
",",
"{",
"\"input... | [
538,
0
] | [
611,
59
] | python | en | ['en', 'fr', 'en'] | True |
test_set_tilt_position | (hass, calls) | Test the set_tilt_position command. | Test the set_tilt_position command. | async def test_set_tilt_position(hass, calls):
"""Test the set_tilt_position command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_set_tilt_position",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
614,
0
] | [
653,
26
] | python | en | ['en', 'fr', 'en'] | True |
test_open_tilt_action | (hass, calls) | Test the open_cover_tilt command. | Test the open_cover_tilt command. | async def test_open_tilt_action(hass, calls):
"""Test the open_cover_tilt command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_open_tilt_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\""... | [
656,
0
] | [
692,
26
] | python | en | ['en', 'no', 'en'] | True |
test_close_tilt_action | (hass, calls) | Test the close_cover_tilt command. | Test the close_cover_tilt command. | async def test_close_tilt_action(hass, calls):
"""Test the close_cover_tilt command."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_close_tilt_action",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"... | [
695,
0
] | [
731,
26
] | python | en | ['en', 'fr', 'en'] | True |
test_set_position_optimistic | (hass, calls) | Test optimistic position mode. | Test optimistic position mode. | async def test_set_position_optimistic(hass, calls):
"""Test optimistic position mode."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_set_position_optimistic",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
734,
0
] | [
794,
36
] | python | en | ['en', 'fr', 'en'] | True |
test_set_tilt_position_optimistic | (hass, calls) | Test the optimistic tilt_position mode. | Test the optimistic tilt_position mode. | async def test_set_tilt_position_optimistic(hass, calls):
"""Test the optimistic tilt_position mode."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "temp... | [
"async",
"def",
"test_set_tilt_position_optimistic",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
... | [
797,
0
] | [
859,
65
] | python | en | ['en', 'no', 'en'] | True |
test_icon_template | (hass, calls) | Test icon template. | Test icon template. | async def test_icon_template(hass, calls):
"""Test icon template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers"... | [
"async",
"def",
"test_icon_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
862,
0
] | [
903,
50
] | python | en | ['en', 'en', 'en'] | True |
test_entity_picture_template | (hass, calls) | Test icon template. | Test icon template. | async def test_entity_picture_template(hass, calls):
"""Test icon template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_entity_picture_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"c... | [
906,
0
] | [
947,
67
] | python | en | ['en', 'en', 'en'] | True |
test_availability_template | (hass, calls) | Test availability template. | Test availability template. | async def test_availability_template(hass, calls):
"""Test availability template."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_availability_template",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cov... | [
950,
0
] | [
989,
82
] | python | en | ['en', 'ga', 'en'] | True |
test_availability_without_availability_template | (hass, calls) | Test that component is available if there is no. | Test that component is available if there is no. | async def test_availability_without_availability_template(hass, calls):
"""Test that component is available if there is no."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {
... | [
"async",
"def",
"test_availability_without_availability_template",
"(",
"hass",
",",
"calls",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
"... | [
992,
0
] | [
1022,
43
] | python | en | ['en', 'en', 'en'] | True |
test_invalid_availability_template_keeps_component_available | (hass, caplog) | Test that an invalid availability keeps the device available. | Test that an invalid availability keeps the device available. | async def test_invalid_availability_template_keeps_component_available(hass, caplog):
"""Test that an invalid availability keeps the device available."""
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
... | [
"async",
"def",
"test_invalid_availability_template_keeps_component_available",
"(",
"hass",
",",
"caplog",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"te... | [
1025,
0
] | [
1056,
62
] | python | en | ['en', 'en', 'en'] | True |
test_device_class | (hass, calls) | Test device class. | Test device class. | async def test_device_class(hass, calls):
"""Test device class."""
with assert_setup_component(1, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": ... | [
"async",
"def",
"test_device_class",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
... | [
1059,
0
] | [
1091,
57
] | python | en | ['fr', 'en', 'en'] | True |
test_invalid_device_class | (hass, calls) | Test device class. | Test device class. | async def test_invalid_device_class(hass, calls):
"""Test device class."""
with assert_setup_component(0, "cover"):
assert await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"c... | [
"async",
"def",
"test_invalid_device_class",
"(",
"hass",
",",
"calls",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"cover\"",
")",
":",
"assert",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cove... | [
1094,
0
] | [
1126,
20
] | python | en | ['fr', 'en', 'en'] | True |
test_unique_id | (hass) | Test unique_id option only creates one cover per id. | Test unique_id option only creates one cover per id. | async def test_unique_id(hass):
"""Test unique_id option only creates one cover per id."""
await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"covers": {
"test_template_cover_01": {
... | [
"async",
"def",
"test_unique_id",
"(",
"hass",
")",
":",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",
"\"cover\"",
":",
"{",
"\"platform\"",
":",
"\"template\"",
",",
"\"covers\"",
":",
"{",
"\"test_template_cover_01\"... | [
1129,
0
] | [
1171,
44
] | python | en | ['en', 'en', 'en'] | True |
test_state_gets_lowercased | (hass) | Test True/False is lowercased. | Test True/False is lowercased. | async def test_state_gets_lowercased(hass):
"""Test True/False is lowercased."""
hass.states.async_set("binary_sensor.garage_door_sensor", "off")
await setup.async_setup_component(
hass,
"cover",
{
"cover": {
"platform": "template",
"cove... | [
"async",
"def",
"test_state_gets_lowercased",
"(",
"hass",
")",
":",
"hass",
".",
"states",
".",
"async_set",
"(",
"\"binary_sensor.garage_door_sensor\"",
",",
"\"off\"",
")",
"await",
"setup",
".",
"async_setup_component",
"(",
"hass",
",",
"\"cover\"",
",",
"{",... | [
1174,
0
] | [
1212,
69
] | python | en | ['en', 'et', 'en'] | True |
test_self_referencing_icon_with_no_template_is_not_a_loop | (hass, caplog) | Test a self referencing icon with no value template is not a loop. | Test a self referencing icon with no value template is not a loop. | async def test_self_referencing_icon_with_no_template_is_not_a_loop(hass, caplog):
"""Test a self referencing icon with no value template is not a loop."""
icon_template_str = """{% if is_state('cover.office', 'open') %}
mdi:window-shutter-open
{% else %}
mdi:window-shutter
... | [
"async",
"def",
"test_self_referencing_icon_with_no_template_is_not_a_loop",
"(",
"hass",
",",
"caplog",
")",
":",
"icon_template_str",
"=",
"\"\"\"{% if is_state('cover.office', 'open') %}\n mdi:window-shutter-open\n {% else %}\n mdi:window-shutter\n {%... | [
1215,
0
] | [
1257,
54
] | python | en | ['en', 'en', 'en'] | True |
_default_key_normalizer | (key_class, request_context) |
Create a pool key out of a request context dictionary.
According to RFC 3986, both the scheme and host are case-insensitive.
Therefore, this function normalizes both before constructing the pool
key for an HTTPS request. If you wish to change this behaviour, provide
alternate callables to ``key_fn... |
Create a pool key out of a request context dictionary. | def _default_key_normalizer(key_class, request_context):
"""
Create a pool key out of a request context dictionary.
According to RFC 3986, both the scheme and host are case-insensitive.
Therefore, this function normalizes both before constructing the pool
key for an HTTPS request. If you wish to ch... | [
"def",
"_default_key_normalizer",
"(",
"key_class",
",",
"request_context",
")",
":",
"# Since we mutate the dictionary, make a copy first",
"context",
"=",
"request_context",
".",
"copy",
"(",
")",
"context",
"[",
"\"scheme\"",
"]",
"=",
"context",
"[",
"\"scheme\"",
... | [
73,
0
] | [
119,
31
] | python | en | ['en', 'error', 'th'] | False |
PoolManager._new_pool | (self, scheme, host, port, request_context=None) |
Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments.
If ``request_context`` is provided, it is provided as keyword arguments
to the pool class used. This method is used to actually create the
connection pools handed out by... |
Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments. | def _new_pool(self, scheme, host, port, request_context=None):
"""
Create a new :class:`ConnectionPool` based on host, port, scheme, and
any additional pool keyword arguments.
If ``request_context`` is provided, it is provided as keyword arguments
to the pool class used. This me... | [
"def",
"_new_pool",
"(",
"self",
",",
"scheme",
",",
"host",
",",
"port",
",",
"request_context",
"=",
"None",
")",
":",
"pool_cls",
"=",
"self",
".",
"pool_classes_by_scheme",
"[",
"scheme",
"]",
"if",
"request_context",
"is",
"None",
":",
"request_context"... | [
182,
4
] | [
207,
54
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.clear | (self) |
Empty our store of pools and direct them all to close.
This will not affect in-flight connections, but they will not be
re-used after completion.
|
Empty our store of pools and direct them all to close. | def clear(self):
"""
Empty our store of pools and direct them all to close.
This will not affect in-flight connections, but they will not be
re-used after completion.
"""
self.pools.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"self",
".",
"pools",
".",
"clear",
"(",
")"
] | [
209,
4
] | [
216,
26
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.connection_from_host | (self, host, port=None, scheme="http", pool_kwargs=None) |
Get a :class:`ConnectionPool` based on the host, port, and scheme.
If ``port`` isn't given, it will be derived from the ``scheme`` using
``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is
provided, it is merged with the instance's ``connection_pool_kw``
variable a... |
Get a :class:`ConnectionPool` based on the host, port, and scheme. | def connection_from_host(self, host, port=None, scheme="http", pool_kwargs=None):
"""
Get a :class:`ConnectionPool` based on the host, port, and scheme.
If ``port`` isn't given, it will be derived from the ``scheme`` using
``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is... | [
"def",
"connection_from_host",
"(",
"self",
",",
"host",
",",
"port",
"=",
"None",
",",
"scheme",
"=",
"\"http\"",
",",
"pool_kwargs",
"=",
"None",
")",
":",
"if",
"not",
"host",
":",
"raise",
"LocationValueError",
"(",
"\"No host specified.\"",
")",
"reques... | [
218,
4
] | [
239,
60
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.connection_from_context | (self, request_context) |
Get a :class:`ConnectionPool` based on the request context.
``request_context`` must at least contain the ``scheme`` key and its
value must be a key in ``key_fn_by_scheme`` instance variable.
|
Get a :class:`ConnectionPool` based on the request context. | def connection_from_context(self, request_context):
"""
Get a :class:`ConnectionPool` based on the request context.
``request_context`` must at least contain the ``scheme`` key and its
value must be a key in ``key_fn_by_scheme`` instance variable.
"""
scheme = request_co... | [
"def",
"connection_from_context",
"(",
"self",
",",
"request_context",
")",
":",
"scheme",
"=",
"request_context",
"[",
"\"scheme\"",
"]",
".",
"lower",
"(",
")",
"pool_key_constructor",
"=",
"self",
".",
"key_fn_by_scheme",
"[",
"scheme",
"]",
"pool_key",
"=",
... | [
241,
4
] | [
252,
87
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.connection_from_pool_key | (self, pool_key, request_context=None) |
Get a :class:`ConnectionPool` based on the provided pool key.
``pool_key`` should be a namedtuple that only contains immutable
objects. At a minimum it must have the ``scheme``, ``host``, and
``port`` fields.
|
Get a :class:`ConnectionPool` based on the provided pool key. | def connection_from_pool_key(self, pool_key, request_context=None):
"""
Get a :class:`ConnectionPool` based on the provided pool key.
``pool_key`` should be a namedtuple that only contains immutable
objects. At a minimum it must have the ``scheme``, ``host``, and
``port`` fields... | [
"def",
"connection_from_pool_key",
"(",
"self",
",",
"pool_key",
",",
"request_context",
"=",
"None",
")",
":",
"with",
"self",
".",
"pools",
".",
"lock",
":",
"# If the scheme, host, or port doesn't match existing open",
"# connections, open a new ConnectionPool.",
"pool",... | [
254,
4
] | [
276,
19
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.connection_from_url | (self, url, pool_kwargs=None) |
Similar to :func:`urllib3.connectionpool.connection_from_url`.
If ``pool_kwargs`` is not provided and a new pool needs to be
constructed, ``self.connection_pool_kw`` is used to initialize
the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs``
is provided, it is ... |
Similar to :func:`urllib3.connectionpool.connection_from_url`. | def connection_from_url(self, url, pool_kwargs=None):
"""
Similar to :func:`urllib3.connectionpool.connection_from_url`.
If ``pool_kwargs`` is not provided and a new pool needs to be
constructed, ``self.connection_pool_kw`` is used to initialize
the :class:`urllib3.connectionpoo... | [
"def",
"connection_from_url",
"(",
"self",
",",
"url",
",",
"pool_kwargs",
"=",
"None",
")",
":",
"u",
"=",
"parse_url",
"(",
"url",
")",
"return",
"self",
".",
"connection_from_host",
"(",
"u",
".",
"host",
",",
"port",
"=",
"u",
".",
"port",
",",
"... | [
278,
4
] | [
292,
9
] | python | en | ['en', 'error', 'th'] | False |
PoolManager._merge_pool_kwargs | (self, override) |
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary.
|
Merge a dictionary of override values for self.connection_pool_kw. | def _merge_pool_kwargs(self, override):
"""
Merge a dictionary of override values for self.connection_pool_kw.
This does not modify self.connection_pool_kw and returns a new dict.
Any keys in the override dictionary with a value of ``None`` are
removed from the merged dictionary... | [
"def",
"_merge_pool_kwargs",
"(",
"self",
",",
"override",
")",
":",
"base_pool_kwargs",
"=",
"self",
".",
"connection_pool_kw",
".",
"copy",
"(",
")",
"if",
"override",
":",
"for",
"key",
",",
"value",
"in",
"override",
".",
"items",
"(",
")",
":",
"if"... | [
294,
4
] | [
312,
31
] | python | en | ['en', 'error', 'th'] | False |
PoolManager.urlopen | (self, method, url, redirect=True, **kw) |
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen`
with custom cross-host redirect logic and only sends the request-uri
portion of the ``url``.
The given ``url`` parameter must be absolute, such that an appropriate
:class:`urllib3.connectionpool.ConnectionPool` c... |
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen`
with custom cross-host redirect logic and only sends the request-uri
portion of the ``url``. | def urlopen(self, method, url, redirect=True, **kw):
"""
Same as :meth:`urllib3.connectionpool.HTTPConnectionPool.urlopen`
with custom cross-host redirect logic and only sends the request-uri
portion of the ``url``.
The given ``url`` parameter must be absolute, such that an appr... | [
"def",
"urlopen",
"(",
"self",
",",
"method",
",",
"url",
",",
"redirect",
"=",
"True",
",",
"*",
"*",
"kw",
")",
":",
"u",
"=",
"parse_url",
"(",
"url",
")",
"conn",
"=",
"self",
".",
"connection_from_host",
"(",
"u",
".",
"host",
",",
"port",
"... | [
314,
4
] | [
377,
60
] | python | en | ['en', 'error', 'th'] | False |
ProxyManager._set_proxy_headers | (self, url, headers=None) |
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
|
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
| def _set_proxy_headers(self, url, headers=None):
"""
Sets headers needed by proxies: specifically, the Accept and Host
headers. Only sets headers not provided by the user.
"""
headers_ = {"Accept": "*/*"}
netloc = parse_url(url).netloc
if netloc:
head... | [
"def",
"_set_proxy_headers",
"(",
"self",
",",
"url",
",",
"headers",
"=",
"None",
")",
":",
"headers_",
"=",
"{",
"\"Accept\"",
":",
"\"*/*\"",
"}",
"netloc",
"=",
"parse_url",
"(",
"url",
")",
".",
"netloc",
"if",
"netloc",
":",
"headers_",
"[",
"\"H... | [
448,
4
] | [
461,
23
] | python | en | ['en', 'error', 'th'] | False |
ProxyManager.urlopen | (self, method, url, redirect=True, **kw) | Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute. | Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute. | def urlopen(self, method, url, redirect=True, **kw):
"Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute."
u = parse_url(url)
self._validate_proxy_scheme_url_selection(u.scheme)
if u.scheme == "http":
# For proxied HTTPS requests, httplib sets the necessary head... | [
"def",
"urlopen",
"(",
"self",
",",
"method",
",",
"url",
",",
"redirect",
"=",
"True",
",",
"*",
"*",
"kw",
")",
":",
"u",
"=",
"parse_url",
"(",
"url",
")",
"self",
".",
"_validate_proxy_scheme_url_selection",
"(",
"u",
".",
"scheme",
")",
"if",
"u... | [
475,
4
] | [
487,
86
] | python | en | ['en', 'en', 'nl'] | True |
TestStoreController.test_delete_order | (self) | Test case for delete_order
Delete purchase order by ID
| Test case for delete_order | def test_delete_order(self):
"""Test case for delete_order
Delete purchase order by ID
"""
headers = {
}
response = self.client.open(
'/v2/store/order/{order_id}'.format(order_id='order_id_example'),
method='DELETE',
headers=headers)
... | [
"def",
"test_delete_order",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2/store/order/{order_id}'",
".",
"format",
"(",
"order_id",
"=",
"'order_id_example'",
")",
",",
"method",
"=",
"'DELET... | [
15,
4
] | [
27,
77
] | python | da | ['da', 'da', 'en'] | True |
TestStoreController.test_get_inventory | (self) | Test case for get_inventory
Returns pet inventories by status
| Test case for get_inventory | def test_get_inventory(self):
"""Test case for get_inventory
Returns pet inventories by status
"""
headers = {
'Accept': 'application/json',
'api_key': 'special-key',
}
response = self.client.open(
'/v2/store/inventory',
m... | [
"def",
"test_get_inventory",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'api_key'",
":",
"'special-key'",
",",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2/store/inventory'",
",",
"method",
... | [
29,
4
] | [
43,
77
] | python | en | ['en', 'en', 'en'] | True |
TestStoreController.test_get_order_by_id | (self) | Test case for get_order_by_id
Find purchase order by ID
| Test case for get_order_by_id | def test_get_order_by_id(self):
"""Test case for get_order_by_id
Find purchase order by ID
"""
headers = {
'Accept': 'application/json',
}
response = self.client.open(
'/v2/store/order/{order_id}'.format(order_id=5),
method='GET',
... | [
"def",
"test_get_order_by_id",
"(",
"self",
")",
":",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2/store/order/{order_id}'",
".",
"format",
"(",
"order_id",
"=",
"5",
")... | [
45,
4
] | [
58,
77
] | python | en | ['da', 'en', 'en'] | True |
TestStoreController.test_place_order | (self) | Test case for place_order
Place an order for a pet
| Test case for place_order | def test_place_order(self):
"""Test case for place_order
Place an order for a pet
"""
body = {}
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
}
response = self.client.open(
'/v2/store/order',
... | [
"def",
"test_place_order",
"(",
"self",
")",
":",
"body",
"=",
"{",
"}",
"headers",
"=",
"{",
"'Accept'",
":",
"'application/json'",
",",
"'Content-Type'",
":",
"'application/json'",
",",
"}",
"response",
"=",
"self",
".",
"client",
".",
"open",
"(",
"'/v2... | [
61,
4
] | [
78,
77
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass: HomeAssistant, entry: ConfigEntry) | Set up Profiler from a config entry. | Set up Profiler from a config entry. | async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Profiler from a config entry."""
lock = asyncio.Lock()
domain_data = hass.data[DOMAIN] = {}
async def _async_run_profile(call: ServiceCall):
async with lock:
await _async_generate_profile(hass, c... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
")",
"->",
"bool",
":",
"lock",
"=",
"asyncio",
".",
"Lock",
"(",
")",
"domain_data",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"=",
"{",
"}",... | [
53,
0
] | [
193,
15
] | python | en | ['en', 'en', 'en'] | True |
async_unload_entry | (hass: HomeAssistant, entry: ConfigEntry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
for service in SERVICES:
hass.services.async_remove(domain=DOMAIN, service=service)
if LOG_INTERVAL_SUB in hass.data[DOMAIN]:
hass.data[DOMAIN][LOG_INTERVAL_SUB]()
hass.data.pop(DO... | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
":",
"HomeAssistant",
",",
"entry",
":",
"ConfigEntry",
")",
"->",
"bool",
":",
"for",
"service",
"in",
"SERVICES",
":",
"hass",
".",
"services",
".",
"async_remove",
"(",
"domain",
"=",
"DOMAIN",
",",
"se... | [
196,
0
] | [
203,
15
] | python | en | ['en', 'es', 'en'] | True |
async_setup_entry | (hass, entry, async_add_entities) | Set up the StarLine sensors. | Set up the StarLine sensors. | async def async_setup_entry(hass, entry, async_add_entities):
"""Set up the StarLine sensors."""
account: StarlineAccount = hass.data[DOMAIN][entry.entry_id]
entities = [
sensor
for device in account.api.devices.values()
for description in BINARY_SENSOR_TYPES
if description.k... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"entry",
",",
"async_add_entities",
")",
":",
"account",
":",
"StarlineAccount",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"[",
"entry",
".",
"entry_id",
"]",
"entities",
"=",
"[",
"sensor",
"for",... | [
62,
0
] | [
72,
32
] | python | en | ['en', 'bs', 'en'] | True |
StarlineSensor.__init__ | (
self,
account: StarlineAccount,
device: StarlineDevice,
description: StarlineBinarySensorEntityDescription,
) | Initialize sensor. | Initialize sensor. | def __init__(
self,
account: StarlineAccount,
device: StarlineDevice,
description: StarlineBinarySensorEntityDescription,
) -> None:
"""Initialize sensor."""
super().__init__(account, device, description.key, description.name_)
self.entity_description = descri... | [
"def",
"__init__",
"(",
"self",
",",
"account",
":",
"StarlineAccount",
",",
"device",
":",
"StarlineDevice",
",",
"description",
":",
"StarlineBinarySensorEntityDescription",
",",
")",
"->",
"None",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"account",
","... | [
80,
4
] | [
88,
45
] | python | en | ['en', 'ro', 'it'] | False |
StarlineSensor.is_on | (self) | Return the state of the binary sensor. | Return the state of the binary sensor. | def is_on(self):
"""Return the state of the binary sensor."""
return self._device.car_state.get(self._key) | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"self",
".",
"_device",
".",
"car_state",
".",
"get",
"(",
"self",
".",
"_key",
")"
] | [
91,
4
] | [
93,
52
] | python | en | ['en', 'ig', 'en'] | True |
TestStringBooleanMap.testStringBooleanMap | (self) | Test StringBooleanMap | Test StringBooleanMap | def testStringBooleanMap(self):
"""Test StringBooleanMap"""
# FIXME: construct object with mandatory attributes with example values
# model = StringBooleanMap() # noqa: E501
pass | [
"def",
"testStringBooleanMap",
"(",
"self",
")",
":",
"# FIXME: construct object with mandatory attributes with example values",
"# model = StringBooleanMap() # noqa: E501",
"pass"
] | [
29,
4
] | [
33,
12
] | python | en | ['en', 'af', 'en'] | False |
_fr0 | (a) | fix rank-0 --> rank-1 | fix rank-0 --> rank-1 | def _fr0(a):
"""fix rank-0 --> rank-1"""
if a.ndim == 0:
a = a.copy()
a.shape = (1,)
return a | [
"def",
"_fr0",
"(",
"a",
")",
":",
"if",
"a",
".",
"ndim",
"==",
"0",
":",
"a",
"=",
"a",
".",
"copy",
"(",
")",
"a",
".",
"shape",
"=",
"(",
"1",
",",
")",
"return",
"a"
] | [
16,
0
] | [
21,
12
] | python | en | ['en', 'hu', 'en'] | True |
_fr1 | (a) | fix rank > 0 --> rank-0 | fix rank > 0 --> rank-0 | def _fr1(a):
"""fix rank > 0 --> rank-0"""
if a.size == 1:
a = a.copy()
a.shape = ()
return a | [
"def",
"_fr1",
"(",
"a",
")",
":",
"if",
"a",
".",
"size",
"==",
"1",
":",
"a",
"=",
"a",
".",
"copy",
"(",
")",
"a",
".",
"shape",
"=",
"(",
")",
"return",
"a"
] | [
24,
0
] | [
29,
12
] | python | en | ['en', 'hu', 'en'] | True |
_get_machar | (ftype) | Get MachAr instance or MachAr-like instance
Get parameters for floating point type, by first trying signatures of
various known floating point types, then, if none match, attempting to
identify parameters by analysis.
Parameters
----------
ftype : class
Numpy floating point type class... | Get MachAr instance or MachAr-like instance | def _get_machar(ftype):
""" Get MachAr instance or MachAr-like instance
Get parameters for floating point type, by first trying signatures of
various known floating point types, then, if none match, attempting to
identify parameters by analysis.
Parameters
----------
ftype : class
... | [
"def",
"_get_machar",
"(",
"ftype",
")",
":",
"params",
"=",
"_MACHAR_PARAMS",
".",
"get",
"(",
"ftype",
")",
"if",
"params",
"is",
"None",
":",
"raise",
"ValueError",
"(",
"repr",
"(",
"ftype",
")",
")",
"# Detect known / suspected types",
"key",
"=",
"ft... | [
236,
0
] | [
276,
36
] | python | en | ['en', 'de', 'en'] | True |
_discovered_machar | (ftype) | Create MachAr instance with found information on float types
| Create MachAr instance with found information on float types
| def _discovered_machar(ftype):
""" Create MachAr instance with found information on float types
"""
params = _MACHAR_PARAMS[ftype]
return MachAr(lambda v: array([v], ftype),
lambda v:_fr0(v.astype(params['itype']))[0],
lambda v:array(_fr0(v)[0], ftype),
... | [
"def",
"_discovered_machar",
"(",
"ftype",
")",
":",
"params",
"=",
"_MACHAR_PARAMS",
"[",
"ftype",
"]",
"return",
"MachAr",
"(",
"lambda",
"v",
":",
"array",
"(",
"[",
"v",
"]",
",",
"ftype",
")",
",",
"lambda",
"v",
":",
"_fr0",
"(",
"v",
".",
"a... | [
279,
0
] | [
287,
34
] | python | en | ['en', 'en', 'en'] | True |
get_mock_remote | (
request_error=None,
authorize_error=None,
encrypted=False,
app_id=None,
encryption_key=None,
device_info=MOCK_DEVICE_INFO,
) | Return a mock remote. | Return a mock remote. | def get_mock_remote(
request_error=None,
authorize_error=None,
encrypted=False,
app_id=None,
encryption_key=None,
device_info=MOCK_DEVICE_INFO,
):
"""Return a mock remote."""
mock_remote = Mock()
mock_remote.type = TV_TYPE_ENCRYPTED if encrypted else TV_TYPE_NONENCRYPTED
mock_re... | [
"def",
"get_mock_remote",
"(",
"request_error",
"=",
"None",
",",
"authorize_error",
"=",
"None",
",",
"encrypted",
"=",
"False",
",",
"app_id",
"=",
"None",
",",
"encryption_key",
"=",
"None",
",",
"device_info",
"=",
"MOCK_DEVICE_INFO",
",",
")",
":",
"moc... | [
50,
0
] | [
86,
22
] | python | en | ['en', 'co', 'en'] | True |
mock_remote_fixture | () | Patch the library remote. | Patch the library remote. | def mock_remote_fixture():
"""Patch the library remote."""
mock_remote = get_mock_remote()
with patch(
"homeassistant.components.panasonic_viera.RemoteControl",
return_value=mock_remote,
):
yield mock_remote | [
"def",
"mock_remote_fixture",
"(",
")",
":",
"mock_remote",
"=",
"get_mock_remote",
"(",
")",
"with",
"patch",
"(",
"\"homeassistant.components.panasonic_viera.RemoteControl\"",
",",
"return_value",
"=",
"mock_remote",
",",
")",
":",
"yield",
"mock_remote"
] | [
90,
0
] | [
98,
25
] | python | en | ['en', 'en', 'en'] | True |
init_integration | (hass: HomeAssistant, mock_remote: Mock) | Set up the Panasonic Viera integration for testing. | Set up the Panasonic Viera integration for testing. | async def init_integration(hass: HomeAssistant, mock_remote: Mock) -> MockConfigEntry:
"""Set up the Panasonic Viera integration for testing."""
mock_entry = MockConfigEntry(
domain=DOMAIN,
unique_id=MOCK_DEVICE_INFO[ATTR_UDN],
data={**MOCK_CONFIG_DATA, **MOCK_ENCRYPTION_DATA, **MOCK_DE... | [
"async",
"def",
"init_integration",
"(",
"hass",
":",
"HomeAssistant",
",",
"mock_remote",
":",
"Mock",
")",
"->",
"MockConfigEntry",
":",
"mock_entry",
"=",
"MockConfigEntry",
"(",
"domain",
"=",
"DOMAIN",
",",
"unique_id",
"=",
"MOCK_DEVICE_INFO",
"[",
"ATTR_U... | [
102,
0
] | [
116,
21
] | python | en | ['en', 'en', 'en'] | True |
async_setup | (hass: HomeAssistant, config: ConfigType) | Set up the NEW_NAME integration. | Set up the NEW_NAME integration. | async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the NEW_NAME integration."""
return True | [
"async",
"def",
"async_setup",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
":",
"ConfigType",
")",
"->",
"bool",
":",
"return",
"True"
] | [
13,
0
] | [
15,
15
] | python | en | ['en', 'en', 'en'] | True |
count_frequencies | (language_class: Language, input_path: Path) |
Given a file containing single documents per line
(for scispacy, these are Pubmed abstracts), split the text
using a science specific tokenizer and compute word and
document frequencies for all words.
|
Given a file containing single documents per line
(for scispacy, these are Pubmed abstracts), split the text
using a science specific tokenizer and compute word and
document frequencies for all words.
| def count_frequencies(language_class: Language, input_path: Path):
"""
Given a file containing single documents per line
(for scispacy, these are Pubmed abstracts), split the text
using a science specific tokenizer and compute word and
document frequencies for all words.
"""
print(f"Processi... | [
"def",
"count_frequencies",
"(",
"language_class",
":",
"Language",
",",
"input_path",
":",
"Path",
")",
":",
"print",
"(",
"f\"Processing {input_path}.\"",
")",
"tokenizer",
"=",
"combined_rule_tokenizer",
"(",
"language_class",
"(",
")",
")",
"counts",
"=",
"Cou... | [
21,
0
] | [
37,
29
] | python | en | ['en', 'error', 'th'] | False |
merge_counts | (frequencies: List[Tuple[Counter, Counter]], output_path: str) |
Merge a number of frequency counts generated from `count_frequencies`
into a single file, written to `output_path`.
|
Merge a number of frequency counts generated from `count_frequencies`
into a single file, written to `output_path`.
| def merge_counts(frequencies: List[Tuple[Counter, Counter]], output_path: str):
"""
Merge a number of frequency counts generated from `count_frequencies`
into a single file, written to `output_path`.
"""
counts = Counter()
doc_counts = Counter()
for word_count, doc_count in frequencies:
... | [
"def",
"merge_counts",
"(",
"frequencies",
":",
"List",
"[",
"Tuple",
"[",
"Counter",
",",
"Counter",
"]",
"]",
",",
"output_path",
":",
"str",
")",
":",
"counts",
"=",
"Counter",
"(",
")",
"doc_counts",
"=",
"Counter",
"(",
")",
"for",
"word_count",
"... | [
44,
0
] | [
57,
75
] | python | en | ['en', 'error', 'th'] | False |
setup_platform | (hass, config, add_entities, discovery_info=None) | Set up the platform. | Set up the platform. | def setup_platform(hass, config, add_entities, discovery_info=None):
"""Set up the platform."""
# Validate credentials by processing image.
api_key = config[CONF_API_KEY]
account_type = config[CONF_ACCOUNT_TYPE]
api = hound.cloud(api_key, account_type)
try:
api.detect(b"Test")
except... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discovery_info",
"=",
"None",
")",
":",
"# Validate credentials by processing image.",
"api_key",
"=",
"config",
"[",
"CONF_API_KEY",
"]",
"account_type",
"=",
"config",
"[",
"CONF_ACCOU... | [
45,
0
] | [
71,
26
] | python | en | ['en', 'da', 'en'] | True |
SighthoundEntity.process_image | (self, image) | Process an image. | Process an image. | def process_image(self, image):
"""Process an image."""
detections = self._api.detect(image)
people = hound.get_people(detections)
self._state = len(people)
if self._state > 0:
self._last_detection = dt_util.now().strftime(DATETIME_FORMAT)
metadata = hound.ge... | [
"def",
"process_image",
"(",
"self",
",",
"image",
")",
":",
"detections",
"=",
"self",
".",
"_api",
".",
"detect",
"(",
"image",
")",
"people",
"=",
"hound",
".",
"get_people",
"(",
"detections",
")",
"self",
".",
"_state",
"=",
"len",
"(",
"people",
... | [
97,
4
] | [
111,
66
] | python | en | ['en', 'su', 'en'] | True |
SighthoundEntity.fire_person_detected_event | (self, person) | Send event with detected total_persons. | Send event with detected total_persons. | def fire_person_detected_event(self, person):
"""Send event with detected total_persons."""
self.hass.bus.fire(
EVENT_PERSON_DETECTED,
{
ATTR_ENTITY_ID: self.entity_id,
ATTR_BOUNDING_BOX: hound.bbox_to_tf_style(
person["bounding... | [
"def",
"fire_person_detected_event",
"(",
"self",
",",
"person",
")",
":",
"self",
".",
"hass",
".",
"bus",
".",
"fire",
"(",
"EVENT_PERSON_DETECTED",
",",
"{",
"ATTR_ENTITY_ID",
":",
"self",
".",
"entity_id",
",",
"ATTR_BOUNDING_BOX",
":",
"hound",
".",
"bb... | [
113,
4
] | [
123,
9
] | python | en | ['en', 'en', 'en'] | True |
SighthoundEntity.save_image | (self, image, people, directory) | Save a timestamped image with bounding boxes around targets. | Save a timestamped image with bounding boxes around targets. | def save_image(self, image, people, directory):
"""Save a timestamped image with bounding boxes around targets."""
try:
img = Image.open(io.BytesIO(bytearray(image))).convert("RGB")
except UnidentifiedImageError:
_LOGGER.warning("Sighthound unable to process image, bad da... | [
"def",
"save_image",
"(",
"self",
",",
"image",
",",
"people",
",",
"directory",
")",
":",
"try",
":",
"img",
"=",
"Image",
".",
"open",
"(",
"io",
".",
"BytesIO",
"(",
"bytearray",
"(",
"image",
")",
")",
")",
".",
"convert",
"(",
"\"RGB\"",
")",
... | [
125,
4
] | [
146,
73
] | python | en | ['en', 'en', 'en'] | True |
SighthoundEntity.camera_entity | (self) | Return camera entity id from process pictures. | Return camera entity id from process pictures. | def camera_entity(self):
"""Return camera entity id from process pictures."""
return self._camera | [
"def",
"camera_entity",
"(",
"self",
")",
":",
"return",
"self",
".",
"_camera"
] | [
149,
4
] | [
151,
27
] | python | en | ['en', 'en', 'en'] | True |
SighthoundEntity.name | (self) | Return the name of the sensor. | Return the name of the sensor. | def name(self):
"""Return the name of the sensor."""
return self._name | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
".",
"_name"
] | [
154,
4
] | [
156,
25
] | python | en | ['en', 'mi', 'en'] | True |
SighthoundEntity.should_poll | (self) | Return the polling state. | Return the polling state. | def should_poll(self):
"""Return the polling state."""
return False | [
"def",
"should_poll",
"(",
"self",
")",
":",
"return",
"False"
] | [
159,
4
] | [
161,
20
] | python | en | ['en', 'en', 'en'] | True |
SighthoundEntity.state | (self) | Return the state of the entity. | Return the state of the entity. | def state(self):
"""Return the state of the entity."""
return self._state | [
"def",
"state",
"(",
"self",
")",
":",
"return",
"self",
".",
"_state"
] | [
164,
4
] | [
166,
26
] | python | en | ['en', 'en', 'en'] | True |
SighthoundEntity.extra_state_attributes | (self) | Return the attributes. | Return the attributes. | def extra_state_attributes(self):
"""Return the attributes."""
if not self._last_detection:
return {}
return {"last_person": self._last_detection} | [
"def",
"extra_state_attributes",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"_last_detection",
":",
"return",
"{",
"}",
"return",
"{",
"\"last_person\"",
":",
"self",
".",
"_last_detection",
"}"
] | [
169,
4
] | [
173,
52
] | python | en | ['en', 'la', 'en'] | True |
test_async_match_state | () | Test async_match_state helper. | Test async_match_state helper. | def test_async_match_state():
"""Test async_match_state helper."""
state1 = State("light.kitchen", "on")
state2 = State("switch.kitchen", "on")
state = intent.async_match_state(None, "kitch", [state1, state2])
assert state is state1 | [
"def",
"test_async_match_state",
"(",
")",
":",
"state1",
"=",
"State",
"(",
"\"light.kitchen\"",
",",
"\"on\"",
")",
"state2",
"=",
"State",
"(",
"\"switch.kitchen\"",
",",
"\"on\"",
")",
"state",
"=",
"intent",
".",
"async_match_state",
"(",
"None",
",",
"... | [
17,
0
] | [
23,
26
] | python | en | ['en', 'cy', 'en'] | True |
test_async_validate_slots | () | Test async_validate_slots of IntentHandler. | Test async_validate_slots of IntentHandler. | def test_async_validate_slots():
"""Test async_validate_slots of IntentHandler."""
handler1 = MockIntentHandler({vol.Required("name"): cv.string})
with pytest.raises(vol.error.MultipleInvalid):
handler1.async_validate_slots({})
with pytest.raises(vol.error.MultipleInvalid):
handler1.asy... | [
"def",
"test_async_validate_slots",
"(",
")",
":",
"handler1",
"=",
"MockIntentHandler",
"(",
"{",
"vol",
".",
"Required",
"(",
"\"name\"",
")",
":",
"cv",
".",
"string",
"}",
")",
"with",
"pytest",
".",
"raises",
"(",
"vol",
".",
"error",
".",
"Multiple... | [
26,
0
] | [
39,
5
] | python | en | ['en', 'en', 'en'] | True |
test_fuzzy_match | () | Test _fuzzymatch. | Test _fuzzymatch. | def test_fuzzy_match():
"""Test _fuzzymatch."""
state1 = State("light.living_room_northwest", "off")
state2 = State("light.living_room_north", "off")
state3 = State("light.living_room_northeast", "off")
state4 = State("light.living_room_west", "off")
state5 = State("light.living_room", "off")
... | [
"def",
"test_fuzzy_match",
"(",
")",
":",
"state1",
"=",
"State",
"(",
"\"light.living_room_northwest\"",
",",
"\"off\"",
")",
"state2",
"=",
"State",
"(",
"\"light.living_room_north\"",
",",
"\"off\"",
")",
"state3",
"=",
"State",
"(",
"\"light.living_room_northeas... | [
42,
0
] | [
57,
26
] | python | pl | ['pl', 'pl', 'it'] | False |
MockIntentHandler.__init__ | (self, slot_schema) | Initialize the mock handler. | Initialize the mock handler. | def __init__(self, slot_schema):
"""Initialize the mock handler."""
self.slot_schema = slot_schema | [
"def",
"__init__",
"(",
"self",
",",
"slot_schema",
")",
":",
"self",
".",
"slot_schema",
"=",
"slot_schema"
] | [
12,
4
] | [
14,
38
] | python | en | ['en', 'en', 'en'] | True |
test_valid_config | (hass) | Test configuration. | Test configuration. | async def test_valid_config(hass):
"""Test configuration."""
assert await async_setup_component(
hass,
"switch",
{
"switch": {
"platform": "flux",
"name": "flux",
"lights": ["light.desk", "light.lamp"],
}
},
... | [
"async",
"def",
"test_valid_config",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
"{",
"\"switch\"",
":",
"{",
"\"platform\"",
":",
"\"flux\"",
",",
"\"name\"",
":",
"\"flux\"",
",",
"\"lights\"",
":",... | [
25,
0
] | [
41,
31
] | python | en | ['en', 'fr', 'en'] | False |
test_restore_state_last_on | (hass) | Test restoring state when the last state is on. | Test restoring state when the last state is on. | async def test_restore_state_last_on(hass):
"""Test restoring state when the last state is on."""
mock_restore_cache(hass, [State("switch.flux", "on")])
assert await async_setup_component(
hass,
"switch",
{
"switch": {
"platform": "flux",
... | [
"async",
"def",
"test_restore_state_last_on",
"(",
"hass",
")",
":",
"mock_restore_cache",
"(",
"hass",
",",
"[",
"State",
"(",
"\"switch.flux\"",
",",
"\"on\"",
")",
"]",
")",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
"{... | [
44,
0
] | [
63,
30
] | python | en | ['en', 'en', 'en'] | True |
test_restore_state_last_off | (hass) | Test restoring state when the last state is off. | Test restoring state when the last state is off. | async def test_restore_state_last_off(hass):
"""Test restoring state when the last state is off."""
mock_restore_cache(hass, [State("switch.flux", "off")])
assert await async_setup_component(
hass,
"switch",
{
"switch": {
"platform": "flux",
... | [
"async",
"def",
"test_restore_state_last_off",
"(",
"hass",
")",
":",
"mock_restore_cache",
"(",
"hass",
",",
"[",
"State",
"(",
"\"switch.flux\"",
",",
"\"off\"",
")",
"]",
")",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
... | [
66,
0
] | [
85,
31
] | python | en | ['en', 'en', 'en'] | True |
test_valid_config_with_info | (hass) | Test configuration. | Test configuration. | async def test_valid_config_with_info(hass):
"""Test configuration."""
assert await async_setup_component(
hass,
"switch",
{
"switch": {
"platform": "flux",
"name": "flux",
"lights": ["light.desk", "light.lamp"],
... | [
"async",
"def",
"test_valid_config_with_info",
"(",
"hass",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
"{",
"\"switch\"",
":",
"{",
"\"platform\"",
":",
"\"flux\"",
",",
"\"name\"",
":",
"\"flux\"",
",",
"\"lights\... | [
88,
0
] | [
106,
38
] | python | en | ['en', 'fr', 'en'] | False |
test_valid_config_no_name | (hass) | Test configuration. | Test configuration. | async def test_valid_config_no_name(hass):
"""Test configuration."""
with assert_setup_component(1, "switch"):
assert await async_setup_component(
hass,
"switch",
{"switch": {"platform": "flux", "lights": ["light.desk", "light.lamp"]}},
)
await hass.as... | [
"async",
"def",
"test_valid_config_no_name",
"(",
"hass",
")",
":",
"with",
"assert_setup_component",
"(",
"1",
",",
"\"switch\"",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
"{",
"\"switch\"",
":",
"{",
"\"platform... | [
109,
0
] | [
117,
42
] | python | en | ['en', 'fr', 'en'] | False |
test_invalid_config_no_lights | (hass) | Test configuration. | Test configuration. | async def test_invalid_config_no_lights(hass):
"""Test configuration."""
with assert_setup_component(0, "switch"):
assert await async_setup_component(
hass, "switch", {"switch": {"platform": "flux", "name": "flux"}}
)
await hass.async_block_till_done() | [
"async",
"def",
"test_invalid_config_no_lights",
"(",
"hass",
")",
":",
"with",
"assert_setup_component",
"(",
"0",
",",
"\"switch\"",
")",
":",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"\"switch\"",
",",
"{",
"\"switch\"",
":",
"{",
"\"plat... | [
120,
0
] | [
126,
42
] | python | en | ['en', 'fr', 'en'] | False |
test_flux_when_switch_is_off | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch when it is off. | Test the flux switch when it is off. | async def test_flux_when_switch_is_off(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch when it is off."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFOR... | [
"async",
"def",
"test_flux_when_switch_is_off",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")",
"asse... | [
129,
0
] | [
179,
28
] | python | en | ['en', 'en', 'en'] | True |
test_flux_before_sunrise | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch before sunrise. | Test the flux switch before sunrise. | async def test_flux_before_sunrise(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch before sunrise."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light.DOMAIN: {CONF_PLATFORM: "... | [
"async",
"def",
"test_flux_before_sunrise",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")",
"assert",... | [
182,
0
] | [
240,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_before_sunrise_known_location | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch before sunrise. | Test the flux switch before sunrise. | async def test_flux_before_sunrise_known_location(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch before sunrise."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light.DOMAIN: {C... | [
"async",
"def",
"test_flux_before_sunrise_known_location",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
"... | [
243,
0
] | [
300,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_after_sunrise_before_sunset | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch after sunrise and before sunset. | Test the flux switch after sunrise and before sunset. | async def test_flux_after_sunrise_before_sunset(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch after sunrise and before sunset."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {l... | [
"async",
"def",
"test_flux_after_sunrise_before_sunset",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")"... | [
304,
0
] | [
361,
58
] | python | en | ['en', 'en', 'en'] | True |
test_flux_after_sunset_before_stop | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch after sunset and before stop. | Test the flux switch after sunset and before stop. | async def test_flux_after_sunset_before_stop(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch after sunset and before stop."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light.D... | [
"async",
"def",
"test_flux_after_sunset_before_stop",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")",
... | [
365,
0
] | [
423,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_after_stop_before_sunrise | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch after stop and before sunrise. | Test the flux switch after stop and before sunrise. | async def test_flux_after_stop_before_sunrise(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch after stop and before sunrise."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light... | [
"async",
"def",
"test_flux_after_stop_before_sunrise",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")",
... | [
427,
0
] | [
484,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_with_custom_start_stop_times | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux with custom start and stop times. | Test the flux with custom start and stop times. | async def test_flux_with_custom_start_stop_times(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux with custom start and stop times."""
platform = getattr(hass.components, "test.light")
platform.init()
assert await async_setup_component(
hass, light.DOMAIN, {light.... | [
"async",
"def",
"test_flux_with_custom_start_stop_times",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")... | [
488,
0
] | [
547,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_before_sunrise_stop_next_day | (
hass, legacy_patchable_time, enable_custom_integrations
) | Test the flux switch before sunrise.
This test has the stop_time on the next day (after midnight).
| Test the flux switch before sunrise. | async def test_flux_before_sunrise_stop_next_day(
hass, legacy_patchable_time, enable_custom_integrations
):
"""Test the flux switch before sunrise.
This test has the stop_time on the next day (after midnight).
"""
platform = getattr(hass.components, "test.light")
platform.init()
assert awa... | [
"async",
"def",
"test_flux_before_sunrise_stop_next_day",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init",
"(",
")... | [
550,
0
] | [
611,
59
] | python | en | ['en', 'en', 'en'] | True |
test_flux_after_sunrise_before_sunset_stop_next_day | (
hass, legacy_patchable_time, enable_custom_integrations
) |
Test the flux switch after sunrise and before sunset.
This test has the stop_time on the next day (after midnight).
|
Test the flux switch after sunrise and before sunset. | async def test_flux_after_sunrise_before_sunset_stop_next_day(
hass, legacy_patchable_time, enable_custom_integrations
):
"""
Test the flux switch after sunrise and before sunset.
This test has the stop_time on the next day (after midnight).
"""
platform = getattr(hass.components, "test.light")... | [
"async",
"def",
"test_flux_after_sunrise_before_sunset_stop_next_day",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
".",
"init"... | [
615,
0
] | [
677,
58
] | python | en | ['en', 'error', 'th'] | False |
test_flux_after_sunset_before_midnight_stop_next_day | (
hass, legacy_patchable_time, x, enable_custom_integrations
) | Test the flux switch after sunset and before stop.
This test has the stop_time on the next day (after midnight).
| Test the flux switch after sunset and before stop. | async def test_flux_after_sunset_before_midnight_stop_next_day(
hass, legacy_patchable_time, x, enable_custom_integrations
):
"""Test the flux switch after sunset and before stop.
This test has the stop_time on the next day (after midnight).
"""
platform = getattr(hass.components, "test.light")
... | [
"async",
"def",
"test_flux_after_sunset_before_midnight_stop_next_day",
"(",
"hass",
",",
"legacy_patchable_time",
",",
"x",
",",
"enable_custom_integrations",
")",
":",
"platform",
"=",
"getattr",
"(",
"hass",
".",
"components",
",",
"\"test.light\"",
")",
"platform",
... | [
682,
0
] | [
743,
59
] | 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.