pimlico.utils.network.
get_unused_local_port
Find a local port that’s not currently being used, which we’ll be able to bind a service to once this function returns.
get_unused_local_ports
Find a number of local ports not currently in use. Binds each port found before looking for the next one. If you just called get_unused_local_port() multiple times, you’d get to same answer coming back.