def _merge_links(self, other_trajectory, used_runs, allowed_translations, ignore_data):
linked_items = other_trajectory._linked_by<EOL>run_name_dummys = set([f(-<NUM_LIT:1>) for f in other_trajectory._wildcard_functions.values()])<EOL>if len(linked_items) > <NUM_LIT:0>:<EOL><INDENT>self._logger.info('<STR_LIT>')<EOL>for old_linked_name in other_trajectory._linked_by:<EOL><INDENT>if old_linked_name in ignore_data:<EOL><INDENT>continue<EOL><DEDENT>split_name = old_linked_name.split('<STR_LIT:.>')<EOL>if any(x in run_name_dummys for x in split_name):<EOL><INDENT>self._logger.warning('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(old_linked_name, str(run_name_dummys)))<EOL>continue<EOL><DEDENT>old_link_dict = other_trajectory._linked_by[old_linked_name]<EOL>split_name = old_linked_name.split('<STR_LIT:.>')<EOL>if all(x in allowed_translations for x in split_name):<EOL><INDENT>new_linked_full_name = self._rename_full_name(old_linked_name,<EOL>other_trajectory,<EOL>used_runs=used_runs)<EOL><DEDENT>else:<EOL><INDENT>new_linked_full_name = old_linked_name<EOL><DEDENT>for linking_node, link_set in old_link_dict.values():<EOL><INDENT>linking_full_name = linking_node.v_full_name<EOL>split_name = linking_full_name .split('<STR_LIT:.>')<EOL>if any(x in run_name_dummys for x in split_name):<EOL><INDENT>self._logger.warning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(linking_full_name, str(run_name_dummys)))<EOL><DEDENT>split_name = linking_full_name .split('<STR_LIT:.>')<EOL>if any(x in allowed_translations for x in split_name):<EOL><INDENT>new_linking_full_name = self._rename_full_name(linking_full_name,<EOL>other_trajectory,<EOL>used_runs=used_runs)<EOL><DEDENT>else:<EOL><INDENT>new_linking_full_name = linking_full_name<EOL><DEDENT>for link in link_set:<EOL><INDENT>if (linking_full_name + '<STR_LIT:.>' + link) in ignore_data:<EOL><INDENT>continue<EOL><DEDENT>if link in run_name_dummys:<EOL><INDENT>self._logger.warning('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(link,<EOL>linking_full_name,<EOL>str(run_name_dummys)))<EOL>continue<EOL><DEDENT>try:<EOL><INDENT>new_linked_item = self.f_get(new_linked_full_name,<EOL>shortcuts=False)<EOL>if self.f_contains(new_linking_full_name):<EOL><INDENT>new_linking_item = self.f_get(new_linking_full_name,<EOL>shortcuts=False)<EOL><DEDENT>else:<EOL><INDENT>new_linking_item =  self.f_add_group(new_linking_full_name)<EOL><DEDENT>if link in allowed_translations:<EOL><INDENT>run_indices, wildcards = other_trajectory._reversed_wildcards[link]<EOL>link = self.f_wildcard(wildcards[<NUM_LIT:0>], used_runs[run_indices[<NUM_LIT:0>]])<EOL><DEDENT>if not link in new_linking_item._links:<EOL><INDENT>new_linking_item.f_add_link(link, new_linked_item)<EOL><DEDENT>else:<EOL><INDENT>self._logger.debug('<STR_LIT>' %<EOL>(link, new_linked_item.v_full_name))<EOL><DEDENT><DEDENT>except (AttributeError, ValueError) as exc:<EOL><INDENT>self._logger.error('<STR_LIT>'<EOL>'<STR_LIT>' %<EOL>(link, linking_full_name, old_linked_name,<EOL>repr(exc)))<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>
Merges all links