code: def test_droplevel_with_names(idx):
      index = idx[idx.get_loc("foo")]
      dropped = index.droplevel(0)
      assert dropped.name == "second"
  
      index = MultiIndex(
          levels=[Index(range(4)), Index(range(4)), Index(range(4))],
          codes=[
              np.array([0, 0, 1, 2, 2, 2, 3, 3]),
              np.array([0, 1, 0, 0, 0, 1, 0, 1]),
              np.array([1, 0, 1, 1, 0, 0, 1, 0]),
          ],
          names=["one", "two", "three"],
      )
      dropped = index.droplevel(0)
      assert dropped.names == ("two", "three")
  
      dropped = index.droplevel("two")
      expected = index.droplevel(1)
      assert dropped.equals(expected)
  
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 2 for calling a global function with example usage: test_droplevel_with_names(idx) without return types