def METHOD_NAME():
    while True:
        free_socket = socket.socket()
        free_socket.bind(("", 0))
        free_port = free_socket.getsockname()[1]
        free_socket.close()
        if free_port < 1024:
            continue
        if free_port in RESERVED_FOR_TESTS_PORTS:
            continue
        if free_port in free_ports:
            continue
        break
    free_ports.add(free_port)
    port_age[free_port] = time.time()
    return free_port