Tries to figure out which type of property value that should be merged and
    invoke the right function.
    Returns new properties if the merge was successful otherwise False.
500089
def merge_properties(item_properties, prop_name, merge_value):
    
    existing_value = item_properties.get(prop_name, None)
    if not existing_value:  # A node without existing values for the property
        item_properties[prop_name] = merge_value
    else:
        if type(merge_value) is int or type(merge_value) is str:
            item_properties[prop_name] = existing_value + merge_value
        elif type(merge_value) is list:
            item_properties[prop_name] = merge_list(existing_value, merge_value)
        else:
            return False
    return item_properties
166490
function merge(obj, fallbackObj) {
			var name, value, fallbackValue;

			if ( !fallbackObj ) {
				return;
			}

			for ( name in fallbackObj ) {

				if ( fallbackObj.hasOwnProperty(name) ) {

					value = obj[ name ];
					fallbackValue = fallbackObj[ name ];

					if ( value === undefined ) {
						// 'undefined': value doesn't exist in delta, so take it from the fallback object
						// Note: undefined is not a valid value in JSON, so we can't misunderstand an existing undefined
						obj[name] = fallbackValue;
					} else if ( value === null ) {
						// 'null' is used by the delta tooling as a marker that a value must not be taken form the fallback
						delete obj[name];
					} else if ( typeof value === 'object' && typeof fallbackValue === 'object' ) {
						// both values are objects, merge them recursively
						merge(value, fallbackValue);
					}

				}

			}

		}
214822
function detect_method_or_property(cls, key, value, pair) {
  if (isFn(value)) {
    var m = make_method(key, value);
    if (apply_autodetected(m, pair))
      return cls["members"].push(m); 
  }
  else {
    var p = make_property(key, value);
    if (apply_autodetected(p, pair))
      return cls["members"].push(p);
  }
}
813738
function mergeJson(original, override) {
            return _.merge(original, override, function (a, b, key, aParent, bParent) {
                if (_.isUndefined(b)) {
                    aParent[key] = undefined;
                    return;
                }
            });
        }
13093
public Datatype.Builder mergeFrom(Datatype value) {
    Datatype_Builder defaults = new Datatype.Builder();
    if (defaults._unsetProperties.contains(Property.TYPE)
        || !Objects.equals(value.getType(), defaults.getType())) {
      setType(value.getType());
    }
    if (defaults._unsetProperties.contains(Property.INTERFACE_TYPE)
        || value.isInterfaceType() != defaults.isInterfaceType()) {
      setInterfaceType(value.isInterfaceType());
    }
    if (defaults._unsetProperties.contains(Property.BUILDER)
        || !Objects.equals(value.getBuilder(), defaults.getBuilder())) {
      setBuilder(value.getBuilder());
    }
    if (defaults._unsetProperties.contains(Property.EXTENSIBLE)
        || value.isExtensible() != defaults.isExtensible()) {
      setExtensible(value.isExtensible());
    }
    value.getBuilderFactory().ifPresent(this::setBuilderFactory);
    if (defaults._unsetProperties.contains(Property.GENERATED_BUILDER)
        || !Objects.equals(value.getGeneratedBuilder(), defaults.getGeneratedBuilder())) {
      setGeneratedBuilder(value.getGeneratedBuilder());
    }
    if (defaults._unsetProperties.contains(Property.VALUE_TYPE)
        || !Objects.equals(value.getValueType(), defaults.getValueType())) {
      setValueType(value.getValueType());
    }
    if (defaults._unsetProperties.contains(Property.PARTIAL_TYPE)
        || !Objects.equals(value.getPartialType(), defaults.getPartialType())) {
      setPartialType(value.getPartialType());
    }
    value.getRebuildableType().ifPresent(this::setRebuildableType);
    if (defaults._unsetProperties.contains(Property.PROPERTY_ENUM)
        || !Objects.equals(value.getPropertyEnum(), defaults.getPropertyEnum())) {
      setPropertyEnum(value.getPropertyEnum());
    }
    putAllStandardMethodUnderrides(value.getStandardMethodUnderrides());
    if (defaults._unsetProperties.contains(Property.BUILDER_SERIALIZABLE)
        || value.isBuilderSerializable() != defaults.isBuilderSerializable()) {
      setBuilderSerializable(value.isBuilderSerializable());
    }
    if (defaults._unsetProperties.contains(Property.HAS_TO_BUILDER_METHOD)
        || value.getHasToBuilderMethod() != defaults.getHasToBuilderMethod()) {
      setHasToBuilderMethod(value.getHasToBuilderMethod());
    }
    if (value instanceof Value && generatedBuilderAnnotations == ImmutableList.<Excerpt>of()) {
      generatedBuilderAnnotations = ImmutableList.copyOf(value.getGeneratedBuilderAnnotations());
    } else {
      addAllGeneratedBuilderAnnotations(value.getGeneratedBuilderAnnotations());
    }
    if (value instanceof Value && valueTypeAnnotations == ImmutableList.<Excerpt>of()) {
      valueTypeAnnotations = ImmutableList.copyOf(value.getValueTypeAnnotations());
    } else {
      addAllValueTypeAnnotations(value.getValueTypeAnnotations());
    }
    if (defaults._unsetProperties.contains(Property.VALUE_TYPE_VISIBILITY)
        || !Objects.equals(value.getValueTypeVisibility(), defaults.getValueTypeVisibility())) {
      setValueTypeVisibility(value.getValueTypeVisibility());
    }
    if (value instanceof Value && nestedClasses == ImmutableList.<Excerpt>of()) {
      nestedClasses = ImmutableList.copyOf(value.getNestedClasses());
    } else {
      addAllNestedClasses(value.getNestedClasses());
    }
    return (Datatype.Builder) this;
  }
1017127
def _perform_merge(self, other):
        
        if len(other.value) > len(self.value):
            self.value = other.value[:]
        return True
438968
private void mergeProperties(Map<ExecutionConfigSource, Map<ExecutionProperty, List<String>>> sourceToPropertiesMap) {
        for ( ExecutionConfigSource s : propertySources) {
            Map<ExecutionProperty, List<String>> properties = sourceToPropertiesMap.get(s);
            for ( ExecutionProperty p : properties.keySet()) {
                List<String> valuesFromSource = properties.get(p);
                if ( valuesFromSource != null && !valuesFromSource.isEmpty()) {
                    List<String> vals = getOrCreatePropertyValues(p);
                    mergeValues(valuesFromSource, p, vals);
                }
            }
        }
    }
1141156
private static boolean getBooleanProperty(Function function, String propertyKey, boolean defaultValue) {
        Object value = function.getProperty(propertyKey);
        return value instanceof Boolean ? (Boolean)value : defaultValue;
    }
117568
public void mergeWith(UnconditionalValueDerefSet fact, @CheckForNull ValueNumber skipMe, ValueNumberFactory valueNumberFactory) {
        if (UnconditionalValueDerefAnalysis.DEBUG) {
            System.out.println("merge update of # " + System.identityHashCode(this) + " from " + System.identityHashCode(fact));
            System.out.println("update " + this);
            System.out.println("with " + fact);

        }
        boolean resultForSkippedValue = false;
        if (skipMe != null) {
            resultForSkippedValue = valueNumbersUnconditionallyDereferenced.get(skipMe.getNumber());
        }
        // Compute the intersection of the unconditionally dereferenced value
        // sets
        valueNumbersUnconditionallyDereferenced.and(fact.valueNumbersUnconditionallyDereferenced);
        if (skipMe != null) {
            valueNumbersUnconditionallyDereferenced.set(skipMe.getNumber(), resultForSkippedValue);
        }

        // For each unconditionally dereferenced value...
        for (int i = 0; i < numValueNumbersInMethod; i++) {
            ValueNumber vn = valueNumberFactory.forNumber(i);
            if (vn.equals(skipMe)) {
                continue;
            }
            Set<Location> factDerefLocationSet = fact.derefLocationSetMap.get(vn);
            if (valueNumbersUnconditionallyDereferenced.get(i)) {
                if (factDerefLocationSet != null && !factDerefLocationSet.isEmpty()) {
                    // Compute the union of the dereference locations for
                    // this value number.
                    Set<Location> derefLocationSet = derefLocationSetMap.get(vn);
                    if (derefLocationSet == null) {
                        derefLocationSet = new HashSet<>();
                        derefLocationSetMap.put(vn, derefLocationSet);
                    }
                    derefLocationSet.addAll(fact.derefLocationSetMap.get(vn));
                }
            } else {
                Set<Location> removed = derefLocationSetMap.remove(vn);
                // The value number is not in the fact:
                // remove its location set
                if (removed != null) {
                    if (UnconditionalValueDerefAnalysis.DEBUG) {
                        System.out.println("Goodbye: " + removed);
                    }
                }
            }
        }
    }
751766
public void merge(Object obj) {
        if (obj == null) {
            throw new IllegalArgumentException(
                    "Object to merge cannot be null");
        }

        m_properties.putAll(getPropertyMap(obj));
    }
811051
function mergeObject(target, source) {
  // create a variable to hold the target object
  // so it can be changed if its not an object
  let targetObject = target;
  let sourceObject = source;

  if (!isObj(target)) {
    targetObject = {};
  }

  if (!isObj(source)) {
    sourceObject = {};
  }

  // get the object keys for the target and source objects
  const targetKeys = Object.keys(targetObject);
  const sourceKeys = Object.keys(sourceObject);

  // create a empty object for the result
  const result = {};

  // go through all the target keys
  targetKeys.forEach((key) => {
    // check if the source object contains the key
    if (sourceKeys.indexOf(key) !== -1) {
      // check if the target value is null if it is
      // set the result as the source value, this
      // should be fine because if the source value
      // is null it isn't overriding the target value
      // and if it isn't null it is overriding
      // as expected
      if (targetObject[key] === null) {
        result[key] = sourceObject[key];
      } else if (isObj(targetObject[key])) {
        // check if the source value is an object if
        // it is then we need to merge both objects and
        // set the result value to the merged object
        if (isObj(sourceObject[key])) {
          result[key] = mergeObject(targetObject[key], sourceObject[key]);
        } else {
          // if the source value isn't an object we can
          // simply override the value
          result[key] = sourceObject[key];
        }
      } else {
        // if the target value isn't an object we can
        // simply override the value
        result[key] = sourceObject[key];
      }
    } else {
      // if the source doesn't contain the key set the result
      // as the original from the target
      result[key] = targetObject[key];
    }
  });

  // go through all the source keys
  sourceKeys.forEach((key) => {
    // if the target doesn't contain the key
    // then the value is new and should be added
    // to the result object
    if (targetKeys.indexOf(key) === -1) {
      result[key] = sourceObject[key];
    }
  });

  return result;
}
355158
def _wrap(fn):
        
        def _func(*args):
            merged = None
            _args = []
            for arg in args:
                if merged.__class__ != arg.__class__:
                    if merged is None:
                        merged = arg.__class__(None)
                    else:
                        merged = Value._merge_type(merged, arg)(None)
                merged.merge(arg)
                if isinstance(arg, Value):
                    arg = arg.value
                _args.append(arg)
            merged.value = fn(*_args)
            return merged
        return _func
155896
function merge() {
	return Array.from(arguments)
		.reduce((result, current) => {
			Array.from(current)
				.forEach((value, index) => {
					result[index] = result[index] && typeof result[index] !== 'boolean' ? result[index] : value;
				});

			return result;
		}, []);
}
422611
def merge!(rel)
      return self if rel.nil?
      MULTI_VALUE_METHODS.each do |method|
        (@values[method] ||= []).concat(rel.values[method]).uniq! unless rel.values[method].nil?
      end

      MULTI_KEY_METHODS.each do |method|
        (@values[method] ||= {}).merge!(rel.values[method]) unless rel.values[method].nil?
      end

      SINGLE_VALUE_METHODS.each do |method|
        @values[method] = rel.values[method] unless rel.values[method].nil?
      end

      self
    end
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;
}
173977
function merge(target) {
  for (var _len = arguments.length, sources = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
    sources[_key - 1] = arguments[_key];
  }

  if (!sources.length) return target;
  var source = sources.shift();

  if ((0, _isObject2.default)(target) && (0, _isObject2.default)(source)) {
    for (var key in source) {
      if ((0, _isObject2.default)(source[key])) {
        if (!target[key]) Object.assign(target, _defineProperty({}, key, {}));
        merge(target[key], source[key]);
      } else {
        Object.assign(target, _defineProperty({}, key, source[key]));
      }
    }
  }

  return merge.apply(undefined, [target].concat(sources));
}
334452
function merge_objects_(b) {
		if(is.func(b)) {
			b = b();
		}
		debug.assert(b).is('object');
		_merge_object(opts, a, b);
	}