MCPcopy Create free account
hub / github.com/AdaCompNUS/summit / get_ip

Function get_ip

PythonAPI/util/config.py:37–47  ·  view source on GitHub ↗
(host)

Source from the content-addressed store, hash-verified

35
36
37def get_ip(host):
38 if host in ['localhost', '127.0.0.1']:
39 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
40 try:
41 sock.connect(('10.255.255.255', 1))
42 host = sock.getsockname()[0]
43 except RuntimeError:
44 pass
45 finally:
46 sock.close()
47 return host
48
49
50def find_weather_presets():

Callers 1

inspectFunction · 0.85

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected