code: def create_client_for_kernel(self):
          
          connect_output = KernelConnectionDialog.get_connection_parameters(self)
          (connection_file, hostname, sshkey, password, ok) = connect_output
          if not ok:
              return
          else:
              self._create_client_for_kernel(connection_file, hostname, sshkey,
                                             password)
docs: Create a client connected to an existing kernel