def _dict_merge(a, b):
  if not isinstance(b, dict) or  not isinstance(a, dict):
    return b
  result = copy.deepcopy(a)
  for k, v in b.iteritems():
    if k in result and isinstance(result[k], dict):
      result[k] = _dict_merge(result[k], v)
    else:
      result[k] = copy.deepcopy(v)
  return result
dataset/ETHPy150Open benrady/roost/roost/properties.py/_dict_merge/original