Set field of an option to a given value.
9398
public void set(SourceCodeLocation sourceCodeLocation, String name, Value value) {
        if (name.length() > 1) {
            int dot;
            if (name.charAt(0) == LPAREN) {
                int start = name.indexOf(RPAREN);
                dot = name.indexOf(DOT, start);
            } else {
                dot = name.indexOf(DOT);
            }
            if (dot > 0) {
                String fieldName = name.substring(0, dot);
                String rest = name.substring(dot + 1);
                Key key = createKey(fieldName);
                DynamicMessage msg;
                if (fields.containsKey(key)) {
                    msg = getChildMessage(value, key);
                } else {
                    msg = new DynamicMessage();
                    fields.put(key, Value.createMessage(sourceCodeLocation, msg));
                }
                msg.set(sourceCodeLocation, rest, value);
            } else {
                Key key = createKey(name);
                set(key, value);
            }
        } else {
            Key key = Key.field(name);
            set(key, value);
        }
    }
631030
def setField(self, new_value):
        
        self.field_strength = self.field_strength._replace(
            val=new_value
        )
1125927
def set_value(self, model, value):
        
        if value is None and self.required:
            raise AttributeError("This field is required.")

        if value is not None:
            value = self._converter(value)

        setattr(model, self.storage_name, value)
506888
void setValue(String optionValue) {
      if (StringUtils.isNullOrBlank(optionValue) && isBoolean()) {

         this.value = true;

      } else if (!StringUtils.isNullOrBlank(optionValue)) {

         if (Collection.class.isAssignableFrom(type)) {

            Class<?> genericType = field == null
                                   ? String.class
                                   : (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
            this.value = Convert.convert(optionValue, type, genericType);

         } else if (Map.class.isAssignableFrom(type)) {

            Class<?> keyType = field == null
                               ? String.class
                               : (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];
            Class<?> valueType = field == null
                                 ? String.class
                                 : (Class<?>) ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[1];
            this.value = Convert.convert(optionValue, type, keyType, valueType);

         } else {

            this.value = Convert.convert(optionValue, type);

         }

      }


   }
1072110
def set_option_value(self, name, value):
		
		option = self.get_option(name)
		old_value = option.value
		if option.type in ('str', 'rfile'):
			option.value = value
		elif option.type == 'int':
			value = value.lower()
			if not value.isdigit():
				if value.startswith('0x') and string_is_hex(value[2:]):
					value = int(value[2:], 16)
				else:
					raise TypeError('invalid value type')
			option.value = int(value)
		elif option.type == 'flt':
			if value.count('.') > 1:
				raise TypeError('invalid value type')
			if not value.replace('.', '').isdigit():
				raise TypeError('invalid value type')
			option.value = float(value)
		elif option.type == 'bool':
			if value.lower() in ['true', '1', 'on']:
				option.value = True
			elif value.lower() in ['false', '0', 'off']:
				option.value = False
			else:
				raise TypeError('invalid value type')
		else:
			raise Exception('unknown value type')
		if option.callback and not option.callback(value, old_value):
			option.value = old_value
			return False
		return True
930819
public function setFieldOption(string $option, $value): self
    {
        //Retrieve the single existing field for alteration.
        $params = $this->getParams();
        if (\count($params) < 1) {
            throw new InvalidException('No field has been set');
        }
        $key = \key($params);
        $params[$key][$option] = $value;

        return $this->setParam($key, $params[$key]);
    }
930852
def set(self, field, value = None):
        
        if value is None and isinstance(field, dict):
            self.content(field)
        if field and value:
            self.data[field] = value
        return self
474009
protected void setValueToField(Field field, Object bean, Object value) {
        try {
            field.setAccessible(true);
            field.set(bean, value);
        } catch (Exception e) {
            throw new PropertyLoaderException(
                    String.format("Can not set bean <%s> field <%s> value", bean, field), e
            );
        }
    }
485609
public <T> void put(Option<T> key, T value) {
        this.values.put(key, value);
    }
871207
def set_default_option(cls, key, value):
        """"""
        cls._default_options.update(cls._option_schema({key: value}))
1236303
def set_string(self, option, value):
        
        if not isinstance(value, str):
            raise TypeError("%s must be a string" % option)

        self.options[option] = value
289909
def value(self, value):
        
        self.client.nowait(
            'set_field', (Literal('browser'), self.element, value))
1192779
public function setFieldOption($field, $option, $value)
    {
        if (!isset($this->fields[$field])) {
            throw new \Exception("Cannot set field option: Field {$field} not found");
        }

        $this->fields[$field]['options'][$option] = $value;
    }
862596
function setValue(option, value){
		
		// Assign the value only to the option name it matched
		if(noAliasPropagation){
			let name = option.lastMatchedName;
			
			// Special alternative:
			// In lieu of using the matched option name, use the first --long-name only
			if("first-only" === noAliasPropagation)
				name = option.longNames[0] || option.shortNames[0];
			
			// camelCase?
			name = formatName(name, noCamelCase);
			
			// This option's already been set before
			if(result.options[name])
				resolveDuplicate(option, name, value);
			
			else result.options[name] = value;
		}
		
		// Copy across every alias this option's recognised by
		else{
			const {names} = option;
			
			for(let name of names){
				
				// Decide whether to camelCase this option name
				name = formatName(name, noCamelCase);
				
				// Ascertain if this option's being duplicated
				if(result.options[name])
					resolveDuplicate(option, name, value);
				
				result.options[name] = value;
			}
		}
	}
505746
def set_custom_value(self, field_name, value):
        
        custom_field = self.get_custom_field(field_name)
        custom_value = CustomFieldValue.objects.get_or_create(
            field=custom_field, object_id=self.id)[0]
        custom_value.value = value
        custom_value.save()
789349
public void setValue(String fieldName, String value) {
    int index = getFieldIndex(fieldName);
    assert(index != -1);
    values[index] = value;
  }
1222603
def _option(value):
    '''
    
    '''
    if value in __opts__:
        return __opts__[value]
    master_opts = __pillar__.get('master', {})
    if value in master_opts:
        return master_opts[value]
    if value in __pillar__:
        return __pillar__[value]