code: def test_external_versions_basic():
      ev = ExternalVersions()
      our_module = "datalad"
      assert_equal(ev.versions, {})
      assert_equal(ev[our_module], __version__)
      # and it could be compared
      assert_greater_equal(ev[our_module], __version__)
      # We got some odd failure in this test not long are after switching to versionner
      # https://github.com/datalad/datalad/issues/5785.  Verify that we do get expected
      # data types
      our_version = ev[our_module].version
      assert isinstance(
          our_version, (str, list)
      ), f"Got {our_version!r} of type {type(our_version)}"
      assert_greater(ev[our_module], "0.1")
      assert_equal(list(ev.keys()), [our_module])
      assert_true(our_module in ev)
      assert_false("unknown" in ev)
  
      # all are LooseVersions now
      assert_true(isinstance(ev[our_module], LooseVersion))
      version_str = __version__
      assert_equal(
          ev.dumps(), "Versions: %s=%s" % (our_module, version_str)
      )
  
      # For non-existing one we get None
      assert_equal(ev["custom__nonexisting"], None)
      # and nothing gets added to _versions for nonexisting
      assert_equal(set(ev.versions.keys()), {our_module})
  
      # but if it is a module without version, we get it set to UNKNOWN
      assert_equal(ev["os"], ev.UNKNOWN)
      # And get a record on that inside
      assert_equal(ev.versions.get("os"), ev.UNKNOWN)
      # And that thing is "True", i.e. present
      assert ev["os"]
      # but not comparable with anything besides itself (was above)
      assert_raises(TypeError, cmp, ev["os"], "0")
      assert_raises(TypeError, assert_greater, ev["os"], "0")
  
      return
  
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 2 for calling a global function with example usage: test_external_versions_basic() without return types