Sets the value of the specified attribute in the current item to the
given value.
11625
public Item withShort(String attrName, short val) {
        checkInvalidAttrName(attrName);
        return withNumber(attrName, Short.valueOf(val));
    }
990650
def set(self, name, value):
        
        attr = self.getAttribute(name)
        if attr is None:
            attr = Attribute(name, value)
            self.append(attr)
        else:
            attr.setValue(value)
722038
def _setAttr(self, attr, value):
        
        meth = "_set_%s" % attr
        if not hasattr(self, meth):
            raise AttributeError("No setter for attribute '%s'." % attr)
        meth = getattr(self, meth)
        meth(value)
232423
def set_item(self, key, value):
        
        keys = list(self.keys())

        # if it exists, update
        if key in keys:
            self.set_value(1,keys.index(key),str(value))

        # otherwise we have to add an element
        else:
            self.set_value(0,len(self),   str(key))
            self.set_value(1,len(self)-1, str(value))
150365
def set_value(self, instance, value):
        ''''''
        setattr(instance, self.attname, self.to_python(value))
1231351
public void setAttribute(String name, String value)
	{
		if (value != null)
			getElement().setAttribute(name, value);
		else
			getElement().removeAttribute(name);
	}
1107100
public void setAttributeValue(String attributeName, String value) {

        m_entityAttributes.remove(attributeName);
        List<String> values = new ArrayList<String>();
        values.add(value);
        m_simpleAttributes.put(attributeName, values);
        fireChange();
    }
159413
public void set(String name, Object value) {
        if (value != null) {
            attributes.put(name, String.valueOf(value));
        } else {
            attributes.remove(name);
        }

    }
702823
public void setAttribute(Object object, String attribute, Object newValue) {
        delegate.setAttribute(object, attribute, newValue);
    }
939210
public synchronized void setAttribute(String key, Boolean value)
	{
		if(attributes.containsKey(key))
		{
			attributes.remove(key);
		}
		attributes.put(key, value);
	}
762281
function( attr, val ) {
				var orgVal = this.getAttribute( attr );
				if ( val !== orgVal ) {
					!this._.attrChanges && ( this._.attrChanges = {} );

					// Saved the original attribute val.
					if ( !( attr in this._.attrChanges ) )
						this._.attrChanges[ attr ] = orgVal;

					this.setAttribute( attr, val );
				}
			}
121209
function setAttribute(element, attribute, value) {
        if (element.getAttribute(attribute) !== "" + value) {
            element.setAttribute(attribute, value);
        }
    }
1086192
public static void setValue(final String name, final Object attribute) {
		JKThreadLocal.get().put(name, attribute);
	}
1130267
public void setValue(Object current, String key, Object value) throws ParseException, IOException {
		throw new RuntimeException(ERR_MSG + " setValue in " + this.getClass() + " key=" + key);
	}
1051385
def _set_attribute(self, attribute, name, value):
        """"""
        try:
            if attribute is None:
                attribute = self._attribute_file_open( name )
            else:
                attribute.seek(0)

            if isinstance(value, str):
                value = value.encode()
            attribute.write(value)
            attribute.flush()
        except Exception as ex:
            self._raise_friendly_access_error(ex, name)
        return attribute
1218399
def _set(self, name, value):
        
        if value is not UNSET:
            if isinstance(value, Slotted):
                current = getattr(self, name, UNSET)
                if current is None or current is UNSET:
                    current = value.__class__()
                    current.set(value)
                    setattr(self, name, current)
                    return
                if isinstance(current, Slotted):
                    current.set(value)
                    return
            setattr(self, name, value)
705812
def add(self, attr, item):
        
        return self.set(attr, operation.Add([item]))