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

Before Change


            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

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: 6

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: oddt/oddt
Commit Name: 86698c801848975de9a21fb17093e045b6271ea3
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: rdkit_fixer.py
Class Name:
Method Name: PreparePDBMol


Project Name: emedvedev/attention-ocr
Commit Name: 8858bd041f8d0fac28a45db47da4764f0dee3e52
Time: 2017-08-10
Author: edward.medvedev@gmail.com
File Name: aocr/util/data_gen.py
Class Name: DataGen
Method Name: convert_lex