code: def merge_dicts(dicts, deepcopy=False):
      
      assert isinstance(dicts, list) and all(isinstance(d, dict) for d in dicts)
      return dict(chain(*[copy.deepcopy(d).items() if deepcopy else d.items()
                          for d in dicts]))
docs: Merges dicts
  
      In case of key conflicts, the value kept will be from the latter
      dictionary in the list of dictionaries
  
      :param dicts: [dict, ...]
      :param deepcopy: deepcopy items within dicts