We can merge unless the merge results in an empty set -- a
        contradiction
428930
def merge(self, other):
        
        other = self.coerce(other)
        if self.is_equal(other):
            # pick among dependencies
            return self
        elif other.is_entailed_by(self):
            # other is a subset of self
            return self
        elif self.is_entailed_by(other):
            # self is a subset of other.
            self.values = other.values.copy()
        elif self.is_contradictory(other):
            raise Contradiction("Cannot merge set with %s" % (str(other)))
        else:
            # merge mutual information
            if self.values:
                self.values = self.values.intersection(other.values)
            else:
                self.values = other.values.copy()
        return self
45523
@Override
    public void merge(EvaluationBinary other) {
        if (other.countTruePositive == null) {
            //Other is empty - no op
            return;
        }

        if (countTruePositive == null) {
            //This evaluation is empty -> take results from other
            this.countTruePositive = other.countTruePositive;
            this.countFalsePositive = other.countFalsePositive;
            this.countTrueNegative = other.countTrueNegative;
            this.countFalseNegative = other.countFalseNegative;
            this.rocBinary = other.rocBinary;
        } else {
            if (this.countTruePositive.length != other.countTruePositive.length) {
                throw new IllegalStateException("Cannot merge EvaluationBinary instances with different sizes. This "
                                + "size: " + this.countTruePositive.length + ", other size: "
                                + other.countTruePositive.length);
            }

            //Both have stats
            addInPlace(this.countTruePositive, other.countTruePositive);
            addInPlace(this.countTrueNegative, other.countTrueNegative);
            addInPlace(this.countFalsePositive, other.countFalsePositive);
            addInPlace(this.countFalseNegative, other.countFalseNegative);

            if (this.rocBinary != null) {
                this.rocBinary.merge(other.rocBinary);
            }
        }
    }
472341
function merge(/* obj1 .. objN */){
    var result = {};

    for (var i = 0; i < arguments.length; i++)
      extend(result, arguments[i]);

    return result;
  }
996355
private int merge(String[] dst, String[] srcA, int lengthA, Tag[] srcB, int lengthB) {
    int i = 0;
    int ai = 0;
    int bi = 0;

    while (ai < lengthA && bi < lengthB) {
      final String ak = srcA[ai];
      final String av = srcA[ai + 1];
      Tag b = srcB[bi];
      int cmp = ak.compareTo(b.key());
      if (cmp < 0) {
        dst[i++] = ak;
        dst[i++] = av;
        ai += 2;
      } else if (cmp > 0) {
        dst[i++] = b.key();
        dst[i++] = b.value();
        ++bi;
      } else {
        // Newer tags should override, use source B if there are duplicate keys.
        // If source B has duplicates, then use the last value for the given key.
        int j = bi + 1;
        for (; j < lengthB && ak.equals(srcB[j].key()); ++j) {
          b = srcB[j];
        }
        dst[i++] = b.key();
        dst[i++] = b.value();
        bi = j;
        ai += 2; // Ignore
      }
    }

    if (ai < lengthA) {
      System.arraycopy(srcA, ai, dst, i, lengthA - ai);
      i += lengthA - ai;
    } else if (bi < lengthB) {
      i = dedup(srcB, bi, dst, i, lengthB - bi);
    }

    return i;
  }
1271769
function merge(destination, source, preserve) {
        preserve = preserve || [];

        for (var property in source) {
          if (preserve.indexOf(property) === -1) {
            destination[property] = source[property];
          }
        }

        return destination;
      }
624800
public static final <T> boolean intersect(Collection<Set<T>> sets)
    {
        Set<T> set = intersection(sets);
        return !set.isEmpty();
    }
169578
private static int[] getComplement(int[] subset, int[] fullset) {
        int size = fullset.length - subset.length;

        // Returns null if no complement
        if (size < 1) {
            return null;
        }

        // Otherwsise define combination array and determine complement
        int[] complement = new int[size];
        int index = 0;
        for (int i = 0; i < fullset.length; i++) {
            int item = fullset[i];
            boolean member = false;
            for (int j = 0; j < subset.length; j++) {
                if (item == subset[j]) {
                    member = true;
                    break;
                }
            }

            if (!member) {
                complement[index++] = item;
            }

        }

        return complement;
    }
1283840
def merge(a, b):
    ""
    for key in b:
        if isinstance(a.get(key), dict) and isinstance(b.get(key), dict):
            merge(a[key], b[key])
        else:
            a[key] = b[key]
    return a
760565
function mergeArray(a, b) {
  var adds = [];
  var ai = 0;

  for (var i = 0; i < b.length; i++) {
    if (('object' === type(a[i]) && 'object' === type(b[i]))
    ||  ('array' === type(a[i]) && 'array' === type(b[i]))) {
      a[i] = merge(a[i], b[i]);
    } else if ('object' === type(b[i])) {
      adds.push(merge({}, b[i]));
    } else if ('array' === type(b[i])) {
      adds.push(merge([], b[i]));
    } else if (!~a.indexOf(b[i])) {
      adds.push(b[i]);
    }
  }

  for (; ai < adds.length; ai++) {
    a.push(adds[ai]);
  }

  return a;
}
1325341
function merge (s) {
  var r = {}
  var k

  if (s) {
    for (k in s) {
      if (s.hasOwnProperty(k)) {
        r[k] = s[k]
      }
    }
  }

  return r
}
310834
function merge(a, b) {

    /* result set */
    var c = [];

    /* as long as there are elements in the arrays to be merged */
    while (a.length > 0 || b.length > 0) {

      /* are there elements to be merged, if yes, compare them and merge */
      var n = a.length > 0 && b.length > 0 ? a[0] < b[0] ? a.shift() : b.shift() : b.length > 0 ? b.shift() : a.length > 0 ? a.shift() : null;

      /* always push the smaller one onto the result set */
      if (n !== null) {
        c.push(n);
      }
    }
    return c;
  }
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);
                    }
                }
            }
        }
    }
372462
static Map<String, Object> merge(List<Map<String, Object>> args) {
        if (args.size() > 1) {
            Map<String, Object> obj = args.get(0);
            for (int i = 1; i < args.size(); i++) {
                obj = mergeTwo(obj, args.get(i));
            }
            return obj;
        } else if (args.size() == 1) {
            return args.get(0);
        } else {
            return null;
        }
    }
784282
def merge(self, other):
        
        other = BoolCell.coerce(other)
        if self.is_equal(other):
            # pick among dependencies
            return self
        elif other.is_entailed_by(self):
            return self
        elif self.is_entailed_by(other):
            self.value = other.value
        elif self.is_contradictory(other):
            raise Contradiction("Cannot merge T and F")
        else:
            raise Exception
        return self
1285399
private static <K,V> void combineMaps(Map<K,V> m1, Map<K,V> m2)
    {
    	for (Map.Entry<K,V> me : m2.entrySet()) {
            K key = me.getKey();
            /* Int. subset has precedence, but let's guess most of
             * the time there are no collisions:
             */
            V old = m1.put(key, me.getValue());
            // Oops, got value! Let's put it back
            if (old != null) {
                m1.put(key, old);
            }
        }
    }
995862
function merge (a, b, soft) {
  for (var k in b)
    if (!soft || !a.hasOwnProperty(k)) a[k] = b[k]
  return a
}
729802
def _merge_list(self, key, lst):
    
    self[key] += [x for x in lst if x not in self[key]]