code: def apply_clean(flags_obj):
      if flags_obj.clean and tf.io.gfile.exists(flags_obj.model_dir):
          tf.compat.v1.logging.info(
              "--clean flag set. Removing existing model dir:"
              " {}".format(flags_obj.model_dir)
          )
          tf.io.gfile.rmtree(flags_obj.model_dir)
  
file_path: autodist/examples/benchmark/utils/misc/model_helpers.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numbers
  import tensorflow
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling a global function with example usage: apply_clean(flags_obj) without return types