Restores persisted field values from preferences.
173255
private void restore() {
    Preferences pref = Preferences
        .userNodeForPackage(ConnectionDialog.class);

    getHostField().setText(pref.get("host", "localhost"));
    getUserField().setText(pref.get("user", "guest"));

    boolean remember = pref.getBoolean("remember", false);
    boolean passwordSet = false;
    getRememberPasswordCheckBox().setSelected(remember);
    if (remember) {
      byte[] cipherText = pref.getByteArray("password", null);
      if (cipherText != null) {
        try {
          Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
          KeyGenerator keygen = KeyGenerator.getInstance("AES");
          SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
          random.setSeed(new byte[]{
            0x60, (byte) 0xFD, 0x28, 0x07, 0x35, 0x4A, 0x0D, 0x3B
          });
          byte[] iv = new byte[16];
          random.nextBytes(iv);
          IvParameterSpec spec = new IvParameterSpec(iv);
          keygen.init(128, random);
          cipher.init(Cipher.DECRYPT_MODE, keygen.generateKey(), spec);
          byte[] clearText = cipher.doFinal(cipherText);
          String password = new String(clearText);
          getPasswordField().setText(password);
          passwordSet = true;
        } catch (Exception e) {
          logger.error("Could not decrypt password", e);
        }
      }
    }
    if (!passwordSet) {
      getPasswordField().setText("");
    }
  }
1322410
def revert(self):
        
        for attr, value in self._changed.items():
            setattr(django_settings, attr, value)
        for attr in self._added:
            delattr(django_settings, attr)
        self._changed = {}
        self._added = []
        if self.isolated:
            self._isolated_overrides = BaseSettings()
1212699
protected function restoreFieldsForCount()
    {
        foreach (['orders', 'limit', 'offset', 'columns'] as $field) {
            $this->{$field} = $this->backups[$field];
        }

        foreach (['order', 'select'] as $key) {
            $this->bindings[$key] = $this->bindingBackups[$key];
        }

        $this->backups = [];
        $this->bindingBackups = [];
    }
543292
public final void restoreDefaults() {
        SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();

        if (getPreferenceScreen() != null) {
            restoreDefaults(getPreferenceScreen(), sharedPreferences);
        }
    }
1369174
def _try_persist_settings(serializable_data: dict):
    
    with open(CONFIG_FILE, "w") as json_file:
            json.dump(serializable_data, json_file, indent=4)
256750
def restoreSettings(self, settings):
        
        val = unwrapVariant(settings.value('format'))
        if val:
            self.setFormatText(val)
        
        levels = unwrapVariant(settings.value('levels'))
        if levels:
            self.setActiveLevels(map(int, levels.split(',')))
        
        logger_levels = unwrapVariant(settings.value('loggerLevels'))
        if logger_levels:
            for key in logger_levels.split(','):
                logger, lvl = key.split(':')
                lvl = int(lvl)
                self.setLoggerLevel(logger, lvl)
910546
def clean_value(self):
        '''
        
        '''
        # XXX cached_property is used only for set initial state
        #     this property should be set every time field data
        #     has been changed, for instance, in accept method
        python_data = self.parent.python_data
        if self.name in python_data:
            return python_data[self.name]
        return self.get_initial()
1145702
def previous(self, field):
        """"""

        # handle deferred fields that have not yet been loaded from the database
        if self.instance.pk and field in self.deferred_fields and field not in self.saved_data:

            # if the field has not been assigned locally, simply fetch and un-defer the value
            if field not in self.instance.__dict__:
                self.get_field_value(field)

            # if the field has been assigned locally, store the local value, fetch the database value,
            # store database value to saved_data, and restore the local value
            else:
                current_value = self.get_field_value(field)
                self.instance.refresh_from_db(fields=[field])
                self.saved_data[field] = deepcopy(self.get_field_value(field))
                setattr(self.instance, self.field_map[field], current_value)

        return self.saved_data.get(field)
218567
def Persist(self, config_option):
    """"""
    if not self.writeback:
      raise RuntimeError("Attempting to write a configuration without a "
                         "writeback location.")

    writeback_raw_value = dict(self.writeback.RawData()).get(config_option)
    raw_value = None

    for parser in [self.parser] + self.secondary_config_parsers:
      if parser == self.writeback:
        continue

      config_raw_data = dict(parser.RawData())
      raw_value = config_raw_data.get(config_option)
      if raw_value is None:
        continue
      break

    if writeback_raw_value == raw_value:
      return

    if raw_value is None:
      return

    self.SetRaw(config_option, raw_value)
    self.Write()
370204
def _del_cached_value(self, xblock):
        """"""
        # pylint: disable=protected-access
        if hasattr(xblock, '_field_data_cache') and self.name in xblock._field_data_cache:
            del xblock._field_data_cache[self.name]
430203
protected function restoreFieldsForCount()
	{
		foreach (['orders', 'limit', 'offset', 'columns'] as $field)
		{
			$this->{$field} = $this->backups[$field];
		}

		$this->backups = [];
	}
247027
def restore_row(self, row, schema):
        
        row = list(row)
        for index, field in enumerate(schema.fields):
            if self.__dialect == 'postgresql':
                if field.type in ['array', 'object']:
                    continue
            row[index] = field.cast_value(row[index])
        return row
472769
def restoreDataSet( settings, key, dataSet ):
    
    for datakey in dataSet.keys():
        vtype = unwrapVariant(settings.value('%s/%s/type' % (key, datakey)))
        value = unwrapVariant(settings.value('%s/%s/value' % (key, datakey)))
        
        if ( vtype is None ):
            continue
        
        vtype = nativestring(vtype)
        
        if ( vtype in _dataValueTypes ):
            datavalue = _dataValueTypes[vtype][1](value)
        else:
            logger.warning('Could not restore %s' % vtype)
            continue
        
        if ( type(datavalue).__name__ == 'QString' ):
            datavalue = unicode(datavalue)
        
        dataSet.setValue(datakey, datavalue)
194230
def restore(self, value, context=None):
        
        # ensure this value is a string type
        if isinstance(value, (str, unicode)):
            value = projex.text.decoded(value)

        return super(AbstractStringColumn, self).restore(value, context)
939391
@Override
    public void restoreState(final FacesContext context, final Object state) {
        if (state == null) {
            return;
        }

        final Object values[] = (Object[]) state;
        super.restoreState(context, values[0]);
        final Object restoredSubmittedValues = values[1];
        final Object restoredLocalValues = values[2];
        final Object restoredInvalidUpdates = values[3];
        final Object restoredColMappings = values[4];
        final Object restoredSortedList = values[5];
        final Object restoredRowMap = values[6];
        final Object restoredRowNumbers = values[7];

        if (restoredSubmittedValues == null) {
            submittedValues.clear();
        }
        else {
            submittedValues = (Map<SheetRowColIndex, String>) restoredSubmittedValues;
        }

        if (restoredLocalValues == null) {
            localValues.clear();
        }
        else {
            localValues = (Map<SheetRowColIndex, Object>) restoredLocalValues;
        }

        if (restoredInvalidUpdates == null) {
            getInvalidUpdates().clear();
        }
        else {
            invalidUpdates = (List<SheetInvalidUpdate>) restoredInvalidUpdates;
        }

        if (restoredColMappings == null) {
            columnMapping = null;
        }
        else {
            columnMapping = (Map<Integer, Integer>) restoredColMappings;
        }

        if (restoredSortedList == null) {
            getFilteredValue().clear();
        }
        else {
            setFilteredValue((List<Object>) restoredSortedList);
        }

        if (restoredRowMap == null) {
            rowMap = null;
        }
        else {
            rowMap = (Map<String, Object>) restoredRowMap;
        }

        if (restoredRowNumbers == null) {
            rowNumbers = null;
        }
        else {
            rowNumbers = (Map<String, Integer>) restoredRowNumbers;
        }
    }
272383
def fix_additional_fields(data):
        """"""
        result = dict()
        for key, value in data.items():
            if isinstance(value, dict):
                result.update(KserSpan.to_flat_dict(key, value))
            else:
                result[key] = value
        return result
523566
def _restore(self, value):
        """"""

        items, subs = value
        self.clear()
        for key, value in items:
            self[key] = value
            if key in subs:
                value.sub_frames._restore(subs[key])