def items_overlap_with_suffix(left, lsuffix, right, rsuffix):
to_rename = left.intersection(right)<EOL>if len(to_rename) == <NUM_LIT:0>:<EOL><INDENT>return left, right<EOL><DEDENT>else:<EOL><INDENT>if not lsuffix and not rsuffix:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>'.format(rename=to_rename))<EOL><DEDENT>def renamer(x, suffix):<EOL><INDENT>"""<STR_LIT>"""<EOL>if x in to_rename and suffix is not None:<EOL><INDENT>return '<STR_LIT>'.format(x=x, suffix=suffix)<EOL><DEDENT>return x<EOL><DEDENT>lrenamer = partial(renamer, suffix=lsuffix)<EOL>rrenamer = partial(renamer, suffix=rsuffix)<EOL>return (_transform_index(left, lrenamer),<EOL>_transform_index(right, rrenamer))<EOL><DEDENT>
If two indices overlap, add suffixes to overlapping entries.

If corresponding suffix is empty, the entry is simply converted to string.