class_docstr: A DirectoryWatcher wraps a loader to load from a sequence of paths.
  
  A loader reads a path and produces some kind of values as an iterator. A
  DirectoryWatcher takes a directory, a factory for loaders, and optionally a
  path filter and watches all the paths inside that directory.
  
  This class is only valid under the assumption that only one path will be
  written to by the data source at a time and that once the source stops writing
  to a path, it will start writing to a new path that's lexicographically
  greater and never come back. It uses some heuristics to check whether this is
  true based on tracking changes to the files' sizes, but the check can have
  false negatives. However, it should have no false positives.
docstr: Loads new values.
  
  The watcher will load from one path at a time; as soon as that path stops
  yielding events, it will move on to the next path. We assume that old paths
  are never modified after a newer path has been written. As a result, Load()
  can be called multiple times in a row without losing events that have not
  been yielded yet. In other words, we guarantee that every event will be
  yielded exactly once.
  
  Yields:
    All values that have not been yielded yet.
  
  Raises:
    DirectoryDeletedError: If the directory has been permanently deleted
      (as opposed to being temporarily unavailable).
docstr_tok: ["Loads","new","values",".","The","watcher","will","load","from","one","path","at","a","time",";","as","soon","as","that","path","stops","yielding","events",",","it","will","move","on","to","the","next","path",".","We","assume","that","old","paths","are","never","modified","after","a","newer","path","has","been","written",".","As","a","result",",","Load","(",")","can","be","called","multiple","times","in","a","row","without","losing","events","that","have","not","been","yielded","yet",".","In","other","words",",","we","guarantee","that","every","event","will","be","yielded","exactly","once",".","Yields",":","All","values","that","have","not","been","yielded","yet",".","Raises",":","DirectoryDeletedError",":","If","the","directory","has","been","permanently","deleted","(","as","opposed","to","being","temporarily","unavailable",")","."]
code: def Load(self):
      """Loads new values.
  
      The watcher will load from one path at a time; as soon as that path stops
      yielding events, it will move on to the next path. We assume that old paths
      are never modified after a newer path has been written. As a result, Load()
      can be called multiple times in a row without losing events that have not
      been yielded yet. In other words, we guarantee that every event will be
      yielded exactly once.
  
      Yields:
        All values that have not been yielded yet.
  
      Raises:
        DirectoryDeletedError: If the directory has been permanently deleted
          (as opposed to being temporarily unavailable).
      """
      try:
          for event in self._LoadInternal():
              yield event
      except tf.errors.OpError:
          if not tf.io.gfile.exists(self._directory):
              raise DirectoryDeletedError(
                  "Directory %s has been permanently deleted"
                  % self._directory
              )
  
file_path: tensorboard/tensorboard/backend/event_processing/directory_watcher.py
imports: import bisect
  from tensorboard.backend.event_processing import io_wrapper
  from tensorboard.compat import tf
  from tensorboard.util import io_util
  from tensorboard.util import tb_logging
label_desc: Use image node_id 2 for calling the DirectoryWatcher obj's underlying member method code with example usage: obj.Load() without return types