u"""Adds an attribute to a set of attributes.

    Related attributes are also included.
333326
def taint(taintedSet, taintedAttribute):
    """
    taintedSet.add(taintedAttribute)
    if taintedAttribute == 'marker':
        taintedSet |= set(['marker-start', 'marker-mid', 'marker-end'])
    if taintedAttribute in ['marker-start', 'marker-mid', 'marker-end']:
        taintedSet.add('marker')
    return taintedSet
1343548
public static void addAttributes(final Map<String, Object> attributes, AttributesBuilder attributesBuilder) {
        // TODO Figure out how to reliably set other values (like boolean values, dates, times, etc)
        for (Map.Entry<String, Object> attributeEntry : attributes.entrySet()) {
            addAttribute(attributeEntry.getKey(), attributeEntry.getValue(), attributesBuilder);
        }
    }
1361623
def extend(self, **attributes):
        
        for key, value in attributes.iteritems():
            if not hasattr(self, key):
                setattr(self, key, value)
437360
def add(self, name, attributes):
        
        if name in self._data:
            raise RelationReferenceError(
                'Relation \'{name}\' already exists.'.format(name=name))
        self._data[name] = attributes[:]
1320248
protected void addAttributes(SXTag node, Collection<XAttribute> attributes)
			throws IOException {
		SXTag data = node.addChildNode("Data");
		addAttributes(data, "", attributes);
	}
1297512
def add(self, key, value):
        
        if key.endswith('_'):
            key = key[:-1]
        if key in self.attributes:
            self.attributes[key] = self.attributes[key] + ' ' + value
        else:
            self.attributes[key] = value
759541
protected void appendAttribute(StringBuilder sb, Attr aNode) {
        sb.append("<").append(aNode.getOwnerElement().getNodeName());
        sb.append(' ')
            .append(aNode.getNodeName()).append("=\"")
            .append(aNode.getNodeValue()).append("\"...>");
    }
150638
public void addAttribute(String attribute)
    {
        if(this.attributes == null)
            this.attributes = new ArrayList<String>();
        this.attributes.add(attribute);
    }
591865
private void addToAttributes(final List<ApiAttribute> attributes) {
        for (final ApiObject object : attributes) {
            final ApiModelToGedObjectVisitor visitor = createVisitor();
            object.accept(visitor);
        }
    }
725543
public void addAttribute(String attributeName, String attributeValue) throws XmlModelException {
        String name = attributeName.trim();
        String value = attributeValue.trim();
        if(attributesMap.containsKey(name)) {
            throw new XmlModelException("Duplicate attribute: " + name);
        }
        attributeNames.add(name);
        attributesMap.put(name, new Attribute(name, value));
    }
307051
def add(self,attrlist,attrvalues):
        '''
        
        '''
        for i,d in enumerate(attrlist):
            self[d] = attrvalues[i]
393945
def add_attribute(self, tag, name, value):
        
        self.add_tag(tag)
        d = self._tags[tag]
        d[name] = value
991404
def _add_element_attrs(elem, attrs):
	
	for attr, value in attrs.items():
		elem.attrib[attr] = value
	return elem
635191
def _add_attribute(self, name, value, allowed_values=None):
        """"""
        if value and value != 'none':

            if isinstance(value, (int, bool)):
                value = str(value)

            if allowed_values and value not in allowed_values:
                raise TypeError(
                    "Attribute '" + name + "' must be one of " + str(
                        allowed_values) + " but is '" + str(value) + "'")

            self.element_attrs[name] = value
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);
  }
863221
def add_node_attribute(self, node, attr):
        
        self.node_attr[node] = self.node_attr[node] + [attr]
955407
private static void addAttribute(Element element, Set<Attr> attributes, Object value) {
		Attr attr = (Attr) value;
		if (!attributes.add(attr)) {
			throw new TemplateException("Invalid element |%s|. It has both static attribute |%s| and attribute operator.", element, attr.getName());
		}
	}