code: def test_loc_nan_multiindex(using_infer_string):
      # GH 5286
      tups = [
          ("Good Things", "C", np.nan),
          ("Good Things", "R", np.nan),
          ("Bad Things", "C", np.nan),
          ("Bad Things", "T", np.nan),
          ("Okay Things", "N", "B"),
          ("Okay Things", "N", "D"),
          ("Okay Things", "B", np.nan),
          ("Okay Things", "D", np.nan),
      ]
      df = DataFrame(
          np.ones((8, 4)),
          columns=Index(["d1", "d2", "d3", "d4"]),
          index=MultiIndex.from_tuples(tups, names=["u1", "u2", "u3"]),
      )
      result = df.loc["Good Things"].loc["C"]
      expected = DataFrame(
          np.ones((1, 4)),
          index=Index(
              [np.nan],
              dtype="object"
              if not using_infer_string
              else "string[pyarrow_numpy]",
              name="u3",
          ),
          columns=Index(["d1", "d2", "d3", "d4"]),
      )
      tm.assert_frame_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 10 for calling a global function with example usage: test_loc_nan_multiindex(using_infer_string) without return types