MCPcopy Index your code
hub / github.com/RustPython/RustPython / _splitnetloc

Function _splitnetloc

Lib/urllib/parse.py:416–422  ·  view source on GitHub ↗
(url, start=0)

Source from the content-addressed store, hash-verified

414 return url[:i], url[i+1:]
415
416def _splitnetloc(url, start=0):
417 delim = len(url) # position of end of domain part of url, default is end
418 for c in '/?#': # look for delimiters; the order is NOT important
419 wdelim = url.find(c, start) # find first of this delim
420 if wdelim >= 0: # if found
421 delim = min(delim, wdelim) # use earliest delim position
422 return url[start:delim], url[delim:] # return (domain, rest)
423
424def _checknetloc(netloc):
425 if not netloc or netloc.isascii():

Callers 1

_urlsplitFunction · 0.85

Calls 3

lenFunction · 0.85
minFunction · 0.85
findMethod · 0.45

Tested by

no test coverage detected