3dd869f0c2bc6f82177a1ae23b2ec9151f13310f,homeassistant/components/joaoapps_join.py,,setup,#Any#Any#,31

Before Change


    hass.services.register(DOMAIN, name + "set_wallpaper",
                           set_wallpaper_service)
    hass.services.register(DOMAIN, name + "send_sms", send_sms_service)
    hass.services.register(DOMAIN, name + "send_file", send_file_service)
    hass.services.register(DOMAIN, name + "send_url", send_url_service)
    hass.services.register(DOMAIN, name + "send_tasker", send_tasker_service)
    return True

After Change


def setup(hass, config):
    Setup Join services.
    from pyjoin import get_devices
    for device in config[DOMAIN]:
        device_id = device.get(CONF_DEVICE_ID)
        api_key = device.get(CONF_API_KEY)
        name = device.get(CONF_NAME)
        name = name.lower().replace(" ", "_") + "_" if name else ""
        if api_key:
            if not get_devices(api_key):
                _LOGGER.error("Error connecting to Join, check API key")
                return False
        register_device(hass, device_id, api_key, name)
    return True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: home-assistant/home-assistant
Commit Name: 3dd869f0c2bc6f82177a1ae23b2ec9151f13310f
Time: 2016-07-19
Author: nkgilley@gmail.com
File Name: homeassistant/components/joaoapps_join.py
Class Name:
Method Name: setup


Project Name: tensorly/tensorly
Commit Name: 3752779f18f925b17bede564fe156dc3a73b8ca2
Time: 2018-10-01
Author: jiminy.crist@gmail.com
File Name: tensorly/backend/numpy_backend.py
Class Name:
Method Name:


Project Name: uber/petastorm
Commit Name: a31ae1708b62413c94ffae9fb6aab21b37f78212
Time: 2020-03-12
Author: weichen.xu@databricks.com
File Name: petastorm/spark/spark_dataset_converter.py
Class Name:
Method Name: _cache_df_or_retrieve_cache_path