class_docstr: The nameserver serves as a phonebook-like lookup table for your workers. Unique names are created so the workers
  can work in parallel and register their results without creating racing conditions. The implementation uses
  `PYRO4 <https://pythonhosted.org/Pyro4/nameserver.html>`_ as a backend and this class is basically a wrapper.
class_docstr_tok: ["The","nameserver","serves","as","a","phonebook-like","lookup","table","for","your","workers",".","Unique","names","are","created","so","the","workers","can","work","in","parallel","and","register","their","results","without","creating","racing","conditions",".","The","implementation","uses","`","PYRO4","<","https",":","\/\/pythonhosted.org\/Pyro4\/nameserver.html",">","`","_","as","a","backend","and","this","class","is","basically","a","wrapper","."]
docstr: starts a Pyro4 nameserver in a separate thread
  
  Returns
  -------
          tuple (str, int):
                  the host name and the used port
docstr_tok: ["starts","a","Pyro4","nameserver","in","a","separate","thread","Returns","--","--","--","-","tuple","(","str",",","int",")",":","the","host","name","and","the","used","port"]
code: def start(self):
      """
      starts a Pyro4 nameserver in a separate thread
  
      Returns
      -------
              tuple (str, int):
                      the host name and the used port
      """
  
      if self.host is None:
          if self.nic_name is None:
              self.host = "localhost"
          else:
              self.host = nic_name_to_host(self.nic_name)
  
      uri, self.pyro_ns, _ = Pyro4.naming.startNS(
          host=self.host, port=self.port
      )
  
      self.host, self.port = self.pyro_ns.locationStr.split(":")
      self.port = int(self.port)
  
      thread = threading.Thread(
          target=self.pyro_ns.requestLoop,
          name="Pyro4 nameserver started by HpBandSter",
      )
      thread.start()
  
      if not self.dir is None:
          os.makedirs(self.dir, exist_ok=True)
          self.conf_fn = os.path.join(
              self.dir, "HPB_run_%s_pyro.pkl" % self.run_id
          )
  
          with open(self.conf_fn, "wb") as fh:
              pickle.dump((self.host, self.port), fh)
  
      return (self.host, self.port)
  
file_path: HpBandSter/hpbandster/core/nameserver.py
imports: import os
  import pickle
  import json
  import threading
  import Pyro4.naming
label_desc: Use image node_id 2 for calling the NameServer obj's underlying member method code with example usage: obj.start() and returns: self,  self