code: def merge_dict(to_update: dict, other_dict: dict):
      
      for key, value in other_dict.items():
          has_map = (
              isinstance(value, collections.Mapping) and
              isinstance(to_update.get(key, None), collections.Mapping)
          )
  
          if has_map:
              merge_dict(to_update[key], value)
          else:
              to_update[key] = value
docs: merges b into a