def intersection(self, other, sort=False):
self._validate_sort_keyword(sort)<EOL>self._assert_can_do_setop(other)<EOL>other, result_names = self._convert_can_do_setop(other)<EOL>if self.equals(other):<EOL><INDENT>return self<EOL><DEDENT>self_tuples = self._ndarray_values<EOL>other_tuples = other._ndarray_values<EOL>uniq_tuples = set(self_tuples) & set(other_tuples)<EOL>if sort is None:<EOL><INDENT>uniq_tuples = sorted(uniq_tuples)<EOL><DEDENT>if len(uniq_tuples) == <NUM_LIT:0>:<EOL><INDENT>return MultiIndex(levels=self.levels,<EOL>codes=[[]] * self.nlevels,<EOL>names=result_names, verify_integrity=False)<EOL><DEDENT>else:<EOL><INDENT>return MultiIndex.from_arrays(lzip(*uniq_tuples), sortorder=<NUM_LIT:0>,<EOL>names=result_names)<EOL><DEDENT>
Form the intersection of two MultiIndex objects.

Parameters
----------
other : MultiIndex or array / Index of tuples
sort : False or None, default False
    Sort the resulting MultiIndex if possible

    .. versionadded:: 0.24.0

    .. versionchanged:: 0.24.1

       Changed the default from ``True`` to ``False``, to match
       behaviour from before 0.24.0

Returns
-------
Index