def to_object(self, data):
if not isinstance(data, Data):<EOL><INDENT>return data<EOL><DEDENT>if is_null_data(data):<EOL><INDENT>return None<EOL><DEDENT>inp = self._create_data_input(data)<EOL>try:<EOL><INDENT>type_id = data.get_type()<EOL>serializer = self._registry.serializer_by_type_id(type_id)<EOL>if serializer is None:<EOL><INDENT>if self._active:<EOL><INDENT>raise HazelcastSerializationError("<STR_LIT>".format(type_id))<EOL><DEDENT>else:<EOL><INDENT>raise HazelcastInstanceNotActiveError()<EOL><DEDENT><DEDENT>return serializer.read(inp)<EOL><DEDENT>except:<EOL><INDENT>handle_exception(sys.exc_info()[<NUM_LIT:1>], sys.exc_info()[<NUM_LIT:2>])<EOL><DEDENT>finally:<EOL><INDENT>pass<EOL><DEDENT>
Deserialize input data
:param data: serialized input Data object
:return: Deserialized object