fc6c75deed83ab3b85c47e53656ab85289eaea66,dataset/pipeline.py,Pipeline,_exec_inc_variable,#Pipeline#Any#Any#,455

Before Change



    def _exec_inc_variable(self, _, action):
        if self.has_variable(action["var_name"]):
            if self._variables[action["var_name"]]["lock"] is not None:
                with self._variables[action["var_name"]]["lock"]:
                    self.set_variable(action["var_name"], self.get_variable(action["var_name"]) + 1)
            else:

After Change



    def _exec_inc_variable(self, _, action):
        if self.has_variable(action["var_name"]):
            self.variables.lock(action["var_name"])
            self.set_variable(action["var_name"], self.get_variable(action["var_name"]) + 1)
            self.variables.unlock(action["var_name"])
        else:
            raise KeyError("No such variable %s exists", action["var_name"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: analysiscenter/batchflow
Commit Name: fc6c75deed83ab3b85c47e53656ab85289eaea66
Time: 2018-01-15
Author: rhudor@gmail.com
File Name: dataset/pipeline.py
Class Name: Pipeline
Method Name: _exec_inc_variable


Project Name: vatlab/SoS
Commit Name: dd5dd1abff53aa57db42b0a1777c3971eb094f9e
Time: 2017-02-13
Author: ben.bog@gmail.com
File Name: sos/target.py
Class Name: RuntimeInfo
Method Name: __setstate__


Project Name: pyprob/pyprob
Commit Name: 37c522453b2522a498dd3db7fd5bd4458073e92d
Time: 2018-11-17
Author: atilimgunes.baydin@gmail.com
File Name: pyprob/address_dictionary.py
Class Name: AddressDictionary
Method Name: __init__