code: def test_pandas_adapter():
      """Check pandas adapter has expected behavior."""
      pd = pytest.importorskip("pandas")
      X_np = np.asarray([[1, 0, 3], [0, 0, 1]])
      columns = np.asarray(["f0", "f1", "f2"], dtype=object)
      index = np.asarray([0, 1])
      X_df_orig = pd.DataFrame([[1, 2], [1, 3]], index=index)
  
      adapter = ADAPTERS_MANAGER.adapters["pandas"]
      X_container = adapter.create_container(
          X_np, X_df_orig, columns=lambda: columns
      )
      assert isinstance(X_container, pd.DataFrame)
      assert_array_equal(X_container.columns, columns)
      assert_array_equal(X_container.index, index)
  
      # Input dataframe's index does not change
      new_columns = np.asarray(["f0", "f1"], dtype=object)
      X_df = pd.DataFrame([[1, 2], [1, 3]], index=[10, 12])
      new_df = adapter.create_container(
          X_df, X_df_orig, columns=new_columns
      )
      assert_array_equal(new_df.columns, new_columns)
      assert_array_equal(new_df.index, X_df.index)
  
      assert adapter.is_supported_container(X_df)
      assert not adapter.is_supported_container(X_np)
  
      # adapter.update_columns updates the columns
      new_columns = np.array(["a", "c"], dtype=object)
      new_df = adapter.rename_columns(X_df, new_columns)
      assert_array_equal(new_df.columns, new_columns)
  
      # adapter.hstack stacks the dataframes horizontally.
      X_df_1 = pd.DataFrame(
          [[1, 2, 5], [3, 4, 6]], columns=["a", "b", "e"]
      )
      X_df_2 = pd.DataFrame([[4], [5]], columns=["c"])
      X_stacked = adapter.hstack([X_df_1, X_df_2])
  
      expected_df = pd.DataFrame(
          [[1, 2, 5, 4], [3, 4, 6, 5]], columns=["a", "b", "e", "c"]
      )
      pd.testing.assert_frame_equal(X_stacked, expected_df)
  
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 1 for calling a global function with example usage: test_pandas_adapter() without return types