Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
test_reload | (hass, hass_admin_user, hass_read_only_user) | Test reload service. | Test reload service. | async def test_reload(hass, hass_admin_user, hass_read_only_user):
"""Test reload service."""
count_start = len(hass.states.async_entity_ids())
ent_reg = er.async_get(hass)
assert await async_setup_component(
hass,
DOMAIN,
{
DOMAIN: {
"test_1": {
... | [
"async",
"def",
"test_reload",
"(",
"hass",
",",
"hass_admin_user",
",",
"hass_read_only_user",
")",
":",
"count_start",
"=",
"len",
"(",
"hass",
".",
"states",
".",
"async_entity_ids",
"(",
")",
")",
"ent_reg",
"=",
"er",
".",
"async_get",
"(",
"hass",
")... | [
424,
0
] | [
505,
76
] | python | en | ['en', 'da', 'en'] | True |
test_load_from_storage | (hass, storage_setup) | Test set up from storage. | Test set up from storage. | async def test_load_from_storage(hass, storage_setup):
"""Test set up from storage."""
assert await storage_setup()
state = hass.states.get(f"{DOMAIN}.from_storage")
assert state.state == "storage option 1"
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "from storage"
assert state.attributes... | [
"async",
"def",
"test_load_from_storage",
"(",
"hass",
",",
"storage_setup",
")",
":",
"assert",
"await",
"storage_setup",
"(",
")",
"state",
"=",
"hass",
".",
"states",
".",
"get",
"(",
"f\"{DOMAIN}.from_storage\"",
")",
"assert",
"state",
".",
"state",
"==",... | [
508,
0
] | [
514,
46
] | python | en | ['en', 'en', 'en'] | True |
test_editable_state_attribute | (hass, storage_setup) | Test editable attribute. | Test editable attribute. | async def test_editable_state_attribute(hass, storage_setup):
"""Test editable attribute."""
assert await storage_setup(
config={DOMAIN: {"from_yaml": {"options": ["yaml option", "other option"]}}}
)
state = hass.states.get(f"{DOMAIN}.from_storage")
assert state.state == "storage option 1"
... | [
"async",
"def",
"test_editable_state_attribute",
"(",
"hass",
",",
"storage_setup",
")",
":",
"assert",
"await",
"storage_setup",
"(",
"config",
"=",
"{",
"DOMAIN",
":",
"{",
"\"from_yaml\"",
":",
"{",
"\"options\"",
":",
"[",
"\"yaml option\"",
",",
"\"other op... | [
517,
0
] | [
530,
50
] | python | de | ['de', 'et', 'en'] | False |
test_ws_list | (hass, hass_ws_client, storage_setup) | Test listing via WS. | Test listing via WS. | async def test_ws_list(hass, hass_ws_client, storage_setup):
"""Test listing via WS."""
assert await storage_setup(
config={DOMAIN: {"from_yaml": {"options": ["yaml option"]}}}
)
client = await hass_ws_client(hass)
await client.send_json({"id": 6, "type": f"{DOMAIN}/list"})
resp = awai... | [
"async",
"def",
"test_ws_list",
"(",
"hass",
",",
"hass_ws_client",
",",
"storage_setup",
")",
":",
"assert",
"await",
"storage_setup",
"(",
"config",
"=",
"{",
"DOMAIN",
":",
"{",
"\"from_yaml\"",
":",
"{",
"\"options\"",
":",
"[",
"\"yaml option\"",
"]",
"... | [
533,
0
] | [
552,
59
] | python | hmn | ['nl', 'hmn', 'it'] | False |
test_ws_delete | (hass, hass_ws_client, storage_setup) | Test WS delete cleans up entity registry. | Test WS delete cleans up entity registry. | async def test_ws_delete(hass, hass_ws_client, storage_setup):
"""Test WS delete cleans up entity registry."""
assert await storage_setup()
input_id = "from_storage"
input_entity_id = f"{DOMAIN}.{input_id}"
ent_reg = er.async_get(hass)
state = hass.states.get(input_entity_id)
assert state ... | [
"async",
"def",
"test_ws_delete",
"(",
"hass",
",",
"hass_ws_client",
",",
"storage_setup",
")",
":",
"assert",
"await",
"storage_setup",
"(",
")",
"input_id",
"=",
"\"from_storage\"",
"input_entity_id",
"=",
"f\"{DOMAIN}.{input_id}\"",
"ent_reg",
"=",
"er",
".",
... | [
555,
0
] | [
577,
72
] | python | en | ['en', 'en', 'en'] | True |
test_update | (hass, hass_ws_client, storage_setup) | Test updating min/max updates the state. | Test updating min/max updates the state. | async def test_update(hass, hass_ws_client, storage_setup):
"""Test updating min/max updates the state."""
items = [
{
"id": "from_storage",
"name": "from storage",
"options": ["yaml update 1", "yaml update 2"],
}
]
assert await storage_setup(items)
... | [
"async",
"def",
"test_update",
"(",
"hass",
",",
"hass_ws_client",
",",
"storage_setup",
")",
":",
"items",
"=",
"[",
"{",
"\"id\"",
":",
"\"from_storage\"",
",",
"\"name\"",
":",
"\"from storage\"",
",",
"\"options\"",
":",
"[",
"\"yaml update 1\"",
",",
"\"y... | [
580,
0
] | [
626,
30
] | python | en | ['en', 'en', 'en'] | True |
test_ws_create | (hass, hass_ws_client, storage_setup) | Test create WS. | Test create WS. | async def test_ws_create(hass, hass_ws_client, storage_setup):
"""Test create WS."""
assert await storage_setup(items=[])
input_id = "new_input"
input_entity_id = f"{DOMAIN}.{input_id}"
ent_reg = er.async_get(hass)
state = hass.states.get(input_entity_id)
assert state is None
assert en... | [
"async",
"def",
"test_ws_create",
"(",
"hass",
",",
"hass_ws_client",
",",
"storage_setup",
")",
":",
"assert",
"await",
"storage_setup",
"(",
"items",
"=",
"[",
"]",
")",
"input_id",
"=",
"\"new_input\"",
"input_entity_id",
"=",
"f\"{DOMAIN}.{input_id}\"",
"ent_r... | [
629,
0
] | [
656,
45
] | python | en | ['en', 'gd', 'en'] | True |
test_setup_no_config | (hass, hass_admin_user) | Test component setup with no config. | Test component setup with no config. | async def test_setup_no_config(hass, hass_admin_user):
"""Test component setup with no config."""
count_start = len(hass.states.async_entity_ids())
assert await async_setup_component(hass, DOMAIN, {})
with patch(
"homeassistant.config.load_yaml_config_file", autospec=True, return_value={}
)... | [
"async",
"def",
"test_setup_no_config",
"(",
"hass",
",",
"hass_admin_user",
")",
":",
"count_start",
"=",
"len",
"(",
"hass",
".",
"states",
".",
"async_entity_ids",
"(",
")",
")",
"assert",
"await",
"async_setup_component",
"(",
"hass",
",",
"DOMAIN",
",",
... | [
659,
0
] | [
675,
61
] | python | en | ['en', 'pt', 'en'] | True |
initialize | (hass, client_id, client_secret) | Initialize a local auth provider. | Initialize a local auth provider. | def initialize(hass, client_id, client_secret):
"""Initialize a local auth provider."""
register_flow_implementation(
hass,
DOMAIN,
"configuration.yaml",
partial(generate_auth_url, client_id),
partial(resolve_auth_code, hass, client_id, client_secret),
) | [
"def",
"initialize",
"(",
"hass",
",",
"client_id",
",",
"client_secret",
")",
":",
"register_flow_implementation",
"(",
"hass",
",",
"DOMAIN",
",",
"\"configuration.yaml\"",
",",
"partial",
"(",
"generate_auth_url",
",",
"client_id",
")",
",",
"partial",
"(",
"... | [
14,
0
] | [
22,
5
] | python | en | ['en', 'en', 'en'] | True |
generate_auth_url | (client_id, flow_id) | Generate an authorize url. | Generate an authorize url. | async def generate_auth_url(client_id, flow_id):
"""Generate an authorize url."""
return AUTHORIZE_URL.format(client_id, flow_id) | [
"async",
"def",
"generate_auth_url",
"(",
"client_id",
",",
"flow_id",
")",
":",
"return",
"AUTHORIZE_URL",
".",
"format",
"(",
"client_id",
",",
"flow_id",
")"
] | [
25,
0
] | [
27,
51
] | python | en | ['de', 'en', 'en'] | True |
resolve_auth_code | (hass, client_id, client_secret, code) | Resolve an authorization code. | Resolve an authorization code. | async def resolve_auth_code(hass, client_id, client_secret, code):
"""Resolve an authorization code."""
result = asyncio.Future()
auth = NestAuth(
client_id=client_id,
client_secret=client_secret,
auth_callback=result.set_result,
)
auth.pin = code
try:
await has... | [
"async",
"def",
"resolve_auth_code",
"(",
"hass",
",",
"client_id",
",",
"client_secret",
",",
"code",
")",
":",
"result",
"=",
"asyncio",
".",
"Future",
"(",
")",
"auth",
"=",
"NestAuth",
"(",
"client_id",
"=",
"client_id",
",",
"client_secret",
"=",
"cli... | [
30,
0
] | [
49,
18
] | python | en | ['de', 'en', 'en'] | True |
TRIGGER_SCHEMA | (value: Any) | Validate trigger. | Validate trigger. | def TRIGGER_SCHEMA(value: Any) -> dict: # pylint: disable=invalid-name
"""Validate trigger."""
if not isinstance(value, dict):
raise vol.Invalid("Expected a dictionary")
# We use this approach instead of vol.Any because
# this gives better error messages.
if CONF_ATTRIBUTE in value:
... | [
"def",
"TRIGGER_SCHEMA",
"(",
"value",
":",
"Any",
")",
"->",
"dict",
":",
"# pylint: disable=invalid-name",
"if",
"not",
"isinstance",
"(",
"value",
",",
"dict",
")",
":",
"raise",
"vol",
".",
"Invalid",
"(",
"\"Expected a dictionary\"",
")",
"# We use this app... | [
54,
0
] | [
64,
38
] | python | en | ['en', 'sv', 'en'] | False |
async_attach_trigger | (
hass: HomeAssistant,
config,
action,
automation_info,
*,
platform_type: str = "state",
) | Listen for state changes based on configuration. | Listen for state changes based on configuration. | async def async_attach_trigger(
hass: HomeAssistant,
config,
action,
automation_info,
*,
platform_type: str = "state",
) -> CALLBACK_TYPE:
"""Listen for state changes based on configuration."""
entity_id = config.get(CONF_ENTITY_ID)
from_state = config.get(CONF_FROM, MATCH_ALL)
t... | [
"async",
"def",
"async_attach_trigger",
"(",
"hass",
":",
"HomeAssistant",
",",
"config",
",",
"action",
",",
"automation_info",
",",
"*",
",",
"platform_type",
":",
"str",
"=",
"\"state\"",
",",
")",
"->",
"CALLBACK_TYPE",
":",
"entity_id",
"=",
"config",
"... | [
67,
0
] | [
204,
23
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.__init__ | (self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, date=None, date_time=None, password=None, callback=None, local_vars_configuration=None) | InlineObject3 - a model defined in OpenAPI | InlineObject3 - a model defined in OpenAPI | def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, pattern_without_delimiter=None, byte=None, binary=None, date=None, date_time=None, password=None, callback=None, local_vars_configuration=None): # noqa: E501
"""InlineObject3 - a model defined in OpenAPI... | [
"def",
"__init__",
"(",
"self",
",",
"integer",
"=",
"None",
",",
"int32",
"=",
"None",
",",
"int64",
"=",
"None",
",",
"number",
"=",
"None",
",",
"float",
"=",
"None",
",",
"double",
"=",
"None",
",",
"string",
"=",
"None",
",",
"pattern_without_de... | [
68,
4
] | [
113,
36
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.integer | (self) | Gets the integer of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The integer of this InlineObject3. # noqa: E501
:rtype: int
| Gets the integer of this InlineObject3. # noqa: E501 | def integer(self):
"""Gets the integer of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The integer of this InlineObject3. # noqa: E501
:rtype: int
"""
return self._integer | [
"def",
"integer",
"(",
"self",
")",
":",
"return",
"self",
".",
"_integer"
] | [
116,
4
] | [
124,
28
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.integer | (self, integer) | Sets the integer of this InlineObject3.
None # noqa: E501
:param integer: The integer of this InlineObject3. # noqa: E501
:type integer: int
| Sets the integer of this InlineObject3. | def integer(self, integer):
"""Sets the integer of this InlineObject3.
None # noqa: E501
:param integer: The integer of this InlineObject3. # noqa: E501
:type integer: int
"""
if (self.local_vars_configuration.client_side_validation and
integer is not ... | [
"def",
"integer",
"(",
"self",
",",
"integer",
")",
":",
"if",
"(",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"integer",
"is",
"not",
"None",
"and",
"integer",
">",
"100",
")",
":",
"# noqa: E501",
"raise",
"ValueError",
... | [
127,
4
] | [
142,
31
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.int32 | (self) | Gets the int32 of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The int32 of this InlineObject3. # noqa: E501
:rtype: int
| Gets the int32 of this InlineObject3. # noqa: E501 | def int32(self):
"""Gets the int32 of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The int32 of this InlineObject3. # noqa: E501
:rtype: int
"""
return self._int32 | [
"def",
"int32",
"(",
"self",
")",
":",
"return",
"self",
".",
"_int32"
] | [
145,
4
] | [
153,
26
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.int32 | (self, int32) | Sets the int32 of this InlineObject3.
None # noqa: E501
:param int32: The int32 of this InlineObject3. # noqa: E501
:type int32: int
| Sets the int32 of this InlineObject3. | def int32(self, int32):
"""Sets the int32 of this InlineObject3.
None # noqa: E501
:param int32: The int32 of this InlineObject3. # noqa: E501
:type int32: int
"""
if (self.local_vars_configuration.client_side_validation and
int32 is not None and int32... | [
"def",
"int32",
"(",
"self",
",",
"int32",
")",
":",
"if",
"(",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"int32",
"is",
"not",
"None",
"and",
"int32",
">",
"200",
")",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
"... | [
156,
4
] | [
171,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.int64 | (self) | Gets the int64 of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The int64 of this InlineObject3. # noqa: E501
:rtype: int
| Gets the int64 of this InlineObject3. # noqa: E501 | def int64(self):
"""Gets the int64 of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The int64 of this InlineObject3. # noqa: E501
:rtype: int
"""
return self._int64 | [
"def",
"int64",
"(",
"self",
")",
":",
"return",
"self",
".",
"_int64"
] | [
174,
4
] | [
182,
26
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.int64 | (self, int64) | Sets the int64 of this InlineObject3.
None # noqa: E501
:param int64: The int64 of this InlineObject3. # noqa: E501
:type int64: int
| Sets the int64 of this InlineObject3. | def int64(self, int64):
"""Sets the int64 of this InlineObject3.
None # noqa: E501
:param int64: The int64 of this InlineObject3. # noqa: E501
:type int64: int
"""
self._int64 = int64 | [
"def",
"int64",
"(",
"self",
",",
"int64",
")",
":",
"self",
".",
"_int64",
"=",
"int64"
] | [
185,
4
] | [
194,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.number | (self) | Gets the number of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The number of this InlineObject3. # noqa: E501
:rtype: float
| Gets the number of this InlineObject3. # noqa: E501 | def number(self):
"""Gets the number of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The number of this InlineObject3. # noqa: E501
:rtype: float
"""
return self._number | [
"def",
"number",
"(",
"self",
")",
":",
"return",
"self",
".",
"_number"
] | [
197,
4
] | [
205,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.number | (self, number) | Sets the number of this InlineObject3.
None # noqa: E501
:param number: The number of this InlineObject3. # noqa: E501
:type number: float
| Sets the number of this InlineObject3. | def number(self, number):
"""Sets the number of this InlineObject3.
None # noqa: E501
:param number: The number of this InlineObject3. # noqa: E501
:type number: float
"""
if self.local_vars_configuration.client_side_validation and number is None: # noqa: E501
... | [
"def",
"number",
"(",
"self",
",",
"number",
")",
":",
"if",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"number",
"is",
"None",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
"\"Invalid value for `number`, must not be `None`\"",
"... | [
208,
4
] | [
225,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.float | (self) | Gets the float of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The float of this InlineObject3. # noqa: E501
:rtype: float
| Gets the float of this InlineObject3. # noqa: E501 | def float(self):
"""Gets the float of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The float of this InlineObject3. # noqa: E501
:rtype: float
"""
return self._float | [
"def",
"float",
"(",
"self",
")",
":",
"return",
"self",
".",
"_float"
] | [
228,
4
] | [
236,
26
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.float | (self, float) | Sets the float of this InlineObject3.
None # noqa: E501
:param float: The float of this InlineObject3. # noqa: E501
:type float: float
| Sets the float of this InlineObject3. | def float(self, float):
"""Sets the float of this InlineObject3.
None # noqa: E501
:param float: The float of this InlineObject3. # noqa: E501
:type float: float
"""
if (self.local_vars_configuration.client_side_validation and
float is not None and flo... | [
"def",
"float",
"(",
"self",
",",
"float",
")",
":",
"if",
"(",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"float",
"is",
"not",
"None",
"and",
"float",
">",
"987.6",
")",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
... | [
239,
4
] | [
251,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.double | (self) | Gets the double of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The double of this InlineObject3. # noqa: E501
:rtype: float
| Gets the double of this InlineObject3. # noqa: E501 | def double(self):
"""Gets the double of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The double of this InlineObject3. # noqa: E501
:rtype: float
"""
return self._double | [
"def",
"double",
"(",
"self",
")",
":",
"return",
"self",
".",
"_double"
] | [
254,
4
] | [
262,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.double | (self, double) | Sets the double of this InlineObject3.
None # noqa: E501
:param double: The double of this InlineObject3. # noqa: E501
:type double: float
| Sets the double of this InlineObject3. | def double(self, double):
"""Sets the double of this InlineObject3.
None # noqa: E501
:param double: The double of this InlineObject3. # noqa: E501
:type double: float
"""
if self.local_vars_configuration.client_side_validation and double is None: # noqa: E501
... | [
"def",
"double",
"(",
"self",
",",
"double",
")",
":",
"if",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"double",
"is",
"None",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
"\"Invalid value for `double`, must not be `None`\"",
"... | [
265,
4
] | [
282,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.string | (self) | Gets the string of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The string of this InlineObject3. # noqa: E501
:rtype: str
| Gets the string of this InlineObject3. # noqa: E501 | def string(self):
"""Gets the string of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The string of this InlineObject3. # noqa: E501
:rtype: str
"""
return self._string | [
"def",
"string",
"(",
"self",
")",
":",
"return",
"self",
".",
"_string"
] | [
285,
4
] | [
293,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.string | (self, string) | Sets the string of this InlineObject3.
None # noqa: E501
:param string: The string of this InlineObject3. # noqa: E501
:type string: str
| Sets the string of this InlineObject3. | def string(self, string):
"""Sets the string of this InlineObject3.
None # noqa: E501
:param string: The string of this InlineObject3. # noqa: E501
:type string: str
"""
if (self.local_vars_configuration.client_side_validation and
string is not None an... | [
"def",
"string",
"(",
"self",
",",
"string",
")",
":",
"if",
"(",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"string",
"is",
"not",
"None",
"and",
"not",
"re",
".",
"search",
"(",
"r'[a-z]'",
",",
"string",
",",
"flags",... | [
296,
4
] | [
308,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.pattern_without_delimiter | (self) | Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The pattern_without_delimiter of this InlineObject3. # noqa: E501
:rtype: str
| Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501 | def pattern_without_delimiter(self):
"""Gets the pattern_without_delimiter of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The pattern_without_delimiter of this InlineObject3. # noqa: E501
:rtype: str
"""
return self._pattern_without_delimiter | [
"def",
"pattern_without_delimiter",
"(",
"self",
")",
":",
"return",
"self",
".",
"_pattern_without_delimiter"
] | [
311,
4
] | [
319,
46
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.pattern_without_delimiter | (self, pattern_without_delimiter) | Sets the pattern_without_delimiter of this InlineObject3.
None # noqa: E501
:param pattern_without_delimiter: The pattern_without_delimiter of this InlineObject3. # noqa: E501
:type pattern_without_delimiter: str
| Sets the pattern_without_delimiter of this InlineObject3. | def pattern_without_delimiter(self, pattern_without_delimiter):
"""Sets the pattern_without_delimiter of this InlineObject3.
None # noqa: E501
:param pattern_without_delimiter: The pattern_without_delimiter of this InlineObject3. # noqa: E501
:type pattern_without_delimiter: str
... | [
"def",
"pattern_without_delimiter",
"(",
"self",
",",
"pattern_without_delimiter",
")",
":",
"if",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"pattern_without_delimiter",
"is",
"None",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
... | [
322,
4
] | [
336,
67
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.byte | (self) | Gets the byte of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The byte of this InlineObject3. # noqa: E501
:rtype: str
| Gets the byte of this InlineObject3. # noqa: E501 | def byte(self):
"""Gets the byte of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The byte of this InlineObject3. # noqa: E501
:rtype: str
"""
return self._byte | [
"def",
"byte",
"(",
"self",
")",
":",
"return",
"self",
".",
"_byte"
] | [
339,
4
] | [
347,
25
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.byte | (self, byte) | Sets the byte of this InlineObject3.
None # noqa: E501
:param byte: The byte of this InlineObject3. # noqa: E501
:type byte: str
| Sets the byte of this InlineObject3. | def byte(self, byte):
"""Sets the byte of this InlineObject3.
None # noqa: E501
:param byte: The byte of this InlineObject3. # noqa: E501
:type byte: str
"""
if self.local_vars_configuration.client_side_validation and byte is None: # noqa: E501
raise Valu... | [
"def",
"byte",
"(",
"self",
",",
"byte",
")",
":",
"if",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"byte",
"is",
"None",
":",
"# noqa: E501",
"raise",
"ValueError",
"(",
"\"Invalid value for `byte`, must not be `None`\"",
")",
"#... | [
350,
4
] | [
361,
25
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.binary | (self) | Gets the binary of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The binary of this InlineObject3. # noqa: E501
:rtype: file
| Gets the binary of this InlineObject3. # noqa: E501 | def binary(self):
"""Gets the binary of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The binary of this InlineObject3. # noqa: E501
:rtype: file
"""
return self._binary | [
"def",
"binary",
"(",
"self",
")",
":",
"return",
"self",
".",
"_binary"
] | [
364,
4
] | [
372,
27
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.binary | (self, binary) | Sets the binary of this InlineObject3.
None # noqa: E501
:param binary: The binary of this InlineObject3. # noqa: E501
:type binary: file
| Sets the binary of this InlineObject3. | def binary(self, binary):
"""Sets the binary of this InlineObject3.
None # noqa: E501
:param binary: The binary of this InlineObject3. # noqa: E501
:type binary: file
"""
self._binary = binary | [
"def",
"binary",
"(",
"self",
",",
"binary",
")",
":",
"self",
".",
"_binary",
"=",
"binary"
] | [
375,
4
] | [
384,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.date | (self) | Gets the date of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The date of this InlineObject3. # noqa: E501
:rtype: date
| Gets the date of this InlineObject3. # noqa: E501 | def date(self):
"""Gets the date of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The date of this InlineObject3. # noqa: E501
:rtype: date
"""
return self._date | [
"def",
"date",
"(",
"self",
")",
":",
"return",
"self",
".",
"_date"
] | [
387,
4
] | [
395,
25
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.date | (self, date) | Sets the date of this InlineObject3.
None # noqa: E501
:param date: The date of this InlineObject3. # noqa: E501
:type date: date
| Sets the date of this InlineObject3. | def date(self, date):
"""Sets the date of this InlineObject3.
None # noqa: E501
:param date: The date of this InlineObject3. # noqa: E501
:type date: date
"""
self._date = date | [
"def",
"date",
"(",
"self",
",",
"date",
")",
":",
"self",
".",
"_date",
"=",
"date"
] | [
398,
4
] | [
407,
25
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.date_time | (self) | Gets the date_time of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The date_time of this InlineObject3. # noqa: E501
:rtype: datetime
| Gets the date_time of this InlineObject3. # noqa: E501 | def date_time(self):
"""Gets the date_time of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The date_time of this InlineObject3. # noqa: E501
:rtype: datetime
"""
return self._date_time | [
"def",
"date_time",
"(",
"self",
")",
":",
"return",
"self",
".",
"_date_time"
] | [
410,
4
] | [
418,
30
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.date_time | (self, date_time) | Sets the date_time of this InlineObject3.
None # noqa: E501
:param date_time: The date_time of this InlineObject3. # noqa: E501
:type date_time: datetime
| Sets the date_time of this InlineObject3. | def date_time(self, date_time):
"""Sets the date_time of this InlineObject3.
None # noqa: E501
:param date_time: The date_time of this InlineObject3. # noqa: E501
:type date_time: datetime
"""
self._date_time = date_time | [
"def",
"date_time",
"(",
"self",
",",
"date_time",
")",
":",
"self",
".",
"_date_time",
"=",
"date_time"
] | [
421,
4
] | [
430,
35
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.password | (self) | Gets the password of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The password of this InlineObject3. # noqa: E501
:rtype: str
| Gets the password of this InlineObject3. # noqa: E501 | def password(self):
"""Gets the password of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The password of this InlineObject3. # noqa: E501
:rtype: str
"""
return self._password | [
"def",
"password",
"(",
"self",
")",
":",
"return",
"self",
".",
"_password"
] | [
433,
4
] | [
441,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.password | (self, password) | Sets the password of this InlineObject3.
None # noqa: E501
:param password: The password of this InlineObject3. # noqa: E501
:type password: str
| Sets the password of this InlineObject3. | def password(self, password):
"""Sets the password of this InlineObject3.
None # noqa: E501
:param password: The password of this InlineObject3. # noqa: E501
:type password: str
"""
if (self.local_vars_configuration.client_side_validation and
password ... | [
"def",
"password",
"(",
"self",
",",
"password",
")",
":",
"if",
"(",
"self",
".",
"local_vars_configuration",
".",
"client_side_validation",
"and",
"password",
"is",
"not",
"None",
"and",
"len",
"(",
"password",
")",
">",
"64",
")",
":",
"raise",
"ValueEr... | [
444,
4
] | [
459,
33
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.callback | (self) | Gets the callback of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The callback of this InlineObject3. # noqa: E501
:rtype: str
| Gets the callback of this InlineObject3. # noqa: E501 | def callback(self):
"""Gets the callback of this InlineObject3. # noqa: E501
None # noqa: E501
:return: The callback of this InlineObject3. # noqa: E501
:rtype: str
"""
return self._callback | [
"def",
"callback",
"(",
"self",
")",
":",
"return",
"self",
".",
"_callback"
] | [
462,
4
] | [
470,
29
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.callback | (self, callback) | Sets the callback of this InlineObject3.
None # noqa: E501
:param callback: The callback of this InlineObject3. # noqa: E501
:type callback: str
| Sets the callback of this InlineObject3. | def callback(self, callback):
"""Sets the callback of this InlineObject3.
None # noqa: E501
:param callback: The callback of this InlineObject3. # noqa: E501
:type callback: str
"""
self._callback = callback | [
"def",
"callback",
"(",
"self",
",",
"callback",
")",
":",
"self",
".",
"_callback",
"=",
"callback"
] | [
473,
4
] | [
482,
33
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.to_dict | (self, serialize=False) | Returns the model properties as a dict | Returns the model properties as a dict | def to_dict(self, serialize=False):
"""Returns the model properties as a dict"""
result = {}
def convert(x):
if hasattr(x, "to_dict"):
args = inspect.getargspec(x.to_dict).args
if len(args) == 1:
return x.to_dict()
... | [
"def",
"to_dict",
"(",
"self",
",",
"serialize",
"=",
"False",
")",
":",
"result",
"=",
"{",
"}",
"def",
"convert",
"(",
"x",
")",
":",
"if",
"hasattr",
"(",
"x",
",",
"\"to_dict\"",
")",
":",
"args",
"=",
"inspect",
".",
"getargspec",
"(",
"x",
... | [
484,
4
] | [
514,
21
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.to_str | (self) | Returns the string representation of the model | Returns the string representation of the model | def to_str(self):
"""Returns the string representation of the model"""
return pprint.pformat(self.to_dict()) | [
"def",
"to_str",
"(",
"self",
")",
":",
"return",
"pprint",
".",
"pformat",
"(",
"self",
".",
"to_dict",
"(",
")",
")"
] | [
516,
4
] | [
518,
45
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.__repr__ | (self) | For `print` and `pprint` | For `print` and `pprint` | def __repr__(self):
"""For `print` and `pprint`"""
return self.to_str() | [
"def",
"__repr__",
"(",
"self",
")",
":",
"return",
"self",
".",
"to_str",
"(",
")"
] | [
520,
4
] | [
522,
28
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.__eq__ | (self, other) | Returns true if both objects are equal | Returns true if both objects are equal | def __eq__(self, other):
"""Returns true if both objects are equal"""
if not isinstance(other, InlineObject3):
return False
return self.to_dict() == other.to_dict() | [
"def",
"__eq__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"InlineObject3",
")",
":",
"return",
"False",
"return",
"self",
".",
"to_dict",
"(",
")",
"==",
"other",
".",
"to_dict",
"(",
")"
] | [
524,
4
] | [
529,
48
] | python | en | ['en', 'en', 'en'] | True |
InlineObject3.__ne__ | (self, other) | Returns true if both objects are not equal | Returns true if both objects are not equal | def __ne__(self, other):
"""Returns true if both objects are not equal"""
if not isinstance(other, InlineObject3):
return True
return self.to_dict() != other.to_dict() | [
"def",
"__ne__",
"(",
"self",
",",
"other",
")",
":",
"if",
"not",
"isinstance",
"(",
"other",
",",
"InlineObject3",
")",
":",
"return",
"True",
"return",
"self",
".",
"to_dict",
"(",
")",
"!=",
"other",
".",
"to_dict",
"(",
")"
] | [
531,
4
] | [
536,
48
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, config_entry, async_add_entities) | Set up platform for a new integration.
Called by the HA framework after async_forward_entry_setup has been called
during initialization of a new integration (= wiffi).
| Set up platform for a new integration. | async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up platform for a new integration.
Called by the HA framework after async_forward_entry_setup has been called
during initialization of a new integration (= wiffi).
"""
@callback
def _create_entity(device, metric):
... | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"config_entry",
",",
"async_add_entities",
")",
":",
"@",
"callback",
"def",
"_create_entity",
"(",
"device",
",",
"metric",
")",
":",
"\"\"\"Create platform specific entities.\"\"\"",
"entities",
"=",
"[",
"]",... | [
10,
0
] | [
27,
72
] | python | en | ['en', 'da', 'en'] | True |
BoolEntity.__init__ | (self, device, metric, options) | Initialize the entity. | Initialize the entity. | def __init__(self, device, metric, options):
"""Initialize the entity."""
super().__init__(device, metric, options)
self._value = metric.value
self.reset_expiration_date() | [
"def",
"__init__",
"(",
"self",
",",
"device",
",",
"metric",
",",
"options",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"device",
",",
"metric",
",",
"options",
")",
"self",
".",
"_value",
"=",
"metric",
".",
"value",
"self",
".",
"reset_exp... | [
33,
4
] | [
37,
36
] | python | en | ['en', 'en', 'en'] | True |
BoolEntity.is_on | (self) | Return the state of the entity. | Return the state of the entity. | def is_on(self):
"""Return the state of the entity."""
return self._value | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"self",
".",
"_value"
] | [
40,
4
] | [
42,
26
] | python | en | ['en', 'en', 'en'] | True |
BoolEntity._update_value_callback | (self, device, metric) | Update the value of the entity.
Called if a new message has been received from the wiffi device.
| Update the value of the entity. | def _update_value_callback(self, device, metric):
"""Update the value of the entity.
Called if a new message has been received from the wiffi device.
"""
self.reset_expiration_date()
self._value = metric.value
self.async_write_ha_state() | [
"def",
"_update_value_callback",
"(",
"self",
",",
"device",
",",
"metric",
")",
":",
"self",
".",
"reset_expiration_date",
"(",
")",
"self",
".",
"_value",
"=",
"metric",
".",
"value",
"self",
".",
"async_write_ha_state",
"(",
")"
] | [
45,
4
] | [
52,
35
] | python | en | ['en', 'en', 'en'] | True |
initializeTree | () |
:param all_Node: 为True时返回意图树的所有结点,否则仅返回叶子结点
|
:param all_Node: 为True时返回意图树的所有结点,否则仅返回叶子结点
| def initializeTree():
"""
:param all_Node: 为True时返回意图树的所有结点,否则仅返回叶子结点
"""
#第零层,即根节点
node_0_0 = Node("操控国家政治")
#第一层
node_1_0 = Node("巩固国内政治",father_node=node_0_0)
node_1_1 = Node("阻碍他国政治", father_node=node_0_0)
node_1_2 = Node("其他", father_node=node_0_0)
#第二层,即分类的意图
node_2_0... | [
"def",
"initializeTree",
"(",
")",
":",
"#第零层,即根节点",
"node_0_0",
"=",
"Node",
"(",
"\"操控国家政治\")",
"",
"#第一层",
"node_1_0",
"=",
"Node",
"(",
"\"巩固国内政治\",father_node",
"=",
"node_0_0)",
"",
"",
"",
"node_1_1",
"=",
"Node",
"(",
"\"阻碍他国政治\", father_nod",
"e",
"... | [
55,
0
] | [
79,
151
] | python | en | ['en', 'error', 'th'] | False |
find_log_junit | (build_dir, junit, log_file) |
Looks in build_dir for log_file in a folder that
also includes the junit file.
|
Looks in build_dir for log_file in a folder that
also includes the junit file.
| def find_log_junit(build_dir, junit, log_file):
"""
Looks in build_dir for log_file in a folder that
also includes the junit file.
"""
tmps = [f.filename for f in view_base.gcs_ls('%s/artifacts' % build_dir)
if '/tmp-node' in f.filename]
for folder in tmps:
filenames = [f.fil... | [
"def",
"find_log_junit",
"(",
"build_dir",
",",
"junit",
",",
"log_file",
")",
":",
"tmps",
"=",
"[",
"f",
".",
"filename",
"for",
"f",
"in",
"view_base",
".",
"gcs_ls",
"(",
"'%s/artifacts'",
"%",
"build_dir",
")",
"if",
"'/tmp-node'",
"in",
"f",
".",
... | [
25,
0
] | [
37,
27
] | python | en | ['en', 'error', 'th'] | False |
find_log_files | (all_logs, log_file) |
Returns list of files named log_file from values in all_logs
|
Returns list of files named log_file from values in all_logs
| def find_log_files(all_logs, log_file):
"""
Returns list of files named log_file from values in all_logs
"""
log_files = []
for folder in all_logs.itervalues():
for log in folder:
if log_file in log:
log_files.append(log)
return log_files | [
"def",
"find_log_files",
"(",
"all_logs",
",",
"log_file",
")",
":",
"log_files",
"=",
"[",
"]",
"for",
"folder",
"in",
"all_logs",
".",
"itervalues",
"(",
")",
":",
"for",
"log",
"in",
"folder",
":",
"if",
"log_file",
"in",
"log",
":",
"log_files",
".... | [
40,
0
] | [
50,
20
] | python | en | ['en', 'error', 'th'] | False |
get_all_logs | (directory, artifacts) |
returns dictionary given the artifacts folder with the keys being the
folders, and the values being the log files within the corresponding folder
|
returns dictionary given the artifacts folder with the keys being the
folders, and the values being the log files within the corresponding folder
| def get_all_logs(directory, artifacts):
"""
returns dictionary given the artifacts folder with the keys being the
folders, and the values being the log files within the corresponding folder
"""
log_files = {}
if artifacts:
dirs = [f.filename for f in view_base.gcs_ls('%s/artifacts' % dir... | [
"def",
"get_all_logs",
"(",
"directory",
",",
"artifacts",
")",
":",
"log_files",
"=",
"{",
"}",
"if",
"artifacts",
":",
"dirs",
"=",
"[",
"f",
".",
"filename",
"for",
"f",
"in",
"view_base",
".",
"gcs_ls",
"(",
"'%s/artifacts'",
"%",
"directory",
")",
... | [
54,
0
] | [
71,
20
] | python | en | ['en', 'error', 'th'] | False |
parse_log_file | (log_filename, pod, filters=None, make_dict=False, objref_dict=None) | Based on make_dict, either returns the objref_dict or the parsed log file | Based on make_dict, either returns the objref_dict or the parsed log file | def parse_log_file(log_filename, pod, filters=None, make_dict=False, objref_dict=None):
"""Based on make_dict, either returns the objref_dict or the parsed log file"""
log = gcs_async.read(log_filename).get_result()
if log is None:
return {}, False if make_dict else None
if pod:
bold_re ... | [
"def",
"parse_log_file",
"(",
"log_filename",
",",
"pod",
",",
"filters",
"=",
"None",
",",
"make_dict",
"=",
"False",
",",
"objref_dict",
"=",
"None",
")",
":",
"log",
"=",
"gcs_async",
".",
"read",
"(",
"log_filename",
")",
".",
"get_result",
"(",
")",... | [
74,
0
] | [
89,
71
] | python | en | ['en', 'en', 'en'] | True |
get_logs | (build_dir, log_files, pod_name, filters, objref_dict) |
Get the logs in the case where all logs in artifacts folder may be relevant
Returns:
all_logs: dictionary of all logs that can be filtered
results: dictionary of log file to the parsed text
obref_dict: dictionary of name of filter to the string to be filtered
log_files: list of ... |
Get the logs in the case where all logs in artifacts folder may be relevant
Returns:
all_logs: dictionary of all logs that can be filtered
results: dictionary of log file to the parsed text
obref_dict: dictionary of name of filter to the string to be filtered
log_files: list of ... | def get_logs(build_dir, log_files, pod_name, filters, objref_dict):
"""
Get the logs in the case where all logs in artifacts folder may be relevant
Returns:
all_logs: dictionary of all logs that can be filtered
results: dictionary of log file to the parsed text
obref_dict: dictionary... | [
"def",
"get_logs",
"(",
"build_dir",
",",
"log_files",
",",
"pod_name",
",",
"filters",
",",
"objref_dict",
")",
":",
"all_logs",
"=",
"{",
"}",
"results",
"=",
"{",
"}",
"old_dict_len",
"=",
"len",
"(",
"objref_dict",
")",
"all_logs",
"=",
"get_all_logs",... | [
133,
0
] | [
169,
52
] | python | en | ['en', 'error', 'th'] | False |
parse_by_timestamp | ((build_dir, junit, log_files, pod, filters, objref_dict)) |
Returns:
woven_logs: HTML code of chosen logs woven together by timestamp
all_logs: Dictionary of logs relevant for filtering
|
Returns:
woven_logs: HTML code of chosen logs woven together by timestamp
all_logs: Dictionary of logs relevant for filtering
| def parse_by_timestamp((build_dir, junit, log_files, pod, filters, objref_dict)):
"""
Returns:
woven_logs: HTML code of chosen logs woven together by timestamp
all_logs: Dictionary of logs relevant for filtering
"""
woven_logs = get_woven_logs(log_files, pod, filters, objref_dict)
a... | [
"def",
"parse_by_timestamp",
"(",
"(",
"build_dir",
",",
"junit",
",",
"log_files",
",",
"pod",
",",
"filters",
",",
"objref_dict",
")",
")",
":",
"woven_logs",
"=",
"get_woven_logs",
"(",
"log_files",
",",
"pod",
",",
"filters",
",",
"objref_dict",
")",
"... | [
204,
0
] | [
218,
31
] | python | en | ['en', 'error', 'th'] | False |
NodeLogHandler.get | (self, prefix, job, build) |
Examples of variables
log_files: ["kubelet.log", "kube-apiserver.log"]
pod_name: "pod-abcdef123"
junit: "junit_01.xml"
uid, namespace, wrap: "on"
cID, poduid, ns: strings entered into textboxes
results, logs: {"kubelet.log":"parsed kubelet log for html"}
... |
Examples of variables
log_files: ["kubelet.log", "kube-apiserver.log"]
pod_name: "pod-abcdef123"
junit: "junit_01.xml"
uid, namespace, wrap: "on"
cID, poduid, ns: strings entered into textboxes
results, logs: {"kubelet.log":"parsed kubelet log for html"}
... | def get(self, prefix, job, build):
"""
Examples of variables
log_files: ["kubelet.log", "kube-apiserver.log"]
pod_name: "pod-abcdef123"
junit: "junit_01.xml"
uid, namespace, wrap: "on"
cID, poduid, ns: strings entered into textboxes
results, logs: {"kubele... | [
"def",
"get",
"(",
"self",
",",
"prefix",
",",
"job",
",",
"build",
")",
":",
"# pylint: disable=too-many-locals",
"job_dir",
"=",
"'/%s/%s/'",
"%",
"(",
"prefix",
",",
"job",
")",
"build_dir",
"=",
"job_dir",
"+",
"build",
"log_files",
"=",
"self",
".",
... | [
222,
4
] | [
289,
90
] | python | en | ['en', 'error', 'th'] | False |
setup_platform | (hass, config, add_entities, discover_info=None) | Set up Homeworks lights. | Set up Homeworks lights. | def setup_platform(hass, config, add_entities, discover_info=None):
"""Set up Homeworks lights."""
if discover_info is None:
return
controller = hass.data[HOMEWORKS_CONTROLLER]
devs = []
for dimmer in discover_info[CONF_DIMMERS]:
dev = HomeworksLight(
controller, dimmer[... | [
"def",
"setup_platform",
"(",
"hass",
",",
"config",
",",
"add_entities",
",",
"discover_info",
"=",
"None",
")",
":",
"if",
"discover_info",
"is",
"None",
":",
"return",
"controller",
"=",
"hass",
".",
"data",
"[",
"HOMEWORKS_CONTROLLER",
"]",
"devs",
"=",
... | [
19,
0
] | [
31,
28
] | python | en | ['en', 'da', 'en'] | True |
HomeworksLight.__init__ | (self, controller, addr, name, rate) | Create device with Addr, name, and rate. | Create device with Addr, name, and rate. | def __init__(self, controller, addr, name, rate):
"""Create device with Addr, name, and rate."""
super().__init__(controller, addr, name)
self._rate = rate
self._level = 0
self._prev_level = 0 | [
"def",
"__init__",
"(",
"self",
",",
"controller",
",",
"addr",
",",
"name",
",",
"rate",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"controller",
",",
"addr",
",",
"name",
")",
"self",
".",
"_rate",
"=",
"rate",
"self",
".",
"_level",
"=",... | [
37,
4
] | [
42,
28
] | python | en | ['en', 'en', 'en'] | True |
HomeworksLight.async_added_to_hass | (self) | Call when entity is added to hass. | Call when entity is added to hass. | async def async_added_to_hass(self):
"""Call when entity is added to hass."""
signal = f"homeworks_entity_{self._addr}"
_LOGGER.debug("connecting %s", signal)
self.async_on_remove(
async_dispatcher_connect(self.hass, signal, self._update_callback)
)
self._cont... | [
"async",
"def",
"async_added_to_hass",
"(",
"self",
")",
":",
"signal",
"=",
"f\"homeworks_entity_{self._addr}\"",
"_LOGGER",
".",
"debug",
"(",
"\"connecting %s\"",
",",
"signal",
")",
"self",
".",
"async_on_remove",
"(",
"async_dispatcher_connect",
"(",
"self",
".... | [
44,
4
] | [
51,
57
] | python | en | ['en', 'en', 'en'] | True |
HomeworksLight.supported_features | (self) | Supported features. | Supported features. | def supported_features(self):
"""Supported features."""
return SUPPORT_BRIGHTNESS | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"SUPPORT_BRIGHTNESS"
] | [
54,
4
] | [
56,
33
] | python | en | ['en', 'en', 'en'] | False |
HomeworksLight.turn_on | (self, **kwargs) | Turn on the light. | Turn on the light. | def turn_on(self, **kwargs):
"""Turn on the light."""
if ATTR_BRIGHTNESS in kwargs:
new_level = kwargs[ATTR_BRIGHTNESS]
elif self._prev_level == 0:
new_level = 255
else:
new_level = self._prev_level
self._set_brightness(new_level) | [
"def",
"turn_on",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"ATTR_BRIGHTNESS",
"in",
"kwargs",
":",
"new_level",
"=",
"kwargs",
"[",
"ATTR_BRIGHTNESS",
"]",
"elif",
"self",
".",
"_prev_level",
"==",
"0",
":",
"new_level",
"=",
"255",
"else",
... | [
58,
4
] | [
66,
39
] | python | en | ['en', 'et', 'en'] | True |
HomeworksLight.turn_off | (self, **kwargs) | Turn off the light. | Turn off the light. | def turn_off(self, **kwargs):
"""Turn off the light."""
self._set_brightness(0) | [
"def",
"turn_off",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"self",
".",
"_set_brightness",
"(",
"0",
")"
] | [
68,
4
] | [
70,
31
] | python | en | ['en', 'zh', 'en'] | True |
HomeworksLight.brightness | (self) | Control the brightness. | Control the brightness. | def brightness(self):
"""Control the brightness."""
return self._level | [
"def",
"brightness",
"(",
"self",
")",
":",
"return",
"self",
".",
"_level"
] | [
73,
4
] | [
75,
26
] | python | en | ['en', 'zh', 'en'] | True |
HomeworksLight._set_brightness | (self, level) | Send the brightness level to the device. | Send the brightness level to the device. | def _set_brightness(self, level):
"""Send the brightness level to the device."""
self._controller.fade_dim(
float((level * 100.0) / 255.0), self._rate, 0, self._addr
) | [
"def",
"_set_brightness",
"(",
"self",
",",
"level",
")",
":",
"self",
".",
"_controller",
".",
"fade_dim",
"(",
"float",
"(",
"(",
"level",
"*",
"100.0",
")",
"/",
"255.0",
")",
",",
"self",
".",
"_rate",
",",
"0",
",",
"self",
".",
"_addr",
")"
] | [
77,
4
] | [
81,
9
] | python | en | ['en', 'en', 'en'] | True |
HomeworksLight.extra_state_attributes | (self) | Supported attributes. | Supported attributes. | def extra_state_attributes(self):
"""Supported attributes."""
return {"homeworks_address": self._addr} | [
"def",
"extra_state_attributes",
"(",
"self",
")",
":",
"return",
"{",
"\"homeworks_address\"",
":",
"self",
".",
"_addr",
"}"
] | [
84,
4
] | [
86,
48
] | python | en | ['en', 'en', 'en'] | False |
HomeworksLight.is_on | (self) | Is the light on/off. | Is the light on/off. | def is_on(self):
"""Is the light on/off."""
return self._level != 0 | [
"def",
"is_on",
"(",
"self",
")",
":",
"return",
"self",
".",
"_level",
"!=",
"0"
] | [
89,
4
] | [
91,
31
] | python | en | ['en', 'en', 'en'] | True |
HomeworksLight._update_callback | (self, msg_type, values) | Process device specific messages. | Process device specific messages. | def _update_callback(self, msg_type, values):
"""Process device specific messages."""
if msg_type == HW_LIGHT_CHANGED:
self._level = int((values[1] * 255.0) / 100.0)
if self._level != 0:
self._prev_level = self._level
self.async_write_ha_state() | [
"def",
"_update_callback",
"(",
"self",
",",
"msg_type",
",",
"values",
")",
":",
"if",
"msg_type",
"==",
"HW_LIGHT_CHANGED",
":",
"self",
".",
"_level",
"=",
"int",
"(",
"(",
"values",
"[",
"1",
"]",
"*",
"255.0",
")",
"/",
"100.0",
")",
"if",
"self... | [
94,
4
] | [
101,
39
] | python | en | ['ca', 'en', 'en'] | True |
async_setup | (hass, config) | Set up the updater component. | Set up the updater component. | async def async_setup(hass, config):
"""Set up the updater component."""
conf = config.get(DOMAIN, {})
for option in (CONF_COMPONENT_REPORTING, CONF_REPORTING):
if option in conf:
_LOGGER.warning(
"Analytics reporting with the option '%s' "
"is deprecated... | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"config",
")",
":",
"conf",
"=",
"config",
".",
"get",
"(",
"DOMAIN",
",",
"{",
"}",
")",
"for",
"option",
"in",
"(",
"CONF_COMPONENT_REPORTING",
",",
"CONF_REPORTING",
")",
":",
"if",
"option",
"in",
"c... | [
55,
0
] | [
120,
15
] | python | en | ['en', 'en', 'en'] | True |
get_newest_version | (hass) | Get the newest Home Assistant version. | Get the newest Home Assistant version. | async def get_newest_version(hass):
"""Get the newest Home Assistant version."""
session = async_get_clientsession(hass)
with async_timeout.timeout(30):
req = await session.get(UPDATER_URL)
try:
res = await req.json()
except ValueError as err:
raise update_coordinator.Updat... | [
"async",
"def",
"get_newest_version",
"(",
"hass",
")",
":",
"session",
"=",
"async_get_clientsession",
"(",
"hass",
")",
"with",
"async_timeout",
".",
"timeout",
"(",
"30",
")",
":",
"req",
"=",
"await",
"session",
".",
"get",
"(",
"UPDATER_URL",
")",
"tr... | [
123,
0
] | [
143,
18
] | python | en | ['en', 'en', 'en'] | True |
Updater.__init__ | (
self, update_available: bool, newest_version: str, release_notes: str
) | Initialize attributes. | Initialize attributes. | def __init__(
self, update_available: bool, newest_version: str, release_notes: str
) -> None:
"""Initialize attributes."""
self.update_available = update_available
self.release_notes = release_notes
self.newest_version = newest_version | [
"def",
"__init__",
"(",
"self",
",",
"update_available",
":",
"bool",
",",
"newest_version",
":",
"str",
",",
"release_notes",
":",
"str",
")",
"->",
"None",
":",
"self",
".",
"update_available",
"=",
"update_available",
"self",
".",
"release_notes",
"=",
"r... | [
46,
4
] | [
52,
44
] | python | en | ['en', 'en', 'it'] | False |
_xml_escape | (data) | Escape &, <, >, ", ', etc. in a string of data. | Escape &, <, >, ", ', etc. in a string of data. | def _xml_escape(data):
"""Escape &, <, >, ", ', etc. in a string of data."""
# ampersand must be replaced first
from_symbols = '&><"\''
to_symbols = ('&'+s+';' for s in "amp gt lt quot apos".split())
for from_,to_ in zip(from_symbols, to_symbols):
data = data.replace(from_, to_)
return ... | [
"def",
"_xml_escape",
"(",
"data",
")",
":",
"# ampersand must be replaced first",
"from_symbols",
"=",
"'&><\"\\''",
"to_symbols",
"=",
"(",
"'&'",
"+",
"s",
"+",
"';'",
"for",
"s",
"in",
"\"amp gt lt quot apos\"",
".",
"split",
"(",
")",
")",
"for",
"from_",... | [
146,
0
] | [
154,
15
] | python | en | ['en', 'en', 'en'] | True |
col | (loc,strg) | Returns current column within a string, counting newlines as line separators.
The first column is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
on p... | Returns current column within a string, counting newlines as line separators.
The first column is number 1. | def col (loc,strg):
"""Returns current column within a string, counting newlines as line separators.
The first column is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} f... | [
"def",
"col",
"(",
"loc",
",",
"strg",
")",
":",
"s",
"=",
"strg",
"return",
"1",
"if",
"loc",
"<",
"len",
"(",
"s",
")",
"and",
"s",
"[",
"loc",
"]",
"==",
"'\\n'",
"else",
"loc",
"-",
"s",
".",
"rfind",
"(",
"\"\\n\"",
",",
"0",
",",
"loc... | [
715,
0
] | [
726,
78
] | python | en | ['en', 'en', 'en'] | True |
lineno | (loc,strg) | Returns current line number within a string, counting newlines as line separators.
The first line is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseString>} for more information
o... | Returns current line number within a string, counting newlines as line separators.
The first line is number 1. | def lineno(loc,strg):
"""Returns current line number within a string, counting newlines as line separators.
The first line is number 1.
Note: the default parsing behavior is to expand tabs in the input string
before starting the parsing process. See L{I{ParserElement.parseString}<ParserElement.parseStrin... | [
"def",
"lineno",
"(",
"loc",
",",
"strg",
")",
":",
"return",
"strg",
".",
"count",
"(",
"\"\\n\"",
",",
"0",
",",
"loc",
")",
"+",
"1"
] | [
728,
0
] | [
738,
37
] | python | en | ['en', 'en', 'en'] | True |
line | ( loc, strg ) | Returns the line of text containing loc within a string, counting newlines as line separators.
| Returns the line of text containing loc within a string, counting newlines as line separators.
| def line( loc, strg ):
"""Returns the line of text containing loc within a string, counting newlines as line separators.
"""
lastCR = strg.rfind("\n", 0, loc)
nextCR = strg.find("\n", loc)
if nextCR >= 0:
return strg[lastCR+1:nextCR]
else:
return strg[lastCR+1:] | [
"def",
"line",
"(",
"loc",
",",
"strg",
")",
":",
"lastCR",
"=",
"strg",
".",
"rfind",
"(",
"\"\\n\"",
",",
"0",
",",
"loc",
")",
"nextCR",
"=",
"strg",
".",
"find",
"(",
"\"\\n\"",
",",
"loc",
")",
"if",
"nextCR",
">=",
"0",
":",
"return",
"st... | [
740,
0
] | [
748,
30
] | python | en | ['en', 'en', 'en'] | True |
nullDebugAction | (*args) | Do-nothing' debug action, to suppress debugging output during parsing. | Do-nothing' debug action, to suppress debugging output during parsing. | def nullDebugAction(*args):
"""'Do-nothing' debug action, to suppress debugging output during parsing."""
pass | [
"def",
"nullDebugAction",
"(",
"*",
"args",
")",
":",
"pass"
] | [
759,
0
] | [
761,
8
] | python | en | ['en', 'jv', 'en'] | True |
ParseBaseException.__getattr__ | ( self, aname ) | supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text
| supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text
| def __getattr__( self, aname ):
"""supported attributes by name are:
- lineno - returns the line number of the exception text
- col - returns the column number of the exception text
- line - returns the line containing the exception text
"""
if( aname == "line... | [
"def",
"__getattr__",
"(",
"self",
",",
"aname",
")",
":",
"if",
"(",
"aname",
"==",
"\"lineno\"",
")",
":",
"return",
"lineno",
"(",
"self",
".",
"loc",
",",
"self",
".",
"pstr",
")",
"elif",
"(",
"aname",
"in",
"(",
"\"col\"",
",",
"\"column\"",
... | [
180,
4
] | [
193,
39
] | python | en | ['en', 'en', 'en'] | True |
ParseBaseException.markInputline | ( self, markerString = ">!<" ) | Extracts the exception line from the input string, and marks
the location of the exception with a special symbol.
| Extracts the exception line from the input string, and marks
the location of the exception with a special symbol.
| def markInputline( self, markerString = ">!<" ):
"""Extracts the exception line from the input string, and marks
the location of the exception with a special symbol.
"""
line_str = self.line
line_column = self.column - 1
if markerString:
line_str = "".join(... | [
"def",
"markInputline",
"(",
"self",
",",
"markerString",
"=",
"\">!<\"",
")",
":",
"line_str",
"=",
"self",
".",
"line",
"line_column",
"=",
"self",
".",
"column",
"-",
"1",
"if",
"markerString",
":",
"line_str",
"=",
"\"\"",
".",
"join",
"(",
"(",
"l... | [
200,
4
] | [
209,
31
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.iterkeys | ( self ) | Returns all named result keys. | Returns all named result keys. | def iterkeys( self ):
"""Returns all named result keys."""
if hasattr(self.__tokdict, "iterkeys"):
return self.__tokdict.iterkeys()
else:
return iter(self.__tokdict) | [
"def",
"iterkeys",
"(",
"self",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"__tokdict",
",",
"\"iterkeys\"",
")",
":",
"return",
"self",
".",
"__tokdict",
".",
"iterkeys",
"(",
")",
"else",
":",
"return",
"iter",
"(",
"self",
".",
"__tokdict",
")"
] | [
376,
4
] | [
381,
39
] | python | en | ['en', 'no', 'en'] | True |
ParseResults.itervalues | ( self ) | Returns all named result values. | Returns all named result values. | def itervalues( self ):
"""Returns all named result values."""
return (self[k] for k in self.iterkeys()) | [
"def",
"itervalues",
"(",
"self",
")",
":",
"return",
"(",
"self",
"[",
"k",
"]",
"for",
"k",
"in",
"self",
".",
"iterkeys",
"(",
")",
")"
] | [
383,
4
] | [
385,
49
] | python | en | ['en', 'no', 'en'] | True |
ParseResults.haskeys | ( self ) | Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names. | Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names. | def haskeys( self ):
"""Since keys() returns an iterator, this method is helpful in bypassing
code that looks for the existence of any defined results names."""
return bool(self.__tokdict) | [
"def",
"haskeys",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"__tokdict",
")"
] | [
407,
4
] | [
410,
35
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.pop | ( self, *args, **kwargs) | Removes and returns item at specified index (default=last).
Supports both list and dict semantics for pop(). If passed no
argument or an integer argument, it will use list semantics
and pop tokens from the list of parsed tokens. If passed a
non-integer argument (most likely ... | Removes and returns item at specified index (default=last).
Supports both list and dict semantics for pop(). If passed no
argument or an integer argument, it will use list semantics
and pop tokens from the list of parsed tokens. If passed a
non-integer argument (most likely ... | def pop( self, *args, **kwargs):
"""Removes and returns item at specified index (default=last).
Supports both list and dict semantics for pop(). If passed no
argument or an integer argument, it will use list semantics
and pop tokens from the list of parsed tokens. If passed a
... | [
"def",
"pop",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"args",
":",
"args",
"=",
"[",
"-",
"1",
"]",
"for",
"k",
",",
"v",
"in",
"kwargs",
".",
"items",
"(",
")",
":",
"if",
"k",
"==",
"'default'",
":",... | [
412,
4
] | [
437,
31
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.get | (self, key, defaultValue=None) | Returns named result matching the given key, or if there is no
such name, then returns the given C{defaultValue} or C{None} if no
C{defaultValue} is specified. | Returns named result matching the given key, or if there is no
such name, then returns the given C{defaultValue} or C{None} if no
C{defaultValue} is specified. | def get(self, key, defaultValue=None):
"""Returns named result matching the given key, or if there is no
such name, then returns the given C{defaultValue} or C{None} if no
C{defaultValue} is specified."""
if key in self:
return self[key]
else:
return... | [
"def",
"get",
"(",
"self",
",",
"key",
",",
"defaultValue",
"=",
"None",
")",
":",
"if",
"key",
"in",
"self",
":",
"return",
"self",
"[",
"key",
"]",
"else",
":",
"return",
"defaultValue"
] | [
439,
4
] | [
446,
31
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.insert | ( self, index, insStr ) | Inserts new element at location index in the list of parsed tokens. | Inserts new element at location index in the list of parsed tokens. | def insert( self, index, insStr ):
"""Inserts new element at location index in the list of parsed tokens."""
self.__toklist.insert(index, insStr)
# fixup indices in token dictionary
#~ for name in self.__tokdict:
#~ occurrences = self.__tokdict[name]
#~ for k, (va... | [
"def",
"insert",
"(",
"self",
",",
"index",
",",
"insStr",
")",
":",
"self",
".",
"__toklist",
".",
"insert",
"(",
"index",
",",
"insStr",
")",
"# fixup indices in token dictionary",
"#~ for name in self.__tokdict:",
"#~ occurrences = self.__tokdict[name]",
"#~ for k, (... | [
448,
4
] | [
458,
94
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.append | ( self, item ) | Add single element to end of ParseResults list of elements. | Add single element to end of ParseResults list of elements. | def append( self, item ):
"""Add single element to end of ParseResults list of elements."""
self.__toklist.append(item) | [
"def",
"append",
"(",
"self",
",",
"item",
")",
":",
"self",
".",
"__toklist",
".",
"append",
"(",
"item",
")"
] | [
460,
4
] | [
462,
35
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.extend | ( self, itemseq ) | Add sequence of elements to end of ParseResults list of elements. | Add sequence of elements to end of ParseResults list of elements. | def extend( self, itemseq ):
"""Add sequence of elements to end of ParseResults list of elements."""
if isinstance(itemseq, ParseResults):
self += itemseq
else:
self.__toklist.extend(itemseq) | [
"def",
"extend",
"(",
"self",
",",
"itemseq",
")",
":",
"if",
"isinstance",
"(",
"itemseq",
",",
"ParseResults",
")",
":",
"self",
"+=",
"itemseq",
"else",
":",
"self",
".",
"__toklist",
".",
"extend",
"(",
"itemseq",
")"
] | [
464,
4
] | [
469,
42
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.clear | ( self ) | Clear all elements and results names. | Clear all elements and results names. | def clear( self ):
"""Clear all elements and results names."""
del self.__toklist[:]
self.__tokdict.clear() | [
"def",
"clear",
"(",
"self",
")",
":",
"del",
"self",
".",
"__toklist",
"[",
":",
"]",
"self",
".",
"__tokdict",
".",
"clear",
"(",
")"
] | [
471,
4
] | [
474,
30
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.asList | ( self ) | Returns the parse results as a nested list of matching tokens, all converted to strings. | Returns the parse results as a nested list of matching tokens, all converted to strings. | def asList( self ):
"""Returns the parse results as a nested list of matching tokens, all converted to strings."""
return [res.asList() if isinstance(res,ParseResults) else res for res in self.__toklist] | [
"def",
"asList",
"(",
"self",
")",
":",
"return",
"[",
"res",
".",
"asList",
"(",
")",
"if",
"isinstance",
"(",
"res",
",",
"ParseResults",
")",
"else",
"res",
"for",
"res",
"in",
"self",
".",
"__toklist",
"]"
] | [
536,
4
] | [
538,
96
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.asDict | ( self ) | Returns the named parse results as a nested dictionary. | Returns the named parse results as a nested dictionary. | def asDict( self ):
"""Returns the named parse results as a nested dictionary."""
if PY_3:
item_fn = self.items
else:
item_fn = self.iteritems
def toItem(obj):
if isinstance(obj, ParseResults):
if obj.haskeys():
... | [
"def",
"asDict",
"(",
"self",
")",
":",
"if",
"PY_3",
":",
"item_fn",
"=",
"self",
".",
"items",
"else",
":",
"item_fn",
"=",
"self",
".",
"iteritems",
"def",
"toItem",
"(",
"obj",
")",
":",
"if",
"isinstance",
"(",
"obj",
",",
"ParseResults",
")",
... | [
540,
4
] | [
556,
55
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.copy | ( self ) | Returns a new copy of a C{ParseResults} object. | Returns a new copy of a C{ParseResults} object. | def copy( self ):
"""Returns a new copy of a C{ParseResults} object."""
ret = ParseResults( self.__toklist )
ret.__tokdict = self.__tokdict.copy()
ret.__parent = self.__parent
ret.__accumNames.update( self.__accumNames )
ret.__name = self.__name
return ret | [
"def",
"copy",
"(",
"self",
")",
":",
"ret",
"=",
"ParseResults",
"(",
"self",
".",
"__toklist",
")",
"ret",
".",
"__tokdict",
"=",
"self",
".",
"__tokdict",
".",
"copy",
"(",
")",
"ret",
".",
"__parent",
"=",
"self",
".",
"__parent",
"ret",
".",
"... | [
558,
4
] | [
565,
18
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.asXML | ( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ) | Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. | Returns the parse results as XML. Tags are created for tokens and lists that have defined results names. | def asXML( self, doctag=None, namedItemsOnly=False, indent="", formatted=True ):
"""Returns the parse results as XML. Tags are created for tokens and lists that have defined results names."""
nl = "\n"
out = []
namedItems = dict((v[1],k) for (k,vlist) in self.__tokdict.items()
... | [
"def",
"asXML",
"(",
"self",
",",
"doctag",
"=",
"None",
",",
"namedItemsOnly",
"=",
"False",
",",
"indent",
"=",
"\"\"",
",",
"formatted",
"=",
"True",
")",
":",
"nl",
"=",
"\"\\n\"",
"out",
"=",
"[",
"]",
"namedItems",
"=",
"dict",
"(",
"(",
"v",... | [
567,
4
] | [
624,
27
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.getName | (self) | Returns the results name for this token expression. | Returns the results name for this token expression. | def getName(self):
"""Returns the results name for this token expression."""
if self.__name:
return self.__name
elif self.__parent:
par = self.__parent()
if par:
return par.__lookup(self)
else:
return None
el... | [
"def",
"getName",
"(",
"self",
")",
":",
"if",
"self",
".",
"__name",
":",
"return",
"self",
".",
"__name",
"elif",
"self",
".",
"__parent",
":",
"par",
"=",
"self",
".",
"__parent",
"(",
")",
"if",
"par",
":",
"return",
"par",
".",
"__lookup",
"("... | [
633,
4
] | [
648,
23
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.dump | (self,indent='',depth=0) | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data. | Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data. | def dump(self,indent='',depth=0):
"""Diagnostic method for listing out the contents of a C{ParseResults}.
Accepts an optional C{indent} argument so that this string can be embedded
in a nested display of other data."""
out = []
NL = '\n'
out.append( indent+_ustr(sel... | [
"def",
"dump",
"(",
"self",
",",
"indent",
"=",
"''",
",",
"depth",
"=",
"0",
")",
":",
"out",
"=",
"[",
"]",
"NL",
"=",
"'\\n'",
"out",
".",
"append",
"(",
"indent",
"+",
"_ustr",
"(",
"self",
".",
"asList",
"(",
")",
")",
")",
"if",
"self",... | [
650,
4
] | [
678,
27
] | python | en | ['en', 'en', 'en'] | True |
ParseResults.pprint | (self, *args, **kwargs) | Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) | Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint}) | def pprint(self, *args, **kwargs):
"""Pretty-printer for parsed results as a list, using the C{pprint} module.
Accepts additional positional or keyword args as defined for the
C{pprint.pprint} method. (U{http://docs.python.org/3/library/pprint.html#pprint.pprint})"""
pprint.pprint... | [
"def",
"pprint",
"(",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"pprint",
".",
"pprint",
"(",
"self",
".",
"asList",
"(",
")",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")"
] | [
680,
4
] | [
684,
53
] | python | en | ['en', 'en', 'en'] | True |
ParserElement.setDefaultWhitespaceChars | ( chars ) | Overrides the default whitespace chars
| Overrides the default whitespace chars
| def setDefaultWhitespaceChars( chars ):
"""Overrides the default whitespace chars
"""
ParserElement.DEFAULT_WHITE_CHARS = chars | [
"def",
"setDefaultWhitespaceChars",
"(",
"chars",
")",
":",
"ParserElement",
".",
"DEFAULT_WHITE_CHARS",
"=",
"chars"
] | [
856,
4
] | [
859,
49
] | python | en | ['en', 'en', 'en'] | True |
ParserElement.inlineLiteralsUsing | (cls) |
Set class to be used for inclusion of string literals into a parser.
|
Set class to be used for inclusion of string literals into a parser.
| def inlineLiteralsUsing(cls):
"""
Set class to be used for inclusion of string literals into a parser.
"""
ParserElement.literalStringClass = cls | [
"def",
"inlineLiteralsUsing",
"(",
"cls",
")",
":",
"ParserElement",
".",
"literalStringClass",
"=",
"cls"
] | [
862,
4
] | [
866,
46
] | python | en | ['en', 'error', 'th'] | False |
ParserElement.copy | ( self ) | Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element. | Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element. | def copy( self ):
"""Make a copy of this C{ParserElement}. Useful for defining different parse actions
for the same parsing pattern, using copies of the original parse element."""
cpy = copy.copy( self )
cpy.parseAction = self.parseAction[:]
cpy.ignoreExprs = self.ignoreExprs... | [
"def",
"copy",
"(",
"self",
")",
":",
"cpy",
"=",
"copy",
".",
"copy",
"(",
"self",
")",
"cpy",
".",
"parseAction",
"=",
"self",
".",
"parseAction",
"[",
":",
"]",
"cpy",
".",
"ignoreExprs",
"=",
"self",
".",
"ignoreExprs",
"[",
":",
"]",
"if",
"... | [
891,
4
] | [
899,
18
] | python | en | ['en', 'en', 'en'] | True |
ParserElement.setName | ( self, name ) | Define name for this expression, for use in debugging. | Define name for this expression, for use in debugging. | def setName( self, name ):
"""Define name for this expression, for use in debugging."""
self.name = name
self.errmsg = "Expected " + self.name
if hasattr(self,"exception"):
self.exception.msg = self.errmsg
return self | [
"def",
"setName",
"(",
"self",
",",
"name",
")",
":",
"self",
".",
"name",
"=",
"name",
"self",
".",
"errmsg",
"=",
"\"Expected \"",
"+",
"self",
".",
"name",
"if",
"hasattr",
"(",
"self",
",",
"\"exception\"",
")",
":",
"self",
".",
"exception",
"."... | [
901,
4
] | [
907,
19
] | 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.