code: def test_with_testsui():
      @with_testsui
      def nothing(x, k=1):
          assert_equal(x, 1)
          assert_equal(k, 2)
  
      nothing(1, k=2)
  
      @with_testsui(responses="a")
      def nothing(x, k=1):
          assert_equal(x, 1)
          assert_equal(k, 2)
  
      # responses were not used
      assert_raises(AssertionError, nothing, 1, k=2)
  
      from datalad.ui import ui
  
      @with_testsui(responses="a")
      def ask():
          assert_equal(ui.question("what is a?"), "a")
  
      ask()
  
imports: from unittest.mock import patch
  from ...tests.utils_pytest import assert_equal, assert_false, assert_not_equal, assert_raises, with_testsui
  from ..None import _UI_Switcher
  from ..dialog import ConsoleLog, DialogUI, IPythonUI
label_desc: Use image node_id 3 for calling a global function with example usage: test_with_testsui() without return types