code: def connect_ssh(*args, **kwds):
      
      # Extract device parameter dict, if it was passed into this function. Need to
      # remove it from kwds, since the session.connect() doesn't like extra stuff in
      # there.
      if "device_params" in kwds:
          device_params = kwds["device_params"]
          del kwds["device_params"]
      else:
          device_params = None
  
      device_handler = make_device_handler(device_params)
      device_handler.add_additional_ssh_connect_params(kwds)
      global VENDOR_OPERATIONS
      VENDOR_OPERATIONS.update(device_handler.add_additional_operations())
      session = transport.SSHSession(device_handler)
      if "hostkey_verify" not in kwds or kwds["hostkey_verify"]:
          session.load_known_hosts()
  
      try:
         session.connect(*args, **kwds)
      except Exception as ex:
          if session.transport:
              session.close()
          raise
      return Manager(session, device_handler, **kwds)
docs: Initialize a :class:`Manager` over the SSH transport.
      For documentation of arguments see :meth:`ncclient.transport.SSHSession.connect`.
  
      The underlying :class:`ncclient.transport.SSHSession` is created with
          :data:`CAPABILITIES`. It is first instructed to
          :meth:`~ncclient.transport.SSHSession.load_known_hosts` and then
          all the provided arguments are passed directly to its implementation
          of :meth:`~ncclient.transport.SSHSession.connect`.
  
      To invoke advanced vendor related operation add device_params =
          {'name':'<vendor_alias>'} in connection paramerers. For the time,
          'junos' and 'nexus' are supported for Juniper and Cisco Nexus respectively.
  
      A custom device handler can be provided with device_params =
          {'handler':<handler class>} in connection paramerers.