code: def check_run_and_get_output(cmd):
      runner = WitlessRunner()
      try:
          # suppress log output happen it was set to high values
          with patch.dict("os.environ", {"DATALAD_LOG_LEVEL": "WARN"}):
              output = runner.run(
                  ["datalad", "--help"], protocol=StdOutErrCapture
              )
      except CommandError as e:
          raise AssertionError(
              "'datalad --help' failed to start normally. "
              "Exited with %d and output %s"
              % (e.code, (e.stdout, e.stderr))
          )
      return output["stdout"], output["stderr"]
  
imports: import os
  from unittest.mock import patch
  from datalad.cmd import StdOutErrCapture, WitlessRunner
  from datalad.support.exceptions import CommandError
  from datalad.tests.utils_pytest import assert_cwd_unchanged, eq_, ok_startswith
label_desc: Use image node_id 1 for calling a global function with example usage: check_run_and_get_output(cmd) and returns: output,  output