code: def StopOnEvent(coord, wait_for_stop, set_when_stopped):
      wait_for_stop.wait()
      coord.request_stop()
      set_when_stopped.set()
  
imports: import sys
  import threading
  import time
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.platform import test
  from tensorflow.python.training import coordinator
label_desc: Use image node_id 1 for calling a global function with example usage: StopOnEvent(coord, wait_for_stop, set_when_stopped) without return types