Duplicate an history
@param history the history to duplicate
@return a duplicate of the history
487616
public static INDArray[] dup(INDArray[] history) {
        INDArray[] dupHistory = new INDArray[history.length];
        for (int i = 0; i < history.length; i++) {
            dupHistory[i] = history[i].dup();
        }
        return dupHistory;
    }
1030303
public DTMIterator cloneWithReset() throws CloneNotSupportedException
  {
  	NodeSequence seq = (NodeSequence)super.clone();
    seq.m_next = 0;
    if (m_cache != null) {
        // In making this clone of an iterator we are making
        // another NodeSequence object it has a reference
        // to the same IteratorCache object as the original
        // so we need to remember that more than one
        // NodeSequence object shares the cache.
        m_cache.increaseUseCount();
    }
    
    return seq;
  }
685966
public static HistoryDTO transformToDto(History history) {
        if (history == null) {
            throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
        }

        HistoryDTO historyDto = new HistoryDTO();

        try {
            BeanUtils.copyProperties(historyDto, history);
        } catch (Exception ex) {
            throw new WebApplicationException("DTO transformation failed.", Status.INTERNAL_SERVER_ERROR);
        }
        return historyDto;
    }
231615
@Override
    public Collection duplicate(boolean deepCopy) {
	new ArrayImpl().duplicate(deepCopy);
	return new ListAsArray((List) Duplicator.duplicate(list, deepCopy));
    }
645542
def copy(self):
        '''
        
        '''
        dup = super(Conditional, self).copy()
        condition = self._condition.copy()
        condition.invalidate(self)
        dup._condition = condition
        return dup
573076
public FaunusPipeline dedup() {
        this.state.assertNotLocked();
        this.state.assertNoProperty();

        this.compiler.addMap(DuplicateFilterMap.Map.class,
                NullWritable.class,
                FaunusVertex.class,
                DuplicateFilterMap.createConfiguration(this.state.getElementType()));
        makeMapReduceString(DuplicateFilterMap.class);
        return this;
    }
1099916
public ExecutionVertex duplicateVertex(final boolean preserveVertexID) {

		ExecutionVertexID newVertexID;
		if (preserveVertexID) {
			newVertexID = this.vertexID;
		} else {
			newVertexID = new ExecutionVertexID();
		}

		final ExecutionVertex duplicatedVertex = new ExecutionVertex(newVertexID, this.executionGraph,
			this.groupVertex, this.outputGates.length, this.inputGates.length);

		// Duplicate gates
		for (int i = 0; i < this.outputGates.length; ++i) {
			duplicatedVertex.outputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex,
				this.outputGates[i].getGroupEdge(), false);
		}

		for (int i = 0; i < this.inputGates.length; ++i) {
			duplicatedVertex.inputGates[i] = new ExecutionGate(new GateID(), duplicatedVertex,
				this.inputGates[i].getGroupEdge(), true);
		}

		// TODO set new profiling record with new vertex id
		duplicatedVertex.setAllocatedResource(this.allocatedResource.get());

		return duplicatedVertex;
	}
873706
def remove_dups(head):
    
    hashset = set()
    prev = Node()
    while head:
        if head.val in hashset:
            prev.next = head.next
        else:
            hashset.add(head.val)
            prev = head
        head = head.next
75117
def duplicate(self):
        """"""
        collection = self.__class__(self.header.duplicate(), self.values, self.datetimes)
        collection._validated_a_period = self._validated_a_period
        return collection
523582
public Entry buildWithHistory() {
        if (originalEntry == null) {
            throw new IllegalArgumentException("originalEntry is not set");
        }

        if (history == null) {
            history = new History();
        }

        Entry entryWithoutHistory = new EntryBuilder(originalEntry).history(new History()).build();
        history.getHistoricEntries().add(entryWithoutHistory);
        return build();
    }
88136
public Project duplicate() {
        Project dup = new Project();
        dup.currentWorkingDirectoryList.addAll(this.currentWorkingDirectoryList);
        dup.projectName = this.projectName;
        dup.analysisTargets.addAll(this.analysisTargets);
        dup.srcDirList.addAll(this.srcDirList);
        dup.auxClasspathEntryList.addAll(this.auxClasspathEntryList);
        dup.timestampForAnalyzedClasses = timestampForAnalyzedClasses;
        dup.guiCallback = guiCallback;
        return dup;
    }
1185932
public void pushHistory(String strHistory)
    {
        if (m_vHistory == null)
            m_vHistory = new Vector<String>();
        m_vHistory.addElement(strHistory);
    }
256595
def duplicate(self):
        '''
        
        '''
        return self.__class__(street_address=self.street_address,
                              city=self.city, zipcode=self.zipcode,
                              state=self.state, country=self.country)
1210974
protected History prepareHistory() throws IOException {
        File file = new File(System.getProperty("user.home"), HISTORYFILE);
        if (!file.exists()) {
            try {
                file.createNewFile();
            } catch (IOException ignored) {
                // can't create the file, so no history for you
            }
        }
        return file.canWrite() ? new FileHistory(file) : null;
    }
531614
def duplicate(self, request, *args, **kwargs):
        """"""
        if not request.user.is_authenticated:
            raise exceptions.NotFound

        ids = self.get_ids(request.data)
        queryset = get_objects_for_user(request.user, 'view_collection', Collection.objects.filter(id__in=ids))
        actual_ids = queryset.values_list('id', flat=True)
        missing_ids = list(set(ids) - set(actual_ids))
        if missing_ids:
            raise exceptions.ParseError(
                "Collections with the following ids not found: {}".format(', '.join(map(str, missing_ids)))
            )

        duplicated = queryset.duplicate(contributor=request.user)

        serializer = self.get_serializer(duplicated, many=True)
        return Response(serializer.data)
512428
private HashMap duplicate(HashMap funcs, boolean deepCopy) {
	if (deepCopy) throw new PageRuntimeException(new ExpressionException("deep copy not supported"));

	Iterator it = funcs.entrySet().iterator();
	Map.Entry entry;
	HashMap cm = new HashMap();
	while (it.hasNext()) {
	    entry = (Entry) it.next();
	    cm.put(entry.getKey(), deepCopy ? entry.getValue() : // TODO add support for deepcopy ((FunctionLibFunction)entry.getValue()).duplicate(deepCopy):
		    entry.getValue());
	}
	return cm;
    }
362459
@Override
  public void duplicate(String fromNamespace, String fromName, String toNamespace, String toName, boolean doOverwrite)
      throws DDFException {

    IPersistible from = this.load(fromNamespace, fromName);
    if (from instanceof DDF) {
      DDF to = (DDF) from;
      // to.setNamespace(toNamespace);
      to.getManager().setDDFName(to, toName);
      to.persist();

    } else {
      throw new DDFException("Can only duplicate DDFs");
    }
  }