def _can_reindex(self, indexer):

        # trying to reindex on an axis with duplicates
        if not self.is_unique and len(indexer):
            raise ValueError("cannot reindex from a duplicate axis")
*this is an internal non-public method*
dataset/ETHPy150Open pydata/pandas/pandas/indexes/base.py/Index._can_reindex