code: def test_skoptcv(
      forecaster, param_grid, cv, scoring, error_score, n_iter
  ):
      """Test ForecastingSkoptSearchCV.
  
      Tests that ForecastingSkoptSearchCV successfully searches the
      parameter distributions to identify the best parameter set
      """
      # test for forecasting dataset
      y_forecasting, X_forecasting = load_longley()
      # test for hierarchical dataset
      y_hierarchical, X_hierarchical = _create_hierarchical_data()
  
      datasets = [
          (y_hierarchical, X_hierarchical),
          (y_forecasting, X_forecasting),
      ]
      sscv = ForecastingSkoptSearchCV(
          forecaster,
          param_distributions=param_grid,
          cv=cv,
          scoring=scoring,
          error_score=error_score,
          n_iter=n_iter,
          random_state=42,
          n_jobs=-1,
      )
      for y, X in datasets:
          sscv.fit(y, X)
          param_distributions = list(sscv.cv_results_["params"])
          _check_cv(
              forecaster, sscv, cv, param_distributions, y, X, scoring
          )
          _check_fitted_params_keys(sscv.get_fitted_params())
  
imports: import numpy
  import pytest
  from sklearn.model_selection import ParameterGrid, ParameterSampler
  from sktime.datasets import load_airline, load_longley
  from sktime.forecasting.arima import ARIMA
  from sktime.forecasting.compose import TransformedTargetForecaster
  from sktime.forecasting.exp_smoothing import ExponentialSmoothing
  from sktime.forecasting.model_evaluation import evaluate
  from sktime.forecasting.model_selection import ForecastingGridSearchCV, ForecastingRandomizedSearchCV, ForecastingSkoptSearchCV
  from sktime.forecasting.model_selection._tune import BaseGridSearch
  from sktime.forecasting.naive import NaiveForecaster
  from sktime.forecasting.tests._config import TEST_N_ITERS, TEST_OOS_FHS, TEST_RANDOM_SEEDS, TEST_WINDOW_LENGTHS_INT
  from sktime.forecasting.trend import PolynomialTrendForecaster
  from sktime.performance_metrics.forecasting import MeanAbsolutePercentageError, MeanSquaredError
  from sktime.performance_metrics.forecasting.probabilistic import CRPS, PinballLoss
  from sktime.split import SingleWindowSplitter, SlidingWindowSplitter
  from sktime.tests.test_switch import run_test_for_class
  from sktime.transformations.series.detrend import Detrender
  from sktime.transformations.series.impute import Imputer
  from sktime.utils._testing.hierarchical import _make_hierarchical
  from sktime.utils.parallel import _get_parallel_test_fixtures
label_desc: Use image node_id 9 for calling a global function with example usage: test_skoptcv(forecaster, param_grid, cv, scoring, error_score, n_iter) without return types