Prefers owners from the second hash -> effectively this will make pendingCH == unionCH (I think)
508963
public ScatteredConsistentHash union(ScatteredConsistentHash sch2) {
      checkSameHashAndSegments(sch2);

      List<Address> unionMembers = new ArrayList<>(this.members);
      mergeLists(unionMembers, sch2.getMembers());

      Address[] unionSegmentOwners = new Address[segmentOwners.length];
      for (int i = 0; i < unionSegmentOwners.length; i++) {
         unionSegmentOwners[i] = Optional.ofNullable(sch2.locatePrimaryOwnerForSegment(i)).orElse(locatePrimaryOwnerForSegment(i));
      }

      Map<Address, Float> unionCapacityFactors = unionCapacityFactors(sch2);
      return new ScatteredConsistentHash(hashFunction, unionSegmentOwners.length, unionMembers, unionCapacityFactors, unionSegmentOwners, false);
   }
491882
private CacheTopology addPartitioner(CacheTopology cacheTopology) {
      ConsistentHash currentCH = cacheTopology.getCurrentCH();
      currentCH = new PartitionerConsistentHash(currentCH, keyPartitioner);
      ConsistentHash pendingCH = cacheTopology.getPendingCH();
      if (pendingCH != null) {
         pendingCH = new PartitionerConsistentHash(pendingCH, keyPartitioner);
      }
      ConsistentHash unionCH = cacheTopology.getUnionCH();
      if (unionCH != null) {
         unionCH = new PartitionerConsistentHash(unionCH, keyPartitioner);
      }
      return new CacheTopology(cacheTopology.getTopologyId(), cacheTopology.getRebalanceId(), currentCH, pendingCH,
            unionCH, cacheTopology.getPhase(), cacheTopology.getActualMembers(), cacheTopology.getMembersPersistentUUIDs());
   }
303141
private void transferSemiUnique(SemiUniqueEntry[] src, SemiUniqueEntry[] dest) {
        for (int j = 0; j < src.length; ++j)
        {
            SemiUniqueEntry e = src[j];
            src[j] = null;
            while (e != null)
            {
                SemiUniqueEntry next = e.getSemiUniqueNext();
                int i = indexFor(e.getSemiUniqueHash(), dest.length);
                e.setSemiUniqueNext(dest[i]);
                dest[i] = e;
                e = next;
            }
        }
    }
1271526
def partial_sort!
      unless block_given? then return partial_sort! { |item1, item2| item1 <=> item2 } end
      # The comparison hash
      h = Hash.new { |h, k| h[k] = Hash.new }
      sort! do |a, b|
        # * If a and b are comparable, then use the comparison result.
        # * Otherwise, if there is a member c such that (a <=> c) == (c <=> b),
        #   then a <=> b has the transitive comparison result.
        # * Otherwise, a <=> b is arbitrarily set to 1.
        yield(a, b) || h[a][b] ||= -h[b][a] ||= h[a].detect_value { |c, v| v if v == yield(c, b) } || 1
      end
    end
152229
public static Hash merge(Hash a, Hash b) {
        try {
            MessageDigest digest = MessageDigest.getInstance("SHA-256");
            digest.update(a.bytes);
            return Hash.createFromSafeArray(digest.digest(digest.digest(b.bytes)));
        } catch (NoSuchAlgorithmException e) {
            throw new RuntimeException(e);
        }
    }
264727
function getOrderIndependentHash(object, orderIndependent, pathCache, valueCache) {
    orderIndependent = getFunctionOption(orderIndependent);
    pathCache = pathCache || [];
    valueCache = valueCache || [];

    var accum = 0;
    var accumList = [];
    var type = realTypeOf(object);
    var i;

    if (type === 'array' || type === 'object') {
      if ((i = valueCache.indexOf(object)) !== -1) {
        return hashThisString(pathCache.slice(i).join(','));
      }
    }

    if (type === 'array') {
      var arrayString;
      if (orderIndependent(pathCache)) {
        for (i = 0; i < object.length; ++i) {
          accum += getOrderIndependentHash(object[i], orderIndependent, pathCache.concat(0), valueCache.concat([object]));
        }
        arrayString = '[type: array, hash: ' + accum + ']';
      } else {
        for (i = 0; i < object.length; ++i) {
          accumList.push(getOrderIndependentHash(object[i], orderIndependent, pathCache.concat(i), valueCache.concat([object])));
        }
        arrayString = '[type: array, hash: ' + accumList.join(', ') + ']';
      }
      return hashThisString(arrayString);
    }

    if (type === 'object') {
      var keyValueString;
      var objectString;
      var key;
      if (orderIndependent(pathCache) !== false) {
        for (key in object) {
          if (object.hasOwnProperty(key)) {
            keyValueString = 'key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key], orderIndependent, pathCache.concat(key), valueCache.concat(object));
            accum += hashThisString(keyValueString);
          }
        }
        objectString = '[type: object, hash: ' + accum + ']';
      } else {
        for (key in object) {
          if (object.hasOwnProperty(key)) {
            keyValueString = 'key: ' + key + ', value hash: ' + getOrderIndependentHash(object[key], orderIndependent, pathCache.concat(key), valueCache.concat(object));
            accumList.push(hashThisString(keyValueString));
          }
        }
        objectString = '[type: object, hash: ' + accumList.join(', ') + ']';
      }
      return hashThisString(objectString);
    }

    // Non object, non array...should be good?
    var stringToHash = '[ type: ' + type + ' ; value: ' + object + ']';
    return hashThisString(stringToHash);
  }
914841
def merge_config(first, second)
        first_hash = first.instance_variable_get(:@hash).deep_dup
        ActiveFedora::Indexing::Map.new(first_hash.merge(second))
      end
423134
def _swap_optimizer_allows(self, p1, p2):
        
        # setup local shortcuts
        a = self._array
        tile1 = a[p1]
        tile2 = a[p2]
        # 1) disallow same tiles
        if tile1 == tile2:
            return False
        # 2) disallow matches unless a wildcard is involved
        if tile1.matches(tile2) and not any(t.is_wildcard()
                                            for t in (tile1, tile2)):
            return False
        # 3) disallow when both tiles (post-swap) are surrounded by non-matches
        center_other_pairs = ((p1, p2), (p2, p1))

        class MatchedTiles(Exception):
            pass
        try:
            for center_p, other_p in center_other_pairs:
                up_down_left_right = ((center_p[0] - 1, center_p[1]),
                                      (center_p[0] + 1, center_p[1]),
                                      (center_p[0],     center_p[1] - 1),
                                      (center_p[0],     center_p[1] + 1))
                post_swap_center_tile = a[other_p]
                for surrounding_p in up_down_left_right:
                    # ignore out of bounds positions
                    # and ignore the inner swap which is handled elsewhere
                    if any((not (0 <= surrounding_p[0] <= 7),  # out of bounds
                            not (0 <= surrounding_p[1] <= 7),  # out of bounds
                            surrounding_p == other_p)):  # inner swap
                        continue
                    surrounding_tile = a[surrounding_p]
                    if post_swap_center_tile.matches(surrounding_tile):
                        raise MatchedTiles()
        except MatchedTiles:
            pass  # if any match found, stop checking and pass this filter
        else:
            return False  # if no match is found, then this can be filtered
        return True
678875
function equalOwnProperties(left, right, equalityComparer) {
        if (left === right)
            return true;
        if (!left || !right)
            return false;
        for (var key in left)
            if (hasOwnProperty.call(left, key)) {
                if (!hasOwnProperty.call(right, key) === undefined)
                    return false;
                if (equalityComparer ? !equalityComparer(left[key], right[key]) : left[key] !== right[key])
                    return false;
            }
        for (var key in right)
            if (hasOwnProperty.call(right, key)) {
                if (!hasOwnProperty.call(left, key))
                    return false;
            }
        return true;
    }
1157177
public static IntSupplier leftOf(ISized owner, IPositioned other, int spacing)
	{
		checkNotNull(other);
		return () -> {
			return other.position().x() - owner.size().width() - spacing;
		};
	}
761551
private void refillEntry(int baseHash)
  {
    K key = _keys[baseHash];
    V value = _values[baseHash];

    _keys[baseHash] = null;
    _values[baseHash] = null;

    int hash = key.hashCode() & _mask;

    for (int count = _size; count >= 0; count--) {
      if (_values[hash] == null) {
        _keys[hash] = key;
        _values[hash] = value;
        return;
      }

      hash = (hash + 1) & _mask;
    }
  }
1346421
function fixturizeCommitSha (map, sha) {
  // Do nothing if the passed sha is already set
  if (map[sha]) {
    return map[sha]
  }

  // Do nothing if the passed sha is one of our fixturized ones
  if (Object.values(map).includes(sha)) {
    return sha
  }

  // Otherwise calculate the new sha and set it on the passed state map.
  const counter = Object.keys(map).length + 1
  map[sha] = ('0000000000000000000000000000000000000000' + counter).substr(-40)

  return map[sha]
}
843301
def priority_level_get
      hash = {}
      hash[:priority] = default_priority
      hash[:lower] = default_priority_forward_thresh_lower
      hash[:upper] = default_priority_forward_thresh_upper
      arr = config_get('interface_hsrp_group', 'priority_level', @get_args)
      if arr
        hash[:priority] = arr[0].to_i
        hash[:lower] = arr[1].to_i if arr[1]
        hash[:upper] = arr[2].to_i if arr[2]
      end
      hash
    end
116519
function(_set1, _set2) {
        var hash = {}, uniq = [],
            fullSet = _set1.concat(_set2);

        for (var i = 0; i < fullSet.length; i++) {
            if (fullSet[i] !== undefined) hash[fullSet[i].toString()] = fullSet[i];
        }

        for (var key in hash) {
            uniq.push(hash[key]);
        }
        return uniq;
    }
1008603
def manifest=(hash)
      return unless hash
      raise "Input should be Hash" unless hash.is_a? Hash
      @manifest.merge! VCAP.symbolize_keys(hash)
    end
12515
function sfuse(hash){
	var retval = '';

	var cache = [];
	us.each(hash, function(loc_list, str){
	    var locs = dedupe(loc_list);
	    cache.push( str + ' <small>[' + locs.join(', ') + ']</small>');
	});
	if( cache.length > 0 ){
	    retval = cache.join('<br />');	    
	}
	
	return retval;
    }
280676
def merge_hashes(hashes)
      hashes.inject({}) { |n, h| n.weave(h, true) }
    end