docstr: Tests behavior of a static active_filter.
docstr_tok: ["Tests","behavior","of","a","static","active_filter","."]
code: def testActiveFilter_staticFilterBehavior(self):
      """Tests behavior of a static active_filter."""
      loader_registry = []
      loader_factory = functools.partial(
          _TimestampedByteLoader, registry=loader_registry
      )
      active_filter = lambda timestamp: timestamp >= 2
      self._loader = directory_loader.DirectoryLoader(
          self._directory, loader_factory, active_filter=active_filter
      )
  
      def assertLoadersForPaths(paths):
          paths = [
              os.path.join(self._directory, path) for path in paths
          ]
          self.assertEqual(loader_registry, paths)
  
      # a: normal-looking file.
      # b: file without sufficiently active data (should be marked inactive).
      # c: file with timestamps in reverse order (max computed correctly).
      # d: empty file (should be considered active in absence of timestamps).
      self._WriteToFile("a", ["A1", "A2"], [1, 2])
      self._WriteToFile("b", ["B1"], [1])
      self._WriteToFile("c", ["C2", "C1", "C0"], [2, 1, 0])
      self._WriteToFile("d", [], [])
      self.assertLoaderYields(["A1", "A2", "B1", "C2", "C1", "C0"])
      assertLoadersForPaths(["a", "c", "d"])
      self._WriteToFile("a", ["A3"], [3])
      self._WriteToFile("b", ["B3"], [3])
      self._WriteToFile("c", ["C0"], [0])
      self._WriteToFile("d", ["D3"], [3])
      self.assertLoaderYields(["A3", "C0", "D3"])
      assertLoadersForPaths(["a", "c", "d"])
      # Check that a 0 timestamp in file C on the most recent load doesn't
      # override the max timestamp of 2 seen in the earlier load.
      self._WriteToFile("c", ["C4"], [4])
      self.assertLoaderYields(["C4"])
      assertLoadersForPaths(["a", "c", "d"])
  
imports: import functools
  import glob
  import os
  import shutil
  from unittest import mock
  import tensorflow
  from tensorboard.backend.event_processing import directory_loader
  from tensorboard.backend.event_processing import directory_watcher
  from tensorboard.backend.event_processing import event_file_loader
  from tensorboard.backend.event_processing import io_wrapper
  from tensorboard.util import test_util
label_desc: Use image node_id 10 for calling the DirectoryLoaderTest obj's underlying member method code with example usage: obj.testActiveFilter_staticFilterBehavior() without return types