Given two dicts, merge them into a new dict as a shallow copy.

    Once Python 3.6+ only is supported, replace method with ``z = {**x, **y}``
972555
def _merge_two_dicts(x, y):
    
    z = x.copy()
    z.update(y)
    return z
1319370
def dictmerge(x, y):
    
    z = x.copy()
    z.update(y)
    return z
91624
def dict_minus(d, *keys):
    """"""
    # make shallow copy
    d = dict(d)
    for key in keys:
        try:
            del d[key]
        except:
            pass
    return d
1365730
def _merge_lib_dict(d1, d2):
    
    for required, requirings in d2.items():
        if required in d1:
            d1[required].update(requirings)
        else:
            d1[required] = requirings
    return None
377722
function shallowCopy (targetObj, srcObj) {
      each(srcObj, function (prop) {
        targetObj[prop] = srcObj[prop];
      });

      return targetObj;
    }
1256798
def deep_merge_dict(a, b):
    """"""
    if not isinstance(a, dict):
        raise TypeError("a must be a dict, but found %s" % a.__class__.__name__)
    if not isinstance(b, dict):
        raise TypeError("b must be a dict, but found %s" % b.__class__.__name__)

    _a = copy(a)
    _b = copy(b)

    for key_b, val_b in iteritems(_b):
        # if it's a sub-dictionary
        if isinstance(val_b, dict):
            if key_b not in _a or not isinstance(_a[key_b], dict):
                _a[key_b] = {}

            # perform the deep merge recursively
            _a[key_b] = deep_merge_dict(_a[key_b], val_b)
        else:
            _a[key_b] = val_b

    # b should now be deep-merged into a
    return _a
398502
def merge_values(src, new):
    """"""
    if isinstance(src, dict) and isinstance(new, dict):
        return merge_dicts(src, new)
    else:
        if not isinstance(src, list):
            src = [src]
        if not isinstance(new, list):
            new = [new]

        return merge_lists(src, new)
1320579
def combine_dicts(new_dict, old_dict):
    
    old_data_keys = list(old_dict.keys())
    new_data_keys = list(new_dict.keys())
    all_keys = set(old_data_keys).union(new_data_keys)
    combined_data_dict = {}
    for k in all_keys:
        try:
            combined_data_dict[k] = new_dict[k]
        except KeyError:
            combined_data_dict[k] = old_dict[k]
    return combined_data_dict
287084
def merge_map(a, b):
    
    if isinstance(a, list) and isinstance(b, list):
        return a + b

    if not isinstance(a, dict) or not isinstance(b, dict):
        return b

    for key in b:
        a[key] = merge_map(a[key], b[key]) if key in a else b[key]
    return a
639503
function shallowMerge(o1, o2) {
    var o = {},
        k;

    for (k in o1) o[k] = o1[k];
    for (k in o2) o[k] = o2[k];

    return o;
  }
633757
def merge(dict1, dict2):
    
    for k in dict2:
        if k in dict1 and isinstance(dict1[k], dict) and isinstance(dict2[k], dict):
            merge(dict1[k], dict2[k])
        else:
            dict1[k] = dict2[k]
814793
def merge_dicts(base, updates):
    
    if not base:
        base = dict()
    if not updates:
        updates = dict()
    z = base.copy()
    z.update(updates)
    return z
1076461
def merge (d, o):
    """"""
    for k in o.keys():
        if type(o[k]) is dict and k in d:
            merge(d[k], o[k])
        else:
            d[k] = o[k]
    return d
202653
def merge_dict(dict_1, *other, **kw):
    """"""
    tmp = dict_1.copy()
    for x in other:
        tmp.update(x)
    tmp.update(kw)
    return tmp
267914
def dict_merge_pair(d1, d2):
    
    for key in d2:
        if key in d1 and isinstance(d1[key], dict) and \
           isinstance(d2[key], dict):
            dict_merge_pair(d1[key], d2[key])
        else:
            d1[key] = d2[key]

    return d1
1142979
def merge_dicts(*ds):
    
    result = ds[0]
    for d in ds[1:]:
        result.update(d)
    return result
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