55cece34158493025b98ab8d75d5a85943d858b6,src/syft/core/node/common/action/function_or_constructor_action.py,RunFunctionOrConstructorAction,execute_action,#RunFunctionOrConstructorAction#Any#Any#,76

Before Change


                    )
                )

            r_arg = node.store.get_object(key=arg.id_at_location)
            result_read_permissions = self.intersect_keys(
                result_read_permissions, r_arg.read_permissions
            )
            resolved_kwargs[arg_name] = r_arg.data

        // upcast our args in case the method only accepts the original types
        (
            upcasted_args,
            upcasted_kwargs,
        ) = lib.python.util.upcast_args_and_kwargs(resolved_args, resolved_kwargs)

        // execute the method with the newly upcasted args and kwargs
        result = method(*upcasted_args, **upcasted_kwargs)

        // to avoid circular imports
        if lib.python.primitive_factory.isprimitive(value=result):
            // Wrap in a SyPrimitive
            result = lib.python.primitive_factory.PrimitiveFactory.generate_primitive(
                value=result, id=self.id_at_location
            )
        else:
            if hasattr(result, "id"):
                result._id = self.id_at_location

        // If we have no permission (None or {}) we add some default permissions based on a permission list
        if result_read_permissions is None:
            result_read_permissions = {}

        if not isinstance(result, StorableObject):
            result = StorableObject(
                id=self.id_at_location,
                data=result,
                read_permissions=result_read_permissions,
            )

        node.store[self.id_at_location] = result

    def _object2proto(self) -> RunFunctionOrConstructorAction_PB:
        Returns a protobuf serialization of self.

After Change


                    )
                )

            r_arg = node.store[arg.id_at_location]
            result_read_permissions = self.intersect_keys(
                result_read_permissions, r_arg.read_permissions
            )
            resolved_kwargs[arg_name] = r_arg.data
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: OpenMined/PySyft
Commit Name: 55cece34158493025b98ab8d75d5a85943d858b6
Time: 2021-02-08
Author: tudorcebere@gmail.com
File Name: src/syft/core/node/common/action/function_or_constructor_action.py
Class Name: RunFunctionOrConstructorAction
Method Name: execute_action


Project Name: OpenMined/PySyft
Commit Name: 658f477c38d6ba0ceb08d13fec8337437a620208
Time: 2020-08-08
Author: andrew@openmined.org
File Name: src/syft/core/node/common/action/run_class_method_action.py
Class Name: RunClassMethodAction
Method Name: execute_action


Project Name: OpenMined/PySyft
Commit Name: 55cece34158493025b98ab8d75d5a85943d858b6
Time: 2021-02-08
Author: tudorcebere@gmail.com
File Name: src/syft/core/node/common/action/get_or_set_property_action.py
Class Name: GetOrSetPropertyAction
Method Name: execute_action