class_docstr: A thread that runs code repeatedly, optionally on a timer.
  
  This thread class is intended to be used with a `Coordinator`.  It repeatedly
  runs code specified either as `target` and `args` or by the `run_loop()`
  method.
  
  Before each run the thread checks if the coordinator has requested stop.  In
  that case the looper thread terminates immediately.
  
  If the code being run raises an exception, that exception is reported to the
  coordinator and the thread terminates.  The coordinator will then request all
  the other threads it coordinates to stop.
  
  You typically pass looper threads to the supervisor `Join()` method.
class_docstr_tok: ["A","thread","that","runs","code","repeatedly",",","optionally","on","a","timer",".","This","thread","class","is","intended","to","be","used","with","a","`","Coordinator","`",".","It","repeatedly","runs","code","specified","either","as","`","target","`","and","`","args","`","or","by","the","`","run_loop","(",")","`","method",".","Before","each","run","the","thread","checks","if","the","coordinator","has","requested","stop",".","In","that","case","the","looper","thread","terminates","immediately",".","If","the","code","being","run","raises","an","exception",",","that","exception","is","reported","to","the","coordinator","and","the","thread","terminates",".","The","coordinator","will","then","request","all","the","other","threads","it","coordinates","to","stop",".","You","typically","pass","looper","threads","to","the","supervisor","`","Join","(",")","`","method","."]
docstr: Create a LooperThread.
  
  Args:
    coord: A Coordinator.
    timer_interval_secs: Time boundaries at which to call Run(), or None
      if it should be called back to back.
    target: Optional callable object that will be executed in the thread.
    args: Optional arguments to pass to `target` when calling it.
    kwargs: Optional keyword arguments to pass to `target` when calling it.
  
  Raises:
    ValueError: If one of the arguments is invalid.
docstr_tok: ["Create","a","LooperThread",".","Args",":","coord",":","A","Coordinator",".","timer_interval_secs",":","Time","boundaries","at","which","to","call","Run","(",")",",","or","None","if","it","should","be","called","back","to","back",".","target",":","Optional","callable","object","that","will","be","executed","in","the","thread",".","args",":","Optional","arguments","to","pass","to","`","target","`","when","calling","it",".","kwargs",":","Optional","keyword","arguments","to","pass","to","`","target","`","when","calling","it",".","Raises",":","ValueError",":","If","one","of","the","arguments","is","invalid","."]
code: def __init__(
      self,
      coord,
      timer_interval_secs,
      target=None,
      args=None,
      kwargs=None,
  ):
      """Create a LooperThread.
  
      Args:
        coord: A Coordinator.
        timer_interval_secs: Time boundaries at which to call Run(), or None
          if it should be called back to back.
        target: Optional callable object that will be executed in the thread.
        args: Optional arguments to pass to `target` when calling it.
        kwargs: Optional keyword arguments to pass to `target` when calling it.
  
      Raises:
        ValueError: If one of the arguments is invalid.
      """
      if not isinstance(coord, Coordinator):
          raise ValueError(
              "'coord' argument must be a Coordinator: %s" % coord
          )
      super(LooperThread, self).__init__()
      self.daemon = True
      self._coord = coord
      self._timer_interval_secs = timer_interval_secs
      self._target = target
      if self._target:
          self._args = args or ()
          self._kwargs = kwargs or {}
      elif args or kwargs:
          raise ValueError(
              "'args' and 'kwargs' argument require that you also "
              "pass 'target'"
          )
      self._coord.register_thread(self)
  
imports: import contextlib
  import sys
  import threading
  import time
  from tensorflow.python.framework import errors
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
  from tensorflow.python.util.tf_export import tf_export
label_desc: Use image node_id 1 to create a new LooperThread object from inherited base classes: threading with example: obj = LooperThread(coord, timer_interval_secs, target, args, kwargs)