class_docstr: Tune driver
code: def _set_scheduler(scheduler, scheduler_params, metric, mode):
      if scheduler:
          if not isinstance(scheduler, str):
              invalidInputError(
                  False,
                  f"Scheduler should be of type str. "
                  f"Got {scheduler.__class__.__name__}",
              )
          params = (
              scheduler_params.copy() if scheduler_params else dict()
          )
          if metric and "metric" not in params:
              params["metric"] = metric
          if mode and "mode" not in params:
              params["mode"] = mode
          if "time_attr" not in params:
              params["time_attr"] = "training_iteration"
          scheduler = tune.create_scheduler(scheduler, **params)
      return scheduler
  
imports: import ray
  from ray import tune
  import os
  from bigdl.orca.automl.search.base import SearchEngine, TrialOutput, GoodError
  from bigdl.orca.automl.search.parameters import DEFAULT_LOGGER_NAME, DEFAULT_METRIC_NAME
  from bigdl.orca.automl.search.ray_tune.utils import convert_bayes_configs
  from bigdl.orca.automl.search.utils import get_ckpt_hdfs, put_ckpt_hdfs
  from ray.tune import Stopper
  from bigdl.orca.automl.model.abstract import ModelBuilder
  from bigdl.orca.data import ray_xshards
  from ray.tune.progress_reporter import TrialProgressCallback
  from bigdl.dllib.utils.log4Error import *
label_desc: Use image node_id 5 for calling the RayTuneSearchEngine obj's underlying member method code with example usage: obj._set_scheduler(scheduler, scheduler_params, metric, mode) and returns: scheduler