code: def _recursive_update(d1, d2):
      
  
      for k in set(d1).intersection(d2):
          if isinstance(d1[k], dict) and isinstance(d2[k], dict):
              d1[k] = _recursive_update(d1[k], d2[k])
          else:
              d1[k] = d2[k]
  
      for k in set(d2).difference(d1):
          d1[k] = d2[k]
  
      return d1
docs: Little helper function that does what d1.update(d2) does,
      but works nice and recursively with dicts of dicts of dicts.
  
      It's not necessarily very efficient.