def restore(self, state):
        """Restore this state from the output of a previous call to dump().

        Only those properties in this object and listed in state will be
        updated.  Other properties will not be modified and state may contain
        keys that do not correspond with properties in this object.

        Args:
            state (dict): A serialized representation of this object.
        """

        own_properties = set(self.get_properties())
        state_properties = set(state)

        to_restore = own_properties.intersection(state_properties)

        for name in to_restore:
            value = state.get(name)

            if name in self._complex_properties:
                value = self._complex_properties[name][1](value)

            setattr(self, name, value)
def restore ( self , state ) : own_properties = set ( self . get_properties ( ) ) state_properties = set ( state ) to_restore = own_properties . intersection ( state_properties ) for name in to_restore : value = state . get ( name ) if name in self . _complex_properties : value = self . _complex_properties [ name ] [ 1 ] ( value ) setattr ( self , name , value )
Restore this state from the output of a previous call to dump().

        Only those properties in this object and listed in state will be
        updated.  Other properties will not be modified and state may contain
        keys that do not correspond with properties in this object.

        Args:
            state (dict): A serialized representation of this object.