import socket


def get_free_port() -> int:
    """

    Returns:
        int: A free port in the machine.
    """
    with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
        s.bind(('', 0))
        _host, port = s.getsockname()
    return port