46b03dae5a8333a38c072da8e541da6fe5c0912d,grid/services/torch/torch_service.py,TorchService,receive_obj_break,#TorchService#Any#,36

Before Change


                // Ensure
                tensor_type = tu.types_guard(_tensor_type)
            except KeyError:
                raise TypeError(
                    "Tried to receive a non-Torch object of type {}.".format(
                        _tensor_type))
            // this could be a significant failure point, security-wise
            if ("data" in msg.keys()):
                data = obj_msg["data"]
                data = tu.tensor_contents_guard(data)

After Change


        try:
            torch_type = tu.types_guard(obj_msg)

            if torch_type in self.var_types:
                v = self.build_var(obj_msg, torch_type)
            else:
                v = self.build_tensor(obj_msg, torch_type)

            return self.handle_register(v, obj_msg)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenMined/Grid
Commit Name: 46b03dae5a8333a38c072da8e541da6fe5c0912d
Time: 2018-04-10
Author: jason@manc.us
File Name: grid/services/torch/torch_service.py
Class Name: TorchService
Method Name: receive_obj_break


Project Name: biotite-dev/biotite
Commit Name: e37538b338c88a70ccbf14c2a783126fd2564f68
Time: 2019-03-08
Author: patrick.kunzm@gmail.com
File Name: src/biotite/structure/io/general.py
Class Name:
Method Name: load_structure


Project Name: nipy/dipy
Commit Name: 014decc24e6bbb05e4383170da2cadc0f2cba973
Time: 2019-12-16
Author: francois.m.rheault@usherbrooke
File Name: dipy/io/stateful_tractogram.py
Class Name: StatefulTractogram
Method Name: __init__