code: def test_reentry_detection() -> None:
      runner = _runner_with_protocol(MinimalGeneratorProtocol)
      runner.run()
      assert_raises(RuntimeError, runner.run)
  
imports: from __future__ import annotations
  import random
  import threading
  import time
  from threading import Thread
  from datalad.tests.utils_pytest import assert_raises
  from ..coreprotocols import StdOutCapture
  from ..nonasyncrunner import ThreadedRunner
  from ..protocol import GeneratorMixIn, WitlessProtocol
  from .utils import py2cmd
label_desc: Use image node_id 6 for calling a global function with example usage: test_reentry_detection() without return types