code: def main():
      batch_util.init_logging()
      batch = batch_util.batch_run()
      batch_flags = batch.get("flags")
      max_trials = batch.get("max_trials") or DEFAULT_MAX_TRIALS
      random_seed = batch.get("random_seed")
      trials = hyperopt.Trials()
      try:
          hyperopt.fmin(
              fn=_objective_fn(batch),
              space=_space_for_flags(batch),
              algo=_tpe_suggest,
              max_evals=max_trials,
              show_progressbar=False,
              rstate=np.random.RandomState(random_seed),
              trials=trials,
          )
      except hyperopt.exceptions.AllTrialsFailed:
          pass
      else:
          _label_best(trials.best_trial)
  
file_path: guildai/examples/hyperopt/tpe.py
imports: import logging
  from guild import batch_util
  from guild import flag_util
  from guild import index
  import numpy
  import hyperopt
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types