class_docstr: Representation of a (shared) ssh connection.
      
class_docstr_tok: ["Representation","of","a","(","shared",")","ssh","connection","."]
docstr: Create a connection handler
  
  The actual opening of the connection is performed on-demand.
  
  Parameters
  ----------
  ctrl_path: str
    path to SSH controlmaster
  sshri: SSHRI
    SSH resource identifier (contains all connection-relevant info),
    or another resource identifier that can be converted into an SSHRI.
  **kwargs
    Pass on to BaseSSHConnection
code: def __init__(self, ctrl_path, sshri, **kwargs):
      """Create a connection handler
  
      The actual opening of the connection is performed on-demand.
  
      Parameters
      ----------
      ctrl_path: str
        path to SSH controlmaster
      sshri: SSHRI
        SSH resource identifier (contains all connection-relevant info),
        or another resource identifier that can be converted into an SSHRI.
      **kwargs
        Pass on to BaseSSHConnection
      """
      super().__init__(sshri, **kwargs)
  
      # on windows cmd args lists are always converted into a string using appropriate
      # quoting rules, on other platforms args lists are passed directly and we need
      # to take care of quoting ourselves
      ctrlpath_arg = "ControlPath={}".format(
          ctrl_path if on_windows else sh_quote(str(ctrl_path))
      )
      self._ssh_args += ["-o", ctrlpath_arg]
      self._ssh_open_args += [
          "-fN",
          "-o",
          "ControlMaster=auto",
          "-o",
          "ControlPersist=15m",
      ]
      self.ctrl_path = Path(ctrl_path)
      self._opened_by_us = False
      # used by @fasteners.locked
      self._lock = [
          threading.Lock(),
          fasteners.process_lock.InterProcessLock(
              self.ctrl_path.with_suffix(".lck")
          ),
      ]
  
imports: import fasteners
  import os
  import logging
  from socket import gethostname
  from hashlib import md5
  from subprocess import Popen
  import tempfile
  import threading
  from datalad.utils import quote_cmdlinearg
  from datalad.support.exceptions import CapturedException, CommandError, ConnectionOpenFailedError
  from datalad.support.external_versions import external_versions
  from datalad.utils import auto_repr, Path, ensure_list, on_windows
  from datalad.cmd import NoCapture, StdOutErrCapture, WitlessRunner
  from ..None import cfg
label_desc: Use image node_id 1 to create a new MultiplexSSHConnection object from inherited base classes: BaseSSHConnection with example: obj = MultiplexSSHConnection(ctrl_path, sshri)