Replace part of an entity by attribute.
343529
public function replaceByAttribute($attributeKey, $attributeValue, array $params)
	{
		$params['key_attribute'] = $attributeKey;
		$params['key_value']     = $this->wrapAttributeValueWithQuotes($attributeValue);

		return $this->_replace($params);
	}
1235817
private void changeSimpleValue(String attributeName, int index, String value, List<String> parentPathElements) {

        CmsAttributeHandler handler = getAttributeHandler(attributeName, parentPathElements);
        handler.changeValue(value, index);
    }
222901
def perform_partial_update(self, data, instance):
        

        for key, val in data.items():
            setattr(instance, key, val)
577516
def modify(self, **kwargs):
        """"""
        for key, val in kwargs.items():
            setattr(self, key, val)
        return self
582298
def replace_matcher(part, new_matcher)
      key = key_for(part)
      @components[key] = new_matcher.with_attribute(:name => /\(#{key}\)/)
    end
814937
protected function replaceLt($message, $attribute, $rule, $parameters)
    {
        if (is_null($value = $this->getValue($parameters[0]))) {
            return str_replace(':value', $parameters[0], $message);
        }

        return str_replace(':value', $this->getSize($attribute, $value), $message);
    }
509484
public void undo() {

        if (hasUndo()) {
            ChangeType type = m_current.getType();
            String entityId = m_current.getEntityId();
            String attributeName = m_current.getAttributeName();
            int valueIndex = m_current.getValueIndex();
            m_redo.push(m_current);
            m_current = m_undo.pop();
            changeEntityContentValues(m_current.getEntityData(), entityId, attributeName, valueIndex, type);
            fireStateChange();
        }
    }
1229748
def replaceData(self, offset: int, count: int, string: str) -> None:
        """"""
        self._replace_data(offset, count, string)
576334
public void removeAttributeValue(String attributeName, int index) {

        if (m_simpleAttributes.containsKey(attributeName)) {
            List<String> values = m_simpleAttributes.get(attributeName);
            if ((values.size() == 1) && (index == 0)) {
                removeAttributeSilent(attributeName);
            } else {
                values.remove(index);
            }
        } else if (m_entityAttributes.containsKey(attributeName)) {
            List<CmsEntity> values = m_entityAttributes.get(attributeName);
            if ((values.size() == 1) && (index == 0)) {
                removeAttributeSilent(attributeName);
            } else {
                CmsEntity child = values.remove(index);
                removeChildChangeHandler(child);
            }
        }
        fireChange();
    }
39936
def replace(self, eid, entity, note=None, force=False):
		
		# we need to unset some fields in the entity, if they exist
		newentity = entity
		for field in ('createdAtDate','id','isActive','parentRevision','revisionNr','updatedAtDate','updatedByUserName','updatedFromIp'):
			if field in newentity: del newentity[field]

		if note:
			newentity['revisionNote'] = note
		else:
			newentity['revisionNote'] = "Automatic change by user %s on %s" % (pwd.getpwuid(os.getuid()).pw_name,platform.node())

		if not force:
			for field in ('allowedConnections','blockedConnections','disableConsentConnections','arpAttributes','manipulationCode'):
				if not field in newentity:
					raise ServiceRegistryError(-1,"%s MUST be specified, otherwise the API will be silently truncate it" % field)

		result = self._http_req('connections/%u' % eid, method='PUT', payload=newentity)
		status = result['status']
		if not status==201:
			raise ServiceRegistryError(status,"Couldn't write entity %u: %u" % (eid,status))

		self.debug(0x01,result)
		return result['decoded']
1093889
def update_attribute(self, attr, value):
        """"""
        update = [fapi._attr_up(attr, value)]
        r = fapi.update_workspace_attributes(self.namespace, self.name,
                                             update, self.api_url)
        fapi._check_response_code(r, 200)
76326
private void updateReadonly(EntityType entityType, Attribute attr, Attribute updatedAttr) {
    Map<String, Attribute> readonlyTableAttrs =
        getTableAttributesReadonly(entityType)
            .collect(toLinkedMap(Attribute::getName, Function.identity()));
    if (!readonlyTableAttrs.isEmpty()) {
      dropTableTriggers(entityType);
    }

    if (attr.isReadOnly() && !updatedAttr.isReadOnly()) {
      readonlyTableAttrs.remove(attr.getName());
    } else if (!attr.isReadOnly() && updatedAttr.isReadOnly()) {
      readonlyTableAttrs.put(updatedAttr.getName(), updatedAttr);
    }

    if (!readonlyTableAttrs.isEmpty()) {
      createTableTriggers(entityType, readonlyTableAttrs.values());
    }
  }
891973
def replace(self, year=None, week=None):
        """"""
        return self.__class__(self.year if year is None else year,
                              self.week if week is None else week)
1110614
def replace_entity_resource(model, oldres, newres):
    '''
    
    '''
    oldrids = set()
    for rid, link in model:
        if link[ORIGIN] == oldres or link[TARGET] == oldres or oldres in link[ATTRIBUTES].values():
            oldrids.add(rid)
            new_link = (newres if o == oldres else o, r, newres if t == oldres else t, dict((k, newres if v == oldres else v) for k, v in a.items()))
            model.add(*new_link)
    model.delete(oldrids)
    return
420437
function replaceAttributes(file, attributes) {
        return (attributes || []).reduce((html, attrObj) =>
            html.replace(options.variablePrefix + attrObj.key, attrObj.value), file && file.toString() || '');
    }
719579
def match_attributes(self, el, attributes):
        """"""

        match = True
        if attributes:
            for a in attributes:
                value = self.match_attribute_name(el, a.attribute, a.prefix)
                pattern = a.xml_type_pattern if self.is_xml and a.xml_type_pattern else a.pattern
                if isinstance(value, list):
                    value = ' '.join(value)
                if value is None:
                    match = False
                    break
                elif pattern is None:
                    continue
                elif pattern.match(value) is None:
                    match = False
                    break
        return match
1266812
def transform(self, node, results):
        
        """
        params = results.get(u"params")
        ret = results.get(u"ret")
        if ret is not None:
            assert ret.prev_sibling.type == token.RARROW, u"Invalid return annotation"
            self.warn_once(node, reason=warning_text)
            ret.prev_sibling.remove()
            ret.remove()
        if params is None: return
        if params.type == syms.typedargslist:
            # more than one param in a typedargslist
            for param in params.children:
                if param.type == syms.tname:
                    self.warn_once(node, reason=warning_text)
                    param.replace(param_without_annotations(param))
        elif params.type == syms.tname:
            # one param
            self.warn_once(node, reason=warning_text)
            params.replace(param_without_annotations(params))