docstr: Use a watch_fn that returns different allowlists for different runs.
docstr_tok: ["Use","a","watch_fn","that","returns","different","allowlists","for","different","runs","."]
code: def testDumpingWithLegacyWatchFnOnFetchesWorks(self):
      """Use a watch_fn that returns different allowlists for different runs."""
  
      def watch_fn(fetches, feeds):
          del feeds
          # A watch_fn that picks fetch name.
          if fetches.name == "inc_v:0":
              # If inc_v, watch everything.
              return "DebugIdentity", r".*", r".*"
          else:
              # If dec_v, watch nothing.
              return "DebugIdentity", r"$^", r"$^"
  
      sess = dumping_wrapper.DumpingDebugWrapperSession(
          self.sess, session_root=self.session_root, watch_fn=watch_fn
      )
  
      for _ in range(3):
          sess.run(self.inc_v)
          sess.run(self.dec_v)
  
      dump_dirs = glob.glob(os.path.join(self.session_root, "run_*"))
      dump_dirs = sorted(
          dump_dirs,
          key=lambda x: int(os.path.basename(x).split("_")[1]),
      )
      self.assertEqual(6, len(dump_dirs))
  
      for i, dump_dir in enumerate(dump_dirs):
          self._assert_correct_run_subdir_naming(
              os.path.basename(dump_dir)
          )
          dump = debug_data.DebugDumpDir(dump_dir)
          if i % 2 == 0:
              self.assertGreater(dump.size, 0)
              self.assertAllClose(
                  [10.0 - 0.4 * (i / 2)],
                  dump.get_tensors("v", 0, "DebugIdentity"),
              )
              self.assertEqual(repr(self.inc_v), dump.run_fetches_info)
              self.assertEqual(repr(None), dump.run_feed_keys_info)
          else:
              self.assertEqual(0, dump.size)
              self.assertEqual(repr(self.dec_v), dump.run_fetches_info)
              self.assertEqual(repr(None), dump.run_feed_keys_info)
  
imports: import glob
  import os
  import tempfile
  import threading
  from tensorflow.python.client import session
  from tensorflow.python.debug.lib import debug_data
  from tensorflow.python.debug.wrappers import dumping_wrapper
  from tensorflow.python.debug.wrappers import framework
  from tensorflow.python.debug.wrappers import hooks
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_v1
  from tensorflow.python.platform import gfile
  from tensorflow.python.platform import googletest
  from tensorflow.python.training import monitored_session
label_desc: Use image node_id 12 for calling the DumpingDebugWrapperSessionTest obj's underlying member method code with example usage: obj.testDumpingWithLegacyWatchFnOnFetchesWorks() and returns: str,  str,  str, str,  str,  str