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: loads the nameserver credentials in cases where master and workers share a filesystem
  
  Parameters
  ----------
          working_directory: str
                  the working directory for the HPB run (see master)
          num_tries: int
                  number of attempts to find the file (default 60)
          interval: float
                  waiting period between the attempts
docstr_tok: ["loads","the","nameserver","credentials","in","cases","where","master","and","workers","share","a","filesystem","Parameters","--","--","--","--","--","working_directory",":","str","the","working","directory","for","the","HPB","run","(","see","master",")","num_tries",":","int","number","of","attempts","to","find","the","file","(","default","60",")","interval",":","float","waiting","period","between","the","attempts"]
code: def load_nameserver_credentials(
      self, working_directory, num_tries=60, interval=1
  ):
      """
      loads the nameserver credentials in cases where master and workers share a filesystem
  
      Parameters
      ----------
              working_directory: str
                      the working directory for the HPB run (see master)
              num_tries: int
                      number of attempts to find the file (default 60)
              interval: float
                      waiting period between the attempts
      """
      fn = os.path.join(
          working_directory, "HPB_run_%s_pyro.pkl" % self.run_id
      )
  
      for i in range(num_tries):
          try:
              with open(fn, "rb") as fh:
                  self.nameserver, self.nameserver_port = pickle.load(
                      fh
                  )
              return
          except FileNotFoundError:
              self.logger.warning(
                  "config file %s not found (trail %i/%i)"
                  % (fn, i + 1, num_tries)
              )
              time.sleep(interval)
          except:
              raise
      raise RuntimeError(
          "Could not find the nameserver information, aborting!"
      )
  
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 2 for calling the Worker obj's underlying member method code with example usage: obj.load_nameserver_credentials(working_directory, num_tries, interval) without return types