':return: True if the current user can bind to the specified port.'

def _is_locally_available(self, port):

    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    try:
        s.bind(('0.0.0.0', port))
    except:
        return False
    return True
