1d615ea6c3a5f9b3ae6481b827919f04f23c09ce,homeassistant/components/mysensors.py,,setup,#Any#Any#,152

Before Change


        return False

    // Setup all devices from config
    gateways = []
    conf_gateways = config[DOMAIN][CONF_GATEWAYS]

    for index, gway in enumerate(conf_gateways):
        device = gway[CONF_DEVICE]
        persistence_file = gway.get(
            CONF_PERSISTENCE_FILE,
            hass.config.path("mysensors{}.pickle".format(index + 1)))
        baud_rate = gway.get(CONF_BAUD_RATE)
        tcp_port = gway.get(CONF_TCP_PORT)
        in_prefix = gway.get(CONF_TOPIC_IN_PREFIX)
        out_prefix = gway.get(CONF_TOPIC_OUT_PREFIX)
        ready_gateway = setup_gateway(
            device, persistence_file, baud_rate, tcp_port, in_prefix,
            out_prefix)
        if ready_gateway is not None:
            gateways.append(ready_gateway)

    if not gateways:
        _LOGGER.error(
            "No devices could be setup as gateways, check your configuration")

After Change


        return gateway

    // Setup all devices from config
    gateways = {}
    conf_gateways = config[DOMAIN][CONF_GATEWAYS]

    for index, gway in enumerate(conf_gateways):
        device = gway[CONF_DEVICE]
        persistence_file = gway.get(
            CONF_PERSISTENCE_FILE,
            hass.config.path("mysensors{}.pickle".format(index + 1)))
        baud_rate = gway.get(CONF_BAUD_RATE)
        tcp_port = gway.get(CONF_TCP_PORT)
        in_prefix = gway.get(CONF_TOPIC_IN_PREFIX)
        out_prefix = gway.get(CONF_TOPIC_OUT_PREFIX)
        ready_gateway = setup_gateway(
            device, persistence_file, baud_rate, tcp_port, in_prefix,
            out_prefix)
        if ready_gateway is not None:
            gateways[id(ready_gateway)] = ready_gateway

    if not gateways:
        _LOGGER.error(
            "No devices could be setup as gateways, check your configuration")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: home-assistant/home-assistant
Commit Name: 1d615ea6c3a5f9b3ae6481b827919f04f23c09ce
Time: 2017-08-25
Author: marhje52@kth.se
File Name: homeassistant/components/mysensors.py
Class Name:
Method Name: setup


Project Name: pytorch/pytorch
Commit Name: 249c21346208b682d128e28fe4480262f8b76cd8
Time: 2021-02-27
Author: benjamin.lefaudeux@gmail.com
File Name: torch/distributed/optim/zero_redundancy_optimizer.py
Class Name: ZeroRedundancyOptimizer
Method Name: state_dict


Project Name: home-assistant/home-assistant
Commit Name: 8775c54d29a4adcc11a55c4a37db7da54eccc6e7
Time: 2017-08-25
Author: marhje52@kth.se
File Name: homeassistant/components/mysensors.py
Class Name:
Method Name: setup