Create a deep copy of the set of matched elements.
189124
function clone() {
  var arr = [];
  this.each(function(el) {
    arr.push(el.cloneNode(true));
  });
  return this.air(arr);
}
1043748
def copy(self):
        """"""
        return self.__class__(key=self._key, load=self._load, _set=set(self._set))
298932
function cloneIfElseNodes(element, hasElse) {
      var children = childNodes(element),
          ifNodes = [],
          elseNodes = [],
          target = ifNodes;
        
      for (var i = 0, j = children.length; i < j; ++i) {
          if (hasElse && isElseNode(children[i])) {
              target = elseNodes;
              hasElse = false;
          } else {
              target.push(cleanNode(children[i].cloneNode(true)));
          }
      }
      
      return {
          ifNodes: ifNodes,
          elseNodes: elseNodes
      };
  }
501174
public static <T> Set<T> copy(final Set<T> set) {
		if (set == null) {
			return null;
		}

		TypeEnum elementType = null;
		Set<T> copy = new HashSet<T>();
		for (T element : set) {
			T elementCopy = null;
			if (element != null) {
				if (elementType == null) {
					elementType = TypeEnum.dataTypeOf(element.getClass());
				}
				elementCopy = copy(element, elementType);
			}

			copy.add(elementCopy);
		}

		return copy;
	}
1149814
@Override
	public Collection<BioPAXElement> generate(Match match, int... ind)
	{
		Collection<BioPAXElement> gen = new HashSet<BioPAXElement> (
			con[0].generate(match, ind));

		for (int i = 1; i < con.length; i++)
		{
			if (gen.isEmpty()) break;

			Collection<BioPAXElement> subset = con[i].generate(match, ind);
			Set<BioPAXElement> copy = new HashSet<BioPAXElement>(subset);

			copy.removeAll(gen);
			gen.removeAll(subset);
			gen.addAll(copy);
		}
		return gen;
	}
222365
def copy(input, **params):
    
    PARAM_FIELDS = 'fields'

    def filter_fields(obj, fields):
        return {k:v for k,v in obj.items() if k in fields}

    if PARAM_FIELDS in params:
        fields = params.get(PARAM_FIELDS)
        if isinstance(input, list):
            res = []
            for row in input:
                res.append(filter_fields(row, fields))
            return res
        elif isinstance(input, dict):
            return filter_fields(input, fields)
        else:
            raise NotImplementedError('{} is not supported'.format(type(input)))
    else:
        return input
661248
private <R> Collection<R> copy(Iterable<R> src) {
        return Lists.newArrayList(src);
    }
582976
private HashMap<String, TagLibTag> duplicate(HashMap<String, TagLibTag> tags, boolean deepCopy) {
	if (deepCopy) throw new PageRuntimeException(new ExpressionException("deep copy not supported"));

	Iterator<Entry<String, TagLibTag>> it = tags.entrySet().iterator();
	HashMap<String, TagLibTag> cm = new HashMap<String, TagLibTag>();
	Entry<String, TagLibTag> entry;
	while (it.hasNext()) {
	    entry = it.next();
	    cm.put(entry.getKey(), deepCopy ? entry.getValue() : // TODO add support for deepcopy ((TagLibTag)entry.getValue()).duplicate(deepCopy):
		    entry.getValue());
	}
	return cm;
    }
17707
def merge_config(d1, d2):
    '''
    '''
    result = deepcopy(d1)
    elements = deque()
    elements.append((result, d2))

    while elements:
        old, new = elements.popleft()

        new = OrderedDict([(k.lower(), (k, v)) for k, v in new.items()])
        visited_keys = []

        for k, old_value in old.items():
            klow = k.lower()
            if klow in new:
                new_key, new_value = new[klow]
                visited_keys.append(new_key)
                if all(isinstance(e, MutableMapping) for e in (old_value, new_value)):
                    elements.append((old_value, new_value))
                else:
                    old[k] = deepcopy(new_value)

        for k, v in new.values():
            if k not in visited_keys:
                old[k] = deepcopy(v)

    return result
506840
def copy(self):
		""""""
		ret = IndexedDict()
		ret._dict = self._dict.copy()
		ret._list = list(self._list)
		return ret
716385
def __copy(self, other):
        """"""
        self.__data = copy.deepcopy(other.data)
        self.__classes = copy.deepcopy(other.classes)
        self.__labels = copy.deepcopy(other.labels)
        self.__dtype = copy.deepcopy(other.dtype)
        self.__description = copy.deepcopy(other.description)
        self.__feature_names = copy.deepcopy(other.feature_names)
        self.__num_features = copy.deepcopy(other.num_features)

        return self
1001805
public static <E> List<E> copyOf(E[] elements) {
    Preconditions.checkNotNull(elements, "elements");
    List<E> result = new ArrayList<>(elements.length);
    Collections.addAll(result, elements);
    return Collections.unmodifiableList(result);
  }
60676
function createSet(values) {
    var set = new Set();
    Lazy(values || []).flatten().each(function(e) {
      set.add(e);
    });
    return set;
  }
755530
def deep_copy(object)
      try_to_clone(object).tap do |new_object|
        case new_object
        when Hash
          new_object.each{ |k, v| new_object[k] = deep_copy(v) }
        when Array
          new_object.replace(new_object.collect{ |item| deep_copy(item) })
        end
      end
    end
916680
function( elems, name, selector ) {
		// Build a new jQuery matched element set
		var ret = jQuery( elems );

		// Add the old object onto the stack (as a reference)
		ret.prevObject = this;

		ret.context = this.context;

		if ( name === "find" )
			ret.selector = this.selector + (this.selector ? " " : "") + selector;
		else if ( name )
			ret.selector = this.selector + "." + name + "(" + selector + ")";

		// Return the newly-formed element set
		return ret;
	}
604686
def copy(self):
        '''

        '''
        # Significant performance improvements by skipping alphabet check
        return type(self)(self.seq, self.material, run_checks=False)
677268
def _clone(self, deepcopy=True):
        """"""
        clone = self._clone_base()
        values_to_clone = ("spec", "projection", "skip", "limit",
                           "max_time_ms", "max_await_time_ms", "comment",
                           "max", "min", "ordering", "explain", "hint",
                           "batch_size", "max_scan", "manipulate",
                           "query_flags", "modifiers", "collation")
        data = dict((k, v) for k, v in iteritems(self.__dict__)
                    if k.startswith('_Cursor__') and k[9:] in values_to_clone)
        if deepcopy:
            data = self._deepcopy(data)
        clone.__dict__.update(data)
        return clone