Deep merge two objects.
@param target
@param ...sources
972145
function mergeDeep(target, ...sources) {
  if (!sources.length) return target;
  const source = sources.shift();

  if (isObject(target) && isObject(source)) {
    for (const key in source) {
      if (isObject(source[key])) {
        if (!target[key]) Object.assign(target, { [key]: {} });
        mergeDeep(target[key], source[key]);
      } else {
        Object.assign(target, { [key]: source[key] });
      }
    }
  }

  return mergeDeep(target, ...sources);
}
843742
function merge(source, destination) {
  source.forEach(function(current) {
    let matchFound = false;
    destination.forEach(function(target) {
      let isSameReceiver = identifiers.areMatch(current.receiverId,
                                                current.receiverIdType,
                                                target.receiverId,
                                                target.receiverIdType);
      if(isSameReceiver) {
        target.rssiSum = target.rssiSum ||
                         (target.rssi * target.numberOfDecodings);
        target.numberOfDecodings += current.numberOfDecodings || 1;
        target.rssiSum += current.rssiSum ||
                          (current.rssi * current.numberOfDecodings);
        target.rssi = Math.round(target.rssiSum / target.numberOfDecodings);
        matchFound = true;
      }
    });
    if(!matchFound) {
      destination.push(current);
    }
  });
  destination.sort(compareRssi);
}
763539
function mergeDeep (target, source) {
  let dummy;

  if (isObject(target) && isObject(source)) {
    for (const key in source) {
      if (isObject(source[key])) {
        if (!target[key]) {
          dummy = {};
          dummy[key] = {};
          objectAssign(target, dummy);
        }
        mergeDeep(target[key], source[key]);
      } else {
        dummy = {};
        dummy[key] = source[key];
        objectAssign(target, dummy);
      }
    }
  }
  return target;
}
1125181
function _mergeProperties(target, source) {
	for(var property in source) {
		if(source.hasOwnProperty(property)) {
			if(source[property] instanceof Array) {
				target[property] = source[property].concat(target[property] instanceof Array ? target[property] : []);
			} else if(
				source[property] !== null &&
				typeof source[property] === "object" &&
				source[property].constructor === Object
			) {
				target[property] = _mergeProperties(target[property] || {}, source[property]);
			} else {
				target[property] = source[property];
			}
		}
	}

	return target;
}
804990
public <T> void move(Local<T> target, Local<T> source) {
        addInstruction(new PlainInsn(Rops.opMove(source.type.ropType),
                sourcePosition, target.spec(), source.spec()));
    }
767714
function(sources){
      if (!sources)
        sources = {};

      for (var name in this.fields.sources)
        this.setSource(name, sources[name]);

      /** @cut */ for (var name in sources)
      /** @cut */   if (name in this.fields.sources == false)
      /** @cut */     basis.dev.warn('basis.data.object.Merge#setSource: can\'t set source with name `' + name + '` as not specified by fields configuration');
    }
671784
public static void zip(File[] sources, File target) throws IOException {
		zip(sources, target, null);
	}
1088447
public static Taint merge(Taint a, Taint b) {
        if (a == null) {
            if (b == null) {
                return null;
            } else {
                return new Taint(b);
            }
        } else if (b == null) {
            return new Taint(a);
        }
        assert a != null && b != null;
        Taint result = new Taint(State.merge(a.getState(), b.getState()));
        if (a.variableIndex == b.variableIndex) {
            result.variableIndex = a.variableIndex;
        }
        result.taintLocations.addAll(a.taintLocations);
        result.taintLocations.addAll(b.taintLocations);
        result.unknownLocations.addAll(a.unknownLocations);
        result.unknownLocations.addAll(b.unknownLocations);
        if (!result.isTainted()) {
           mergeParameters(a, b, result); 
        }
        mergeRealInstanceClass(a, b, result);
        mergeTags(a, b, result);
        if (a.constantValue != null && a.constantValue.equals(b.constantValue)) {
            result.constantValue = a.constantValue;
        }
        if (FindSecBugsGlobalConfig.getInstance().isDebugTaintState()) {
            result.setDebugInfo("[" + a.getDebugInfo() + "]+[" + b.getDebugInfo() + "]");
        }
        assert !result.hasParameters() || result.isUnknown();
        if(a.potentialValue != null) {
            result.potentialValue = a.potentialValue;
        }
        else if(b.potentialValue != null) {
            result.potentialValue = b.potentialValue;
        }
        result.addAllSources(a.sources);
        result.addAllSources(b.sources);
        return result;
    }
209101
public static void merge(List<String> sources, String target) throws IOException{
        //读取所有需要合并的词典
        Set<String> set = new HashSet<>();
        AtomicInteger i = new AtomicInteger();
        for(String source : sources){
            try(Stream<String> lines = Files.lines(Paths.get(source), Charset.forName("utf-8"))){
                lines.forEach(line -> {
                    i.incrementAndGet();
                    line = line.trim();
                    // 词长度：大于等于2并且小于等于4
                    // 识别功能 能识别的词 就不用放到词典中了，没必要多此一举
                    //至少要两个中文字符，防止大量无意义或特殊词混入词典
                    if (line.length() > 4
                            || line.length() < 2
                            || !Utils.isChineseCharAndLengthAtLeastTwo(line)
                            || RecognitionTool.recog(line)) {
                        LOGGER.debug("过滤：" + line);
                        return;
                    }
                    set.add(line);
                });
            }
        }
        LOGGER.info("合并词数："+i.get());
        LOGGER.info("保留词数："+set.size());
        List<String> list = set.stream().sorted().collect(Collectors.toList());
        Files.write(Paths.get(target), list, Charset.forName("utf-8"));
    }
751763
public void merge(Model target, BioPAXElement source)
	{
		merge(target, Collections.singleton(source));
	}
794552
def merge(source, target)
      # trivial case
      return target if source.equal?(target)
      # the domain attributes to merge
      mas = @mergeable.call(source)
      unless mas.empty? then
        logger.debug { "Merging #{source.qp} #{mas.to_series} into #{target.qp}..." }
      end
      # merge the non-domain attributes
      target.merge_attributes(source)
      # merge the source domain attributes into the target
      target.merge_attributes(source, mas, @matches, &@filter)
    end
1253909
public static void copy(FileObject source, FileObject target) throws IOException {
        InputStream in = source.openInputStream();
        OutputStream out = target.openOutputStream();
        try {
            byte[] buffer = new byte[1024];
            int len = in.read(buffer);
            while (len != -1) {
                out.write(buffer, 0, len);
                len = in.read(buffer);
            }
        } finally {
            in.close();
            out.close();
        }
    }
602267
private function mergeUnmodifiedPartial(array &$target, array $source)
    {
        foreach ($source as $key => $value) {
            if (is_array($value) && isset($target[$key])) {
                $this->mergeUnmodifiedPartial($target[$key], $value);
            } else {
                $target[$key] = $value;
            }
        }
    }
1075594
public void merge
			(Model target, Model... sources)
	{
		// Empty merged and added elements sets
		mergedElements.clear();
		addedElements.clear();

		// Fill equivalence map with objects from  target model
		Set<BioPAXElement> targetElements = target.getObjects();
		for (BioPAXElement t_bpe : targetElements)
		{
			this.addIntoEquivalanceMap(t_bpe);
		}

		// Try to insert every biopax element in every source one by one
		for (Model source : sources)
		{
			Set<BioPAXElement> sourceElements = source.getObjects();
			for (BioPAXElement bpe : sourceElements)
			{
				insert(target, bpe);
			}
		}
	}
775183
@Override
    public T merge(Archive<?> source, ArchivePath path, Filter<ArchivePath> filter) throws IllegalArgumentException {
        // Precondition checks
        Validate.notNull(source, "No source archive was specified");
        Validate.notNull(path, "No path was specified");
        Validate.notNull(filter, "No filter was specified");

        // Get existing contents from source archive
        final Map<ArchivePath, Node> sourceContent = source.getContent();
        Validate.notNull(sourceContent, "Source archive content can not be null.");

        // Add each asset from the source archive
        for (final Entry<ArchivePath, Node> contentEntry : sourceContent.entrySet()) {
            final Node node = contentEntry.getValue();
            ArchivePath nodePath = new BasicPath(path, contentEntry.getKey());
            if (!filter.include(nodePath)) {
                continue;
            }
            // Delegate
            if (node.getAsset() == null) {
                addAsDirectory(nodePath);
            } else {
                add(node.getAsset(), nodePath);
            }
        }
        return covariantReturn();
    }
67558
function merge(object, options, ...sources) {

	/* iterate through all provided sources */
	for(const source of sources) {

		/* retrieve the property names defined on object */
		const propNames = Object.getOwnPropertyNames(source);

		/* recursively merge properties */
		for(const name of propNames) {
			const value = source[name];

			/* skip undefined values */
			if(options && options.skipUndefined && value === undefined) {
				continue;
			}

			/* skip if both values equals */
			if(value === object[name]) {
				continue;
			}

			/* merge based on options */
			if(value && typeof value === "object") {
				if(options && options.arrayConcat && Array.isArray(object[name]) && Array.isArray(value)) {
					object[name] = object[name].concat(value);
					if(options && options.arrayUnique) {
						object[name] = Array.from(new Set(object[name]));
					}
				} else if(Array.isArray(value)) {
					object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
				} else {
					object[name] = merge(object[name] || {}, options, value);
				}
			} else {
				object[name] = options && options.overwrite || object[name] === undefined ? value : object[name];
			}

		}

	}

	/* return merged object */
	return object;
}
1232962
public void setSources(java.util.Collection<InputSource> sources) {
        if (sources == null) {
            this.sources = null;
            return;
        }

        this.sources = new java.util.ArrayList<InputSource>(sources);
    }