Merge callable look-up tables from two objects.
542897
def _merge_ex_dicts(sexdict, oexdict):
    """"""
    # pylint: disable=R0101
    for okey, ovalue in oexdict.items():
        # Keys in other dictionary are callable paths or
        # callables ids depending on the full_cname argument
        # of the handler
        if okey in sexdict:
            svalue = sexdict[okey]
            # Each callable dictionary entry is itself a dictionary where the
            # key is (exception type, exception message) and the value is a
            # dictionary with keys 'function' (a list of callable paths to
            # the function), 'raised' (list of booleans indicating whether the
            # exception though each callable path was raised or not) and name
            for fkey, fvalue in ovalue.items():
                if fkey not in svalue:
                    # The other dictionary has a callable path not present in
                    # the self dictionary, add it unmodified
                    sexdict[okey][fkey] = fvalue
                else:
                    # The other dictionary has a callable and exception
                    # present in the self dictionary, have to check whether
                    # the callable path is the same (in which case update
                    # raise flag) or not (in which case add to 'function' and
                    # 'raise' keys
                    iobj = zip(fvalue["function"], fvalue["raised"])
                    for func, raised in iobj:
                        if func not in sexdict[okey][fkey]["function"]:
                            sexdict[okey][fkey]["function"].append(func)
                            sexdict[okey][fkey]["raised"].append(raised)
                        else:
                            idx = sexdict[okey][fkey]["function"].index(func)
                            sraised = sexdict[okey][fkey]["raised"][idx]
                            if sraised or raised:
                                sexdict[okey][fkey]["raised"][idx] = True
        else:
            sexdict[okey] = ovalue
181694
function mergeInto(one, two) {
  checkMergeObjectArg(one);
  if (two != null) {
    checkMergeObjectArg(two);
    for (var key in two) {
      if (!two.hasOwnProperty(key)) {
        continue;
      }
      one[key] = two[key];
    }
  }
}
603698
function mergeInner(base, mixin, mergeArrays) {
    if (base === null || typeof base !== 'object' || Array.isArray(base)) {
        throw new Error('base must be object');
    }
    if (mixin === null || typeof mixin !== 'object' || Array.isArray(mixin)) {
        throw new Error('mixin must be object');
    }
    Object.keys(mixin).forEach((name) => {
        mergeHelper(base, mixin, name, mergeArrays);
    });
}
113623
function createLookup(ids) {
  for (let value of lookup) {
    if (ids.length === value.length) {
      let match = true;
      value.forEach(subItem=>{
        if (ids[n] !== subItem) match = false;
      });
      if (match) return value;
    }
  }
  return ids;
}
1146044
function merge_objects(obj1,obj2){
        var obj3 = {};
        for (var attrname1 in obj1) { obj3[attrname1] = obj1[attrname1]; }
        for (var attrname2 in obj2) { obj3[attrname2] = obj2[attrname2]; }
        return obj3;
    }
690806
def merge(a, b):
    
    for item in a:
        setattr(b, item[0], item[1])
        b.__metadata__ = b.__metadata__
    return b
756544
function merge(obj1, obj2)
{
    var obj3 = {}, index;
    for (index in obj1) {
        obj3[index] = obj1[index];
    }
    for (index in obj2) {
        obj3[index] = obj2[index];
    }
    return obj3;
}
82800
function clone(obj1, obj2, index) {
  index = index || 0;
  for (var i in obj2) {
    if ('object' == typeof i) obj1[i] = recursiveMerge(obj1[i], obj2[i], index++);
    else obj1[i] = obj2[i];
  }
  return obj1;
}
726958
def join(self, ToMerge, keycols=None, nullvals=None, 
             renamer=None, returnrenaming=False, selfname=None, Names=None):
        

        if isinstance(ToMerge,np.ndarray):
            ToMerge = [ToMerge]

        if isinstance(ToMerge,dict):
            assert selfname not in ToMerge.keys(), \
             ('Can\'t use "', selfname + '" for name of one of the things to '  
              'merge, since it is the same name as the self object.')
            if selfname == None:
                try:
                    selfname = self.name
                except AttributeError:
                    selfname = 'self'
            ToMerge.update({selfname:self})
        else:
            ToMerge = [self] + ToMerge

        return tab_join(ToMerge, keycols=keycols, nullvals=nullvals, 
                   renamer=renamer, returnrenaming=returnrenaming, Names=Names)
1150342
def merge_dict(a, b):
    
    c = a.copy()
    c.update(b)
    return c
606063
def _merge_on_matching(self, uuid, matcher, verbose):
        """"""

        matches = api.match_identities(self.db, uuid, matcher)

        new_uuid = uuid

        u = api.unique_identities(self.db, uuid)[0]

        for m in matches:
            if m.uuid == uuid:
                continue

            self._merge(u, m, verbose)

            new_uuid = m.uuid

            # Swap uids to merge with those that could
            # remain on the list with updated info
            u = api.unique_identities(self.db, m.uuid)[0]

        return new_uuid
1245387
def relateObjectLocs(obj, entities, selectF):
    """"""
    #if obj in entities: return 0 # is already one of the entities
    try:                    obj = obj.loc # get object's location, if it has one
    except AttributeError:  pass # assume obj is already a MapPoint
    try:                    func = obj.direct2dDistance # assume obj is a MapPoint
    except AttributeError:  raise ValueError("object %s (%s) does not possess and is not a %s"%(obj, type(obj), MapPoint))
    try:                    return selectF([(func(b.loc), b) for b in entities])
    except AttributeError:  return selectF([(func(b)    , b) for b in entities])
607516
def merge_data_and_coords(data, coords, compat='broadcast_equals',
                          join='outer'):
    """"""
    objs = [data, coords]
    explicit_coords = coords.keys()
    indexes = dict(extract_indexes(coords))
    return merge_core(objs, compat, join, explicit_coords=explicit_coords,
                      indexes=indexes)
334514
def merge_dicts(*dicts, **kwargs):
    """"""
    result = {}
    for d in dicts:
        result.update(d)
    result.update(kwargs)
    return result
1239015
function merge (schema, doc, self) {
  var keys = Object.keys(doc);

  for (var i = 0; i < keys.length; ++i) {
    var key = keys[i];
    var type;

    // if nothing in schema yet, just assign
    if ('undefined' == typeof schema[key]) {
      var type = self.getType(doc, key);
      if (undefined !== type) {
        schema[key] = type;
      }
      continue;
    }

    // exists in schema and incoming is an object?
    if (isObject(doc[key])) {
      if (isObject(schema[key])) {
        merge(schema[key], doc[key], self);

      } else {
        type = self.getType(doc, key);
        if (undefined !== type) {
          if ('null' == schema[key]) {
            schema[key] = type;
          } else if (type != schema[key]) {
            schema[key] = 'Mixed';
          }
        }
      }
    } else {
      // exists in schema and incoming is not an object.
      var type = self.getType(doc, key);
      if (undefined === type) {
        continue;
      }

      if ('null' == schema[key]) {
        schema[key] = type;

      } else if ('null' == type) {
        // ignore

      } else if (Array.isArray(schema[key]) && Array.isArray(type)) {

        if (0 === schema[key].length) {
          schema[key] = type;

        } else if (schema[key][0] instanceof Schema && isObject(type[0])) {
          // merge schemas
          schema[key][0].combine(type[0]);

        } else if (!equalType(schema[key], type)) {
          schema[key] = ['Mixed'];
        }

      } else if (!equalType(schema[key], type)) {
        schema[key] = 'Mixed';
      }
    }
  }
}
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;
}
556599
def _merge_asized(base, other, level=0):
    
    ref2key = lambda ref: ref.name.split(':')[0]
    base.size += other.size
    base.flat += other.flat
    if level > 0:
        base.name = ref2key(base)
    # Add refs from other to base. Any new refs are appended.
    base.refs = list(base.refs) # we may need to append items
    refs = {}
    for ref in base.refs:
        refs[ref2key(ref)] = ref
    for ref in other.refs:
        key = ref2key(ref)
        if key in refs:
            _merge_asized(refs[key], ref, level=level+1)
        else:
            # Don't modify existing Asized instances => deepcopy
            base.refs.append(deepcopy(ref))
            base.refs[-1].name = key