code: def main(
      ctx,
      scheduler,
      scheduler_port,
      hostnames,
      hostfile,
      nthreads,
      n_workers,
      ssh_username,
      ssh_port,
      ssh_private_key,
      nohost,
      log_directory,
      remote_python,
      memory_limit,
      worker_port,
      nanny_port,
      remote_dask_worker,
      local_directory,
  ):
      if "dask-ssh" in sys.argv[0]:
          warnings.warn(
              "dask-ssh is deprecated and will be removed in a future release; use `dask ssh` instead",
              FutureWarning,
              stacklevel=1,
          )
  
      try:
          hostnames = list(hostnames)
          if hostfile:
              with open(hostfile) as f:
                  hosts = f.read().split()
              hostnames.extend(hosts)
  
          if not scheduler:
              scheduler = hostnames[0]
  
      except IndexError:
          print(ctx.get_help())
          exit(1)
  
      c = SSHCluster(
          scheduler,
          scheduler_port,
          hostnames,
          nthreads,
          n_workers,
          ssh_username,
          ssh_port,
          ssh_private_key,
          nohost,
          log_directory,
          remote_python,
          memory_limit,
          worker_port,
          nanny_port,
          remote_dask_worker,
          local_directory,
      )
  
      import distributed
  
      print(
          "\n---------------------------------------------------------------"
      )
      print(
          "                 Dask.distributed v{version}\n".format(
              version=distributed.__version__
          )
      )
      print(f"Worker nodes: {len(hostnames)}")
      for i, host in enumerate(hostnames):
          print(f"  {i}: {host}")
      print(f"\nscheduler node: {scheduler}:{scheduler_port}")
      print(
          "---------------------------------------------------------------\n\n"
      )
  
      # Monitor the output of remote processes.  This blocks until the user issues a KeyboardInterrupt.
      c.monitor_remote_processes()
  
      # Close down the remote processes and exit.
      print(
          "\n[ dask ssh ]: Shutting down remote processes (this may take a moment)."
      )
      c.shutdown()
      print(
          "[ dask ssh ]: Remote processes have been terminated. Exiting."
      )
  
file_path: distributed/distributed/cli/dask_ssh.py
imports: from __future__ import annotations
  import logging
  import sys
  import warnings
  from textwrap import dedent
  import click
  from distributed.deploy.old_ssh import SSHCluster
label_desc: Use image node_id 1 for calling a global function with example usage: main(ctx, scheduler, scheduler_port, hostnames, hostfile, nthreads, n_workers, ssh_username, ssh_port, ssh_private_key, nohost, log_directory, remote_python, memory_limit, worker_port, nanny_port, remote_dask_worker, local_directory) without return types