docstr: Tests AddRunsFromDirectory function.
  
  Tests the following scenarios:
  - When the directory does not exist.
  - When the directory is empty.
  - When the directory has empty subdirectory.
  - Contains proper EventAccumulators after adding events.
docstr_tok: ["Tests","AddRunsFromDirectory","function",".","Tests","the","following","scenarios",":","-","When","the","directory","does","not","exist",".","-","When","the","directory","is","empty",".","-","When","the","directory","has","empty","subdirectory",".","-","Contains","proper","EventAccumulators","after","adding","events","."]
code: def testAddRunsFromDirectory(self):
      """Tests AddRunsFromDirectory function.
  
      Tests the following scenarios:
      - When the directory does not exist.
      - When the directory is empty.
      - When the directory has empty subdirectory.
      - Contains proper EventAccumulators after adding events.
      """
      x = event_multiplexer.EventMultiplexer()
      tmpdir = self.get_temp_dir()
      join = os.path.join
      fakedir = join(tmpdir, "fake_accumulator_directory")
      realdir = join(tmpdir, "real_accumulator_directory")
      self.assertEqual(x.Runs(), {})
      x.AddRunsFromDirectory(fakedir)
      self.assertEqual(x.Runs(), {}, "loading fakedir had no effect")
  
      _CreateCleanDirectory(realdir)
      x.AddRunsFromDirectory(realdir)
      self.assertEqual(
          x.Runs(), {}, "loading empty directory had no effect"
      )
  
      path1 = join(realdir, "path1")
      tf.io.gfile.mkdir(path1)
      x.AddRunsFromDirectory(realdir)
      self.assertEqual(
          x.Runs(), {}, "creating empty subdirectory had no effect"
      )
  
      _AddEvents(path1)
      x.AddRunsFromDirectory(realdir)
      self.assertCountEqual(x.Runs(), ["path1"], "loaded run: path1")
      loader1 = x.GetAccumulator("path1")
      self.assertEqual(loader1._path, path1, "has the correct path")
  
      path2 = join(realdir, "path2")
      _AddEvents(path2)
      x.AddRunsFromDirectory(realdir)
      self.assertCountEqual(x.Runs(), ["path1", "path2"])
      self.assertEqual(
          x.GetAccumulator("path1"), loader1, "loader1 not regenerated"
      )
  
      path2_2 = join(path2, "path2")
      _AddEvents(path2_2)
      x.AddRunsFromDirectory(realdir)
      self.assertCountEqual(x.Runs(), ["path1", "path2", "path2/path2"])
      self.assertEqual(
          x.GetAccumulator("path2/path2")._path,
          path2_2,
          "loader2 path correct",
      )
  
imports: import os
  import os.path
  import shutil
  import tensorflow
  from tensorboard.backend.event_processing import event_accumulator
  from tensorboard.backend.event_processing import event_multiplexer
label_desc: Use image node_id 11 for calling the EventMultiplexerTest obj's underlying member method code with example usage: obj.testAddRunsFromDirectory() without return types