code: def test_slice_keep_name():
      x = MultiIndex.from_tuples(
          [("a", "b"), (1, 2), ("c", "d")], names=["x", "y"]
      )
      assert x[1:].names == x.names
  
file_path: pandas/pandas/tests/indexes/multi/test_names.py
imports: import pytest
  import pandas
  from pandas import MultiIndex
  import pandas._testing
label_desc: Use image node_id 2 for calling a global function with example usage: test_slice_keep_name() without return types