class_docstr: Execute remote commands with Paramiko.
  
  .. seealso:: https://github.com/paramiko/paramiko
  
  This hook also lets you create ssh tunnel and serve as basis for SFTP file transfer.
  
  :param ssh_conn_id: :ref:`ssh connection id<howto/connection:ssh>` from airflow
      Connections from where all the required parameters can be fetched like
      username, password or key_file, though priority is given to the
      params passed during init.
  :param remote_host: remote host to connect
  :param username: username to connect to the remote_host
  :param password: password of the username to connect to the remote_host
  :param key_file: path to key file to use to connect to the remote_host
  :param port: port of remote host to connect (Default is paramiko SSH_PORT)
  :param conn_timeout: timeout (in seconds) for the attempt to connect to the remote_host.
      The default is 10 seconds. If provided, it will replace the `conn_timeout` which was
      predefined in the connection of `ssh_conn_id`.
  :param timeout: (Deprecated). timeout for the attempt to connect to the remote_host.
      Use conn_timeout instead.
  :param cmd_timeout: timeout (in seconds) for executing the command. The default is 10 seconds.
      Nullable, `None` means no timeout. If provided, it will replace the `cmd_timeout`
      which was predefined in the connection of `ssh_conn_id`.
  :param keepalive_interval: send a keepalive packet to remote host every
      keepalive_interval seconds
  :param banner_timeout: timeout to wait for banner from the server in seconds
  :param disabled_algorithms: dictionary mapping algorithm type to an
      iterable of algorithm identifiers, which will be disabled for the
      lifetime of the transport
  :param ciphers: list of ciphers to use in order of preference
docstr: Create a tunnel between two hosts.
  
  This is conceptually similar to ``ssh -L <LOCAL_PORT>:host:<REMOTE_PORT>``.
  
  :param remote_port: The remote port to create a tunnel to
  :param remote_host: The remote host to create a tunnel to (default localhost)
  :param local_port:  The local port to attach the tunnel to
  
  :return: sshtunnel.SSHTunnelForwarder object
docstr_tok: ["Create","a","tunnel","between","two","hosts",".","This","is","conceptually","similar","to","``","ssh","-L","<","LOCAL_PORT",">",":","host",":","<","REMOTE_PORT",">","``",".",":","param","remote_port",":","The","remote","port","to","create","a","tunnel","to",":","param","remote_host",":","The","remote","host","to","create","a","tunnel","to","(","default","localhost",")",":","param","local_port",":","The","local","port","to","attach","the","tunnel","to",":","return",":","sshtunnel.SSHTunnelForwarder","object"]
code: def get_tunnel(
      self,
      remote_port: int,
      remote_host: str = "localhost",
      local_port: int | None = None,
  ) -> SSHTunnelForwarder:
      """Create a tunnel between two hosts.
  
      This is conceptually similar to ``ssh -L <LOCAL_PORT>:host:<REMOTE_PORT>``.
  
      :param remote_port: The remote port to create a tunnel to
      :param remote_host: The remote host to create a tunnel to (default localhost)
      :param local_port:  The local port to attach the tunnel to
  
      :return: sshtunnel.SSHTunnelForwarder object
      """
      if local_port:
          local_bind_address: tuple[str, int] | tuple[str] = (
              "localhost",
              local_port,
          )
      else:
          local_bind_address = ("localhost",)
  
      tunnel_kwargs = {
          "ssh_port": self.port,
          "ssh_username": self.username,
          "ssh_pkey": self.key_file or self.pkey,
          "ssh_proxy": self.host_proxy,
          "local_bind_address": local_bind_address,
          "remote_bind_address": (remote_host, remote_port),
          "logger": self.log,
      }
  
      if self.password:
          password = self.password.strip()
          tunnel_kwargs.update(
              ssh_password=password,
          )
      else:
          tunnel_kwargs.update(
              host_pkey_directories=None,
          )
  
      client = SSHTunnelForwarder(self.remote_host, **tunnel_kwargs)
  
      return client
  
imports: from __future__ import annotations
  import os
  import warnings
  from base64 import decodebytes
  from functools import cached_property
  from io import StringIO
  from select import select
  from typing import Any, Sequence
  import paramiko
  from paramiko.config import SSH_PORT
  from sshtunnel import SSHTunnelForwarder
  from tenacity import Retrying, stop_after_attempt, wait_fixed, wait_random
  from airflow.exceptions import AirflowException, AirflowProviderDeprecationWarning
  from airflow.hooks.base import BaseHook
  from airflow.utils.platform import getuser
  from airflow.utils.types import NOTSET, ArgNotSet
label_desc: Use image node_id 7 for calling the SSHHook obj's underlying member method code with example usage: obj.get_tunnel(remote_port, remote_host, local_port) and returns: client