bcf6219d4325d7575303d3c5b95a781b37c7b8a4,src/sos/section_analyzer.py,,get_param_of_function,#Any#Any#Any#,18

Before Change


            try:
                params.append([ast.literal_eval(arg)])
            except Exception as e:
                env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")
                try:
                    params.append([eval(compile(ast.Expression(body=arg), filename="<string>", mode="eval"), extra_dict)])
                except Exception as e:
                    env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")

After Change


            try:
                params.append([ast.literal_eval(arg)])
            except Exception as e:
                if "STEP" in env.config["SOS_DEBUG"]:
                    env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")
                try:
                    params.append([eval(compile(ast.Expression(body=arg), filename="<string>", mode="eval"), extra_dict)])
                except Exception as e:
                    if "STEP" in env.config["SOS_DEBUG"]:
                        env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")
        for kwarg in func.keywords:
            try:
                params.append([kwarg.arg, ast.literal_eval(kwarg.value)])
            except Exception as e:
                if "STEP" in env.config["SOS_DEBUG"]:
                    env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")
                try:
                    params.append([kwarg.arg, eval(compile(ast.Expression(body=kwarg.value), filename="<string>", mode="eval"), extra_dict)])
                except Exception as e:
                    if "STEP" in env.config["SOS_DEBUG"]:
                        env.log_to_file("STEP", "Failed to evaluate parameter of function {name} from {param_list}: {e}")
    return params

def get_names_of_param(name, param_list, extra_dict={}):
    tree = ast.parse(f"__null_func__({param_list})")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: vatlab/SoS
Commit Name: bcf6219d4325d7575303d3c5b95a781b37c7b8a4
Time: 2019-03-01
Author: ben.bog@gmail.com
File Name: src/sos/section_analyzer.py
Class Name:
Method Name: get_param_of_function


Project Name: vatlab/SoS
Commit Name: bcf6219d4325d7575303d3c5b95a781b37c7b8a4
Time: 2019-03-01
Author: ben.bog@gmail.com
File Name: src/sos/controller.py
Class Name:
Method Name: disconnect_controllers


Project Name: vatlab/SoS
Commit Name: bcf6219d4325d7575303d3c5b95a781b37c7b8a4
Time: 2019-03-01
Author: ben.bog@gmail.com
File Name: src/sos/section_analyzer.py
Class Name:
Method Name: get_param_of_function


Project Name: vatlab/SoS
Commit Name: bcf6219d4325d7575303d3c5b95a781b37c7b8a4
Time: 2019-03-01
Author: ben.bog@gmail.com
File Name: src/sos/controller.py
Class Name:
Method Name: connect_controllers