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: Add a run to the multiplexer.
  
  If the name is not specified, it is the same as the path.
  
  If a run by that name exists, and we are already watching the right path,
    do nothing. If we are watching a different path, replace the event
    accumulator.
  
  If `Reload` has been called, it will `Reload` the newly created
  accumulators.
  
  Args:
    path: Path to the event files (or event directory) for given run.
    name: Name of the run to add. If not provided, is set to path.
  
  Returns:
    The `EventMultiplexer`.
docstr_tok: ["Add","a","run","to","the","multiplexer",".","If","the","name","is","not","specified",",","it","is","the","same","as","the","path",".","If","a","run","by","that","name","exists",",","and","we","are","already","watching","the","right","path",",","do","nothing",".","If","we","are","watching","a","different","path",",","replace","the","event","accumulator",".","If","`","Reload","`","has","been","called",",","it","will","`","Reload","`","the","newly","created","accumulators",".","Args",":","path",":","Path","to","the","event","files","(","or","event","directory",")","for","given","run",".","name",":","Name","of","the","run","to","add",".","If","not","provided",",","is","set","to","path",".","Returns",":","The","`","EventMultiplexer","`","."]
code: def AddRun(self, path, name=None):
      """Add a run to the multiplexer.
  
      If the name is not specified, it is the same as the path.
  
      If a run by that name exists, and we are already watching the right path,
        do nothing. If we are watching a different path, replace the event
        accumulator.
  
      If `Reload` has been called, it will `Reload` the newly created
      accumulators.
  
      Args:
        path: Path to the event files (or event directory) for given run.
        name: Name of the run to add. If not provided, is set to path.
  
      Returns:
        The `EventMultiplexer`.
      """
      name = name or path
      accumulator = None
      with self._accumulators_mutex:
          if (
              name not in self._accumulators
              or self._paths[name] != path
          ):
              if name in self._paths and self._paths[name] != path:
                  # TODO(@decentralion) - Make it impossible to overwrite an old path
                  # with a new path (just give the new path a distinct name)
                  logger.warning(
                      "Conflict for name %s: old path %s, new path %s",
                      name,
                      self._paths[name],
                      path,
                  )
              logger.info("Constructing EventAccumulator for %s", path)
              accumulator = event_accumulator.EventAccumulator(
                  path,
                  size_guidance=self._size_guidance,
                  tensor_size_guidance=self._tensor_size_guidance,
                  purge_orphaned_data=self.purge_orphaned_data,
                  event_file_active_filter=self._event_file_active_filter,
                  detect_file_replacement=self._detect_file_replacement,
              )
              self._accumulators[name] = accumulator
              self._paths[name] = path
      if accumulator:
          if self._reload_called:
              accumulator.Reload()
      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 2 for calling the EventMultiplexer obj's underlying member method code with example usage: obj.AddRun(path, name) and returns: self