Restore config from selected target item (openy or revision ID).
778067
public function applySelectedConfigVersion(array &$form, FormStateInterface $form_state) {
    $compare_with = $form_state->getValue('compare_with', self::DEFAULT_DIFF_TARGET);

    if ($compare_with == self::DEFAULT_DIFF_TARGET) {
      // Restore config from file system (Open Y feature).
      $this->upgradeLogManager->applyOpenyVersion($this->entity->getName());
    }
    else {
      // Restore config from revision data.
      $revision = $this->upgradeLogManager
        ->loggerEntityStorage
        ->loadRevision($compare_with);
      $revision->applyConfigVersionFromData();
    }
  }
1327338
def restore_revision!(id, revision_number)
      record = restore_revision(id, revision_number)
      if record
        record.store_revision do
          save_restorable_associations(record, revisionable_associations)
        end
      end
      return record
    end
154000
public function restoreConfigScope()
    {
        $event = new ScopeChangeEvent($this->originalSiteAccess);
        $this->eventDispatcher->dispatch(MVCEvents::CONFIG_SCOPE_RESTORE, $event);

        return $event->getSiteAccess();
    }
480354
function restore_options() {
  // Use default value showChangeLog = true.
  chrome.storage.sync.get({
    showChangeLog: true
  }, function (items) {
    document.getElementById('show_changelog').checked = items.showChangeLog;
  });
}
300544
def reset(self):
        

        # Delete user config file
        try:
            os.remove(self._user_config_file)
        except FileNotFoundError:
            pass

        # Empty and refill the config object
        for section_name in self.sections():
            self.remove_section(section_name)
        self.read_defaults()
930620
def restore_default(self, index):
        
        spec = self.get_configspec_str(index)
        if spec is None or isinstance(spec, Section):
            return
        try:
            default = self._vld.get_default_value(spec)
            defaultstr = self._val_to_str(default)
            self.setData(index, defaultstr)
        except KeyError:
            raise ConfigError("Missing Default Value in spec: \"%s\"" % spec)
626982
def patch_config(config, data):
    """"""
    is_changed = False
    for name, value in data.items():
        if value is None:
            if config.pop(name, None) is not None:
                is_changed = True
        elif name in config:
            if isinstance(value, dict):
                if isinstance(config[name], dict):
                    if patch_config(config[name], value):
                        is_changed = True
                else:
                    config[name] = value
                    is_changed = True
            elif str(config[name]) != str(value):
                config[name] = value
                is_changed = True
        else:
            config[name] = value
            is_changed = True
    return is_changed
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]
55982
def patch(patch, ids):
    """"""
    records_deprecation_warning()

    from .api import Record

    patch_content = patch.read()

    if ids:
        for id_ in ids:
            rec = Record.get_record(id_).patch(patch_content).commit()
            current_app.logger.info("Created new revision {0}".format(
                rec.revision_id))
            click.echo(rec.id)
        db.session.commit()
123695
def save_config(path, config):
    """"""
    import json
    config['version'] = 1
    with open(path, 'w') as f:
        json.dump(config, f)
1336728
function restore() {
    if (isOriginal) return;
    else isOriginal = true;
    ['log', 'debug', 'info', 'warn', 'error'].forEach((item) => {
        console[item] = originalConsoleFunctions[item];
    });
}
1186213
def get_revision_of_build_configuration(revision_id, id=None, name=None):
    
    data = get_revision_of_build_configuration_raw(revision_id, id, name)
    if data:
        return utils.format_json_list(data)
631831
def clear_restore_points(self, name=None):
        '''
        '''
        if name is None:
            self.config_state.clear()
        else:
            del self.config_state[name]
1212802
def reset_config_files():
    """"""
    print("*** Reset Spyder settings to defaults ***", file=STDERR)
    for fname in SAVED_CONFIG_FILES:
        cfg_fname = get_conf_path(fname)
        if osp.isfile(cfg_fname) or osp.islink(cfg_fname):
            os.remove(cfg_fname)
        elif osp.isdir(cfg_fname):
            shutil.rmtree(cfg_fname)
        else:
            continue
        print("removing:", cfg_fname, file=STDERR)
215511
def _discard_config(self):
        """"""
        discard_candidate = "copy running-config {}".format(
            self._gen_full_path(self.candidate_cfg)
        )
        discard_merge = "copy null: {}".format(self._gen_full_path(self.merge_cfg))
        self.device.send_command_expect(discard_candidate)
        self.device.send_command_expect(discard_merge)
1242229
def _reset_changes(self):
        """"""
        self._original = {}
        if self.last_updated is not None:
            self._original['last_updated'] = self.last_updated
970420
def restoreSettings(self, settings):
        
        value = unwrapVariant(settings.value('recent_files'))
        if value:
            self.setFilenames(value.split(os.path.pathsep))