parameters: (hostspec)
return_statement: return protocol, hostname, username, password
docstring: Parse the hostspec to get protocol, hostname, username and password.
docstring_summary: Parse the hostspec to get protocol, hostname, username and password.
docstring_tokens: Parse the hostspec to get protocol hostname username and password .
function: def parse_proxy_hostspec(hostspec):
      """Parse the hostspec to get protocol, hostname, username and password."""
      protocol = None
      username = None
      password = None
      hostname = hostspec
  
      if "://" in hostname:
          protocol, hostname = hostname.split("://", 1)
      if "@" in hostname:
          username, hostname = hostname.rsplit("@", 1)
          if ":" in username:
              username, password = username.split(":", 1)
      return protocol, hostname, username, password
function_tokens: def parse_proxy_hostspec ( hostspec ) : protocol = None username = None password = None hostname = hostspec if "://" in hostname : protocol , hostname = hostname . split ( "://" , 1 ) if "@" in hostname : username , hostname = hostname . rsplit ( "@" , 1 ) if ":" in username : username , password = username . split ( ":" , 1 ) return protocol , hostname , username , password