909978b0d1a763861154cfc454890ff1030192c6,homeassistant/components/device_tracker/xiaomi.py,,_get_token,#Any#Any#Any#,118

Before Change


    except requests.exceptions.Timeout:
        _LOGGER.exception("Connection to the router timed out")
        return
    return _extract_result(res, "token")


def _extract_result(res, key_name):
    if res.status_code == 200:

After Change


        _LOGGER.exception("Connection to the router timed out")
        return
    if res.status_code == 200:
        try:
            result = res.json()
        except ValueError:
            // If json decoder could not parse the response
            _LOGGER.exception("Failed to parse response from mi router")
            return
        try:
            return result["token"]
        except KeyError:
            error_message = "Xiaomi token cannot be refreshed, response from "\
                            + "url: [%s] \nwith parameter: [%s] \nwas: [%s]"
            _LOGGER.exception(error_message, url, data, result)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: home-assistant/home-assistant
Commit Name: 909978b0d1a763861154cfc454890ff1030192c6
Time: 2017-01-19
Author: RiRomain@users.noreply.github.com
File Name: homeassistant/components/device_tracker/xiaomi.py
Class Name:
Method Name: _get_token


Project Name: studioml/studio
Commit Name: d1d565824a50d0ae8c00af96bd6dc855896f5035
Time: 2017-10-11
Author: peter.zhokhov@sentient.ai
File Name: studio/gcloud_artifact_store.py
Class Name: GCloudArtifactStore
Method Name: get_bucket


Project Name: EducationalTestingService/skll
Commit Name: 1d5da4e1e8c8202995e4be6d7d2f0884b974c783
Time: 2013-10-24
Author: dblanchard@ets.org
File Name: skll/data.py
Class Name:
Method Name: _classes_for_iter_type


Project Name: EducationalTestingService/skll
Commit Name: 1d5da4e1e8c8202995e4be6d7d2f0884b974c783
Time: 2013-10-24
Author: dblanchard@ets.org
File Name: skll/data.py
Class Name:
Method Name: _ids_for_iter_type