docstr: The Master class is responsible for the book keeping and to decide what to run next. Optimizers are
  instantiations of Master, that handle the important steps of deciding what configurations to run on what
  budget when.
  
  Parameters
  ----------
  run_id : string
          A unique identifier of that Hyperband run. Use, for example, the cluster's JobID when running multiple
          concurrent runs to separate them
  config_generator: hpbandster.config_generators object
          An object that can generate new configurations and registers results of executed runs
  working_directory: string
          The top level working directory accessible to all compute nodes(shared filesystem).
  eta : float
          In each iteration, a complete run of sequential halving is executed. In it,
          after evaluating each configuration on the same subset size, only a fraction of
          1/eta of them 'advances' to the next round.
          Must be greater or equal to 2.
  min_budget : float
          The smallest budget to consider. Needs to be positive!
  max_budget : float
          the largest budget to consider. Needs to be larger than min_budget!
          The budgets will be geometrically distributed :math:`\sim \eta^k` for
          :math:`k\in [0, 1, ... , num\_subsets - 1]`.
  ping_interval: int
          number of seconds between pings to discover new nodes. Default is 60 seconds.
  nameserver: str
          address of the Pyro4 nameserver
  nameserver_port: int
          port of Pyro4 nameserver
  host: str
          ip (or name that resolves to that) of the network interface to use
  shutdown_workers: bool
          flag to control whether the workers are shutdown after the computation is done
  job_queue_size: tuple of ints
          min and max size of the job queue. During the run, when the number of jobs in the queue
          reaches the min value, it will be filled up to the max size. Default: (0,1)
  dynamic_queue_size: bool
          Whether or not to change the queue size based on the number of workers available.
          If true (default), the job_queue_sizes are relative to the current number of workers.
  logger: logging.logger like object
          the logger to output some (more or less meaningful) information
  result_logger: hpbandster.api.results.util.json_result_logger object
          a result logger that writes live results to disk
  previous_result: hpbandster.core.result.Result object
          previous run to warmstart the run
docstr_tok: ["The","Master","class","is","responsible","for","the","book","keeping","and","to","decide","what","to","run","next",".","Optimizers","are","instantiations","of","Master",",","that","handle","the","important","steps","of","deciding","what","configurations","to","run","on","what","budget","when",".","Parameters","--","--","--","--","--","run_id",":","string","A","unique","identifier","of","that","Hyperband","run",".","Use",",","for","example",",","the","cluster","'s","JobID","when","running","multiple","concurrent","runs","to","separate","them","config_generator",":","hpbandster.config_generators","object","An","object","that","can","generate","new","configurations","and","registers","results","of","executed","runs","working_directory",":","string","The","top","level","working","directory","accessible","to","all","compute","nodes","(","shared","filesystem",")",".","eta",":","float","In","each","iteration",",","a","complete","run","of","sequential","halving","is","executed",".","In","it",",","after","evaluating","each","configuration","on","the","same","subset","size",",","only","a","fraction","of","1\/eta","of","them","'advances","'","to","the","next","round",".","Must","be","greater","or","equal","to","2.","min_budget",":","float","The","smallest","budget","to","consider",".","Needs","to","be","positive","!","max_budget",":","float","the","largest","budget","to","consider",".","Needs","to","be","larger","than","min_budget","!","The","budgets","will","be","geometrically","distributed",":","math",":","`","\\sim","\\eta^k","`","for",":","math",":","`","k\\in","[","0",",","1",",","...",",","num\\_subsets","-","1","]","`",".","ping_interval",":","int","number","of","seconds","between","pings","to","discover","new","nodes",".","Default","is","60","seconds",".","nameserver",":","str","address","of","the","Pyro4","nameserver","nameserver_port",":","int","port","of","Pyro4","nameserver","host",":","str","ip","(","or","name","that","resolves","to","that",")","of","the","network","interface","to","use","shutdown_workers",":","bool","flag","to","control","whether","the","workers","are","shutdown","after","the","computation","is","done","job_queue_size",":","tuple","of","ints","min","and","max","size","of","the","job","queue",".","During","the","run",",","when","the","number","of","jobs","in","the","queue","reaches","the","min","value",",","it","will","be","filled","up","to","the","max","size",".","Default",":","(","0,1",")","dynamic_queue_size",":","bool","Whether","or","not","to","change","the","queue","size","based","on","the","number","of","workers","available",".","If","true","(","default",")",",","the","job_queue_sizes","are","relative","to","the","current","number","of","workers",".","logger",":","logging.logger","like","object","the","logger","to","output","some","(","more","or","less","meaningful",")","information","result_logger",":","hpbandster.api.results.util.json_result_logger","object","a","result","logger","that","writes","live","results","to","disk","previous_result",":","hpbandster.core.result.Result","object","previous","run","to","warmstart","the","run"]
code: def __init__(
      self,
      run_id,
      config_generator,
      working_directory=".",
      ping_interval=60,
      nameserver="127.0.0.1",
      nameserver_port=None,
      host=None,
      shutdown_workers=True,
      job_queue_sizes=(-1, 0),
      dynamic_queue_size=True,
      logger=None,
      result_logger=None,
      previous_result=None,
  ):
      """The Master class is responsible for the book keeping and to decide what to run next. Optimizers are
      instantiations of Master, that handle the important steps of deciding what configurations to run on what
      budget when.
  
      Parameters
      ----------
      run_id : string
              A unique identifier of that Hyperband run. Use, for example, the cluster's JobID when running multiple
              concurrent runs to separate them
      config_generator: hpbandster.config_generators object
              An object that can generate new configurations and registers results of executed runs
      working_directory: string
              The top level working directory accessible to all compute nodes(shared filesystem).
      eta : float
              In each iteration, a complete run of sequential halving is executed. In it,
              after evaluating each configuration on the same subset size, only a fraction of
              1/eta of them 'advances' to the next round.
              Must be greater or equal to 2.
      min_budget : float
              The smallest budget to consider. Needs to be positive!
      max_budget : float
              the largest budget to consider. Needs to be larger than min_budget!
              The budgets will be geometrically distributed :math:`\sim \eta^k` for
              :math:`k\in [0, 1, ... , num\_subsets - 1]`.
      ping_interval: int
              number of seconds between pings to discover new nodes. Default is 60 seconds.
      nameserver: str
              address of the Pyro4 nameserver
      nameserver_port: int
              port of Pyro4 nameserver
      host: str
              ip (or name that resolves to that) of the network interface to use
      shutdown_workers: bool
              flag to control whether the workers are shutdown after the computation is done
      job_queue_size: tuple of ints
              min and max size of the job queue. During the run, when the number of jobs in the queue
              reaches the min value, it will be filled up to the max size. Default: (0,1)
      dynamic_queue_size: bool
              Whether or not to change the queue size based on the number of workers available.
              If true (default), the job_queue_sizes are relative to the current number of workers.
      logger: logging.logger like object
              the logger to output some (more or less meaningful) information
      result_logger: hpbandster.api.results.util.json_result_logger object
              a result logger that writes live results to disk
      previous_result: hpbandster.core.result.Result object
              previous run to warmstart the run
      """
  
      self.working_directory = working_directory
      os.makedirs(self.working_directory, exist_ok=True)
  
      if logger is None:
          self.logger = logging.getLogger("hpbandster")
      else:
          self.logger = logger
  
      self.result_logger = result_logger
  
      self.config_generator = config_generator
      self.time_ref = None
  
      self.iterations = []
      self.jobs = []
  
      self.num_running_jobs = 0
      self.job_queue_sizes = job_queue_sizes
      self.user_job_queue_sizes = job_queue_sizes
      self.dynamic_queue_size = dynamic_queue_size
  
      if job_queue_sizes[0] >= job_queue_sizes[1]:
          raise ValueError(
              "The queue size range needs to be (min, max) with min<max!"
          )
  
      if previous_result is None:
          self.warmstart_iteration = []
  
      else:
          self.warmstart_iteration = [
              WarmStartIteration(previous_result, self.config_generator)
          ]
  
      # condition to synchronize the job_callback and the queue
      self.thread_cond = threading.Condition()
  
      self.config = {"time_ref": self.time_ref}
  
      self.dispatcher = Dispatcher(
          self.job_callback,
          queue_callback=self.adjust_queue_size,
          run_id=run_id,
          ping_interval=ping_interval,
          nameserver=nameserver,
          nameserver_port=nameserver_port,
          host=host,
      )
  
      self.dispatcher_thread = threading.Thread(
          target=self.dispatcher.run
      )
      self.dispatcher_thread.start()
  
imports: import os
  import threading
  import time
  import math
  import pdb
  import copy
  import logging
  import numpy
  from hpbandster.core.dispatcher import Dispatcher
  from hpbandster.core.result import Result
  from hpbandster.core.base_iteration import WarmStartIteration
label_desc: Use image node_id 1 to create a new Master object from inherited base classes: object with example: obj = Master(run_id, config_generator, working_directory, ping_interval, nameserver, nameserver_port, host, shutdown_workers, job_queue_sizes, dynamic_queue_size, logger, result_logger, previous_result)