class_docstr: An `EventMultiplexer` manages access to multiple `EventAccumulator`s.
  
  Each `EventAccumulator` is associated with a `run`, which is a self-contained
  TensorFlow execution. The `EventMultiplexer` provides methods for extracting
  information about events from multiple `run`s.
  
  Example usage for loading specific runs from files:
  
  ```python
  x = EventMultiplexer({'run1': 'path/to/run1', 'run2': 'path/to/run2'})
  x.Reload()
  ```
  
  Example usage for loading a directory where each subdirectory is a run
  
  ```python
  (eg:) /parent/directory/path/
        /parent/directory/path/run1/
        /parent/directory/path/run1/events.out.tfevents.1001
        /parent/directory/path/run1/events.out.tfevents.1002
  
        /parent/directory/path/run2/
        /parent/directory/path/run2/events.out.tfevents.9232
  
        /parent/directory/path/run3/
        /parent/directory/path/run3/events.out.tfevents.9232
  x = EventMultiplexer().AddRunsFromDirectory('/parent/directory/path')
  (which is equivalent to:)
  x = EventMultiplexer({'run1': '/parent/directory/path/run1', 'run2':...}
  ```
  
  If you would like to watch `/parent/directory/path`, wait for it to be created
    (if necessary) and then periodically pick up new runs, use
    `AutoloadingMultiplexer`
  @@Tensors
docstr: Load runs from a directory; recursively walks subdirectories.
  
  If path doesn't exist, no-op. This ensures that it is safe to call
    `AddRunsFromDirectory` multiple times, even before the directory is made.
  
  If path is a directory, load event files in the directory (if any exist) and
    recursively call AddRunsFromDirectory on any subdirectories. This mean you
    can call AddRunsFromDirectory at the root of a tree of event logs and
    TensorBoard will load them all.
  
  If the `EventMultiplexer` is already loaded this will cause
  the newly created accumulators to `Reload()`.
  Args:
    path: A string path to a directory to load runs from.
    name: Optionally, what name to apply to the runs. If name is provided
      and the directory contains run subdirectories, the name of each subrun
      is the concatenation of the parent name and the subdirectory name. If
      name is provided and the directory contains event files, then a run
      is added called "name" and with the events from the path.
  
  Raises:
    ValueError: If the path exists and isn't a directory.
  
  Returns:
    The `EventMultiplexer`.
docstr_tok: ["Load","runs","from","a","directory",";","recursively","walks","subdirectories",".","If","path","does","n't","exist",",","no-op",".","This","ensures","that","it","is","safe","to","call","`","AddRunsFromDirectory","`","multiple","times",",","even","before","the","directory","is","made",".","If","path","is","a","directory",",","load","event","files","in","the","directory","(","if","any","exist",")","and","recursively","call","AddRunsFromDirectory","on","any","subdirectories",".","This","mean","you","can","call","AddRunsFromDirectory","at","the","root","of","a","tree","of","event","logs","and","TensorBoard","will","load","them","all",".","If","the","`","EventMultiplexer","`","is","already","loaded","this","will","cause","the","newly","created","accumulators","to","`","Reload","(",")","`",".","Args",":","path",":","A","string","path","to","a","directory","to","load","runs","from",".","name",":","Optionally",",","what","name","to","apply","to","the","runs",".","If","name","is","provided","and","the","directory","contains","run","subdirectories",",","the","name","of","each","subrun","is","the","concatenation","of","the","parent","name","and","the","subdirectory","name",".","If","name","is","provided","and","the","directory","contains","event","files",",","then","a","run","is","added","called","``","name","''","and","with","the","events","from","the","path",".","Raises",":","ValueError",":","If","the","path","exists","and","is","n't","a","directory",".","Returns",":","The","`","EventMultiplexer","`","."]
code: def AddRunsFromDirectory(self, path, name=None):
      """Load runs from a directory; recursively walks subdirectories.
  
      If path doesn't exist, no-op. This ensures that it is safe to call
        `AddRunsFromDirectory` multiple times, even before the directory is made.
  
      If path is a directory, load event files in the directory (if any exist) and
        recursively call AddRunsFromDirectory on any subdirectories. This mean you
        can call AddRunsFromDirectory at the root of a tree of event logs and
        TensorBoard will load them all.
  
      If the `EventMultiplexer` is already loaded this will cause
      the newly created accumulators to `Reload()`.
      Args:
        path: A string path to a directory to load runs from.
        name: Optionally, what name to apply to the runs. If name is provided
          and the directory contains run subdirectories, the name of each subrun
          is the concatenation of the parent name and the subdirectory name. If
          name is provided and the directory contains event files, then a run
          is added called "name" and with the events from the path.
  
      Raises:
        ValueError: If the path exists and isn't a directory.
  
      Returns:
        The `EventMultiplexer`.
      """
      path = os.path.expanduser(path)
      logger.info("Starting AddRunsFromDirectory: %s", path)
      for subdir in io_wrapper.GetLogdirSubdirectories(path):
          logger.info("Adding run from directory %s", subdir)
          rpath = os.path.relpath(subdir, path)
          subname = os.path.join(name, rpath) if name else rpath
          self.AddRun(subdir, name=subname)
      logger.info("Done with AddRunsFromDirectory: %s", path)
      return self
  
imports: import os
  import queue
  import threading
  from typing import Optional
  from tensorboard.backend.event_processing import directory_watcher
  from tensorboard.backend.event_processing import plugin_event_accumulator
  from tensorboard.backend.event_processing import io_wrapper
  from tensorboard.util import tb_logging
label_desc: Use image node_id 3 for calling the EventMultiplexer obj's underlying member method code with example usage: obj.AddRunsFromDirectory(path, name) and returns: self