class_docstr: The worker is responsible for evaluating a single configuration on a single budget at a time.
  Communication to the individual workers goes via the nameserver, management of the worker-pool and job
  scheduling is done by the Dispatcher and jobs are determined by the Master. In distributed systems, each
  cluster-node runs a Worker-instance. To implement your own worker, overwrite the `__init__`- and the `compute`-method.
  The first allows to perform inital computations, e.g. loading the dataset, when the worker is started, while the
  latter is repeatedly called during the optimization and evaluates a given configuration yielding the associated loss.
class_docstr_tok: ["The","worker","is","responsible","for","evaluating","a","single","configuration","on","a","single","budget","at","a","time",".","Communication","to","the","individual","workers","goes","via","the","nameserver",",","management","of","the","worker-pool","and","job","scheduling","is","done","by","the","Dispatcher","and","jobs","are","determined","by","the","Master",".","In","distributed","systems",",","each","cluster-node","runs","a","Worker-instance",".","To","implement","your","own","worker",",","overwrite","the","`","__init__","`","-","and","the","`","compute","`","-method",".","The","first","allows","to","perform","inital","computations",",","e.g",".","loading","the","dataset",",","when","the","worker","is","started",",","while","the","latter","is","repeatedly","called","during","the","optimization","and","evaluates","a","given","configuration","yielding","the","associated","loss","."]
docstr: Parameters
  ----------
  run_id: anything with a __str__ method
          unique id to identify individual HpBandSter run
  nameserver: str
          hostname or IP of the nameserver
  nameserver_port: int
          port of the nameserver
  logger: logging.logger instance
          logger used for debugging output
  host: str
          hostname for this worker process
  id: anything with a __str__method
          if multiple workers are started in the same process, you MUST provide a unique id for each one of them using the `id` argument.
  timeout: int or float
          specifies the timeout a worker will wait for a new after finishing a computation before shutting down.
          Towards the end of a long run with multiple workers, this helps to shutdown idling workers. We recommend
          a timeout that is roughly half the time it would take for the second largest budget to finish.
          The default (None) means that the worker will wait indefinitely and never shutdown on its own.
docstr_tok: ["Parameters","--","--","--","--","--","run_id",":","anything","with","a","__str__","method","unique","id","to","identify","individual","HpBandSter","run","nameserver",":","str","hostname","or","IP","of","the","nameserver","nameserver_port",":","int","port","of","the","nameserver","logger",":","logging.logger","instance","logger","used","for","debugging","output","host",":","str","hostname","for","this","worker","process","id",":","anything","with","a","__str__method","if","multiple","workers","are","started","in","the","same","process",",","you","MUST","provide","a","unique","id","for","each","one","of","them","using","the","`","id","`","argument",".","timeout",":","int","or","float","specifies","the","timeout","a","worker","will","wait","for","a","new","after","finishing","a","computation","before","shutting","down",".","Towards","the","end","of","a","long","run","with","multiple","workers",",","this","helps","to","shutdown","idling","workers",".","We","recommend","a","timeout","that","is","roughly","half","the","time","it","would","take","for","the","second","largest","budget","to","finish",".","The","default","(","None",")","means","that","the","worker","will","wait","indefinitely","and","never","shutdown","on","its","own","."]
code: def __init__(
      self,
      run_id,
      nameserver=None,
      nameserver_port=None,
      logger=None,
      host=None,
      id=None,
      timeout=None,
  ):
      """
  
      Parameters
      ----------
      run_id: anything with a __str__ method
              unique id to identify individual HpBandSter run
      nameserver: str
              hostname or IP of the nameserver
      nameserver_port: int
              port of the nameserver
      logger: logging.logger instance
              logger used for debugging output
      host: str
              hostname for this worker process
      id: anything with a __str__method
              if multiple workers are started in the same process, you MUST provide a unique id for each one of them using the `id` argument.
      timeout: int or float
              specifies the timeout a worker will wait for a new after finishing a computation before shutting down.
              Towards the end of a long run with multiple workers, this helps to shutdown idling workers. We recommend
              a timeout that is roughly half the time it would take for the second largest budget to finish.
              The default (None) means that the worker will wait indefinitely and never shutdown on its own.
      """
      self.run_id = run_id
      self.host = host
      self.nameserver = nameserver
      self.nameserver_port = nameserver_port
      self.worker_id = "hpbandster.run_%s.worker.%s.%i" % (
          self.run_id,
          socket.gethostname(),
          os.getpid(),
      )
  
      self.timeout = timeout
      self.timer = None
  
      if not id is None:
          self.worker_id += ".%s" % str(id)
  
      self.thread = None
  
      if logger is None:
          logging.basicConfig(
              level=logging.DEBUG,
              format="%(asctime)s %(message)s",
              datefmt="%H:%M:%S",
          )
          self.logger = logging.getLogger(self.worker_id)
      else:
          self.logger = logger
  
      self.busy = False
      self.thread_cond = threading.Condition(threading.Lock())
  
file_path: HpBandSter/hpbandster/core/worker.py
imports: import time
  import logging
  import pickle
  import os, socket
  import traceback
  import threading
  import Pyro4
label_desc: Use image node_id 1 to create a new Worker object from inherited base classes: object with example: obj = Worker(run_id, nameserver, nameserver_port, logger, host, id, timeout)