Merge two dictionaries (or DotDicts) together.

    Args:
          d: The dictionary/DotDict to merge into.
          u: The source of the data to merge.
512052
def _merge(d, u):
    
    for k, v in u.items():
        # if we have a mapping, recursively merge the values
        if isinstance(v, collections.Mapping):
            d[k] = _merge(d.get(k, {}), v)

        # if d (the dict to merge into) is a dict, just add the
        # value to the dict.
        elif isinstance(d, collections.MutableMapping):
            d[k] = v

        # otherwise if d (the dict to merge into) is not a dict (e.g. when
        # recursing into it, `d.get(k, {})` may not be a dict), then do what
        # `update` does and prefer the new value.
        #
        # this means that something like `{'foo': 1}` when updated with
        # `{'foo': {'bar': 1}}` would have the original value (`1`) overwritten
        # and would become: `{'foo': {'bar': 1}}`
        else:
            d = {k: v}

    return d
134764
def _union_copy(dict1, dict2):
    

    for key, value in dict2.items():
        if key in dict1 and isinstance(value, dict):
            dict1[key] = _union_copy(dict1[key], value)
        else:
            dict1[key] = copy.deepcopy(value)
    return dict1
780775
def _merge_dicts(first, second):
    """"""
    new = deepcopy(first)
    for k, v in second.items():
        if isinstance(v, dict) and v:
            ret = _merge_dicts(new.get(k, dict()), v)
            new[k] = ret
        else:
            new[k] = second[k]
    return new
77194
def merge(self):
        """"""
        if isinstance(self.head, dict) and isinstance(self.update, dict):
            if not isinstance(self.root, dict):
                self.root = {}
            self._merge_dicts()
        else:
            self._merge_base_values()

        if self.conflict_set:
            raise MergeError('Dictdiffer Errors', self.conflicts)
275048
def merge_dict(a, b):
    

    if not isinstance(b, dict):
        return b

    result = deepcopy(a)
    for key, val in six.iteritems(b):
        if key in result and isinstance(result[key], dict):
            result[key] = merge_dict(result[key], val)
        elif key in result and isinstance(result[key], list):
            result[key] = sorted(list(set(val) | set(result[key])))
        else:
            result[key] = deepcopy(val)

    return result
537824
def merge_dict(d1, d2):
    
    for k,v2 in d2.items():
        v1 = d1.get(k) # returns None if v1 has no value for this key
        if ( isinstance(v1, collections.Mapping) and
             isinstance(v2, collections.Mapping) ):
            merge_dict(v1, v2)
        else:
            d1[k] = v2
629198
def dict_merge(set1, set2):
    """"""
    return dict(list(set1.items()) + list(set2.items()))
104784
def dict_merge(s, m):
    """"""
    if not isinstance(m, dict):
        return m
    out = copy.deepcopy(s)
    for k, v in m.items():
        if k in out and isinstance(out[k], dict):
            out[k] = dict_merge(out[k], v)
        else:
            out[k] = copy.deepcopy(v)
    return out
1142979
def merge_dicts(*ds):
    
    result = ds[0]
    for d in ds[1:]:
        result.update(d)
    return result
957763
def combine_dicts(recs):
    """"""
    if not recs:
        return None

    if len(recs) == 1:
        return recs.pop()

    new_rec = {}
    for rec in recs:
        for k, v in rec.iteritems():
            if k in new_rec:
                new_rec[k] = "%s, %s" % (new_rec[k], v)
            else:
                new_rec[k] = v
    return new_rec
176615
public void merge(Dictionary dict){
		for (Word word: dict.getWords().values()){
			addWord(word, true);
		}
	}
129553
def merge_dicts(*dict_list):
    
    # if not isinstance(dict_list, list):
    #     raise TypeError("dict_list is not a list. Please try again")
    # print(dict_list)
    all_dicts = []
    for ag in dict_list:
        if isinstance(ag, dict):
            all_dicts.append(ag)
    
    # Get all dictionaries
    # Merge them
    # Check if type is there
    try:
        qitem = { k: v for d in all_dicts for k, v in d.items() }
        return qitem
    except Exception:
        return {}
1209633
def setdict(self, D):
        """"""

        self.D = np.asarray(D, dtype=self.dtype)
1150342
def merge_dict(a, b):
    
    c = a.copy()
    c.update(b)
    return c
415260
def dict_union_combine(dict1, dict2, combine_op=op.add,
                       default=util_const.NoParam,
                       default2=util_const.NoParam):
    
    keys3 = set(dict1.keys()).union(set(dict2.keys()))
    if default is util_const.NoParam:
        dict3 = {key: combine_op(dict1[key], dict2[key]) for key in keys3}
    else:
        if default2 is util_const.NoParam:
            default2 = default
        dict3 = {key: combine_op(dict1.get(key, default), dict2.get(key, default2))
                 for key in keys3}
    return dict3
729207
def _merge_metadata(self_or_cls, obj, fn, *dicts):
        
        merged = dict([(k,v) for d in dicts for (k,v) in d.items()])
        return dict(merged, **fn(obj)) if fn else merged
815770
def merge_dicts(i):
    

    a=i['dict1']
    b=i['dict2']

    for k in b:
        v=b[k]
        if type(v) is dict:
           if k not in a:
              a.update({k:b[k]})
           elif type(a[k])==dict:
              merge_dicts({'dict1':a[k], 'dict2':b[k]})
           else:
              a[k]=b[k]
        elif type(v) is list:
           a[k]=[]
           for y in v:
               a[k].append(y)
        else:
           a[k]=b[k]

    return {'return':0, 'dict1':a}