import socket


def get_available_port() -> int:
    """get_available_port returns an available port"""

    with socket.socket() as s:
        s.bind(("localhost", 0))
        return s.getsockname()[1]