code: def get_empirical_bayes_thompson(
      experiment: Experiment,
      data: Data,
      search_space: Optional[SearchSpace] = None,
      num_samples: int = 10000,
      min_weight: Optional[float] = None,
      uniform_weights: bool = False,
  ) -> DiscreteModelBridge:
      """Instantiates an empirical Bayes / Thompson sampling model."""
      if data.df.empty:
          raise ValueError(
              "Empirical Bayes Thompson sampler requires non-empty data."
          )
      return checked_cast(
          DiscreteModelBridge,
          Models.EMPIRICAL_BAYES_THOMPSON(
              experiment=experiment,
              data=data,
              search_space=search_space or experiment.search_space,
              num_samples=num_samples,
              min_weight=min_weight,
              uniform_weights=uniform_weights,
              fit_out_of_design=True,
          ),
      )
  
imports: from logging import Logger
  from typing import Any, Dict, List, Optional, Type
  import torch
  from ax.core.data import Data
  from ax.core.experiment import Experiment
  from ax.core.multi_type_experiment import MultiTypeExperiment
  from ax.core.observation import ObservationFeatures
  from ax.core.optimization_config import OptimizationConfig
  from ax.core.search_space import SearchSpace
  from ax.modelbridge.discrete import DiscreteModelBridge
  from ax.modelbridge.modelbridge_utils import check_has_multi_objective_and_data
  from ax.modelbridge.random import RandomModelBridge
  from ax.modelbridge.registry import Cont_X_trans, Models, MT_MTGP_trans, ST_MTGP_trans, Y_trans
  from ax.modelbridge.torch import TorchModelBridge
  from ax.modelbridge.transforms.base import Transform
  from ax.modelbridge.transforms.convert_metric_names import tconfig_from_mt_experiment
  from ax.models.torch.botorch import BotorchModel, TAcqfConstructor, TModelConstructor, TModelPredictor, TOptimizer
  from ax.models.torch.botorch_defaults import get_and_fit_model, get_qLogNEI, scipy_optimizer
  from ax.models.torch.botorch_moo_defaults import get_EHVI
  from ax.models.torch.utils import predict_from_model
  from ax.models.types import TConfig
  from ax.utils.common.logger import get_logger
  from ax.utils.common.typeutils import checked_cast
label_desc: Use image node_id 10 for calling a global function with example usage: get_empirical_bayes_thompson(experiment, data, search_space, num_samples, min_weight, uniform_weights) and returns: checked_cast