'Watch the daemon input threads and restart if dead.'

def _WatchThreads(self):

    while True:
        time.sleep(60)
        input_threads = []
        for t in self._input_threads:
            if t.is_alive():
                input_threads.append(t)
            else:
                tf.logging.error('Found    input    thread    dead.')
                new_t = Thread(target=self._FillInputQueue)
                input_threads.append(new_t)
                input_threads[(-1)].daemon = True
                input_threads[(-1)].start()
        self._input_threads = input_threads
        bucketing_threads = []
        for t in self._bucketing_threads:
            if t.is_alive():
                bucketing_threads.append(t)
            else:
                tf.logging.error('Found    bucketing    thread    dead.')
                new_t = Thread(target=self._FillBucketInputQueue)
                bucketing_threads.append(new_t)
                bucketing_threads[(-1)].daemon = True
                bucketing_threads[(-1)].start()
        self._bucketing_threads = bucketing_threads
