class_docstr: Representation of a (shared) ssh connection.
      
class_docstr_tok: ["Representation","of","a","(","shared",")","ssh","connection","."]
code: def is_open(self):
      if not self.ctrl_path.exists():
          lgr.log(
              5,
              "Not opening %s for checking since %s does not exist",
              self,
              self.ctrl_path,
          )
          return False
      # check whether controlmaster is still running:
      cmd = self._assemble_multiplex_ssh_cmd(["-O", "check"])
  
      lgr.debug("Checking %s by calling %s", self, cmd)
      try:
          # expect_stderr since ssh would announce to stderr
          # "Master is running" and that is normal, not worthy warning about
          # etc -- we are doing the check here for successful operation
          with tempfile.TemporaryFile() as tempf:
              self.runner.run(
                  cmd,
                  # do not leak output
                  protocol=StdOutErrCapture,
                  stdin=tempf,
              )
          res = True
      except CommandError as e:
          if e.code != 255:
              # this is not a normal SSH error, whine ...
              raise e
          # SSH died and left socket behind, or server closed connection
          self.close()
          res = False
      lgr.debug(
          "Check of %s has %s",
          self,
          {True: "succeeded", False: "failed"}[res],
      )
      return res
  
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 4 for calling the MultiplexSSHConnection obj's underlying member method code with example usage: obj.is_open() and returns: res, False