def reindex(self, target, method=None, level=None, limit=None,<EOL>tolerance=None):
<EOL>preserve_names = not hasattr(target, '<STR_LIT>')<EOL>if level is not None:<EOL><INDENT>if method is not None:<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>target = ibase._ensure_has_len(target)<EOL>if len(target) == <NUM_LIT:0> and not isinstance(target, Index):<EOL><INDENT>idx = self.levels[level]<EOL>attrs = idx._get_attributes_dict()<EOL>attrs.pop('<STR_LIT>', None)  <EOL>target = type(idx)._simple_new(np.empty(<NUM_LIT:0>, dtype=idx.dtype),<EOL>**attrs)<EOL><DEDENT>else:<EOL><INDENT>target = ensure_index(target)<EOL><DEDENT>target, indexer, _ = self._join_level(target, level, how='<STR_LIT:right>',<EOL>return_indexers=True,<EOL>keep_order=False)<EOL><DEDENT>else:<EOL><INDENT>target = ensure_index(target)<EOL>if self.equals(target):<EOL><INDENT>indexer = None<EOL><DEDENT>else:<EOL><INDENT>if self.is_unique:<EOL><INDENT>indexer = self.get_indexer(target, method=method,<EOL>limit=limit,<EOL>tolerance=tolerance)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>if not isinstance(target, MultiIndex):<EOL><INDENT>if indexer is None:<EOL><INDENT>target = self<EOL><DEDENT>elif (indexer >= <NUM_LIT:0>).all():<EOL><INDENT>target = self.take(indexer)<EOL><DEDENT>else:<EOL><INDENT>target = MultiIndex.from_tuples(target)<EOL><DEDENT><DEDENT>if (preserve_names and target.nlevels == self.nlevels and<EOL>target.names != self.names):<EOL><INDENT>target = target.copy(deep=False)<EOL>target.names = self.names<EOL><DEDENT>return target, indexer<EOL>
Create index with target's values (move/add/delete values as necessary)

Returns
-------
new_index : pd.MultiIndex
    Resulting index
indexer : np.ndarray or None
    Indices of output values in original index.