Copy this model element and contained elements if they exist.
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
676059
def copy(self, **replacements):
    """"""
    cls = type(self)
    kwargs = self._asdict()
    for key, val in replacements.items():
      if key == 'excludes':
        val = JarDependency._prepare_excludes(val)
      kwargs[key] = val
    org = kwargs.pop('org')
    base_name = kwargs.pop('base_name')
    return cls(org, base_name, **kwargs)
1046983
def copy(self):
        """"""
        return self._fromset(set(self._set), key=self._key)
593087
def add_copies(self, node, parent, elem, minel):
        """"""
        rep = 0 if minel is None else int(minel.arg) - 1
        for i in range(rep):
            parent.append(copy.deepcopy(elem))
52550
def copy_nested_elements_to(target_element)
      nested_elements.map do |nested_element|
        Element.copy(nested_element, {
          parent_element_id: target_element.id,
          page_id: target_element.page_id
        })
      end
    end
1206926
public void copyFrom(Model other) {
        if (!metaModelLocal.getTableName().equals(other.metaModelLocal.getTableName())) {
            throw new IllegalArgumentException("can only copy between the same types");
        }
        Map<String, Object> otherAttributes = other.getAttributes();
        for (String name : metaModelLocal.getAttributeNamesSkipId()) {
            attributes.put(name, otherAttributes.get(name));
            dirtyAttributeNames.add(name);
            // Why not use setRaw() here? Does the same and avoids duplication of code... (Garagoth)
            // other.setRaw(name, getRaw(name));
        }
    }
786435
def copy(self, **replacements):
    """"""
    cls = type(self)
    kwargs = {'org': self.org, 'name': self.name, 'ext': self.ext, 'classifier': self.classifier, 'rev': self.rev}
    for key, val in replacements.items():
      kwargs[key] = val
    return cls(**kwargs)
80969
def copy(self):
        
        return self.__class__(self, key=self._keyfn, precedes=self._precedes)
931980
def filtered_elements(self, model):
        """"""
        if isinstance(model, self.element_type):
            yield model
        yield from (e for e in model.eAllContents() if isinstance(e, self.element_type))
632125
function copyExistingProperties(src, dst) {
  Object.keys(dst).forEach(function(key) {
    if (dst.hasOwnProperty(key) && src.hasOwnProperty(key)) {
      dst[key] = src[key];
    }
  });
}
690437
def copy_models(module_from, module_to):
    
    module_from = get_module(module_from)
    module_to = get_module(module_to)
    models = get_models(module_from)
    if models:
        models = models.copy()
        models.update(((t.key, t) for t in module_tables(module_from)))
        module_to.__odm_models__ = models
        return models
963532
private ImmutableList<String> copyAnnotations(
      Element autoValueType, Element typeOrMethod, Set<String> excludedAnnotations) {
    ImmutableList<AnnotationMirror> annotationsToCopy =
        annotationsToCopy(autoValueType, typeOrMethod, excludedAnnotations);
    return annotationStrings(annotationsToCopy);
  }
903244
def copy(self):
        """"""
        content = [(k, v) for k, v in self.items()]

        intidx = [(k, v) for k, v in content if isinstance(k, int)]
        args = [v for k, v in sorted(intidx)]

        kwargs = {k: v
                  for k, v in content
                  if not isinstance(k, int) and not self.is_special(k)}
        return self.__class__(*args, **kwargs)
647637
def copy_of_xml_element(elem):
    

    copyElem = ElementTree.Element(elem.tag, elem.attrib)
    for child in elem:
        copyElem.append(child)
    return copyElem
338635
function(models, out)
  {
    var target = out || this.cloneEmpty();

    for (var i = 0; i < this.length; i++)
    {
      var a = this[ i ];
      var key = a.$key();
      var exists = false;

      if ( models instanceof ModelCollection )
      {
        exists = models.has( key );
      }
      else
      {
        for (var k = 0; k < models.length && !exists; k++)
        {
          var modelKey = this.buildKeyFromInput( models[ k ] );

          exists = (key === modelKey);
        }
      }

      if (!exists)
      {
        target.push( a );
      }
    }

    return target;
  }
1326930
def copy(self, **kwargs):
        
        for k in kwargs:
            assert k in self._keys, 'Invalid key: %s' % k

        d = self.values()
        d.update(kwargs)
        return self.__class__(**d)
290803
def copy(self):
        """"""
        if not self.selectedIndexes():
            return
        (row_min, row_max,
         col_min, col_max) = get_idx_rect(self.selectedIndexes())
        index = header = False
        df = self.model().df
        obj = df.iloc[slice(row_min, row_max + 1),
                      slice(col_min, col_max + 1)]
        output = io.StringIO()
        obj.to_csv(output, sep='\t', index=index, header=header)
        if not PY2:
            contents = output.getvalue()
        else:
            contents = output.getvalue().decode('utf-8')
        output.close()
        clipboard = QApplication.clipboard()
        clipboard.setText(contents)