code: def test_sortlevel_na_position():
      # GH#51612
      midx = MultiIndex.from_tuples([(1, np.nan), (1, 1)])
      result = midx.sortlevel(level=[0, 1], na_position="last")[0]
      expected = MultiIndex.from_tuples([(1, 1), (1, np.nan)])
      tm.assert_index_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas.errors import PerformanceWarning, UnsortedIndexError
  from pandas import CategoricalIndex, DataFrame, Index, MultiIndex, RangeIndex, Series, Timestamp
  import pandas._testing
  from pandas.core.indexes.frozen import FrozenList
label_desc: Use image node_id 4 for calling a global function with example usage: test_sortlevel_na_position() without return types