code: def test_given_searcher_when_ray_backend_used_in_hpo_then_correct_searcher_used(
      model_class, searcher
  ):
      model = model_class(
          prediction_length=3,
          freq=DUMMY_TS_DATAFRAME.freq,
          hyperparameters={
              "epochs": space.Int(1, 3),
              "num_batches_per_epoch": 1,
              "use_fallback_model": False,
          },
          eval_metric="MASE",
      )
      backend = model._get_hpo_backend()
      if backend is not RAY_BACKEND:
          pytest.skip()
  
      val_data = (
          None
          if isinstance(model, MultiWindowBacktestingModel)
          else DUMMY_TS_DATAFRAME
      )
      num_trials = 2
  
      with mock.patch("ray.tune.Tuner") as mock_tuner:
          try:
              _ = model.hyperparameter_tune(
                  hyperparameter_tune_kwargs={
                      "num_trials": num_trials,
                      "scheduler": "FIFO",
                      "searcher": searcher,
                  },
                  time_limit=300,
                  train_data=DUMMY_TS_DATAFRAME,
                  val_data=val_data,
              )
          except:
              pass
  
          ray_searcher_class_name = mock_tuner.call_args[1][
              "tune_config"
          ].search_alg.__class__.__name__
          assert {
              "bayes": "HyperOpt",
              "random": "BasicVariant",
          }.get(searcher) in ray_searcher_class_name
  
imports: import itertools
  import shutil
  import sys
  import tempfile
  from unittest import mock
  import numpy
  import pandas
  import pytest
  from flaky import flaky
  from autogluon.common import space
  from autogluon.core.hpo.constants import RAY_BACKEND
  from autogluon.timeseries import TimeSeriesDataFrame
  from autogluon.timeseries.dataset.ts_dataframe import ITEMID, TIMESTAMP
  from autogluon.timeseries.metrics import AVAILABLE_METRICS
  from autogluon.timeseries.models import DeepARModel, ETSModel
  from autogluon.timeseries.models.abstract import AbstractTimeSeriesModel
  from autogluon.timeseries.models.multi_window import MultiWindowBacktestingModel
  from ..common import DUMMY_TS_DATAFRAME, CustomMetric, dict_equal_primitive, get_data_frame_with_item_index
  from .test_gluonts import TESTABLE_MODELS
  from .test_local import TESTABLE_MODELS
  from .test_mlforecast import TESTABLE_MODELS
  from .test_multi_window_model import get_multi_window_deepar
label_desc: Use image node_id 20 for calling a global function with example usage: test_given_searcher_when_ray_backend_used_in_hpo_then_correct_searcher_used(model_class, searcher) without return types