code: def test_single_level_drop_partially_missing_elements():
      # GH 37820
  
      mi = MultiIndex.from_tuples([(1, 2), (2, 2), (3, 2)])
      msg = r"labels \[4\] not found in level"
      with pytest.raises(KeyError, match=msg):
          mi.drop(4, level=0)
      with pytest.raises(KeyError, match=msg):
          mi.drop([1, 4], level=0)
      msg = r"labels \[nan\] not found in level"
      with pytest.raises(KeyError, match=msg):
          mi.drop([np.nan], level=0)
      with pytest.raises(KeyError, match=msg):
          mi.drop([np.nan, 1, 2, 3], level=0)
  
      mi = MultiIndex.from_tuples([(np.nan, 1), (1, 2)])
      msg = r"labels \['a'\] not found in level"
      with pytest.raises(KeyError, match=msg):
          mi.drop([np.nan, 1, "a"], level=0)
  
file_path: pandas/pandas/tests/indexes/multi/test_drop.py
imports: import numpy
  import pytest
  from pandas.errors import PerformanceWarning
  import pandas
  from pandas import Index, MultiIndex
  import pandas._testing
label_desc: Use image node_id 7 for calling a global function with example usage: test_single_level_drop_partially_missing_elements() without return types