parameters: (host, port, timeout=float('Inf'))
docstring: Wait for the specified port to become occupied (accepting requests).
      Return when the port is occupied or raise a Timeout if timeout has
      elapsed.
  
      Timeout may be specified in seconds or as a timedelta.
      If timeout is None or ∞, the routine will run indefinitely.
  
      >>> occupied('localhost', find_available_local_port(), .1)
      Traceback (most recent call last):
      ...
      Timeout: Port ... not bound on localhost.
docstring_summary: Wait for the specified port to become occupied (accepting requests).
      Return when the port is occupied or raise a Timeout if timeout has
      elapsed.
docstring_tokens: Wait for the specified port to become occupied ( accepting requests ) . Return when the port is occupied or raise a Timeout if timeout has elapsed .
function: def occupied(host, port, timeout=float('Inf')):
      """
      Wait for the specified port to become occupied (accepting requests).
      Return when the port is occupied or raise a Timeout if timeout has
      elapsed.
  
      Timeout may be specified in seconds or as a timedelta.
      If timeout is None or ∞, the routine will run indefinitely.
  
      >>> occupied('localhost', find_available_local_port(), .1)
      Traceback (most recent call last):
      ...
      Timeout: Port ... not bound on localhost.
      """
      if not host:
          raise ValueError("Host values of '' or None are not allowed.")
  
      timer = timing.Timer(timeout)
  
      while True:
          try:
              Checker(timeout=0.5).assert_free(host, port)
              if timer.expired():
                  raise Timeout("Port {port} not bound on {host}.".format(**locals()))
              # Politely wait
              time.sleep(0.1)
          except PortNotFree:
              # port is occupied
              return
function_tokens: def occupied ( host , port , timeout = float ( 'Inf' ) ) : if not host : raise ValueError ( "Host values of '' or None are not allowed." ) timer = timing . Timer ( timeout ) while True : try : Checker ( timeout = 0.5 ) . assert_free ( host , port ) if timer . expired ( ) : raise Timeout ( "Port {port} not bound on {host}." . format ( * * locals ( ) ) ) # Politely wait time . sleep ( 0.1 ) except PortNotFree : # port is occupied return