copy attributes defined in the element declaration to the instance e.g. <polymer-element name="x-foo" tabIndex="0"> tabIndex is copied to the element instance here.
424836
function () {
      var a$ = this._instanceAttributes;
      for (var k in a$) {
        if (!this.hasAttribute(k)) {
          this.setAttribute(k, a$[k]);
        }
      }
    }
695251
function() {
      if (!this.el) {
        var attrs = getValue(this, 'attributes') || {};
        if (this.id) attrs.id = this.id;
        if (this.className) attrs['class'] = this.className;
        this.setElement(this.make(this.tagName, attrs), false);
      } else {
        this.setElement(this.el, false);
      }
    }
311490
private void putElement(final String elemName, final Attributes atts, final boolean removeConref) throws SAXException {
        //parameter boolean removeConref specifies whether to remove
        //conref information like @conref @conaction in current element
        //when copying it to pushcontent. True means remove and false means
        //not remove.
        final Set<String> namespaces = new HashSet<>();
        try {
            pushcontentWriter.writeStartElement(elemName);
            for (int index = 0; index < atts.getLength(); index++) {
                final String name = atts.getQName(index);
                if (!removeConref ||
                        !ATTRIBUTE_NAME_CONREF.equals(name) && !ATTRIBUTE_NAME_CONACTION.equals(name)) {
                    String value = atts.getValue(index);
                    if (ATTRIBUTE_NAME_HREF.equals(name) || ATTRIBUTE_NAME_CONREF.equals(name)) {
                        // adjust href for pushbefore and replace
                        value = replaceURL(value);
                    }
                    final int offset = atts.getQName(index).indexOf(":");
                    final String prefix = offset != -1 ? atts.getQName(index).substring(0, offset) : "";
                    if (!namespaces.contains(prefix)) {
                        namespaces.add(prefix);
                        if (!prefix.isEmpty()) {
                            pushcontentWriter.writeNamespace(prefix, atts.getURI(index));
                        }
                    }
                    pushcontentWriter.writeAttribute(prefix, atts.getURI(index), atts.getLocalName(index), value);
                }
            }
            //id attribute should only be added to the starting element
            //which dosen't have id attribute set
            if (ATTR_CONACTION_VALUE_PUSHREPLACE.equals(pushType) &&
                    atts.getValue(ATTRIBUTE_NAME_ID) == null &&
                    level == 1) {
                final String fragment = target.getFragment();
                if (fragment == null) {
                    //if there is no '#' in target string, report error
                    logger.error(MessageUtils.getMessage("DOTJ041E", target.toString()).toString());
                } else {
                    String id;
                    //has element id
                    if (fragment.contains(SLASH)) {
                        id = fragment.substring(fragment.lastIndexOf(SLASH) + 1);
                    } else {
                        id = fragment;
                    }
                    //add id attribute
                    pushcontentWriter.writeAttribute(ATTRIBUTE_NAME_ID, id);
                }
            }
        } catch (final XMLStreamException e) {
            throw new SAXException(e);
        }
    }
420840
def copy(self, *args, **kwargs):
        """"""

        for slot in self.__slots__:
            attr = getattr(self, slot)
            if slot[0] == '_':  # convert protected attribute name to public
                slot = slot[1:]
            if slot not in kwargs:
                kwargs[slot] = attr

        result = type(self)(*args, **kwargs)

        return result
720922
def copy_all(self, ctxt):
        '''
         
        '''
        for key, value  in ctxt.iteritems:
            self.set_attribute(key, value)
347857
public void copyValues(ElementBox src)
    {
        super.copyValues(src);
        nested.addAll(src.nested);
        textonly = src.textonly;
        pseudoElements = new HashMap<>(src.pseudoElements);
        style = src.style; 
        pseudoStyle = new HashMap<>(src.pseudoStyle);
        startChild = src.startChild;
        endChild = src.endChild;
        isblock = src.isblock;
        style = src.style;
        display = src.display;
        lineHeight = src.lineHeight;
        whitespace = src.whitespace;
        bgcolor = (src.bgcolor == null) ? null : new Color(src.bgcolor.getRed(), src.bgcolor.getGreen(), src.bgcolor.getBlue(), src.bgcolor.getAlpha());
        bgimages = (src.bgimages == null) ? null : new Vector<BackgroundImage>(src.bgimages);
        transform = src.transform;
        position = src.position;
        topset = src.topset;
        leftset = src.leftset;
        bottomset = src.bottomset;
        rightset = src.rightset;
        
        if (src.coords != null)
            coords = new LengthSet(src.coords);
        
        if (src.margin != null)
            margin = new LengthSet(src.margin);
        if (src.emargin != null)
            emargin = new LengthSet(src.emargin);
        if (src.border != null)
            border = new LengthSet(src.border);
        if (src.padding != null)
            padding = new LengthSet(src.padding);
        if (src.content != null)
            content = new Dimension(src.content);
    }
528862
private void initializeAttrs(AttributeSet attrs) {
    TypedArray attributes = getContext().obtainStyledAttributes(attrs, R.styleable.draggable_panel);
    this.topFragmentHeight =
        attributes.getDimensionPixelSize(R.styleable.draggable_panel_top_fragment_height,
            DEFAULT_TOP_FRAGMENT_HEIGHT);
    this.xScaleFactor =
        attributes.getFloat(R.styleable.draggable_panel_x_scale_factor, DEFAULT_SCALE_FACTOR);
    this.yScaleFactor =
        attributes.getFloat(R.styleable.draggable_panel_y_scale_factor, DEFAULT_SCALE_FACTOR);
    this.topFragmentMarginRight =
        attributes.getDimensionPixelSize(R.styleable.draggable_panel_top_fragment_margin_right,
            DEFAULT_TOP_FRAGMENT_MARGIN);
    this.topFragmentMarginBottom =
        attributes.getDimensionPixelSize(R.styleable.draggable_panel_top_fragment_margin_bottom,
            DEFAULT_TOP_FRAGMENT_MARGIN);
    this.enableHorizontalAlphaEffect =
        attributes.getBoolean(R.styleable.draggable_panel_enable_horizontal_alpha_effect,
            DEFAULT_ENABLE_HORIZONTAL_ALPHA_EFFECT);
    this.enableClickToMaximize =
        attributes.getBoolean(R.styleable.draggable_panel_enable_click_to_maximize_panel,
            DEFAULT_ENABLE_CLICK_TO_MAXIMIZE);
    this.enableClickToMinimize =
        attributes.getBoolean(R.styleable.draggable_panel_enable_click_to_minimize_panel,
            DEFAULT_ENABLE_CLICK_TO_MINIMIZE);
    this.enableTouchListener =
        attributes.getBoolean(R.styleable.draggable_panel_enable_touch_listener_panel,
            DEFAULT_ENABLE_TOUCH_LISTENER);
    attributes.recycle();
  }
251046
protected final String copyElement(int nodeID, int exptype,
                               SerializationHandler handler)
        throws SAXException
    {
        final ExtendedType extType = m_extendedTypes[exptype];
        String uri = extType.getNamespace();
        String name = extType.getLocalName();

        if (uri.length() == 0) {
            handler.startElement(name);
            return name;
        }
        else {
            int qnameIndex = m_dataOrQName.elementAt(nodeID);

            if (qnameIndex == 0) {
                handler.startElement(name);
                handler.namespaceAfterStartElement(EMPTY_STR, uri);
                return name;
            }

            if (qnameIndex < 0) {
    	        qnameIndex = -qnameIndex;
    	        qnameIndex = m_data.elementAt(qnameIndex);
            }

            String qName = m_valuesOrPrefixes.indexToString(qnameIndex);
            handler.startElement(qName);
            int prefixIndex = qName.indexOf(':');
            String prefix;
            if (prefixIndex > 0) {
                prefix = qName.substring(0, prefixIndex);
            }
            else {
                prefix = null;
            }
            handler.namespaceAfterStartElement(prefix, uri);
            return qName;
        }

    }
640567
def clone_bs4_elem(el):
    
    if isinstance(el, NavigableString):
        return type(el)(el)

    copy = Tag(None, el.builder, el.name, el.namespace, el.nsprefix)
    # work around bug where there is no builder set
    # https://bugs.launchpad.net/beautifulsoup/+bug/1307471
    copy.attrs = dict(el.attrs)
    for attr in ('can_be_empty_element', 'hidden'):
        setattr(copy, attr, getattr(el, attr))
    for child in el.contents:
        copy.append(clone_bs4_elem(child))
    return copy
1113104
public void copyFrom(XElement other) {
        content = other.content;
        userObject = other.userObject;
        attributes.putAll(other.attributes);
        for (XElement c : other.children) {
            add(c.copy());
        }
    }
783057
function ElementConstructor() {

	var attr,
	    i;

	// Trigger an initial attribute change
	for (i = 0; i < this.attributes.length; i++) {
		attr = this.attributes[i];
		this.attributeChangedCallback(attr.name, null, attr.value, true);
	}
}
1176376
def make_copy(self, copy_to):
        

        for attr, value in self.__dict__.items():
            if attr.startswith('__') and attr.endswith('__'):
                continue
            setattr(copy_to, attr, value)
369159
protected void addAttributes(SXTag dataNode, String keyPrefix,
			Collection<XAttribute> attributes) throws IOException {
		for (XAttribute attribute : attributes) {
			// skip attributes defined by standard extensions
			// to ensure parity with MXML input files.
			if (// BVD: KEEP ALL Attributes
				// attribute.getKey().equals(XConceptExtension.KEY_NAME)
				// || attribute.getKey()
				// .equals(XConceptExtension.KEY_INSTANCE)
				// || attribute.getKey().equals(XLifecycleExtension.KEY_MODEL)
				// || attribute.getKey().equals(
				// XLifecycleExtension.KEY_TRANSITION)
				// || attribute.getKey().equals(
				// XOrganizationalExtension.KEY_GROUP)
				// || attribute.getKey().equals(
				// XOrganizationalExtension.KEY_RESOURCE)
				// || attribute.getKey().equals(
				// XOrganizationalExtension.KEY_ROLE)||
			attribute.getKey().equals(XSemanticExtension.KEY_MODELREFERENCE)
			// || attribute.getKey().equals(XTimeExtension.KEY_TIMESTAMP)
			) {
				continue;
			}
			SXTag attributeTag = dataNode.addChildNode("attribute");
			attributeTag.addAttribute("name", keyPrefix + attribute.getKey());
			addModelReference(attribute, attributeTag);
			attributeTag.addTextNode(attribute.toString());
			Collection<XAttribute> subAttributes = attribute.getAttributes()
					.values();
			if (subAttributes.size() > 0) {
				String subKeyPrefix = attribute.getKey();
				if (keyPrefix.length() > 0) {
					subKeyPrefix = keyPrefix + ":" + subKeyPrefix;
				}
				addAttributes(dataNode, subKeyPrefix, subAttributes);
			}
		}
	}
413812
static void copyProperties(ExecutionGraphVertex standard, Set<ExecutionGraphVertex> vertices) {
        for (ExecutionGraphVertex vertex : vertices) {
            if (standard.equals(vertex)) { continue; }

            IExecutionGraphVertexProperties from = standard.properties();
            IExecutionGraphVertexProperties to = vertex.properties();

            //copy all, but: IndexInFormula and VertexId
            to.setName(from.getName());
            to.setAlias(from.getAlias());
            to.setValue(from.getValue());
            to.setType(from.getType());
            to.setFormulaPtg(from.getFormulaPtg());
            to.setPtgs(from.getPtgs());
            if (from.getFormulaString() == null && to.getFormulaString() != null) { from.setFormulaString(to.getFormulaString()); }
            else { to.setFormulaString(from.getFormulaString()); }
            if (from.getFormulaValues() == null && to.getFormulaValues() != null) { from.setFormulaValues(to.getFormulaValues()); }
            else { to.setFormulaValues(from.getFormulaValues()); }
            if (from.getFormulaPtgString() == null && to.getFormulaPtgString() != null) { from.setFormulaPtgString(to.getFormulaPtgString()); }
            else { to.setFormulaPtgString(from.getFormulaPtgString()); }
            if (from.getPtgString() == null && to.getPtgString() != null) { from.setPtgString(to.getPtgString()); }
            else { to.setPtgString(from.getPtgString()); }
            to.setSourceObjectId(from.getSourceObjectId());
            to.setRootFormulaId(from.getRootFormulaId());
        }
    }
299017
public void copyAttributes(File file, File copy, AttributeCopyOption copyOption) {
    switch (copyOption) {
      case ALL:
        file.copyAttributes(copy);
        break;
      case BASIC:
        file.copyBasicAttributes(copy);
        break;
      default:
        // don't copy
    }
  }
238492
def copy(self):
        
        # New dummy item with it's own running properties
        copied_item = self.__class__({})
        # Now, copy the properties
        for prop in self.__class__.properties:
            if prop in ['uuid']:
                continue
            val = getattr(self, prop, None)
            if val is not None:
                setattr(copied_item, prop, val)

        # Also copy some running properties
        # The custom variables
        if hasattr(self, "customs"):
            copied_item.customs = copy(self.customs)
        # And tags/templates
        if hasattr(self, "tags"):
            copied_item.tags = copy(self.tags)
        if hasattr(self, "templates"):
            copied_item.templates = copy(self.templates)

        return copied_item
226598
function copyValues(origin, clone, elementSelector) {
        var $originalElements = origin.find(elementSelector);

        clone.find(elementSelector).each(function(index, item) {
            $(item).val($originalElements.eq(index).val());
        });
    }