class_docstr: A simple text progress bar suitable for both the IPython notebook
  and the IPython interactive prompt.
  
  ProgressBars are automatically nested if a previous instantiated
  progress bars has not achieved 100% completion.
class_docstr_tok: ["A","simple","text","progress","bar","suitable","for","both","the","IPython","notebook","and","the","IPython","interactive","prompt",".","ProgressBars","are","automatically","nested","if","a","previous","instantiated","progress","bars","has","not","achieved","100","%","completion","."]
code: def _get_socket(self, min_port=8080, max_port=8100, max_tries=20):
      import zmq
  
      context = zmq.Context()
      sock = context.socket(zmq.PUB)
      try:
          port = sock.bind_to_random_port(
              "tcp://*",
              min_port=min_port,
              max_port=max_port,
              max_tries=max_tries,
          )
          self.param.message(
              "Progress broadcast bound to port %d" % port
          )
          return sock
      except Exception:
          self.param.message(
              "No suitable port found for progress broadcast."
          )
          return None
  
imports: import math
  import sys
  import time
  import param
  from IPython.core.display import clear_output
  from ..core.util import ProgressIndicator
label_desc: Use image node_id 4 for calling the ProgressBar obj's underlying member method code with example usage: obj._get_socket(min_port, max_port, max_tries) and returns: sock, None