Combines the values from two map objects using the indx values
    using the op operator. In situations where there is a missing value
    it will use the callable function handle_missing
339886
def binOp(op, indx, amap, bmap, fill_vec):
    '''
    
    '''
    def op_or_missing(id):
        va = amap.get(id, None)
        vb = bmap.get(id, None)
        if va is None or vb is None:
            # This should create as many elements as the number of columns!?
            result = fill_vec
        else:
            try:
                result = op(va, vb)
            except Exception:
                result = None
            if result is None:
                result = fill_vec
            return result
    seq_arys = map(op_or_missing, indx)
    data = np.vstack(seq_arys)
    return data
367244
function getDeeplyMergedValues(value1, value2) {
  if (isArray(value2)) {
    return !isArray(value1) ? value2 : mergeDeepArrays(value1, value2); // eslint-disable-line no-use-before-define
  }

  if (isObject(value2)) {
    return !isObject(value1) ? value2 : mergeDeepObjects(value1, value2); //eslint-disable-line no-use-before-define
  }

  return value2;
}
541036
function(objA, objB) {
		// combine all properties ... if the same property, try to take
		// an intersection ... if an intersection isn't possible ... freak out?
		var valuesA = objA.values,
			valuesB = objB.values,
			foundEmpty = false;
		var resultValues = {};
		eachInUnique(valuesA,
			function(prop, aVal, bVal) {
				resultValues[prop] = bVal === MISSING ? aVal : set.intersection(aVal, bVal);
				if (resultValues[prop] === set.EMPTY) {
					foundEmpty = true;
				}
			},
			valuesB,
			function(prop, aVal, bVal) {
				resultValues[prop] = bVal;
				if (resultValues[prop] === set.EMPTY) {
					foundEmpty = true;
				}
			});
		if (foundEmpty) {
			return set.EMPTY;
		} else {
			return new KeysAnd(resultValues);
		}

	}
1065404
private static int mergeMaps(Map<String, Integer> map, Map<String, Integer> other)
    {
        int deltaSize = 0;
        for (Map.Entry<String, Integer> entry : other.entrySet()) {
            if (!map.containsKey(entry.getKey())) {
                deltaSize += entry.getKey().getBytes().length + SIZE_OF_INT;
            }
            map.put(entry.getKey(), map.getOrDefault(entry.getKey(), 0) + other.getOrDefault(entry.getKey(), 0));
        }
        return deltaSize;
    }
442766
def dict_isect_combine(dict1, dict2, combine_op=op.add):
    
    keys3 = set(dict1.keys()).intersection(set(dict2.keys()))
    dict3 = {key: combine_op(dict1[key], dict2[key]) for key in keys3}
    return dict3
1272286
def combine(self, node, othernode, op=None, unary_op=None, register=False,
                aliasing_type=False):
        
        if self.result[othernode] is self.builder.UnknownType:
            if node not in self.result:
                self.result[node] = self.builder.UnknownType
            return

        if aliasing_type:
            self.combine_(node, othernode, op or operator.add,
                          unary_op or (lambda x: x), register)
            for a in self.strict_aliases[node]:
                self.combine_(a, othernode, op or operator.add,
                              unary_op or (lambda x: x), register)
        else:
            self.combine_(node, othernode, op or operator.add,
                          unary_op or (lambda x: x), register)
1141386
public boolean addAllValues(MultiMap<V> map) {
        boolean merged = false;

        if ((map == null) || (map.isEmpty())) {
            // done
            return merged;
        }

        for (Map.Entry<String, List<V>> entry : map.entrySet()) {
            String name = entry.getKey();
            List<V> values = entry.getValue();

            if (this.containsKey(name)) {
                merged = true;
            }

            this.addValues(name, values);
        }

        return merged;
    }
673219
def _nested_op(inputs, op):  # pylint: disable=invalid-name
  """"""
  # First the simple non-nested case.
  if not isinstance(inputs[0], (list, tuple)):
    return op(inputs)
  # In the nested case, sum on each axis separately.
  result_list = []
  for i in range(len(inputs[0])):
    result_list.append(_nested_op([x[i] for x in inputs], op=op))
  if isinstance(inputs[0], list):
    return result_list
  return tuple(result_list)
1112233
public static IsNullValue merge(IsNullValue a, IsNullValue b) {
        if (a == b) {
            return a;
        }
        if (a.equals(b)) {
            return a;
        }
        int aKind = a.kind & 0xff;
        int bKind = b.kind & 0xff;
        int aFlags = a.getFlags();
        int bFlags = b.getFlags();

        int combinedFlags = aFlags & bFlags;

        if (!(a.isNullOnSomePath() || a.isDefinitelyNull()) && b.isException()) {
            combinedFlags |= EXCEPTION;
        } else if (!(b.isNullOnSomePath() || b.isDefinitelyNull()) && a.isException()) {
            combinedFlags |= EXCEPTION;
        }

        // Left hand value should be >=, since it is used
        // as the first dimension of the matrix to index.
        if (aKind < bKind) {
            int tmp = aKind;
            aKind = bKind;
            bKind = tmp;
        }
        assert aKind >= bKind;
        int result = mergeMatrix[aKind][bKind];

        IsNullValue resultValue = (result == NO_KABOOM_NN) ? noKaboomNonNullValue(a.locationOfKaBoom)
                : instanceByFlagsList[combinedFlags >> FLAG_SHIFT][result];

        return resultValue;
    }
724019
private static String joinAndGetValue(List<Field> fields, String sep,
                List<Object> values, Object obj, boolean isWithNullValue) {
	    return joinAndGetValueForInsert(fields, sep, null, values, obj, isWithNullValue);
    }
739093
def combine(operator, other)
      if other.respond_to?(:composition) && compatible_with?(other)
        new(value.send(operator, other.convert_to(unit).value), unit)
      end
    end
1063112
private static <K, V> HamtPMap<K, V> reconcile(
      @Nullable HamtPMap<K, V> t1,
      @Nullable HamtPMap<K, V> t2,
      BiFunction<V, V, V> joiner) {
    if (t1 == t2) {
      return t1;
    } else if (t1 == null) {
      V newValue = joiner.apply(null, t2.value);
      HamtPMap<K, V>[] newChildren = Arrays.copyOf(t2.children, t2.children.length);
      for (int i = 0; i < newChildren.length; i++) {
        newChildren[i] = reconcile(null, newChildren[i], joiner);
      }
      return newValue != null
          ? new HamtPMap<>(t2.key, t2.hash, newValue, t2.mask, newChildren)
          : deleteRoot(t2.mask, newChildren);
    } else if (t2 == null) {
      V newValue = joiner.apply(t1.value, null);
      HamtPMap<K, V>[] newChildren = Arrays.copyOf(t1.children, t1.children.length);
      for (int i = 0; i < newChildren.length; i++) {
        newChildren[i] = reconcile(newChildren[i], null, joiner);
      }
      return newValue != null
          ? new HamtPMap<>(t1.key, t1.hash, newValue, t1.mask, newChildren)
          : deleteRoot(t1.mask, newChildren);
    }

    // Try as hard as possible to return input trees exactly.
    boolean sameChildrenAs1 = true;
    boolean sameChildrenAs2 = true;

    // If the hashes are different, we need to keep the lower one at the top.
    int hashCmp = compareUnsigned(t1.hash, t2.hash);
    K key = t1.key;
    int hash = t1.hash;
    if (hashCmp < 0) {
      // t1.key is missing from t2
      t2 = t2.vacateRoot();
      sameChildrenAs2 = false;
    } else if (hashCmp > 0) {
      // t2.key is missing from t1
      t1 = t1.vacateRoot();
      sameChildrenAs1 = false;
      key = t2.key;
      hash = t2.hash;
    } else if (!t1.key.equals(t2.key)) {
      // Hash collision: try to rearrange t2 to have the same root as t1
      t2 = t2.pivot(t1.key, t1.hash);
      sameChildrenAs2 = false;
    }
    // Note: one or the other (but not both) tree may have a null key at root.

    V newValue = Objects.equals(t1.value, t2.value) ? t1.value : joiner.apply(t1.value, t2.value);
    int newMask = t1.mask | t2.mask;
    sameChildrenAs1 &= (newMask == t1.mask);
    sameChildrenAs2 &= (newMask == t2.mask);

    @SuppressWarnings("unchecked") // only used internally.
    HamtPMap<K, V>[] newChildren =
        newMask != 0
            ? (HamtPMap<K, V>[]) new HamtPMap<?, ?>[Integer.bitCount(newMask)]
            : emptyChildren();
    int mask = newMask;
    int index = 0;
    while (mask != 0) {
      int childBit = Integer.lowestOneBit(mask);
      mask &= ~childBit;
      HamtPMap<K, V> child1 = t1.getChild(childBit);
      HamtPMap<K, V> child2 = t2.getChild(childBit);
      newChildren[index] = reconcile(child1, child2, joiner);
      sameChildrenAs1 &= (newChildren[index] == child1);
      sameChildrenAs2 &= (newChildren[index] == child2);
      if (newChildren[index] != null) {
        index++;
      } else {
        newMask &= ~childBit;
      }
    }
    if (sameChildrenAs1 && t1.value.equals(newValue)) {
      return t1;
    } else if (sameChildrenAs2 && t2.value.equals(newValue)) {
      return t2;
    } else if (newValue == null) {
      return deleteRoot(newMask, newChildren);
    }
    return new HamtPMap<>(key, hash, newValue, newMask, newChildren);
  }
1031105
private <V> BiMap<V, Integer> createIndex(Set<V> values) {
    if (values == null) {
      return null;
    }

    ImmutableBiMap.Builder<V, Integer> builder = ImmutableBiMap.builder();
    int idx = 0;
    for (V value : values) {
      builder.put(value, idx++);
    }
    return builder.build();
  }
80584
function applyOps(data, ops, className) {
  debugPrint('OPS', ops);
  _.forIn(ops, (value, key) => {
    const operator = value.__op;

    if (operator in UPDATE_OPERATORS) {
      UPDATE_OPERATORS[operator](data, key, value, className);
    } else {
      throw new Error(`Unknown update operator: ${key}`);
    }

    if (MASKED_UPDATE_OPS.has(operator)) {
      getMask(className).add(key);
    }
  });
}
384691
def _match(self, x, op, y):
        
        if (op not in self.condition_mapper):
            raise ValueError('Invalid where condition given')

        func = getattr(self, self.condition_mapper.get(op))
        return func(x, y)
991775
def _reverse_operator(self, op):
        
        op = copy.copy(op)
        op.reverse()
        # check that we can map it
        if not str(op) in self.MONGO_OPS:
            raise ValueError('unknown operator: {}'.format(op))
        return op
1304075
function mergeObjects(params, addition) {
        for (var i in addition)
            if (i && addition.hasOwnProperty(i))
                params[i] = mergeParams(params[i], addition[i]);

        return params;
    }