class_docstr: A TestCase class that keeps a single `tempfile.TemporaryDirectory` open for the duration of the class, wipes its
  data at the start of a test, and then destroyes it at the end of the TestCase.
  
  Useful for when a class or API requires a single constant folder throughout it's use, such as Weights and Biases
  
  The temporary directory location will be stored in `self.tmpdir`
class_docstr_tok: ["A","TestCase","class","that","keeps","a","single","`","tempfile.TemporaryDirectory","`","open","for","the","duration","of","the","class",",","wipes","its","data","at","the","start","of","a","test",",","and","then","destroyes","it","at","the","end","of","the","TestCase",".","Useful","for","when","a","class","or","API","requires","a","single","constant","folder","throughout","it","'s","use",",","such","as","Weights","and","Biases","The","temporary","directory","location","will","be","stored","in","`","self.tmpdir","`"]
docstr: Destroy all contents in `self.tmpdir`, but not `self.tmpdir`
docstr_tok: ["Destroy","all","contents","in","`","self.tmpdir","`",",","but","not","`","self.tmpdir","`"]
code: def setUp(self):
      "Destroy all contents in `self.tmpdir`, but not `self.tmpdir`"
      if self.clear_on_setup:
          for path in Path(self.tmpdir).glob("**/*"):
              if path.is_file():
                  path.unlink()
              elif path.is_dir():
                  shutil.rmtree(path)
  
imports: import asyncio
  import os
  import shutil
  import subprocess
  import sys
  import tempfile
  import unittest
  from contextlib import contextmanager
  from functools import partial
  from pathlib import Path
  from typing import List, Union
  from unittest import mock
  import torch
  from ..state import AcceleratorState, PartialState
  from ..utils import gather, is_bnb_available, is_clearml_available, is_comet_ml_available, is_cuda_available, is_datasets_available, is_deepspeed_available, is_dvclive_available, is_mps_available, is_npu_available, is_pandas_available, is_tensorboard_available, is_timm_available, is_torch_version, is_tpu_available, is_transformers_available, is_wandb_available, is_xpu_available, str_to_bool
label_desc: Use image node_id 3 for calling the TempDirTestCase obj's underlying member method code with example usage: obj.setUp() without return types