code: def test_set_output_pandas_keep_index():
      """Check that set_output does not override index.
  
      Non-regression test for gh-25730.
      """
      pd = pytest.importorskip("pandas")
  
      X = pd.DataFrame([[1, 2, 3], [4, 5, 6]], index=[0, 1])
      est = EstimatorWithSetOutputIndex().set_output(transform="pandas")
      est.fit(X)
  
      X_trans = est.transform(X)
      assert_array_equal(X_trans.index, ["s0", "s1"])
  
imports: import importlib
  from collections import namedtuple
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn._config import config_context, get_config
  from sklearn.preprocessing import StandardScaler
  from sklearn.utils._set_output import ADAPTERS_MANAGER, ContainerAdapterProtocol, _get_output_config, _safe_set_output, _SetOutputMixin, _wrap_data_with_container, check_library_installed
  from sklearn.utils.fixes import CSR_CONTAINERS
label_desc: Use image node_id 14 for calling a global function with example usage: test_set_output_pandas_keep_index() without return types