def get_open_port(host="<STR_LIT:localhost>"):
temp_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)<EOL>temp_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, <NUM_LIT:1>)<EOL>temp_sock.bind((host, <NUM_LIT:0>))<EOL>port = temp_sock.getsockname()[<NUM_LIT:1>]<EOL>temp_sock.close()<EOL>del temp_sock<EOL>return port<EOL>
Get an open port on the machine.