59d8b58dced84ed5cc2846f8fe9c522b16cc7c05,sos/sos_executor.py,Base_Executor,reset_dict,#Base_Executor#,134

Before Change


        env.sos_dict.set("__step_output__", [])

        // load configuration files
        if "CONFIG" not in self.shared:
            cfg = {}
            sos_config_file = os.path.join(os.path.expanduser("~"), ".sos", "config.yml")
            if os.path.isfile(sos_config_file):
                try:
                    with open(sos_config_file) as config:
                        cfg = yaml.safe_load(config)
                except Exception as e:
                    raise RuntimeError("Failed to parse global sos config file {}, is it in YAML/JSON format? ({})".format(sos_config_file, e))
            // local config file
            sos_config_file = "config.yml"
            if os.path.isfile(sos_config_file):
                try:
                    with open(sos_config_file) as config:
                        dict_merge(cfg, yaml.safe_load(config))
                except Exception as e:
                    raise RuntimeError("Failed to parse local sos config file {}, is it in YAML/JSON format? ({})".format(sos_config_file, e))
            // user-specified configuration file.
            if self.config["config_file"] is not None:
                if not os.path.isfile(self.config["config_file"]):
                    raise RuntimeError("Config file {} not found".format(self.config["config_file"]))
                try:
                    with open(self.config["config_file"]) as config:
                        dict_merge(cfg, yaml.safe_load(config))
                except Exception as e:
                    raise RuntimeError("Failed to parse config file {}, is it in YAML/JSON format? ({})".format(self.config["config_file"], e))
            // set config to CONFIG
            env.sos_dict.set("CONFIG", frozendict(cfg))

        SoS_exec("import os, sys, glob", None)
        SoS_exec("from sos.runtime import *", None)
        self._base_symbols = set(dir(__builtins__)) | set(env.sos_dict["sos_symbols_"]) | set(SOS_KEYWORDS) | set(keyword.kwlist)
        self._base_symbols -= {"dynamic"}

After Change


        cfg = {}
        sos_config_file = os.path.join(os.path.expanduser("~"), ".sos", "config.yml")
        if os.path.isfile(sos_config_file):
            with fasteners.InterProcessLock("/tmp/sos_config_"):
                try:
                    with open(sos_config_file) as config:
                        cfg = yaml.safe_load(config)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: vatlab/SoS
Commit Name: 59d8b58dced84ed5cc2846f8fe9c522b16cc7c05
Time: 2017-02-02
Author: ben.bog@gmail.com
File Name: sos/sos_executor.py
Class Name: Base_Executor
Method Name: reset_dict


Project Name: vatlab/SoS
Commit Name: 2c9b35fd80328c4c6270ef03149b7ffc17619860
Time: 2016-10-10
Author: ben.bog@gmail.com
File Name: pysos/dag.py
Class Name: SoS_DAG
Method Name: find_executable


Project Name: vatlab/SoS
Commit Name: 66ac3d23a624923817cac6ac9951978a673e7844
Time: 2016-11-07
Author: ben.bog@gmail.com
File Name: pysos/monitor.py
Class Name:
Method Name: summarizeExecution