class_docstr: Common methods used in PerfZero Benchmarks.
  
  Handles the resetting of flags between tests. PerfZero (OSS) runs each test
  in a separate process reducing some need to reset the flags.
class_docstr_tok: ["Common","methods","used","in","PerfZero","Benchmarks",".","Handles","the","resetting","of","flags","between","tests",".","PerfZero","(","OSS",")","runs","each","test","in","a","separate","process","reducing","some","need","to","reset","the","flags","."]
docstr: Sets up and resets flags before each test.
docstr_tok: ["Sets","up","and","resets","flags","before","each","test","."]
code: def setUp(self):
      """Sets up and resets flags before each test."""
      logging.set_verbosity(logging.INFO)
      if PerfZeroBenchmark.local_flags is None:
          # Loads flags to get defaults to then override. List cannot be empty.
          flags.FLAGS(["foo"])
          saved_flag_values = flagsaver.save_flag_values()
          PerfZeroBenchmark.local_flags = saved_flag_values
      else:
          flagsaver.restore_flag_values(PerfZeroBenchmark.local_flags)
  
file_path: agents/tf_agents/benchmark/perfzero_benchmark.py
imports: import os
  from typing import Optional, Union
  from absl import flags
  from absl import logging
  from absl.testing import flagsaver
  import tensorflow
label_desc: Use image node_id 3 for calling the PerfZeroBenchmark obj's underlying member method code with example usage: obj.setUp() without return types