MCPcopy Create free account
hub / github.com/FSoft-AI4Code/HyperAgent / find_free_port

Function find_free_port

src/hyperagent/utils.py:40–43  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 return matches[0] if matches else None
39
40def find_free_port():
41 with socketserver.TCPServer(("localhost", 0), None) as s:
42 free_port = s.server_address[1]
43 return free_port
44
45def check_local_or_remote(path: str):
46 # Check if link is a valid folder path

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected