def merge_dicts(source_dicts, merge_dicts, join_key, merge_keys):
    """
    Insert specified fields from a merge dictionary to a source dictionary
    based on a matching key/val. Join field must exist in both source and
    merge dictionaries
    """
    merged = []
    for merge_dict in merge_dicts:
        for source_dict in source_dicts:
            try:
                if str(merge_dict[join_key]) == str(source_dict[join_key]):
                    for key in merge_dict:
                        if key in merge_keys:
                            source_dict[key] = merge_dict[key]
                    merged.append(source_dict)
                    continue
            except KeyError:
                continue
    return merged
