def _reindex_non_unique(self, target):
target = ensure_index(target)<EOL>indexer, missing = self.get_indexer_non_unique(target)<EOL>check = indexer != -<NUM_LIT:1><EOL>new_labels = self.take(indexer[check])<EOL>new_indexer = None<EOL>if len(missing):<EOL><INDENT>length = np.arange(len(indexer))<EOL>missing = ensure_platform_int(missing)<EOL>missing_labels = target.take(missing)<EOL>missing_indexer = ensure_int64(length[~check])<EOL>cur_labels = self.take(indexer[check]).values<EOL>cur_indexer = ensure_int64(length[check])<EOL>new_labels = np.empty(tuple([len(indexer)]), dtype=object)<EOL>new_labels[cur_indexer] = cur_labels<EOL>new_labels[missing_indexer] = missing_labels<EOL>if target.is_unique:<EOL><INDENT>new_indexer = np.arange(len(indexer))<EOL>new_indexer[cur_indexer] = np.arange(len(cur_labels))<EOL>new_indexer[missing_indexer] = -<NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>indexer[~check] = -<NUM_LIT:1><EOL>new_indexer = np.arange(len(self.take(indexer)))<EOL>new_indexer[~check] = -<NUM_LIT:1><EOL><DEDENT><DEDENT>new_index = self._shallow_copy_with_infer(new_labels, freq=None)<EOL>return new_index, indexer, new_indexer<EOL>
Create a new index with target's values (move/add/delete values as
necessary) use with non-unique Index and a possibly non-unique target.

Parameters
----------
target : an iterable

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