':param  uri: Hypervisor URI (e.g. vbox:///session, qemu:///system,
etc.).
:type   uri: ``str``
:param  key: the username for a remote libvirtd server
:type   key: ``str``
:param  secret: the password for a remote libvirtd server
:type   key: ``str``'

def __init__(self, uri, key=None, secret=None):

    if (not have_libvirt):
        raise RuntimeError(("Libvirt    driver    requires    'libvirt'    Python    " + 'package'))
    self._uri = uri
    self._key = key
    self._secret = secret
    if ((uri is not None) and ('+tcp' in self._uri)):
        if ((key is None) and (secret is None)):
            raise RuntimeError((('The    remote    Libvirt    instance    requires    ' + "authentication,    please    set    'key'    and    ") + "'secret'    parameters"))
        auth = [[libvirt.VIR_CRED_AUTHNAME, libvirt.VIR_CRED_PASSPHRASE], self._cred_callback, None]
        self.connection = libvirt.openAuth(uri, auth, 0)
    else:
        self.connection = libvirt.open(uri)
    if (uri is None):
        self._uri = self.connection.getInfo()
