code: def test_main_version(stdout=None):
      assert_raises(
          SystemExit, __main__.main, ["__main__.py", "--version"]
      )
      assert_equal(
          stdout.getvalue().rstrip(), "datalad %s" % __version__
      )
  
imports: import sys
  from io import StringIO
  from unittest.mock import patch
  from datalad.tests.utils_pytest import assert_equal, assert_raises
  from ..None import __main__, __version__
label_desc: Use image node_id 2 for calling a global function with example usage: test_main_version(stdout) without return types