code: def _paramiko_tunnel(
      lport: int,
      rport: int,
      server: str,
      remoteip: str,
      keyfile: str | None = None,
      password: str | None = None,
  ) -> None:
      """Function for actually starting a paramiko tunnel, to be passed
      to multiprocessing.Process(target=this), and not called directly.
      """
      username, server, port = _split_server(server)
      client = paramiko.SSHClient()
      client.load_system_host_keys()
      client.set_missing_host_key_policy(paramiko.WarningPolicy())
  
      try:
          client.connect(
              server,
              port,
              username=username,
              key_filename=keyfile,
              look_for_keys=True,
              password=password,
          )
      #    except paramiko.AuthenticationException:
      #        if password is None:
      #            password = getpass("%s@%s's password: "%(username, server))
      #            client.connect(server, port, username=username, password=password)
      #        else:
      #            raise
      except Exception as e:
          warnings.warn(
              "*** Failed to connect to %s:%d: %r" % (server, port, e),
              stacklevel=2,
          )
          sys.exit(1)
  
      # Don't let SIGINT kill the tunnel subprocess
      signal.signal(signal.SIGINT, signal.SIG_IGN)
  
      try:
          forward_tunnel(lport, remoteip, rport, client.get_transport())
      except KeyboardInterrupt:
          warnings.warn(
              "SIGINT: Port forwarding stopped cleanly", stacklevel=2
          )
          sys.exit(0)
      except Exception as e:
          warnings.warn(
              "Port forwarding stopped uncleanly: %s" % e, stacklevel=2
          )
          sys.exit(255)
  
imports: from __future__ import annotations
  import atexit
  import os
  import re
  import signal
  import socket
  import sys
  import warnings
  from getpass import getpass, getuser
  from multiprocessing import Process
  from typing import Any, cast
label_desc: Use image node_id 11 for calling a global function with example usage: _paramiko_tunnel(lport, rport, server, remoteip, keyfile, password) without return types