class_docstr: Base class for NCF model benchmark.
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."""
      assert tf.version.VERSION.startswith("2.")
      tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.INFO)
      if NCFKerasBenchmarkBase.local_flags is None:
          ncf_common.define_ncf_flags()
          # Loads flags to get defaults to then override. List cannot be
          # empty.
          flags.FLAGS(["foo"])
          core.set_defaults(**self.default_flags)
          saved_flag_values = flagsaver.save_flag_values()
          NCFKerasBenchmarkBase.local_flags = saved_flag_values
      else:
          flagsaver.restore_flag_values(
              NCFKerasBenchmarkBase.local_flags
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import time
  from absl import flags
  from absl.testing import flagsaver
  import tensorflow
  from utils import benchmark_wrappers
  from utils.recommendation import ncf_common
  from utils.recommendation import ncf_keras_main
  from utils.flags import core
label_desc: Use image node_id 2 for calling the NCFKerasBenchmarkBase obj's underlying member method code with example usage: obj._setup() without return types