def _maybe_restore_index_levels(self, result):
names_to_restore = []<EOL>for name, left_key, right_key in zip(self.join_names,<EOL>self.left_on,<EOL>self.right_on):<EOL><INDENT>if (self.orig_left._is_level_reference(left_key) and<EOL>self.orig_right._is_level_reference(right_key) and<EOL>name not in result.index.names):<EOL><INDENT>names_to_restore.append(name)<EOL><DEDENT><DEDENT>if names_to_restore:<EOL><INDENT>result.set_index(names_to_restore, inplace=True)<EOL><DEDENT>
Restore index levels specified as `on` parameters

Here we check for cases where `self.left_on` and `self.right_on` pairs
each reference an index level in their respective DataFrames. The
joined columns corresponding to these pairs are then restored to the
index of `result`.

**Note:** This method has side effects. It modifies `result` in-place

Parameters
----------
result: DataFrame
    merge result

Returns
-------
None