code: def dict_update(d, u):
      
      for k, v in six.iteritems(u):
          if isinstance(v, collections.Mapping):
              r = dict_update(d.get(k, {}), v)
              d[k] = r
          else:
              d[k] = u[k]
      return d
docs: Recursive dict update
  
      :param d: goal dict
      :param u: updates for d
      :return: new dict