def person_same_name_map(json_content, role_from):
matched_editors = [(i, person) for i, person in enumerate(json_content)<EOL>if person.get('<STR_LIT>') in role_from]<EOL>same_name_map = {}<EOL>for i, editor in matched_editors:<EOL><INDENT>if not editor.get("<STR_LIT:name>"):<EOL><INDENT>continue<EOL><DEDENT>name = editor.get("<STR_LIT:name>").get("<STR_LIT:index>")<EOL>if name not in same_name_map:<EOL><INDENT>same_name_map[name] = []<EOL><DEDENT>same_name_map[name].append(i)<EOL><DEDENT>return same_name_map<EOL>
to merge multiple editors into one record, filter by role values and group by name