code: def test_ssh_versions():
      for s, v in [
          (
              "OpenSSH_7.4p1 Debian-6, OpenSSL 1.0.2k  26 Jan 2017",
              "7.4p1",
          ),
          ("OpenSSH_8.1p1, LibreSSL 2.7.3", "8.1p1"),
          ("OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2", "8.1p1"),
      ]:
          ev = ExternalVersions()
  
          # TODO: figure out leaner way
          class _runner(object):
              def run(self, cmd, *args, **kwargs):
                  return dict(stdout="", stderr=s)
  
          with patch(
              "datalad.support.external_versions._runner", _runner()
          ):
              assert_equal(ev["cmd:system-ssh"], v)
  
imports: import logging
  import pytest
  from os import linesep
  from datalad import __version__
  from datalad.cmd import StdOutErrCapture, WitlessRunner
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import CommandError, MissingExternalDependency, OutdatedExternalDependency
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_false, assert_greater, assert_greater_equal, assert_in, assert_not_in, assert_raises, assert_true, create_tree, patch, set_annex_version, swallow_logs, with_tempfile
  from ..external_versions import ExternalVersions, LooseVersion
label_desc: Use image node_id 15 for calling a global function with example usage: test_ssh_versions() and returns: dict