code: def prepare_searcher(
      data,
      search_space,
      stop,
      validation_data=None,
      model_creator=linear_model_creator,
      optimizer_creator=optimizer_creator,
      loss_creator=loss_creator,
      metric="mse",
      metric_mode="min",
      name="demo",
  ):
      modelBuilder = PytorchModelBuilder(
          model_creator=model_creator,
          optimizer_creator=optimizer_creator,
          loss_creator=loss_creator,
      )
      searcher = SearchEngineFactory.create_engine(
          backend="ray",
          logs_dir="~/zoo_automl_logs",
          resources_per_trial={"cpu": 2},
          name=name,
      )
      searcher.compile(
          data=data,
          validation_data=validation_data,
          model_builder=modelBuilder,
          search_space=search_space,
          n_sampling=2,
          epochs=stop["training_iteration"],
          metric_threshold=stop["reward_metric"],
          metric_mode=metric_mode,
          metric=metric,
      )
      return searcher
  
imports: from bigdl.orca.test_zoo_utils import ZooTestCase
  from bigdl.orca.automl.search import SearchEngineFactory
  from bigdl.orca.automl.search.ray_tune import RayTuneSearchEngine
  from bigdl.orca.automl.model.base_pytorch_model import PytorchModelBuilder
  import torch
  import torch.nn
  from bigdl.orca.automl import hp
  import numpy
  from bigdl.orca import init_orca_context, stop_orca_context
label_desc: Use image node_id 6 for calling a global function with example usage: prepare_searcher(data, search_space, stop, validation_data, model_creator, optimizer_creator, loss_creator, metric, metric_mode, name) and returns: searcher