Permanently set the JSON configuration

        Unable to call twice.
184269
def set_json(self, config_json):
        """"""

        if self.configuration_dict is not None:
            raise RuntimeError("Can only set configuration once", self.configuration_dict)

        schema = fetch_config('ConfigurationSchema.json')
        validictory.validate(config_json, schema)

        config_json['name'] = self.name
        config_json['run_number'] = self.run
        config_json['src_dir'] = get_source_dir()
        config_json['data_dir'] = get_data_dir()
        config_json['log_dir'] = get_log_dir()

        self.configuration_dict = config_json
56955
def set(self, name, value):
        """"""
        if not hasattr(self, 'funcs'):
            raise StartupError('startup cannot be called again')
        self.variable_values[name] = value
985966
@ResponseOverride(
            description = "Set a JSON value.",
            parameters = {"name", "value", "path"}
    )
    public static void set_json_value(PluginArguments args, String name, String value, String path) throws Exception {
        HttpServletResponse response = args.getResponse();
        String content = PluginHelper.readResponseContent(response);
        JSONObject jsonContent = new JSONObject(content);

        process_json_value(jsonContent, name, value, path, true);
        PluginHelper.writeResponseContent(response, jsonContent.toString());
    }
412412
private void setInternal(String key, String value) {
		Preconditions.checkArgument(value != null && !value.isEmpty(),
			"The configuration value must not be empty.");

		configuredOptions.put(key, value);
	}
194458
public RequestParameterBuilder reset() {
        buffer = new StringBuilder(originalUrl);
        jsonConverter.setType(null);
        added = false;

        return this;
    }
41234
@Override
    public void storeJson(PortletPreferences prefs, String key, Object data)
            throws IOException, ReadOnlyException, ValidatorException {
        final String configData = mapper.writeValueAsString(data);
        prefs.setValue(key, configData);
        prefs.store();
    }
846008
def reset(self, collection, jsonFieldInit = None) :
        if not jsonFieldInit:
            jsonFieldInit = {}
        """"""
        self.collection = collection
        self.connection = self.collection.connection
        self.documentsURL = self.collection.documentsURL


        self.URL = None
        self.setPrivates(jsonFieldInit)
        self._store = DocumentStore(self.collection, validators=self.collection._fields, initDct=jsonFieldInit)
        if self.collection._validation['on_load']:
            self.validate()

        self.modified = True
391183
def forever(self, key, value):
        
        value = self.serialize(value)

        self._redis.set(self._prefix + key, value)
425582
public void setFromJson(final byte[] persisted) {
    try {
      SessionState decoded = JACKSON.readValue(persisted, SessionState.class);
      decoded.foreachPartition(new Action1<PartitionState>() {
        int i = 0;

        @Override
        public void call(PartitionState dps) {
          partitionStates.set(i++, dps);
        }
      });
    } catch (Exception ex) {
      throw new RuntimeException("Could not decode SessionState from JSON.", ex);
    }
  }
163423
function(json) {
			Object.keys(json).forEach(function(key) {
				this.set(key, json[key]);
			}, this);
		}
1369174
def _try_persist_settings(serializable_data: dict):
    
    with open(CONFIG_FILE, "w") as json_file:
            json.dump(serializable_data, json_file, indent=4)
933313
private static void setProperty( Object bean, String key, Object value, JsonConfig jsonConfig )
         throws Exception {
      PropertySetStrategy propertySetStrategy = jsonConfig.getPropertySetStrategy() != null ? jsonConfig.getPropertySetStrategy()
            : PropertySetStrategy.DEFAULT;
      propertySetStrategy.setProperty( bean, key, value, jsonConfig );
   }
1195721
def _set(self, data, version):
        """"""

        self.zk.set(self.path, json.dumps(data), version)
696020
public function setJson($key, $value = null): void
    {
        if (is_array($key)) {
            foreach ($key as $k => $v) {
                $this->setJson($k, $v);
            }
            return;
        }

        $this->_jsonData[$key] = $value;
    }
652288
public JSONObject put(String key, long value) throws JSONException {
        put(key, Long.valueOf(value));
        return this;
    }
126574
function setJsonField(json, field, value) {
    if (value === undefined && typeof value === 'undefined') {
        //Ignore undefined values
        return;
    }
    if (value === null) {
        //Ignore null values
        return;
    }
    if (typeof value === 'boolean' && value === false) {
        //Ignore false values since they are generally default values.
        return;
    }
    json[field] = value;
}
631735
private void resetJcsegTaskConfig(JcsegTaskConfig config, JSONObject json)
    {
        if ( json.has("jcseg_maxlen") ) {
            config.setMaxLength(json.getInt("jcseg_maxlen"));
        }
        if ( json.has("jcseg_icnname") ) {
            config.setICnName(json.getBoolean("jcseg_icnname"));
        }
        if ( json.has("jcseg_pptmaxlen") ) {
            config.setPPT_MAX_LENGTH(json.getInt("jcseg_pptmaxlen"));
        }
        if ( json.has("jcseg_cnmaxlnadron") ) {
            config.setMaxCnLnadron(json.getInt("jcseg_cnmaxlnadron"));
        }
        if ( json.has("jcseg_clearstopword") ) {
            config.setClearStopwords(json.getBoolean("jcseg_clearstopword"));
        }
        if ( json.has("jcseg_cnnumtoarabic") ) {
            config.setCnNumToArabic(json.getBoolean("jcseg_cnnumtoarabic"));
        }
        if ( json.has("jcseg_cnfratoarabic") ) {
            config.setCnFactionToArabic(json.getBoolean("jcseg_cnfratoarabic"));
        }
        if ( json.has("jcseg_keepunregword") ) {
            config.setKeepUnregWords(json.getBoolean("jcseg_keepunregword"));
        }
        if ( json.has("jcseg_ensencondseg") ) {
            config.setEnSecondSeg(json.getBoolean("jcseg_ensencondseg"));
        }
        if ( json.has("jcseg_stokenminlen") ) {
            config.setSTokenMinLen(json.getInt("jcseg_stokenminlen"));
        }
        if ( json.has("jcseg_nsthreshold") ) {
            config.setNameSingleThreshold(json.getInt("jcseg_nsthreshold"));
        }
        if ( json.has("jcseg_keeppunctuations") ) {
            config.setKeepPunctuations(json.getString("jcseg_keeppunctuations"));
        }
    }