e4c5108c9deb8ecdf296f7c8da5f9dc26789d930,homeassistant/components/automation/__init__.py,,setup,#Any#Any#,37
Before Change
name = p_config.get(CONF_ALIAS, config_key)
action = _get_action(hass, p_config.get(CONF_ACTION, {}), name)
if action is None:
continue
if CONF_CONDITION in p_config or CONF_CONDITION_TYPE in p_config:
action = _process_if(hass, config, p_config, action)
if action is None:
continue
_process_trigger(hass, config, p_config.get(CONF_TRIGGER, []), name,
action)
return True
After Change
while config_key in config:
// check for one block syntax
if isinstance(config[config_key], dict):
config_block = _migrate_old_config(config[config_key])
name = config_block.get(CONF_ALIAS, config_key)
_setup_automation(hass, config_block, name, config)
// check for multiple block syntax
elif isinstance(config[config_key], list):
list_no = 0
for config_block in config[config_key]:
name = config_block.get(CONF_ALIAS, "{}, {}".format(config_key, list_no))
list_no += 1
config_block = _migrate_old_config(config_block)
_setup_automation(hass, config_block, name, config)
// any scalar value is incorrect
else:
_LOGGER.error("Error in config in section %s.", config_key)
found += 1
config_key = "{} {}".format(DOMAIN, found)
return True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: home-assistant/home-assistant
Commit Name: e4c5108c9deb8ecdf296f7c8da5f9dc26789d930
Time: 2015-09-18
Author: stefan.jonasson@sitedirect.se
File Name: homeassistant/components/automation/__init__.py
Class Name:
Method Name: setup
Project Name: mil-tokyo/webdnn
Commit Name: b697c6f3a5ba11f7507f963596d47731754cb99c
Time: 2017-04-30
Author: y.kikura@gmail.com
File Name: src/graph_builder/frontend/sub_rules/remove_last_softmax.py
Class Name: RemoveLastSoftmax
Method Name: optimize
Project Name: jsalt18-sentence-repl/jiant
Commit Name: 05a5e9c7c71571a1396adacd305bb0415e9c4170
Time: 2018-07-04
Author: wang.alex.c@gmail.com
File Name: src/evaluate.py
Class Name:
Method Name: write_preds