parameters: (url)
return_statement: return None, url
docstring: splithost('//host[:port]/path') --> 'host[:port]', '/path'.
docstring_summary: splithost('//host[:port]/path') --> 'host[:port]', '/path'.
docstring_tokens: splithost ( // host [ : port ] / path ) -- > host [ : port ] / path .
function: def splithost(url):
      """splithost('//host[:port]/path') --> 'host[:port]', '/path'."""
      global _hostprog
      if _hostprog is None:
          import re
          _hostprog = re.compile('^//([^/?]*)(.*)$')
  
      match = _hostprog.match(url)
      if match:
          host_port = match.group(1)
          path = match.group(2)
          if path and not path.startswith('/'):
              path = '/' + path
          return host_port, path
      return None, url
function_tokens: def splithost ( url ) : global _hostprog if _hostprog is None : import re _hostprog = re . compile ( '^//([^/?]*)(.*)$' ) match = _hostprog . match ( url ) if match : host_port = match . group ( 1 ) path = match . group ( 2 ) if path and not path . startswith ( '/' ) : path = '/' + path return host_port , path return None , url