def map(self, mapper, na_action=None):
from .multi import MultiIndex<EOL>new_values = super()._map_values(mapper, na_action=na_action)<EOL>attributes = self._get_attributes_dict()<EOL>if new_values.size and isinstance(new_values[<NUM_LIT:0>], tuple):<EOL><INDENT>if isinstance(self, MultiIndex):<EOL><INDENT>names = self.names<EOL><DEDENT>elif attributes.get('<STR_LIT:name>'):<EOL><INDENT>names = [attributes.get('<STR_LIT:name>')] * len(new_values[<NUM_LIT:0>])<EOL><DEDENT>else:<EOL><INDENT>names = None<EOL><DEDENT>return MultiIndex.from_tuples(new_values,<EOL>names=names)<EOL><DEDENT>attributes['<STR_LIT>'] = False<EOL>if not new_values.size:<EOL><INDENT>attributes['<STR_LIT>'] = self.dtype<EOL><DEDENT>return Index(new_values, **attributes)<EOL>
Map values using input correspondence (a dict, Series, or function).

Parameters
----------
mapper : function, dict, or Series
    Mapping correspondence.
na_action : {None, 'ignore'}
    If 'ignore', propagate NA values, without passing them to the
    mapping correspondence.

Returns
-------
applied : Union[Index, MultiIndex], inferred
    The output of the mapping function applied to the index.
    If the function returns a tuple with more than one element
    a MultiIndex will be returned.