code: def run_smbo(self):
      self.stopwatch.start("SMBO")
  
      # == first things first: load the datamanager
      self.reset_data_manager()
  
      # == Initialize non-SMBO stuff
      # first create a scenario
      seed = self.seed
      self.config_space.seed(seed)
      # allocate a run history
      num_run = self.start_num_run
  
      # Initialize some SMAC dependencies
  
      metalearning_configurations = self.get_metalearning_suggestions()
  
      if self.resampling_strategy in [
          "partial-cv",
          "partial-cv-iterative-fit",
      ]:
          num_folds = self.resampling_strategy_args["folds"]
          instances = [
              [
                  json.dumps(
                      {
                          "task_id": self.dataset_name,
                          "fold": fold_number,
                      }
                  )
              ]
              for fold_number in range(num_folds)
          ]
      else:
          instances = [[json.dumps({"task_id": self.dataset_name})]]
  
      # TODO rebuild target algorithm to be it's own target algorithm
      # evaluator, which takes into account that a run can be killed prior
      # to the model being fully fitted; thus putting intermediate results
      # into a queue and querying them once the time is over
  
      ta_kwargs = dict(
          backend=copy.deepcopy(self.backend),
          autosklearn_seed=seed,
          resampling_strategy=self.resampling_strategy,
          initial_num_run=num_run,
          include=self.include,
          exclude=self.exclude,
          metrics=self.metrics,
          memory_limit=self.memory_limit,
          disable_file_output=self.disable_file_output,
          scoring_functions=self.scoring_functions,
          port=self.port,
          pynisher_context=self.pynisher_context,
          **self.resampling_strategy_args,
      )
      ta = ExecuteTaFuncWithQueue
  
      startup_time = self.stopwatch.time_since(
          self.dataset_name, "start"
      )
      total_walltime_limit = (
          self.total_walltime_limit - startup_time - 5
      )
  
      scenario_dict = {
          "abort_on_first_run_crash": False,
          "save-results-instantly": True,
          "cs": self.config_space,
          "cutoff_time": self.func_eval_time_limit,
          "deterministic": "true",
          "instances": instances,
          "memory_limit": self.memory_limit,
          "output-dir": self.backend.get_smac_output_directory(),
          "run_obj": "quality",
          "wallclock_limit": total_walltime_limit,
          "cost_for_crash": self.worst_possible_result,
      }
      if self.smac_scenario_args is not None:
          for arg in [
              "abort_on_first_run_crash",
              "cs",
              "deterministic",
              "instances",
              "output-dir",
              "run_obj",
              "shared-model",
              "cost_for_crash",
          ]:
              if arg in self.smac_scenario_args:
                  self.logger.warning(
                      "Cannot override scenario argument %s, "
                      "will ignore this.",
                      arg,
                  )
                  del self.smac_scenario_args[arg]
          for arg in [
              "cutoff_time",
              "memory_limit",
              "wallclock_limit",
          ]:
              if arg in self.smac_scenario_args:
                  self.logger.warning(
                      "Overriding scenario argument %s: %s with value %s",
                      arg,
                      scenario_dict[arg],
                      self.smac_scenario_args[arg],
                  )
          scenario_dict.update(self.smac_scenario_args)
  
      smac_args = {
          "scenario_dict": scenario_dict,
          "seed": seed,
          "ta": ta,
          "ta_kwargs": ta_kwargs,
          "metalearning_configurations": metalearning_configurations,
          "n_jobs": self.n_jobs,
          "dask_client": self.dask_client,
      }
      if len(self.metrics) > 1:
          smac_args["multi_objective_algorithm"] = ParEGO
          smac_args["multi_objective_kwargs"] = {"rho": 0.05}
          scenario_dict["multi_objectives"] = [
              metric.name for metric in self.metrics
          ]
      else:
          smac_args["multi_objective_algorithm"] = None
          smac_args["multi_objective_kwargs"] = {}
      if self.get_smac_object_callback is not None:
          smac = self.get_smac_object_callback(**smac_args)
      else:
          smac = get_smac_object(**smac_args)
  
      if self.ensemble_callback is not None:
          smac.register_callback(self.ensemble_callback)
      if self.trials_callback is not None:
          smac.register_callback(self.trials_callback)
  
      smac.optimize()
  
      self.runhistory = smac.solver.runhistory
      self.trajectory = smac.solver.intensifier.traj_logger.trajectory
      if isinstance(smac.solver.tae_runner, DaskParallelRunner):
          self._budget_type = (
              smac.solver.tae_runner.single_worker.budget_type
          )
      elif isinstance(smac.solver.tae_runner, SerialRunner):
          self._budget_type = smac.solver.tae_runner.budget_type
      else:
          raise NotImplementedError(type(smac.solver.tae_runner))
  
      self.stopwatch.stop("SMBO")
  
      return self.runhistory, self.trajectory, self._budget_type
  
imports: import typing
  from typing import Dict, List, Optional, Sequence
  import copy
  import json
  import logging
  import multiprocessing
  import os
  import time
  import traceback
  import warnings
  import dask.distributed
  import pynisher
  from smac.callbacks import IncorporateRunResultCallback
  from smac.facade.smac_ac_facade import SMAC4AC
  from smac.intensification.intensification import Intensifier
  from smac.intensification.simple_intensifier import SimpleIntensifier
  from smac.optimizer.multi_objective.parego import ParEGO
  from smac.runhistory.runhistory2epm import RunHistory2EPM4LogCost
  from smac.scenario.scenario import Scenario
  from smac.tae.dask_runner import DaskParallelRunner
  from smac.tae.serial_runner import SerialRunner
  import autosklearn.metalearning
  from autosklearn.constants import BINARY_CLASSIFICATION, CLASSIFICATION_TASKS, MULTICLASS_CLASSIFICATION, MULTILABEL_CLASSIFICATION, MULTIOUTPUT_REGRESSION, REGRESSION, TASK_TYPES_TO_STRING
  from autosklearn.data.abstract_data_manager import AbstractDataManager
  from autosklearn.ensemble_building import EnsembleBuilderManager
  from autosklearn.evaluation import ExecuteTaFuncWithQueue, get_cost_of_crash
  from autosklearn.metalearning.metafeatures.metafeatures import calculate_all_metafeatures_encoded_labels, calculate_all_metafeatures_with_labels
  from autosklearn.metalearning.metalearning.meta_base import MetaBase
  from autosklearn.metalearning.mismbo import suggest_via_metalearning
  from autosklearn.metrics import Scorer
  from autosklearn.util.logging_ import get_named_client_logger
  from autosklearn.util.parallel import preload_modules
  from autosklearn.util.stopwatch import StopWatch
label_desc: Use image node_id 6 for calling the AutoMLSMBO obj's underlying member method code with example usage: obj.run_smbo() and returns: self,  self,  self