def _restore_dropped_levels_multijoin(left, right, dropped_level_names,<EOL>join_index, lindexer, rindexer):
def _convert_to_mulitindex(index):<EOL><INDENT>if isinstance(index, MultiIndex):<EOL><INDENT>return index<EOL><DEDENT>else:<EOL><INDENT>return MultiIndex.from_arrays([index.values],<EOL>names=[index.name])<EOL><DEDENT><DEDENT>join_index = _convert_to_mulitindex(join_index)<EOL>join_levels = join_index.levels<EOL>join_codes = join_index.codes<EOL>join_names = join_index.names<EOL>if lindexer is None:<EOL><INDENT>lindexer = range(left.size)<EOL><DEDENT>if rindexer is None:<EOL><INDENT>rindexer = range(right.size)<EOL><DEDENT>for dropped_level_name in dropped_level_names:<EOL><INDENT>if dropped_level_name in left.names:<EOL><INDENT>idx = left<EOL>indexer = lindexer<EOL><DEDENT>else:<EOL><INDENT>idx = right<EOL>indexer = rindexer<EOL><DEDENT>name_idx = idx.names.index(dropped_level_name)<EOL>restore_levels = idx.levels[name_idx]<EOL>codes = idx.codes[name_idx]<EOL>restore_codes = algos.take_nd(codes, indexer, fill_value=-<NUM_LIT:1>)<EOL>join_levels = join_levels + [restore_levels]<EOL>join_codes = join_codes + [restore_codes]<EOL>join_names = join_names + [dropped_level_name]<EOL><DEDENT>return join_levels, join_codes, join_names<EOL>
*this is an internal non-public method*

Returns the levels, labels and names of a multi-index to multi-index join.
Depending on the type of join, this method restores the appropriate
dropped levels of the joined multi-index.
The method relies on lidx, rindexer which hold the index positions of
left and right, where a join was feasible

Parameters
----------
left : MultiIndex
    left index
right : MultiIndex
    right index
dropped_level_names : str array
    list of non-common level names
join_index : MultiIndex
    the index of the join between the
    common levels of left and right
lindexer : intp array
    left indexer
rindexer : intp array
    right indexer

Returns
-------
levels : list of Index
    levels of combined multiindexes
labels : intp array
    labels of combined multiindexes
names : str array
    names of combined multiindexes