7a979e9f720fb03af107bb89ad94247d76e150df,homeassistant/components/alarm_control_panel/egardia.py,EgardiaAlarm,lookupstatusfromcode,#EgardiaAlarm#Any#,157

Before Change


        status = "UNKNOWN"
        if self._rs_codes is not None:
            statuscode = str(statuscode).strip()
            for i in self._rs_codes:
                val = str(self._rs_codes[i]).strip()
                if "," in val:
                    splitted = val.split(",")
                    for code in splitted:
                        code = str(code).strip()
                        if statuscode == code:
                            status = i.upper()
                            break
                elif statuscode == val:
                    status = i.upper()
                    break
        return status

    def parsestatus(self, status):
        Parse the status.

After Change



    def lookupstatusfromcode(self, statuscode):
        Look at the rs_codes and returns the status from the code.
        status = next((
            status_group.upper() for status_group, codes
            in self._rs_codes.items() for code in codes
            if statuscode == code), "UNKNOWN")
        return status

    def parsestatus(self, status):
        Parse the status.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: home-assistant/home-assistant
Commit Name: 7a979e9f720fb03af107bb89ad94247d76e150df
Time: 2018-03-02
Author: jeroen_ter_heerdt@hotmail.com
File Name: homeassistant/components/alarm_control_panel/egardia.py
Class Name: EgardiaAlarm
Method Name: lookupstatusfromcode


Project Name: OpenNMT/OpenNMT-py
Commit Name: 90e5b974a7173ab0bba0990a690e32f25f5b725a
Time: 2019-01-14
Author: benzurdopeters@gmail.com
File Name: tools/embeddings_to_torch.py
Class Name:
Method Name: get_vocabs


Project Name: matplotlib/matplotlib
Commit Name: 17613bb4266accef84d96d90cdfe89d11ee3e641
Time: 2017-12-25
Author: anntzer.lee@gmail.com
File Name: lib/matplotlib/_pylab_helpers.py
Class Name: Gcf
Method Name: destroy_fig