MCPcopy Index your code
hub / github.com/python/cpython / _splithost

Function _splithost

Lib/urllib/parse.py:1265–1277  ·  view source on GitHub ↗

splithost('//host[:port]/path') --> 'host[:port]', '/path'.

(url)

Source from the content-addressed store, hash-verified

1263
1264_hostprog = None
1265def _splithost(url):
1266 """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
1267 global _hostprog
1268 if _hostprog is None:
1269 _hostprog = re.compile('//([^/#?]*)(.*)', re.DOTALL)
1270
1271 match = _hostprog.match(url)
1272 if match:
1273 host_port, path = match.groups()
1274 if path and path[0] != '/':
1275 path = '/' + path
1276 return host_port, path
1277 return None, url
1278
1279
1280def splituser(host):

Callers 3

_parseMethod · 0.90
do_request_Method · 0.90
splithostFunction · 0.85

Calls 3

compileMethod · 0.45
matchMethod · 0.45
groupsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…