Copies the current FmtStr's attributes while changing its string.
176283
def copy_with_new_str(self, new_str):
        """"""
        # What to do when there are multiple Chunks with conflicting atts?
        old_atts = dict((att, value) for bfs in self.chunks
                    for (att, value) in bfs.atts.items())
        return FmtStr(Chunk(new_str, old_atts))
569627
public static void copyAttributes(Element source, Map<String, String> dest) {
        NamedNodeMap attributes = source.getAttributes();

        if (attributes != null) {
            for (int i = 0; i < attributes.getLength(); i++) {
                Node attribute = attributes.item(i);
                dest.put(attribute.getNodeName(), attribute.getNodeValue());
            }
        }
    }
257785
static AttrVersion createFromString(final String str)
    throws BOSHException {
        if (str == null) {
            return null;
        } else {
            return new AttrVersion(str);
        }
    }
1328733
def write_attributes(self, attrs):
        
        if attrs:
            self.write(
                ' [' + ','.join('%s="%s"' % kv for kv in attrs.items()) + ']'
            )
        else:  # pragma: nocover
            pass
1103169
def attributes_strToDict(astr_attributes, astr_separator=" "):
  
  adict = {}
  alist = str2lst(astr_attributes, astr_separator)
  for str_pair in alist:
    alistTuple = str2lst(str_pair, "=")
    adict.setdefault(alistTuple[0], alistTuple[1].strip(chr(0x22) + chr(0x27)))
  return adict
1345837
void recomposeAttributeSets(ElemAttributeSet attrSet)
  {
    ArrayList attrSetList = (ArrayList) m_attrSets.get(attrSet.getName());

    if (null == attrSetList)
    {
      attrSetList = new ArrayList();

      m_attrSets.put(attrSet.getName(), attrSetList);
    }

    attrSetList.add(attrSet);
  }
387155
def update(self, attributes):
        
        for attribute in attributes:
            setattr(self, attribute, attributes[attribute])
        return self
224676
function(attrs, attributeBlocks){
    if (attributeBlocks.length) {
      if (attrs.length) {
        var val = this.attrs(attrs);
        attributeBlocks.unshift(val);
      }
      if (attributeBlocks.length > 1) {
        this.bufferExpression(this.runtime('attrs') + '(' + this.runtime('merge') + '([' + attributeBlocks.join(',') + ']), ' + stringify(this.terse) + ')');
      } else {
        this.bufferExpression(this.runtime('attrs') + '(' + attributeBlocks[0] + ', ' + stringify(this.terse) + ')');
      }
    } else if (attrs.length) {
      this.attrs(attrs, true);
    }
  }
483033
def preserve_attr_data(A, B):
    '''
    '''
    for attr, B_data in B.items(): # defined object attrs
        if getattr(B_data, 'override_parent', True):
            continue
        if attr in A:
            A_data = A[attr]
            for _attr in getattr(A_data, '_attrs', []): # Attr attrs, like type, default, & doc
                if hasattr(A_data, _attr):
                    if getattr(B_data, _attr, None) is not None:
                        if _attr in getattr(B_data, '_set_by_default', []):
                            setattr(B_data, _attr, getattr(A_data, _attr))
                    else:
                        setattr(B_data, _attr, getattr(A_data, _attr))
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 );
				}
			}
445094
def copy_attr(f1, f2):
    
    copyit = lambda x: not hasattr(f2, x) and x[:10] == 'PACKAGING_'
    if f1._tags:
        pattrs = [tag for tag in f1._tags if copyit(tag)]
        for attr in pattrs:
            f2.Tag(attr, f1.GetTag(attr))
894427
def fmt
      formated = {}
      attrs.each_key do |key|
        formated[camelize(key)] = attrs[key]
      end
      formated
    end
134526
def restore_attribute!(attr_name)
        attr_name = attr_name.to_s
        if attribute_changed?(attr_name)
          __send__("#{attr_name}=", attribute_was(attr_name))
          clear_attribute_change(attr_name)
        end
      end
724558
def setattr(self, attr, new_value, close_the_changeset=True):
        """"""
        existing_value = getattr(self, attr, None)
        if existing_value != new_value:
            setattr(self, attr, new_value)
            self._changeset[attr] = new_value

        if close_the_changeset and self._changeset:
            self._call_callbacks()
436770
def copy_attr(self, other):
        
        if not isinstance(other, Symbol):
            return  # Nothing done if not a Symbol object

        tmp = re.compile('__.*__')
        for attr in (x for x in dir(other) if not tmp.match(x)):

            if (
                hasattr(self.__class__, attr) and
                str(type(getattr(self.__class__, attr)) in ('property', 'function', 'instancemethod'))
            ):
                continue

            val = getattr(other, attr)
            if isinstance(val, str) or str(val)[0] != '<':  # Not a value
                setattr(self, attr, val)
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)
333300
public void replaceAttribute(Attribute original, Attribute newAttribute) {
		for (ListIterator<Attribute> it = attributes.listIterator(); it.hasNext(); )
			if (it.next().equals(original)) {
				it.set(newAttribute);
				break;
			}
	}