(url)
return None, url
splithost('//host[:port]/path') --> 'host[:port]', '/path'.
splithost('//host[:port]/path') --> 'host[:port]', '/path'.
splithost ( // host [ : port ] / path ) -- > host [ : port ] / path .
def _splithost(url):
    """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
    global _hostprog
    if _hostprog is None:
        _hostprog = re.compile('//([^/#?]*)(.*)', re.DOTALL)

    match = _hostprog.match(url)
    if match:
        host_port, path = match.groups()
        if path and path[0] != '/':
            path = '/' + path
        return host_port, path
    return None, url
def _splithost ( url ) : global _hostprog if _hostprog is None : _hostprog = re . compile ( '//([^/#?]*)(.*)' , re . DOTALL ) match = _hostprog . match ( url ) if match : host_port , path = match . groups ( ) if path and path [ 0 ] != '/' : path = '/' + path return host_port , path return None , url