code: def main_search():
      from optparse import OptionParser
  
      parser = OptionParser(
          usage="%prog [options] [<bandit> <bandit_algo>]"
      )
      parser.add_option(
          "--load",
          default="",
          dest="load",
          metavar="FILE",
          help="unpickle experiment from here on startup",
      )
      parser.add_option(
          "--save",
          default="experiment.pkl",
          dest="save",
          metavar="FILE",
          help="pickle experiment to here on exit",
      )
      parser.add_option(
          "--steps",
          dest="steps",
          default="100",
          metavar="N",
          help="exit after queuing this many jobs (default: 100)",
      )
      parser.add_option(
          "--workdir",
          dest="workdir",
          default=os.path.expanduser("~/.hyperopt.workdir"),
          help="create workdirs here",
          metavar="DIR",
      )
      parser.add_option(
          "--bandit-argfile",
          dest="bandit_argfile",
          default=None,
          help="path to file containing arguments bandit constructor \
                    file format: pickle of dictionary containing two keys,\
                    {'args' : tuple of positional arguments, \
                     'kwargs' : dictionary of keyword arguments}",
      )
      parser.add_option(
          "--bandit-algo-argfile",
          dest="bandit_algo_argfile",
          default=None,
          help="path to file containing arguments for bandit_algo "
          "constructor.  File format is pickled dictionary containing "
          "two keys: 'args', a tuple of positional arguments, and "
          "'kwargs', a dictionary of keyword arguments. "
          "NOTE: bandit is pre-pended as first element of arg tuple.",
      )
  
      (options, args) = parser.parse_args()
      try:
          bandit_json, bandit_algo_json = args
      except:
          parser.print_help()
          return -1
  
      try:
          if not options.load:
              raise IOError()
          handle = open(options.load, "rb")
          self = pickler.load(handle)
          handle.close()
      except IOError:
          bandit = utils.get_obj(
              bandit_json, argfile=options.bandit_argfile
          )
          bandit_algo = utils.get_obj(
              bandit_algo_json,
              argfile=options.bandit_algo_argfile,
              args=(bandit,),
          )
          self = SerialExperiment(bandit_algo)
  
      try:
          self.run(int(options.steps))
      finally:
          if options.save:
              pickler.dump(self, open(options.save, "wb"))
  
file_path: auptimizer/src/aup/Proposer/hyperopt/main.py
imports: from __future__ import absolute_import
  from future import standard_library
  import logging
  import os
  from .None import utils
  from .base import SerialExperiment
  import sys
label_desc: Use image node_id 1 for calling a global function with example usage: main_search() and returns: unknown