code: def test_script_shims(script):
      runner = Runner()
      if not on_windows:
          from shutil import which
  
          which(script)
  
      # and let's check that it is our script
      out = runner.run([script, "--version"], protocol=StdOutErrCapture)
      version = out["stdout"].rstrip()
      mod, version = version.split(" ", 1)
      assert_equal(mod, "datalad")
      # we can get git and non git .dev version... so for now
      # relax
      get_numeric_portion = lambda v: [
          x for x in re.split("[+.]", v) if x.isdigit()
      ]
      # extract numeric portion
      assert get_numeric_portion(
          version
      ), f"Got no numeric portion from {version}"
      assert_equal(
          get_numeric_portion(__version__), get_numeric_portion(version)
      )
  
imports: import os
  import re
  from io import StringIO
  from unittest.mock import patch
  import pytest
  import datalad
  from datalad import __version__
  from datalad.api import Dataset, create
  from datalad.cmd import StdOutErrCapture
  from datalad.cmd import WitlessRunner
  from datalad.interface.base import get_interface_groups
  from datalad.tests.utils_pytest import SkipTest, assert_equal, assert_in, assert_not_in, assert_raises, assert_re_in, eq_, in_, ok_, ok_startswith, on_windows, skip_if_no_module, slow, with_tempfile
  from datalad.ui.utils import get_console_width, get_terminal_size
  from datalad.utils import chpwd
  from ..helpers import get_commands_from_groups
  from ..main import main
label_desc: Use image node_id 13 for calling a global function with example usage: test_script_shims(script) without return types