code: def __init__(self, config):
      super(SpearmintProposer, self).__init__(config)
  
      if os.path.isdir(config["workingdir"]):  # local folder exist
          set_default_keyvalue(
              "spearmint_dir",
              os.path.join(config["workingdir"], "spearmint"),
              config,
              log=logger,
          )
      else:  # local folder not exist (esp. run remotely)
          set_default_keyvalue(
              "spearmint_dir", "spearmint", config, log=logger
          )
      self.expt_dir = config["spearmint_dir"]
      set_default_keyvalue("random_seed", 0, config, log=logger)
      set_default_keyvalue("engine", "GPEIChooser", config, log=logger)
      set_default_keyvalue("engine_config", {}, config, log=logger)
      set_default_keyvalue("grid_size", 20000, config, log=logger)
  
      self.nSamples = config["n_samples"]
      self.seed = config["random_seed"]
      self.target = -1 if config["target"] == "max" else 1
      self.variables = []
      self.grid_size = config["grid_size"]
  
      for param in config["parameter_config"]:
          p = self.parse_param_config(param)
          if "job_id" == p["name"]:
              msg = "`job_id` is preserved for HPO"
              logger.fatal(msg)
              raise ValueError(msg)
          if p["type"] == "choice":
              p["type"] = "enum"
          set_default_keyvalue("size", 1, p)
          self.variables.append(BasicConfig(**p))
  
      try:
          module = importlib.import_module(
              ".spearmint.chooser." + config["engine"],
              package="aup.Proposer",
          )
          self.chooser = module.init(
              self.expt_dir, config["engine_config"]
          )
          self.verify_config(config)
      except ImportError:
          msg = "%s doesn't exist in spearmint" % config["engine"]
          logger.fatal(msg)
          raise KeyError(msg)
  
file_path: auptimizer/src/aup/Proposer/SpearmintProposer.py
imports: import importlib
  import logging
  import os
  import shutil
  from six.moves import input
  from .AbstractProposer import AbstractProposer
  from .spearmint import ExperimentGrid
  from ..aup import BasicConfig
  from ..utils import set_default_keyvalue, check_missing_key, get_from_options
label_desc: Use image node_id 1 to create a new SpearmintProposer object from inherited base classes: AbstractProposer with example: obj = SpearmintProposer(config)