code: def test_multiplex_transformer_in_grid():
      """Test behavior of MultiplexTransformer.
  
      It often makes sense to use MultiplexTransformer in conjunction with
      ForecastingGridSearchCV within a pipeline.  Here we check that when you do that you
      get the expected result.
      """
      y = load_shampoo_sales()
      # randomly make some of the values nans:
      y.iloc[[5, 10, 15, 25, 32]] = -1
      # Note - we select two transformers which are deterministic.
      transformer_tuples = [
          ("two", ExponentTransformer(2)),
          ("three", ExponentTransformer(3)),
      ]
      transformer_names = [name for name, _ in transformer_tuples]
      multiplex_transformer = MultiplexTransformer(
          transformers=transformer_tuples
      )
      cv = ExpandingWindowSplitter(
          initial_window=24, step_length=12, fh=[1, 2, 3]
      )
      pipe = TransformedTargetForecaster(
          steps=[
              ("multiplex", multiplex_transformer),
              ("forecaster", NaiveForecaster(strategy="mean")),
          ]
      )
      gscv = ForecastingGridSearchCV(
          cv=cv,
          param_grid={
              "multiplex__selected_transformer": transformer_names
          },
          forecaster=pipe,
      )
      gscv.fit(y)
      best_steps = gscv.best_forecaster_.steps
      for name, estimator in best_steps:
          if "multiplex" == name:
              gscv_best_name = estimator.selected_transformer
      best_name = _find_best_transformer(
          NaiveForecaster(strategy="mean"), transformer_tuples, cv, y
      )
      assert gscv_best_name == best_name
  
file_path: sktime/sktime/transformations/tests/test_multiplexer.py
imports: import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from sklearn.base import clone
  from sktime.datasets import load_shampoo_sales
  from sktime.forecasting.compose import TransformedTargetForecaster
  from sktime.forecasting.model_evaluation import evaluate
  from sktime.forecasting.model_selection import ForecastingGridSearchCV
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.split import ExpandingWindowSplitter
  from sktime.transformations.compose import MultiplexTransformer
  from sktime.transformations.series.exponent import ExponentTransformer
  from sktime.utils.validation.forecasting import check_scoring
label_desc: Use image node_id 3 for calling a global function with example usage: test_multiplex_transformer_in_grid() without return types