code: def test_IPythonUI():
      # largely just smoke tests to see if nothing is horribly bad
      with patch_input(return_value="a"):
          out = StringIO()
          response = IPythonUI(out=out).question(
              "prompt", choices=sorted(["b", "a"])
          )
          eq_(response, "a")
          eq_(out.getvalue(), "prompt (choices: a, b): ")
  
      ui = IPythonUI()
      pbar = ui.get_progressbar(total=10)
      assert_in("notebook", str(pbar._tqdm))
  
file_path: datalad/datalad/ui/tests/test_dialog.py
imports: import builtins
  from io import StringIO
  from unittest.mock import call, patch
  import pytest
  from datalad.ui.progressbars import progressbars
  from datalad.utils import swallow_logs
  from ...tests.utils_pytest import assert_in, assert_not_in, assert_raises, assert_re_in, eq_, ok_endswith, ok_startswith
  from ..dialog import ConsoleLog, DialogUI, IPythonUI
label_desc: Use image node_id 7 for calling a global function with example usage: test_IPythonUI() without return types