class_docstr: Representation of a (shared) ssh connection.
      
class_docstr_tok: ["Representation","of","a","(","shared",")","ssh","connection","."]
code: def close(self):
      if not self._opened_by_us:
          lgr.debug(
              "Not closing %s since was not opened by itself", self
          )
          return
      # stop controlmaster:
      cmd = self._assemble_multiplex_ssh_cmd(["-O", "stop"])
      lgr.debug("Closing %s by calling %s", self, cmd)
      try:
          self.runner.run(cmd, protocol=StdOutErrCapture)
      except CommandError as e:
          lgr.debug("Failed to run close command")
          if self.ctrl_path.exists():
              lgr.debug(
                  "Removing existing control path %s", self.ctrl_path
              )
              # socket need to go in any case
              self.ctrl_path.unlink()
          if e.code != 255:
              # not a "normal" SSH error
              raise e
  
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 6 for calling the MultiplexSSHConnection obj's underlying member method code with example usage: obj.close() without return types