code: def test_preemption(self):
      program = lp.Program("test")
      ready_to_preempt = threading.Event()
      preemption_ok = threading.Event()
  
      def node():
          ready_to_preempt.set()
          lp.wait_for_stop()
          preemption_ok.set()
  
      def stopper():
          ready_to_preempt.wait()
          lp.stop()
  
      program.add_node(
          lp.MultiThreadingColocation(
              [lp.PyNode(node), lp.PyNode(stopper)]
          ),
          label="coloc",
      )
      # Disable serialization due to `Lock` objects
      lp.launch(
          program,
          launch_type="test_mt",
          test_case=self,
          serialize_py_nodes=False,
      )
      preemption_ok.wait()
  
file_path: launchpad/launchpad/nodes/multi_threading_colocation/node_test.py
imports: import threading
  from absl.testing import absltest
  import courier
  import launchpad
  from launchpad.launch import worker_manager
label_desc: Use image node_id 2 for calling the NodeTest obj's underlying member method code with example usage: obj.test_preemption() without return types