def reorder_levels(
        self, level_variables: Mapping[Any, Variable]
    ) -> PandasMultiIndex:
        """Re-arrange index levels using input order and return a new multi-index with
        its corresponding coordinates.

        """
        index = cast(pd.MultiIndex, self.index.reorder_levels(level_variables.keys()))
        level_coords_dtype = {k: self.level_coords_dtype[k] for k in index.names}
        return self._replace(index, level_coords_dtype=level_coords_dtype)
Re-arrange index levels using input order and return a new multi-index with
        its corresponding coordinates.

        
xarray/core/indexes.py