def get_host_info(self, host):

        x509 = {}
        if isinstance(host, tuple):
            host, x509 = host

        auth, host = splituser(host)

        if auth:
            auth = base64.encodestring(unquote(auth))
            auth = "".join(auth.split())  # get rid of whitespace
            extra_headers = [
                ("Authorization", "Basic " + auth)
            ]
        else:
            extra_headers = None

        return host, extra_headers, x509

    ##
    # Connect to server.
    #
    # @param host Target host.
    # @return A connection handle.
dataset/ETHPy150Open circuits/circuits/tests/web/jsonrpclib.py/Transport.get_host_info/original