code: def test_loc_getitem_drops_levels_for_one_row_dataframe():
      # GH#10521 "x" and "z" are both scalar indexing, so those levels are dropped
      mi = MultiIndex.from_arrays(
          [["x"], ["y"], ["z"]], names=["a", "b", "c"]
      )
      df = DataFrame({"d": [0]}, index=mi)
      expected = df.droplevel([0, 2])
      result = df.loc["x", :, "z"]
      tm.assert_frame_equal(result, expected)
  
      ser = Series([0], index=mi)
      result = ser.loc["x", :, "z"]
      expected = Series([0], index=Index(["y"], name="b"))
      tm.assert_series_equal(result, expected)
  
imports: import numpy
  import pytest
  from pandas.errors import IndexingError, PerformanceWarning
  import pandas
  from pandas import DataFrame, Index, MultiIndex, Series
  import pandas._testing
label_desc: Use image node_id 25 for calling a global function with example usage: test_loc_getitem_drops_levels_for_one_row_dataframe() without return types