MCPcopy Create free account
hub / github.com/CL-lau/SQL-GPT / is_valid_ip

Function is_valid_ip

utils/st_content.py:85–91  ·  view source on GitHub ↗
(ip)

Source from the content-addressed store, hash-verified

83
84
85def is_valid_ip(ip):
86 import re
87 pattern = r'^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
88 if re.match(pattern, ip):
89 return True
90 else:
91 return False
92
93
94def is_valid_port(port):

Callers 1

init_proxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected