def _get_unique_index(self, dropna=False):
if self.is_unique and not dropna:<EOL><INDENT>return self<EOL><DEDENT>values = self.values<EOL>if not self.is_unique:<EOL><INDENT>values = self.unique()<EOL><DEDENT>if dropna:<EOL><INDENT>try:<EOL><INDENT>if self.hasnans:<EOL><INDENT>values = values[~isna(values)]<EOL><DEDENT><DEDENT>except NotImplementedError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>return self._shallow_copy(values)<EOL>
Returns an index containing unique values.

Parameters
----------
dropna : bool
    If True, NaN values are dropped.

Returns
-------
uniques : index