code: def remove_temp_dirpath(dirpath, strategy):
      """Removes the temp path after writing is finished.
  
      Args:
          dirpath: Original dirpath that would be used without distribution, or
              the temporary dirpath used with distribution.
          strategy: The tf.distribute strategy object currently used.
      """
      if tf is None:
          return
  
      if strategy is None:
          # Infer strategy if not given.
          strategy = tf.distribute.get_strategy()
      if strategy is None:
          # If strategy is still not available, this is not in distributed
          # training. Fallback to no-op.
          return
      # TODO(anjalisridhar): Consider removing the check for multi worker mode
      # since it is redundant when used with the should_checkpoint property.
      if (
          strategy.extended._in_multi_worker_mode()
          and not strategy.extended.should_checkpoint
      ):
          # If this worker is not chief and hence should not save file, remove
          # the temporary directory.
          tf.io.gfile.rmtree(_get_temp_dir(dirpath, strategy))
  
file_path: keras-tuner/keras_tuner/backend/io.py
imports: import glob
  import os
  import shutil
  from keras_tuner.backend import config
label_desc: Use image node_id 10 for calling a global function with example usage: remove_temp_dirpath(dirpath, strategy) without return types