Restore the state of this InMemoryStorageEngine from a dict.
356470
def restore(self, state):
        """"""

        storage_data = state.get(u'storage_data', [])
        streaming_data = state.get(u'streaming_data', [])

        if len(storage_data) > self.storage_length or len(streaming_data) > self.streaming_length:
            raise ArgumentError("Cannot restore InMemoryStorageEngine, too many readings",
                                storage_size=len(storage_data), storage_max=self.storage_length,
                                streaming_size=len(streaming_data), streaming_max=self.streaming_length)

        self.storage_data = [IOTileReading.FromDict(x) for x in storage_data]
        self.streaming_data = [IOTileReading.FromDict(x) for x in streaming_data]
327259
def from_dict(self, dic):
        """"""
        self._reset_data()
        for cluster, vals in dic.items():
            for field, value in vals.items():
                self.set(field, [cluster], value, add_to_stack=False)
        self._data_base = deepcopy(self._data)
820326
def restore(self):
        """"""
        signal.signal(signal.SIGINT, self.original_sigint)
        signal.signal(signal.SIGTERM, self.original_sigterm)
        if os.name == 'nt':
            signal.signal(signal.SIGBREAK, self.original_sigbreak)
581977
public function restore() 
    {
        $state = array_pop($this->savedStates);
        if ($state != NULL) {
            $this->transform = $state['transform'];
            $this->fillStyle = $state['fillStyle'];
        }
    }
755482
def from_storage(self, storage):
        
        self._storage_obj = storage.get(self._data["name"])
        self._storage_loaded = True
1138188
def restore(self):
        
        try:
            for modname, mod in self._saved.items():
                if mod is not None:
                    sys.modules[modname] = mod
                else:
                    try:
                        del sys.modules[modname]
                    except KeyError:
                        pass
        finally:
            imp.release_lock()
699835
def rev(self, rev):
        """"""
        d = self.dict
        d['revision'] = rev
        return self.from_dict(d)
1129658
def restore_state(self):
        """"""
        last_path = setting('directory', '', expected_type=str)
        self.output_directory.setText(last_path)
1187964
def remove_module_load(state_dict):
    """"""
    new_state_dict = OrderedDict()
    for k, v in state_dict.items(): new_state_dict[k[7:]] = v
    return new_state_dict
420694
def reset_state(self):
        """"""
        self.y = self.y0.copy()
        self.dy = np.zeros(self.dmps)   
        self.ddy = np.zeros(self.dmps)  
        self.cs.reset_state()
356212
def fromDict(cls, _dict):
        
        obj = cls()
        obj.__dict__.update(_dict)
        return obj
20459
def restore_session(self, cookie):
        """"""
        log.debug("Restoring session from cookie: {}".format(cookie))
        opener = build_opener()
        opener.addheaders.append(('Cookie', cookie))
        self._opener = opener
1073199
public void restoreState() {
		String memberStr = keyValStore.getValue(keyValStoreName);
		if (null != memberStr) {
			// The member was found in the key value store, so restore the
			// state.
			byte[] serialized = Hex.decode(memberStr);
			ByteArrayInputStream bis = new ByteArrayInputStream(serialized);
			try {
				ObjectInputStream ois = new ObjectInputStream(bis);
				Member state = (Member)ois.readObject();
				if (state != null) {
					this.name = state.name;
			        this.roles = state.roles;
			        this.account = state.account;
			        this.affiliation = state.affiliation;
			        this.enrollmentSecret = state.enrollmentSecret;
			        this.enrollment = state.enrollment;
				} else {
					logger.debug(String.format("Could not find member %s from keyvalue store", this.name));
				}
			} catch (IOException | ClassNotFoundException e) {
				logger.debug(String.format("Could not restore state of member %s", this.name), e);
			}
		}
   }
26353
def saveCopy(self) :
        ""
        old_key = self._key
        self.reset(self.collection)
        self.save()
        return (old_key, self._key)
61635
def restore(self, nosave=False):
        
        if self.exists:
            obj = self.content_type.model_class().objects.get(uid=self.uid)
        else:
            obj = self.content_type.model_class()(uid=self.uid)
        for field in self.fields + self.foreignkeys:
            obj.__setattr__(field, self.get(field))
        if not nosave: obj.save()
        return obj
154973
def reload(self):
        ''' '''
        key = self.key()
        redis = type(self).get_redis()

        if not redis.exists(key):
            raise ModelNotFoundError('This object has been deleted')

        data = debyte_hash(redis.hgetall(key))

        for fieldname, field in self.proxy:
            value = field.recover(data, redis)

            setattr(
                self,
                fieldname,
                value
            )

        return self
392707
def restore_expanded_state(self):
        """"""
        if self.__expanded_state is not None:
            # In the old project explorer, the expanded state was a dictionnary:
            if isinstance(self.__expanded_state, list):
                self.fsmodel.directoryLoaded.connect(
                                                  self.restore_directory_state)
                self.fsmodel.directoryLoaded.connect(
                                                self.follow_directories_loaded)