code: def test_truncation_pd_multiindex():
      """Test that column and index names in a pd-multiindex container are preserved."""
      # get a multiindex dataframe, ensure instance levels are string, not int
      X = get_examples("pd-multiindex")[0].copy()
      X.index = X.index.set_levels(["a", "b", "c"], level=0)
  
      t = TruncationTransformer(1, 2)
      Xt = t.fit_transform(X)
  
      # assert that column names and index names are preserved
      assert (
          X.index.get_level_values(0).unique().values == ["a", "b", "c"]
      ).all()
      assert (Xt.columns == X.columns).all()
  
imports: from sktime.datasets import load_basic_motions
  from sktime.datatypes import get_examples
  from sktime.datatypes._panel._convert import from_nested_to_2d_array
  from sktime.transformations.panel.truncation import TruncationTransformer
label_desc: Use image node_id 3 for calling a global function with example usage: test_truncation_pd_multiindex() without return types