code: def test_set_output_func():
      """Check behavior of set_output with different settings."""
      pd = pytest.importorskip("pandas")
  
      X = pd.DataFrame({"a": [1, 2, 3], "b": [10, 20, 100]})
  
      ft = FunctionTransformer(np.log, feature_names_out="one-to-one")
  
      # no warning is raised when feature_names_out is defined
      with warnings.catch_warnings():
          warnings.simplefilter("error", UserWarning)
          ft.set_output(transform="pandas")
  
      X_trans = ft.fit_transform(X)
      assert isinstance(X_trans, pd.DataFrame)
      assert_array_equal(X_trans.columns, ["a", "b"])
  
      ft = FunctionTransformer(lambda x: 2 * x)
      ft.set_output(transform="pandas")
  
      # no warning is raised when func returns a panda dataframe
      with warnings.catch_warnings():
          warnings.simplefilter("error", UserWarning)
          X_trans = ft.fit_transform(X)
      assert isinstance(X_trans, pd.DataFrame)
      assert_array_equal(X_trans.columns, ["a", "b"])
  
      # Warning is raised when func returns a ndarray
      ft_np = FunctionTransformer(lambda x: np.asarray(x))
      ft_np.set_output(transform="pandas")
  
      msg = "When `set_output` is configured to be 'pandas'"
      with pytest.warns(UserWarning, match=msg):
          ft_np.fit_transform(X)
  
      # default transform does not warn
      ft_np.set_output(transform="default")
      with warnings.catch_warnings():
          warnings.simplefilter("error", UserWarning)
          ft_np.fit_transform(X)
  
imports: import warnings
  import numpy
  import pytest
  from sklearn.pipeline import make_pipeline
  from sklearn.preprocessing import FunctionTransformer
  from sklearn.utils._testing import _convert_container, assert_allclose_dense_sparse, assert_array_equal
  from sklearn.utils.fixes import CSC_CONTAINERS, CSR_CONTAINERS
label_desc: Use image node_id 20 for calling a global function with example usage: test_set_output_func() without return types