sets an attribute value for a given field name
509796
def set_value(self, field_name, value):
        
        if field_name in self.fields:
            if not value is None:
                self._dict['attributes'][field_name] = _unicode_convert(value)
            else:
                pass
        elif field_name.upper() in ['SHAPE', 'SHAPE@', "GEOMETRY"]:
            if isinstance(value, dict):
                if 'geometry' in value:
                    self._dict['geometry'] = value['geometry']
                elif any(k in value.keys() for k in ['x','y','points','paths','rings', 'spatialReference']):
                    self._dict['geometry'] = value
            elif isinstance(value, AbstractGeometry):
                self._dict['geometry'] = value.asDictionary
            elif arcpyFound:
                if isinstance(value, arcpy.Geometry) and \
                   value.type == self.geometryType:
                    self._dict['geometry']=json.loads(value.JSON)
            self._geom = None
            self._geom = self.geometry
        else:
            return False
        self._json = json.dumps(self._dict, default=_date_handler)
        return True
1044933
public void setAttr(String attr, Object val) throws NamingException {
    getAttributes().put(attr, val);
  }
1145326
public void setAttribute(String name, String value) {
        this.myAttrs.put(name.toLowerCase(), value);
    }
145922
public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(ISSUER_NAME)) {
            if (!(obj instanceof GeneralNames)) {
              throw new IOException("Attribute value should be of" +
                                    " type GeneralNames.");
            }
            names = (GeneralNames)obj;
        } else {
          throw new IOException("Attribute name not recognized by " +
                        "CertAttrSet:IssuerAlternativeName.");
        }
        encodeThis();
    }
39557
public function setAttribute($name, $attribute, $value)
    {
        $this->getField($name)->setAttribute($attribute, $value);
    }
1134567
public void set(String name, Object obj) throws IOException {
        if (!(obj instanceof Integer)) {
            throw new IOException("Attribute must be of type Integer.");
        }
        if (name.equalsIgnoreCase(REASON)) {
            reasonCode = ((Integer)obj).intValue();
        } else {
            throw new IOException
                ("Name not supported by CRLReasonCodeExtension");
        }
        encodeThis();
    }
738651
public void setStringAttribute(String name, String value) {
		ensureAttributes();
		Attribute attribute = new StringAttribute(value);
		attribute.setEditable(isEditable(name));
		getAllAttributes().put(name, attribute);

	}
1307196
def set_field(self, name, value):
        
        if not any([isinstance(value, t) for t in {int, float, bool, str}]):
            LOGGER.debug('Invalid field value: %r', value)
            raise ValueError('Value must be a str, bool, integer, or float')
        self.fields[name] = value
774518
def set_attribute(self, key, value):
        
        if not isinstance(key, str) or not isinstance(value, str):
            raise ValueError("The arguments 'key' and 'value' must both be "
                             "strings. Instead they are {} and {}.".format(
                                 key, value))
        self.extra_data[key] = value
1051423
def set_attr(self, name, value):
    
    self.exec_script("node.setAttribute(%s, %s)" % (repr(name), repr(value)))
246412
@Override
	public void setAttribute(String name, Object value) {
		attributesSupport.setAttribute(name, value);
	}
232558
public static void setValue(Object instance, String fieldName, Object value) {
        try {
            Field f = findFieldRecursively(instance.getClass(), fieldName);
            if (f == null)
                throw new NoSuchMethodException("Cannot find field " + fieldName + " on " + instance.getClass() + " or superclasses");
            f.setAccessible(true);
            f.set(instance, value);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
760340
public void setAttribute(ObjectName name, String attrName, Object value) throws Exception {
		checkClientConnected();
		Attribute attribute = new Attribute(attrName, value);
		mbeanConn.setAttribute(name, attribute);
	}
119902
def _set_attributes(self):
        """"""
        for parameter, data in self._data.items():
            if isinstance(data, dict) or isinstance(data, OrderedDict):
                field_names, field_values = zip(*data.items())
                sorted_indices = np.argsort(field_names)
                attr = namedtuple(
                    parameter, [field_names[i] for i in sorted_indices]
                )
                setattr(
                    self, parameter,
                    attr(*[field_values[i] for i in sorted_indices])
                )
            else:
                setattr(self, parameter, data)
937632
private void setField(Field field, Object instance, Object value) throws SlickXMLException {
		try {
			field.setAccessible(true);
			field.set(instance, value);
		} catch (IllegalArgumentException e) {
			throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
		} catch (IllegalAccessException e) {
			throw new SlickXMLException("Failed to set: "+field+" for an XML attribute, is it valid?", e);
		} finally {
			field.setAccessible(false);
		}
	}
561831
def _setVal(self, name, val, defVal = None):
        """"""
        if val == defVal:
            return
        if not hasattr(self, "vals"):
            self.vals = {}
        self.vals[name] = val
1356679
function SetButtonAttribute($optValue, $attribute, $value) {
        if (!isset($this->fieldAttributes[$optValue])) {
            $this->fieldAttributes[$optValue] = array();
        }
        $this->fieldAttributes[$optValue][$attribute] = $value;
    }