Set a value for a specified custom field
        field_name - Name of the custom field you want.
        value - Value to set it to
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()
819908
def set_field(self, state, field_name, field_type, value):
        
        field_ref = SimSootValue_InstanceFieldRef.get_ref(state=state,
                                                          obj_alloc_id=self.heap_alloc_id,
                                                          field_class_name=self.type,
                                                          field_name=field_name,
                                                          field_type=field_type)
        # store value in java memory
        state.memory.store(field_ref, value)
18861
protected function set_field() {

		$properties = get_class_vars( __CLASS__ );

		// Some things must run before the others.
		$this->set_option_type();
		$this->set_settings();

		// Sanitize the properties, skipping the ones that have already run above.
		foreach ( $properties as $property => $value ) {
			if ( in_array( $property, [ 'option_name', 'option_type', 'settings' ], true ) ) {
				continue;
			}
			if ( method_exists( $this, 'set_' . $property ) ) {
				$method_name = 'set_' . $property;
				$this->$method_name();
			}
		}

		// Get all arguments with their values.
		$args = get_object_vars( $this );
		foreach ( array_keys( $args ) as $key ) {
			$args[ $key ] = $this->$key;
		}

		// Add the field to the static $fields variable properly indexed.
		Kirki::$fields[ $this->settings ] = $args;

	}
408111
function setFieldValuesNestedArray (field, items) {
    // do not process unless value
    if (!defined(items)) {
        return
    }
    // property value must be array of items
    assert.ok(Array.isArray(items), 'expected array for '+field.property)
    // index of item in values array
    var idx = 0
    // create entry in field values for each item in array
    _.each(items, item => {
        // index string for field name
        var nameIdx = '['+idx+']'
        // each entry in values is an array of fields with values
        var values = []
        // add each sub field to values with value from record item
        _.each(field.fields, field => {
            // clone field to change properties for local version
            field = _.cloneDeep(field)
            // set value from item
            setFieldValue(item, field)
            // replace index in field name
            field.name = field.name.replace('[0]', nameIdx)
            // add field to list of values for item
            values.push(field)
        })
        // add row to values
        field.values.push(values)
        // increment row count
        idx++
    })
    // get index string for new row
    var nameIdx = '['+idx+']'
    // update row index for field names that will be used for a new row
    _.each(field.fields, field => {
        field.name = field.name.replace('[0]', nameIdx)
    })
}
260132
public void setField(String name, MLArray value, int m, int n)
    {
        setField(name, value, getIndex(m,n) );
    }
404220
def set(self, instance, value, **kw):
        
        proxy_field = self.get_proxy_field(instance)
        if proxy_field is None:
            return None
        # set the field with the proper field manager of the proxy field
        fieldmanager = IFieldManager(proxy_field)
        return fieldmanager.set(instance, value, **kw)
1303621
function CustomField(obj){
    this._id = obj && obj.id;
    this._field = obj && obj.field;
    this._value = obj && obj.value;
}
724590
def change(obj, **changed_fields):
    
    obj_field_names = {
        field.name for field in obj._meta.fields
    } | {
        field.attname for field in obj._meta.fields
    } | {'pk'}

    for field_name, value in changed_fields.items():
        if field_name not in obj_field_names:
            raise ValueError("'{}' is an invalid field name".format(field_name))
        setattr(obj, field_name, value)
    return obj
1226851
def setField(self, new_value):
        
        self.B = self.B._replace(val=new_value)
400746
function setFieldValue (data, field, isRecord) {
    // do not set value for password input
    if (field.inputType === 'password') {
        return
    }
    // get value using either property or name fields
    var value = defined(data[field.property]) ? data[field.property] : data[field.name]
    // data is a record
    if (data.ImmutableCoreModelRecord) {
        // set record for field
        field.record = data
        // value was not found - could be due to resolving record so try to
        // lookup by default id column names
        if (!defined(value)) {
            // get default id column name from model
            var defaultIdColumnName = field.record.model.defaultColumns[field.property]
            // use for value if found
            if (defined(defaultIdColumnName)) {
                value = data[defaultIdColumnName]
            }
        }
    }
    // field is nested array
    if (field.nested && field.array) {
        setFieldValuesNestedArray(field, value)
    }
    // set value
    else {
        field.value = value
    }
    // if field is select then set selected flag on option that matches value
    if (field.inputType === 'select') {
        _.each(field.options, option => {
            option.selected = option.value === field.value
        })
    }
    // if field is immutable and it has a value then make it readonly
    if (isRecord && field.immutable && defined(field.value)) {
        field.readonly = true
    }
}
1133019
function() {
		if(this.options.name) {
			for(var i = 0 ; i < this.subFields.length ; i++) {
				var subFieldEl = this.subFields[i];
				subFieldEl.setFieldName(this.options.name+"["+i+"]");
			}
		}
	}
631030
def setField(self, new_value):
        
        self.field_strength = self.field_strength._replace(
            val=new_value
        )
1038190
def add_field(self, field):
        """"""
        self.remove_field(field.name)
        self._fields[field.name] = field

        if field.default is not None:
            if six.callable(field.default):
                self._default_callables[field.key] = field.default
            else:
                self._defaults[field.key] = field.default
989968
def set_virtualchain_field(cls, opdata, virtualchain_field, value):
        
        assert virtualchain_field in RESERVED_KEYS, 'Invalid field name {} (choose from {})'.format(virtualchain_field, ','.join(RESERVED_KEYS))
        opdata[virtualchain_field] = value
955121
def value_fields_for(source, order=nil)
      fields = self.send(source).fields

      fields = fields.order(order) if order

      fields.each do |i|
        i.set_value_for(self)
      end

      fields
    end
630649
def _set(self, instance, value, **kw):
        
        logger.debug("ATFieldManager::set: value=%r" % value)

        # check field permission
        if not self.field.checkPermission("write", instance):
            raise Unauthorized("You are not allowed to write the field {}"
                               .format(self.name))

        # check if field is writable
        if not self.field.writeable(instance):
            raise Unauthorized("Field {} is read only."
                               .format(self.name))

        # id fields take only strings
        if self.name == "id":
            value = str(value)

        # get the field mutator
        mutator = self.field.getMutator(instance)

        # Inspect function and apply *args and **kwargs if possible.
        mapply(mutator, value, **kw)

        return True
991469
def add_field(self, field):
        
        if not isinstance(field, fields.BaseField):
            raise ValueError('Argument "field" must be an instance of '
                             'BaseField')
        self.fields.add(field.name, field)