Restore all items expanded state
171235
def restore_expanded_state(self):
        """"""
        if self.__expanded_state is None:
            return
        for item in self.get_items()+self.get_top_level_items():
            user_text = get_item_user_text(item)
            is_expanded = self.__expanded_state.get(hash(user_text))
            if is_expanded is not None:
                item.setExpanded(is_expanded)
1040770
def restore_default(self, key):
        
        default = self.default_values[key]
        dict.__setitem__(self, key, default)
        if key not in self.defaults:
            self.defaults.append(key)
        return default
216588
def restore(self, state):
        
        import pickle
        state = pickle.loads(state)
        for k in state:
            if isinstance(state[k], list):
                state[k] = np.array(state[k])
            setattr(self, k, state[k])
1259066
def restore(self, key, ttl, value):
        """"""
        return self.execute(b'RESTORE', key, ttl, value)
255792
function ensureExpandState() {
        var state = ed.$expandRegionState;
        var pos = pToI(ed, ed.getCursorPosition());
        if (state
          // has cursor moved? invalidate expansion state
         && (state.range  [0] === pos || state.range[1] === pos)) 
           return state;

        var aceRange = ed.getSelectionRange();
        return ed.$expandRegionState = {
          range: [pToI(ed,aceRange.start), pToI(ed,aceRange.end)]
        };
      }
177300
function _restoreCanvas(ctx, data) {
	if (data.savedTransforms.length === 0) {
		// Reset transformation state if it can't be restored any more
		data.transforms = _cloneTransforms(baseTransforms);
	} else {
		// Restore canvas context
		ctx.restore();
		// Restore current transform state to the last saved state
		data.transforms = data.savedTransforms.pop();
	}
}
314742
public void restoreState(FacesContext context, Object state) {

        if (context == null) {
            throw new NullPointerException();
        }
        if (state == null) {
            return;
        }
        
        if (!component.initialStateMarked() && !defaultMap.isEmpty())
        {
            defaultMap.clear();
            if(deltaMap != null && !deltaMap.isEmpty())
            {
                deltaMap.clear();
            }
        }
        
        Object[] savedState = (Object[]) state;
        if (savedState[savedState.length - 1] != null) {
            component.initialState = (Boolean) savedState[savedState.length - 1];
        }
        int length = (savedState.length-1)/2;
        for (int i = 0; i < length; i++) {
           Object value = savedState[i * 2 + 1];
            Serializable serializable = (Serializable) savedState[i * 2];
            if (value != null) {
                if (value instanceof Collection) {
                    value = restoreAttachedState(context, value);
                } else if (value instanceof StateHolderSaver) {
                    value = ((StateHolderSaver) value).restore(context);
                } else {
                    value = (value instanceof Serializable
                             ? value
                             : restoreAttachedState(context, value));
                }
            }
            if (value instanceof Map) {
                for (Map.Entry<String, Object> entry : ((Map<String, Object>) value)
                      .entrySet()) {
                    this.put(serializable, entry.getKey(), entry.getValue());
                }
            } else if (value instanceof List) {
                List<Object> list = (List) get(serializable);
                for (Object o : ((List<Object>) value)) {
                    if (list == null || !list.contains(o)) {
                        this.add(serializable, o);
                    }
                }
            } else {
                put(serializable, value);
            }
        }
    }
1222366
def restore_defaults_ratio(self):
        """"""
        # Set the flag to true because user ask to.
        self.is_restore_default = True
        # remove current default ratio
        for i in reversed(list(range(self.container_layout.count()))):
            widget = self.container_layout.itemAt(i).widget()
            if widget is not None:
                widget.setParent(None)

        # reload default ratio
        self.restore_default_values_page()
782916
private static List<String> restoreList(String propertyName, 
                                            Object state) {

        if (state == null) {
            return null;
        }

        List<String> list = null;

        if (state instanceof String) {
            list = toSingletonList(propertyName, (String)state);
        } else if (state instanceof String[]) {
            list = Collections.unmodifiableList(Arrays.asList((String[])state));
        }

        return list;
    }
138523
def _update_all_devices(self):
        """"""
        self.all_devices = []
        self.all_devices.extend(self.keyboards)
        self.all_devices.extend(self.mice)
        self.all_devices.extend(self.gamepads)
        self.all_devices.extend(self.other_devices)
174865
def restore(self, state):
        
        self._clear()
        self._parseUserInfo({'labels': state['labels']})
        self._parseNodes(state['nodes'])
        self._keep_version = state['keep_version']
535209
def restore_state(self):
        
        settings = QSettings()
        try:
            last_path = settings.value('directory', type=str)
        except TypeError:
            last_path = ''
        self.output_directory.setText(last_path)
500777
def opt_restore(prefix, opts):
    

    return {prefix + name: value for name, value in opts.items()}
2417
static void restoreState(Bundle savedState) {
        stateKeeper.bundle = savedState;

        MvcComponent root = getRootComponent();
        doRestoreState(root);

        stateKeeper.bundle = null;
    }
767934
private void restore() {

        Element parent = getElement().getParentElement();
        if (parent != null) {
            parent.getStyle().clearZIndex();
        }
        getElement().getStyle().setVisibility(Visibility.HIDDEN);
    }
1138196
public void restoreState() {
        content.append("Q").append_i(separator);
        int idx = stateList.size() - 1;
        if (idx < 0)
            throw new IllegalPdfSyntaxException("Unbalanced save/restore state operators.");
        state = (GraphicState)stateList.get(idx);
        stateList.remove(idx);
    }
47689
def restoredata(filename=None):
    """"""
    if filename is None:
        filename = 'credolib_state.pickle'
    ns = get_ipython().user_ns
    with open(filename, 'rb') as f:
        d = pickle.load(f)
    for k in d.keys():
        ns[k] = d[k]