code: def incomplete_dir(dirname):
    
    tmp_dir = get_incomplete_path(dirname)
    tf.io.gfile.makedirs(tmp_dir)
    try:
      yield tmp_dir
      tf.io.gfile.rename(tmp_dir, dirname)
    finally:
      if tf.io.gfile.exists(tmp_dir):
        tf.io.gfile.rmtree(tmp_dir)
docs: Create temporary dir for dirname and rename on exit.