code: def __init__(self, cache_dir: StrPath) -> None:
      self._cache_dir = Path(cache_dir)
      self._obj_dir = self._cache_dir / "obj"
      self._temp_dir = self._cache_dir / "tmp"
      self._temp_dir.mkdir(parents=True, exist_ok=True)
  
      # NamedTemporaryFile sets the file mode to 600 [1], we reset to the default.
      # [1] https://stackoverflow.com/questions/10541760/can-i-set-the-umask-for-tempfile-namedtemporaryfile-in-python
      umask_cmd = (
          sys.executable,
          "-c",
          "import os; print(os.umask(22))",
      )
      umask = int(subprocess.check_output(umask_cmd))
      self._sys_umask = umask
  
imports: import contextlib
  import errno
  import hashlib
  import os
  import shutil
  import subprocess
  import sys
  from pathlib import Path
  from tempfile import NamedTemporaryFile
  from typing import IO, TYPE_CHECKING, ContextManager, Generator, Optional, Tuple
  import wandb
  from wandb import env, util
  from wandb.errors import term
  from wandb.sdk.lib.filesystem import files_in
  from wandb.sdk.lib.hashutil import B64MD5, ETag, b64_to_hex_id
  from wandb.sdk.lib.paths import FilePathStr, StrPath, URIStr
label_desc: Use image node_id 1 to create a new ArtifactFileCache object  with example: obj = ArtifactFileCache(cache_dir)