code: def test_custom_versions():
      ev = ExternalVersions()
      assert (
          ev["cmd:annex"] > "6.20160101"
      )  # annex must be present and recentish
      assert_equal(set(ev.versions.keys()), {"cmd:annex"})
      # some older git version don't support files to be passed to
      # `commit` call under some conditions and this will lead to diverse
      # errors
      assert ev["cmd:git"] > "2.0"  # git must be present and recentish
      assert isinstance(ev["cmd:git"], LooseVersion)
      assert_equal(set(ev.versions.keys()), {"cmd:annex", "cmd:git"})
  
      # and there is also a version of system-wide installed git, which might
      # differ from cmd:git but should be at least good old 1.7
      assert ev["cmd:system-git"] > "1.7"
  
      ev.CUSTOM = {"bogus": lambda: 1 / 0}
      assert_equal(ev["bogus"], None)
      assert_equal(
          set(ev.versions), {"cmd:annex", "cmd:git", "cmd:system-git"}
      )
  
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 8 for calling a global function with example usage: test_custom_versions() without return types