parameters: (host_port)
docstring: Checks whether the specified host port is available.
  
    Args:
      host_port: Port on host to check.
  
    Returns:
      True if the port on host is available, otherwise returns False.
docstring_summary: Checks whether the specified host port is available.
docstring_tokens: Checks whether the specified host port is available .
function: def IsHostPortAvailable(host_port):
    """Checks whether the specified host port is available.
  
    Args:
      host_port: Port on host to check.
  
    Returns:
      True if the port on host is available, otherwise returns False.
    """
    s = socket.socket()
    try:
      s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
      s.bind(('', host_port))
      s.close()
      return True
    except socket.error:
      return False
function_tokens: def IsHostPortAvailable ( host_port ) : s = socket . socket ( ) try : s . setsockopt ( socket . SOL_SOCKET , socket . SO_REUSEADDR , 1 ) s . bind ( ( '' , host_port ) ) s . close ( ) return True except socket . error : return False